The Semantic Hub Hypothesis: Language Models Share Semantic Representations Across Languages and Modalities

Zhaofeng Wu,Xinyan Velocity Yu,Dani Yogatama,Jiasen Lu,Yoon Kim
2024-11-08
Abstract:Modern language models can process inputs across diverse languages and modalities. We hypothesize that models acquire this capability through learning a shared representation space across heterogeneous data types (e.g., different languages and modalities), which places semantically similar inputs near one another, even if they are from different modalities/languages. We term this the semantic hub hypothesis, following the hub-and-spoke model from neuroscience (Patterson et al., 2007) which posits that semantic knowledge in the human brain is organized through a transmodal semantic "hub" which integrates information from various modality-specific "spokes" regions. We first show that model representations for semantically equivalent inputs in different languages are similar in the intermediate layers, and that this space can be interpreted using the model's dominant pretraining language via the logit lens. This tendency extends to other data types, including arithmetic expressions, code, and visual/audio inputs. Interventions in the shared representation space in one data type also predictably affect model outputs in other data types, suggesting that this shared representations space is not simply a vestigial byproduct of large-scale training on broad data, but something that is actively utilized by the model during input processing.
Computation and Language
What problem does this paper attempt to address?
### Problems the Paper Attempts to Solve The paper attempts to explore how modern language models (LMs) handle different types of data across languages and modalities. Specifically, the authors propose a hypothesis that these models achieve this capability by learning a shared representation space. In this shared representation space, semantically similar inputs are mapped to nearby locations, even if they come from different languages or modalities. This hypothesis is referred to as the "Semantic Hub Hypothesis," inspired by the "Hub-and-Spoke Model" in neuroscience, which posits that semantic knowledge in the human brain is integrated through a cross-modal "semantic hub" that connects various modality-specific regions. ### Main Research Content 1. **Multilingual Processing**: - The authors demonstrate that when processing texts in different languages, the representations in the intermediate layers of the model are similar and can be interpreted through the model's primary pre-training language (usually English). - Experiments confirm that translated sentences have high similarity in the intermediate layer representations of the model. 2. **Cross-Modal Processing**: - The authors further explore the model's behavior when handling other types of data (such as arithmetic expressions, code, visual, and audio inputs). - Experiments show that these different modalities also exhibit similarity in the intermediate layer representations of the model and can be interpreted through the primary pre-training language. 3. **Intervention Experiments**: - The authors conducted intervention experiments and found that intervening in one type of data in the shared representation space can predictably affect the model's output when processing other types of data. - This indicates that the shared representation space is not merely a byproduct of large-scale training but a structure actively utilized by the model when processing inputs. ### Experimental Methods - **Multilingual Experiments**: - Using parallel text datasets, comparing the similarity of sentence representations in different languages in the intermediate layers of the model. - Verifying the dominant role of the primary language in intermediate layer representations by calculating the similarity between hidden states and the embedding vectors of the target language vocabulary. - **Arithmetic Expression Experiments**: - Comparing the similarity of arithmetic expressions represented by Arabic numerals and English words in the intermediate layers of the model. - Analyzing representation changes when predicting numbers using the Logit Lens method. - **Code Experiments**: - Analyzing the model's behavior when processing code, finding that the model tends to use free-form English to express future predictions in the intermediate layers rather than following program syntax. - Verifying the similarity of representations to semantic roles when processing list literals and function call parameters using the Logit Lens method. - **Formal Semantics Experiments**: - Using the COGS dataset to verify the similarity of sentence representations and their formal semantic structures in the intermediate layers of the model. - Ensuring the robustness of results through strictly controlled experiments. ### Conclusion The paper validates the "Semantic Hub Hypothesis" through a series of experiments, showing that modern language models indeed handle different types of data across languages and modalities by learning a shared representation space. This finding not only helps to better understand the internal mechanisms of current models but also provides new directions for future research aimed at better controlling and optimizing these models.