Abstract: When processing language, the brain is thought to deploy specialized computations to construct meaning from complex linguistic structures. Recently, artificial neural networks based on the Transformer architecture have revolutionized the field of natural language processing. Transformers integrate contextual information across words via structured circuit computations. Prior work has focused on the internal representations ("embeddings") generated by these circuits. In this paper, we instead analyze the circuit computations directly: we deconstruct these computations into the functionally-specialized "transformations" that integrate contextual information across words. Using functional MRI data acquired while participants listened to naturalistic stories, we first verify that the transformations account for considerable variance in brain activity across the cortical language network. We then demonstrate that the emergent computations performed by individual, functionally-specialized "attention heads" differentially predict brain activity in specific cortical regions. These heads fall along gradients corresponding to different layers and context lengths in a low-dimensional cortical space.
Introduction: Beyond Representations to Computations
For years, neuroscientists have used Artificial Neural Networks (ANNs) to model brain activity. Most prior work focused on embeddings—the high-dimensional vectors that represent word meaning within a model. However, embeddings are the result of computation, not the computation itself.
This study addresses the "gap" between representation and process by focusing on transformations: the specific updates performed by individual "attention heads" that integrate context from previous words into the current one. The researchers ask: Do the specialized tasks these heads learn (like identifying a direct object or looking back at a distant pronoun) actually correspond to how specific regions of the human brain process language?
Methods: Mapping the Transformer to the Brain
The authors used a model-based encoding framework to map features from BERT-base onto fMRI brain activity. Using the "Narratives" fMRI dataset, they recorded brain activity from 63 human subjects while they listened to spoken stories totaling about 26 minutes of naturalistic language.
To deconstruct the Transformer, they isolated the "transformations"—the 64-dimensional outputs of each of BERT’s 144 attention heads (12 layers × 12 heads). Using banded ridge regression, they predicted fMRI signals in 1,000 cortical parcels, comparing these transformations against baselines like GloVe vectors and classical linguistic annotations (parts of speech, dependency trees).
Key Results: Superior Prediction and Functional Specialization
The study found that Transformer transformations significantly outperformed classical linguistic features and static word embeddings (GloVe) in predicting brain activity across the entire language network.
As shown in the performance metrics across cortical regions, BERT-based features consistently explain a higher percentage of the noise ceiling. Notably, transformations showed much higher "layer specificity" than embeddings. The brain's preference for specific model layers changed more abruptly when looking at transformations, suggesting that different cortical regions are tuned to specific stages of the model's computational pipeline.
The "Look-Back" Gradient and Shared Specialization
A striking finding was a clear spatial gradient in the brain. Attention heads that look at very recent words map to the posterior temporal areas, while heads that look back at long-range context (30+ tokens) map to prefrontal and anterior temporal cortices.
Furthermore, the study demonstrated a functional correspondence: specific heads that are mathematically better at finding "direct objects" are also better at predicting activity in the angular gyrus, a region known for high-level semantic integration. Dimensionality reduction via PCA revealed that 92% of the variance in how these 144 heads map to the brain can be explained by just two principal components, corresponding roughly to model depth (layer) and context length (look-back distance).
Discussion and Future Directions
While the results suggest a shared functional specialization between silicon and biological intelligence, several limitations remain. The study focused on passive listening; the authors note that the Inferior Frontal Gyrus (Broca’s area) was well-predicted but didn't show strong head-wise specialization, possibly because that region is more involved in language production. Additionally, the models used text tokens, ignoring the prosody and rhythm of natural speech.
Future work may involve using "bottlenecked" Transformers or more biologically-plausible architectures to see if the mapping improves, potentially capturing even finer-grained functional specializations of the human language system.
Summary updated