While initial language models were limited to interpreting text, modern large language models now undertake a wide range of functions across various data types. For example, LLMs can comprehend multiple languages, produce computer code, tackle mathematical challenges, or respond to inquiries regarding images and sounds.
Researchers at MIT examined the fundamental operations of LLMs to gain insight into how they manage such varied data, discovering evidence that suggests they exhibit certain resemblances to the human brain.
Neuroscientists propose that the human brain contains a “semantic hub” located in the anterior temporal lobe, which synthesizes semantic information from multiple channels, such as visual stimuli and tactile sensations. This semantic hub is linked to modality-specific “spokes” that direct information to the hub. The MIT team uncovered that LLMs employ a comparable mechanism by abstractly processing inputs from different modalities in a centralized, generalized format. For instance, a model whose primary language is English would utilize English as a core medium to process inputs in Japanese or reason about arithmetic, computer programming, etc. Additionally, the researchers illustrate that they can intervene in a model’s semantic hub by utilizing text in the model’s dominant language to modify its outputs, even when dealing with data in other languages.
These discoveries may aid scientists in training future LLMs that are more adept at managing varied data.
“LLMs are vast black boxes. They have showcased remarkably strong performance, yet we know very little about their underlying mechanisms. I hope this can serve as an initial step towards a deeper understanding of their functionality to enhance them and exercise better control over them as necessary,” states Zhaofeng Wu, a graduate student in electrical engineering and computer science (EECS) and the principal author of a publication on this research.
His collaborators include Xinyan Velocity Yu, a graduate student at the University of Southern California (USC); Dani Yogatama, an associate professor at USC; Jiasen Lu, a research scientist at Apple; and senior author Yoon Kim, an assistant professor of EECS at MIT and a member of the Computer Science and Artificial Intelligence Laboratory (CSAIL). The findings will be presented at the International Conference on Learning Representations.
Integrating diverse data
The researchers built their new study on previous work suggesting that English-centered LLMs utilize English to conduct reasoning processes across various languages.
Wu and his colleagues elaborated on this concept, initiating a comprehensive investigation into the mechanisms LLMs employ for processing diverse data.
An LLM, which consists of numerous interconnected layers, dissects input text into words or sub-words termed tokens. The model attributes a representation to each token, allowing it to analyze the relationships among tokens and generate the subsequent word in a sequence. In terms of images or audio, these tokens correspond to specific segments of an image or portions of an audio file.
The researchers discovered that the model’s initial layers handle data in its specific language or modality, akin to the modality-specific spokes found in the human brain. Next, the LLM converts tokens into modality-agnostic representations as it contemplates them through its internal layers, similar to how the brain’s semantic hub merges diverse information.
The model assigns analogous representations to inputs with comparable meanings, regardless of their data type, including images, audio, computer code, and mathematical problems. Although an image and its textual description are distinct types of data, because they convey the same meaning, the LLM would assign them similar representations.
For example, an English-dominant LLM “thinks” about a Chinese-language input in English before producing an output in Chinese. The model exhibits a similar reasoning approach for non-text inputs such as computer code, math problems, or even multimodal data.
To validate this hypothesis, the researchers inputted a pair of sentences that held the same meaning but were composed in two different languages into the model. They assessed how closely the model’s representations aligned for each sentence.
Subsequently, they performed a second series of experiments where they supplied an English-dominant model with text in another language, like Chinese, and evaluated how closely its internal representation corresponded to English versus Chinese. The researchers carried out similar assessments for other data types.
They consistently observed that the model’s representations were comparable for sentences with similar meanings. Moreover, across various data types, the tokens processed in the model’s internal layers resembled English-centric tokens more than the original input data type.
“Many of these input data types appear vastly different from language, so we were quite astonished that we could extract English-tokens when the model processes, for instance, mathematical or coding expressions,” Wu explains.
Leveraging the semantic hub
The researchers speculate that LLMs might adopt this semantic hub strategy during their training as it represents an efficient method for processing a variety of data.
“There are thousands of languages available, but much of the knowledge is shared, such as commonsense knowledge or factual information. The model does not need to replicate that knowledge across different languages,” Wu states.
The researchers also attempted to intervene in the model’s internal layers with English text while it was processing other languages. They found they could reliably alter the model’s outputs, even when those outputs were in different languages.
Scientists may utilize this phenomenon to encourage the model to maximize the sharing of information across varied data types, potentially enhancing efficiency.
Conversely, there may be concepts or knowledge that cannot be effectively translated across languages or data types, such as cultural-specific knowledge. In those instances, scientists might prefer LLMs to possess some language-specific processing mechanisms.
“How do you optimally share whenever possible but also permit languages to maintain some language-specific processing mechanisms? That could be examined in future research on model architectures,” Wu suggests.
Additionally, researchers might leverage these insights to enhance multilingual models. Often, an English-dominant model that learns to converse in another language may lose some of its precision in English. A deeper understanding of an LLM’s semantic hub could aid researchers in preventing this language interference, according to Wu.
“Grasping how language models process inputs across various languages and modalities is a pivotal question in artificial intelligence. This paper establishes a fascinating connection to neuroscience and demonstrates that the suggested ‘semantic hub hypothesis’ applies to contemporary language models, where semantically similar representations of different data types are formed in the model’s intermediate layers,” remarks Mor Geva Pipek, an assistant professor in the School of Computer Science at Tel Aviv University who was not involved in this research. “The hypothesis and experiments effectively link and extend findings from previous studies and could be influential for upcoming research aimed at creating improved multimodal models and investigating connections between them and human brain function and cognition.”
This research is partially funded by the MIT-IBM Watson AI Lab.