Brain-like Functional Organization within Large Language Models

Haiyang Sun, Lin Zhao, Zihao Wu, Xiaohui Gao, Yutao Hu, Mengfei Zuo, Wei Zhang, Junwei Han, Tianming Liu, Xintao Hu · DOI

Abstract

Recent advancements in Large Language Models (LLMs) have raised questions about whether their internal representations merely mimic statistical patterns or develop structural organizations analogous to the human brain. This study investigates the internal functional networks of LLMs—specifically BERT and the Llama family—by mapping artificial neuron activations to human fMRI data. Our findings demonstrate that as LLMs increase in complexity, they develop increasingly brain-like, hierarchical, and specialized internal organizations. We show that artificial neurons cluster into functional groups that align with known human Functional Brain Networks (FBNs), including those for language, visual imagery, and working memory.

Introduction

The field of neuro-AI has long noted a "representational alignment" between Artificial Neural Networks (ANNs) and the biological brain. While previous research has established that both systems often respond similarly to the same stimuli, these analyses have typically been conducted at a population level, treating the model's internal state as a monolithic block. This approach overlooks the fundamental organizational principle of the human brain: its division into specialized Functional Brain Networks (FBNs) dedicated to specific cognitive tasks like vision, language, and memory.

This research seeks to bridge this gap by moving from general alignment to structural organization. We investigate whether individual artificial neurons (ANs) in LLMs cluster into functional "neighborhoods" that map directly onto human brain networks. By analyzing models ranging from BERT to Llama 3, we track the evolution of this functional organization and its relationship to model performance and complexity.

Methodology

To map the silicon architecture of LLMs to the carbon-based architecture of the human brain, we developed a multi-step encoding framework. We utilized the "Narratives" dataset, which provides fMRI recordings of 59 human subjects listening to a 7-minute spoken story ("Shapes").

Overview of the framework mapping LLM artificial neurons to human fMRI data.

The framework consists of four primary stages:

  1. Temporal Response Extraction: We recorded the activations of individual artificial neurons in BERT and Llama (1, 2, and 3) as they processed the same narrative stimuli used in the human fMRI experiments.
  2. Sparse Dictionary Learning: Given the vast number of neurons in modern LLMs, direct analysis is computationally prohibitive. We employed a sparse representation scheme to compress these thousands of responses into 64 "atoms"—representative temporal patterns that capture the collective behavior of neuron sub-groups.
  3. Voxel-wise Encoding: These 64 atoms were used as regressors in an encoding model to predict human fMRI activity. The ability of a specific "atom" to predict activity in a human brain region suggests a shared functional role.
  4. Network Mapping: Finally, we projected these findings onto established brain atlases to determine which of the 17 known human FBNs were being mirrored by the artificial neuron groups.

Key Results and Insights

Our analysis reveals a clear trend: as LLMs evolve, their internal functional organization becomes more sophisticated and brain-like.

Predictive performance ($R^2$) and brain maps across BERT and Llama model families.

Predictive Accuracy and Alignment

The LLM-based encoding models demonstrated remarkable predictive power, achieving $R^2$ values up to ~0.6 for BERT and ~0.5 for Llama models. This high level of alignment indicates that the temporal patterns of artificial neurons are highly congruent with the biological responses of the human brain to natural language.

The Evolution of Specialization

A key finding is the "specialization" evolution. While BERT's functional mapping is somewhat distributed, Llama 3 exhibits highly specialized sub-groups that consistently map to specific human brain functions. Llama 3 also showed the highest temporal consistency (0.236), suggesting a more stable and "mature" functional architecture.

Hierarchical Depth and Mental Simulation

We observed that specialized neurons are more concentrated in the deeper layers of Llama 3, mirroring the hierarchical processing of the human cortex. Furthermore, the models captured patterns of visual imagery. Despite being trained solely on text, Llama 3's internal states aligned with activity in the human visual cortex during story listening. This supports the cognitive theory that language comprehension involves "mental simulations" of visual scenes, a process the model appears to replicate internally.

Conclusion and Future Work

This study provides compelling evidence that Large Language Models develop internal functional organizations that mirror the human brain. This organization is not static but becomes more specialized and hierarchical as models advance.

However, several avenues for future research remain. The use of a fixed dictionary size (64 atoms) may limit the granularity of analysis for larger models. Additionally, extending this framework to multi-modal models and a broader range of cognitive tasks (such as reasoning or mathematical problem-solving) will be crucial for determining the universality of these brain-like structures in artificial intelligence.

Summary updated

BibTeX
@misc{sun2024brain,
  author = {Haiyang Sun and Lin Zhao and Zihao Wu and Xiaohui Gao and Yutao Hu and Mengfei Zuo and Wei Zhang and Junwei Han and Tianming Liu and Xintao Hu},
  title = {{Brain-like Functional Organization within Large Language Models}},
  year = {2024},
  eprint = {2410.19542},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.19542},
}
Figure