Lune

NeurIPS2023Top-tier venue

The Transient Nature of Emergent In-Context Learning in Transformers

Aaditya K. Singh, Stephanie C. Y. Chan, Ted Moskovitz, Erin Grant, Andrew M. Saxe, Felix Hill

Abstract

Transformer neural networks can exhibit a surprising capacity for in-context learning (ICL) despite not being explicitly trained for it. Prior work has provided a deeper understanding of how ICL emerges in transformers, e.g., through the lens of mechanistic interpretability, Bayesian inference, or by examining the distributional properties of training data. However, in each of these cases, ICL is treated largely as a persistent phenomenon; namely, once ICL emerges, it is assumed to persist asymptotically. Here, we show that the emergence of ICL during transformer training is, in fact, often transient. We train transformers on synthetic data designed so that both ICL and in-weights learning (IWL) strategies can lead to correct predictions. We find that ICL first emerges, then disappears and gives way to IWL, all while the training loss decreases, indicating an asymptotic preference for IWL. The transient nature of ICL is observed in transformers across a range of model sizes and datasets, raising the question of how much to "overtrain" transformers when seeking compact, cheaper-to-run models. We find that L2 regularization may offer a path to more persistent ICL that removes the need for early stopping based on ICL-style validation tasks. Finally, we present initial evidence that ICL transience may be caused by competition between ICL and IWL circuits.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

38 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Locating and Editing Factual Associations in GPT cites Language Models are Few-Shot Learners
  • What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation cites The mechanistic basis of data dependence and abrupt learning in an in-context classification task
  • What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation cites Language Models are Few-Shot Learners
  • What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation cites Transformers Learn In-Context by Gradient Descent
  • The mechanistic basis of data dependence and abrupt learning in an in-context classification task cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • The mechanistic basis of data dependence and abrupt learning in an in-context classification task cites Language Models are Few-Shot Learners
  • The mechanistic basis of data dependence and abrupt learning in an in-context classification task cites Transformers Learn In-Context by Gradient Descent
  • The mechanistic basis of data dependence and abrupt learning in an in-context classification task cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Weight decay induces low-rank attention layers cites Language Models are Few-Shot Learners
  • An Explanation of In-context Learning as Implicit Bayesian Inference cites Language Models are Few-Shot Learners
  • Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspective cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspective cites Language Models are Few-Shot Learners
  • Transformers Learn In-Context by Gradient Descent cites Language Models are Few-Shot Learners
  • Transformers Learn In-Context by Gradient Descent cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites Language Models are Few-Shot Learners
  • Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks cites Language Models are Few-Shot Learners
  • Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks cites Transformers Learn In-Context by Gradient Descent
  • Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers38

  1. The mechanistic basis of data dependence and abrupt learning in an in-context classification taskGautam ReddyICLR 2024 · 112 citations
  2. What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationAaditya K. Singh, Ted Moskovitz, Felix Hill, Stephanie C. Y. Chan et al.ICML 2024 · 77 citations
  3. Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasksTianyu He, Darshil Doshi, Aritra Das, Andrey GromovNeurIPS 2024 · 52 citations
  4. Is In-Context Learning in Large Language Models Bayesian? A Martingale PerspectiveFabian Falck, Ziyu Wang, Christopher C. HolmesICML 2024 · 46 citations
  5. Weight decay induces low-rank attention layersSeijin Kobayashi, Yassir Akram, Johannes von OswaldNeurIPS 2024 · 41 citations

Builds on14

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
  3. An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations
  4. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
  5. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento et al.ICML 2023 · 729 citations

Related papers

  1. Strategy Coopetition Explains the Emergence and Transience of In-Context LearningAaditya K. Singh, Ted Moskovitz, Sara Dragutinovic, Felix Hill et al.ICML 2025
  2. Toward Understanding In-context vs. In-weight LearningBryan Chan, Xinyi Chen, András György, Dale SchuurmansICLR 2025
  3. Differential learning kinetics govern the transition from memorization to generalization during in-context learningAlex Nguyen, Gautam ReddyICLR 2025
  4. In-Context Learning Strategies Emerge RationallyDaniel Wurgaft, Ekdeep Singh Lubana, Core Francisco Park, Hidenori Tanaka et al.NeurIPS 2025 · 19 citations
  5. When can in-context learning generalize out of task distribution?Page C. Goddard, Lindsay M. Smith, Vudtiwat Ngampruetikorn, David J. SchwabICML 2025
Dusk over the sea between two cliffs drawn in fine vertical lines