mlsanityData to 14 Oct 2026

In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Fly

arXiv 2506.19351 ↗First posted 24 Jun 2025cs.LG cs.AI cs.CLcited by 5

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) enables transformers to adapt to new tasks through contextual examples without parameter updates. While existing research has typically studied ICL in fixed-complexity environments, practical language models encounter tasks spanning diverse complexity levels. This paper investigates how transformers navigate hierarchical task structures where higher-complexity categories can perfectly represent any pattern generated by simpler ones. We design well-controlled testbeds based on Markov chains and linear regression that reveal transformers not only identify the appropriate complexity level for each task but also accurately infer the corresponding parameters--even when the in-context examples are compatible with multiple complexity hypotheses. Notably, when presented with data generated by simpler processes, transformers consistently favor the least complex sufficient explanation. We theoretically explain this behavior through a Bayesian framework, demonstrating that transformers effectively implement an in-context Bayesian Occam's razor by balancing model fit against complexity penalties. We further ablate on the roles of model size, training mixture distribution, inference context length, and architecture. Finally, we validate this Occam's razor-like inductive bias on a pretrained GPT-4 model with Boolean-function tasks as case study, suggesting it may be inherent to transformers trained on diverse task distributions.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 27 of its 36 references that are in the map. First posted on arXiv 24 Jun 2025.

Builds on

27 of 36 references.

References · 27

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  3. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  4. 2022Transformers learn in-context by gradient descentcited by 732
  5. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  6. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  7. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  8. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  9. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
  10. 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 236
  11. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
  12. 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 152
15 more
  1. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
  2. 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 118
  3. 2023In-Context Learning through the Bayesian Prismcited by 83
  4. 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 74
  5. 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 63
  6. 2024Asymptotic theory of in-context learning by linear attentioncited by 55
  7. 2024Competition Dynamics Shape Algorithmic Phases of In-Context Learningcited by 54
  8. 2024Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformerscited by 50
  9. 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
  10. 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 46
  11. 2024Dual Operating Modes of In-Context Learningcited by 43
  12. 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 33
  13. 2024Transformers on Markov Data: Constant Depth Sufficescited by 27
  14. 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 24
  15. 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superpositioncited by 14

Built on by

Cited by year (2026 to 14 Oct)

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

5 papers.