mlsanityData to 14 Oct 2026

Spin glass model of in-context learning

arXiv 2408.02288 ↗First posted 5 Aug 2024cond-mat.dis-nn cond-mat.stat-mech cs.AIcited by 2

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2020Scaling Laws for Neural Language Modelscited by 6,586
  4. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
  5. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,057
  6. 2013Distributed Representations of Words and Phrases and their Compositionalitycited by 3,474
  7. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
  8. 2022Emergent Abilities of Large Language Modelscited by 2,512
  9. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  10. 2022Transformers learn in-context by gradient descentcited by 732
  11. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  12. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
13 more
  1. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  2. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
  3. 2023Birth of a Transformer: A Memory Viewpointcited by 161
  4. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
  5. 2023In-Context Convergence of Transformerscited by 115
  6. 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 98
  7. 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 96
  8. 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 74
  9. 2023Auto-Regressive Next-Token Predictors are Universal Learnerscited by 67
  10. 2024Asymptotic theory of in-context learning by linear attentioncited by 55
  11. 2023Eight challenges in developing theory of intelligencecited by 6
  12. 2023Perspectives on the State and Future of Deep Learning - 2023cited by 4
  13. 2023Meta predictive learning model of languages in neural circuitscited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.