Spin glass model of in-context learning
Not on the map. Why?
Abstract (arXiv)
Large language models show a surprising in-context learning ability -- being able to use a prompt to form a prediction for a query, yet without additional training, in stark contrast to old-fashioned supervised learning. Providing a mechanistic interpretation and linking the empirical phenomenon to physics are thus challenging and remain unsolved. We study a simple yet expressive transformer with linear attention and map this structure to a spin glass model with real-valued spins, where the couplings and fields explain the intrinsic disorder in data. The spin glass model explains how the weight parameters interact with each other during pre-training, and further clarifies why an unseen function can be predicted by providing only a prompt yet without further training. Our theory reveals that for single-instance learning, increasing the task diversity leads to the emergence of in-context learning, by allowing the Boltzmann distribution to converge to a unique correct solution of weight parameters. Therefore the pre-trained transformer displays a prediction power in a novel prompt setting. The proposed analytically tractable model thus offers a promising avenue for thinking about how to interpret many intriguing but puzzling properties of large language models.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 25 of its 39 references that are in the map. First posted on arXiv 5 Aug 2024.
Builds on
25 of 39 references.
References · 25
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,057
- 2013Distributed Representations of Words and Phrases and their Compositionalitycited by 3,474
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
13 more
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
- 2023Birth of a Transformer: A Memory Viewpointcited by 161
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
- 2023In-Context Convergence of Transformerscited by 115
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 98
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 96
- 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 74
- 2023Auto-Regressive Next-Token Predictors are Universal Learnerscited by 67
- 2024Asymptotic theory of in-context learning by linear attentioncited by 55
- 2023Eight challenges in developing theory of intelligencecited by 6
- 2023Perspectives on the State and Future of Deep Learning - 2023cited by 4
- 2023Meta predictive learning model of languages in neural circuitscited by 2
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.