Lune

ICLR2025Top-tier venue

Toward Understanding In-context vs. In-weight Learning

Bryan Chan, Xinyi Chen, András György, Dale Schuurmans

Abstract

It has recently been demonstrated empirically that in-context learning emerges in transformers when certain distributional properties are present in the training data, but this ability can also diminish upon further training. We provide a new theoretical understanding of these phenomena by identifying simplified distributional properties that give rise to the emergence and eventual disappearance of in-context learning. We do so by first analyzing a simplified model that uses a gating mechanism to choose between an in-weight and an in-context predictor. Through a combination of a generalization error and regret analysis we identify conditions where in-context and in-weight learning emerge. These theoretical findings are then corroborated experimentally by comparing the behaviour of a full transformer on the simplified distributions to that of the stylized model, demonstrating aligned results. We then extend the study to a full large language model, showing how fine-tuning on various collections of natural language prompts can elicit similar in-context and in-weight learning behaviour.

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.

10 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

  • Understanding Prompt Tuning and In-Context Learning via Meta-Learning cites Data Distributional Properties Drive Emergent In-Context Learning in Transformers
  • Understanding Prompt Tuning and In-Context Learning via Meta-Learning cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Understanding Prompt Tuning and In-Context Learning via Meta-Learning cites Transformers Learn In-Context by Gradient Descent
  • Understanding Prompt Tuning and In-Context Learning via Meta-Learning cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Data Distributional Properties Drive Emergent In-Context Learning in Transformers cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worlds cites Data Distributional Properties Drive Emergent In-Context Learning in Transformers
  • Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worlds cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worlds cites Language Models are Few-Shot Learners
  • Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worlds cites Transformers Learn In-Context by Gradient Descent
  • Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worlds cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Context and Diversity Matter: The Emergence of In-Context Learning in World Models cites Data Distributional Properties Drive Emergent In-Context Learning in Transformers
  • Context and Diversity Matter: The Emergence of In-Context Learning in World Models cites Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worlds
  • Context and Diversity Matter: The Emergence of In-Context Learning in World Models cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Context and Diversity Matter: The Emergence of In-Context Learning in World Models cites Language Models are Few-Shot Learners
  • Context and Diversity Matter: The Emergence of In-Context Learning in World Models cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • An Explanation of In-context Learning as Implicit Bayesian Inference cites Language Models are Few-Shot Learners
  • In-Context Learning Strategies Emerge Rationally cites Data Distributional Properties Drive Emergent In-Context Learning in Transformers
  • In-Context Learning Strategies Emerge Rationally cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • In-Context Learning Strategies Emerge Rationally cites Language Models are Few-Shot Learners
  • In-Context Learning Strategies Emerge Rationally cites Transformers Learn In-Context by Gradient Descent
  • In-Context Learning Strategies Emerge Rationally cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Transformers Learn In-Context by Gradient Descent cites Data Distributional Properties Drive Emergent In-Context Learning in Transformers
  • 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
  • Mechanism of Task-oriented Information Removal in In-context Learning cites Data Distributional Properties Drive Emergent In-Context Learning in Transformers
  • Mechanism of Task-oriented Information Removal in In-context Learning cites An Explanation of In-context Learning as Implicit Bayesian Inference
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. In-Context Learning Strategies Emerge RationallyDaniel Wurgaft, Ekdeep Singh Lubana, Core Francisco Park, Hidenori Tanaka et al.NeurIPS 2025 · 19 citations
  2. Understanding Prompt Tuning and In-Context Learning via Meta-LearningTim Genewein, Kevin Li, Jordi Grau-Moya, Anian Ruoss et al.NeurIPS 2025 · 10 citations
  3. Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized WorldsFan Wang, Pengtao Shao, Yiming Zhang, Bo Yu et al.NeurIPS 2025 · 6 citations
  4. Context and Diversity Matter: The Emergence of In-Context Learning in World ModelsFan Wang, ZHIYUAN CHEN, YUXUAN ZHONG, Sunjian Zheng et al.ICLR 2026 · 5 citations
  5. Mechanism of Task-oriented Information Removal in In-context LearningHakaze Cho, Haolin Yang, Gouki Minegishi, Naoya InoueICLR 2026 · 3 citations

Builds on20

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations
  3. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
  4. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento et al.ICML 2023 · 729 citations
  5. Data Distributional Properties Drive Emergent In-Context Learning in TransformersStephanie C. Y. Chan, Adam Santoro, Andrew K. Lampinen, Jane X. Wang et al.NeurIPS 2022 · 407 citations

Related papers

  1. The Transient Nature of Emergent In-Context Learning in TransformersAaditya K. Singh, Stephanie C. Y. Chan, Ted Moskovitz, Erin Grant et al.NeurIPS 2023 · 92 citations
  2. Strategy Coopetition Explains the Emergence and Transience of In-Context LearningAaditya K. Singh, Ted Moskovitz, Sara Dragutinovic, Felix Hill et al.ICML 2025
  3. The mechanistic basis of data dependence and abrupt learning in an in-context classification taskGautam ReddyICLR 2024 · 112 citations
  4. Differential learning kinetics govern the transition from memorization to generalization during in-context learningAlex Nguyen, Gautam ReddyICLR 2025
  5. Birth of a Transformer: A Memory ViewpointAlberto Bietti, Vivien Cabannes, Diane Bouchacourt, Hervé Jégou et al.NeurIPS 2023 · 182 citations
Dusk over the sea between two cliffs drawn in fine vertical lines