mlsanityData to 14 Oct 2026

In-context learning and Occam's razor

arXiv 2410.14086 ↗First posted 17 Oct 2024cs.LG cs.AIcited by 8

Not on the map. Why?

Abstract (arXiv)

A central goal of machine learning is generalization. While the No Free Lunch Theorem states that we cannot obtain theoretical guarantees for generalization without further assumptions, in practice we observe that simple models which explain the training data generalize best: a principle called Occam's razor. Despite the need for simple models, most current approaches in machine learning only minimize the training error, and at best indirectly promote simplicity through regularization or architecture design. Here, we draw a connection between Occam's razor and in-context learning: an emergent ability of certain sequence models like Transformers to learn at inference time from past observations in a sequence. In particular, we show that the next-token prediction loss used to train in-context learners is directly equivalent to a data compression technique called prequential coding, and that minimizing this loss amounts to jointly minimizing both the training error and the complexity of the model that was implicitly learned from context. Our theory and the empirical experiments we use to support it not only provide a normative account of in-context learning, but also elucidate the shortcomings of current in-context learning methods, suggesting ways in which they can be improved. We make our code available at https://github.com/3rdCore/PrequentialCode.

Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 41 of its 68 references that are in the map. First posted on arXiv 17 Oct 2024.

Builds on

41 of 68 references.

References · 41

  1. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  4. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
  5. 2018Self-Attention with Relative Position Representationscited by 1,120
  6. 2022In-context Learning and Induction Headscited by 964
  7. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  8. 2022Transformers learn in-context by gradient descentcited by 732
  9. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  10. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  11. 2022TabPFN: A Transformer That Solves Small Tabular Classification Problems in a Secondcited by 674
  12. 2021Transformers Can Do Bayesian Inferencecited by 360
29 more
  1. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  2. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
  3. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
  4. 2023Language Modeling Is Compressioncited by 225
  5. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
  6. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
  7. 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
  8. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
  9. 2023Human-Timescale Adaptation in an Open-Ended Task Spacecited by 138
  10. 2023Structured State Space Models for In-Context Reinforcement Learningcited by 111
  11. 2022General-Purpose In-Context Learning by Meta-Learning Transformerscited by 105
  12. 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
  13. 2023In-Context Learning through the Bayesian Prismcited by 83
  14. 2018The Description Length of Deep Learning Modelscited by 72
  15. 2019Meta-learning of Sequential Strategiescited by 70
  16. 2023The No Free Lunch Theorem, Kolmogorov Complexity, and the Role of Inductive Biases in Machine Learningcited by 63
  17. 2023LLMZip: Lossless Text Compression using Large Language Modelscited by 44
  18. 2020Meta-trained agents implement Bayes-optimal agentscited by 38
  19. 2018DeepZip: Lossless Data Compression using Recurrent Neural Networkscited by 33
  20. 2024Learning Universal Predictorscited by 31
  21. 2023Deep neural networks have an inbuilt Occam's razorcited by 28
  22. 2023CausalLM is not optimal for in-context learningcited by 26
  23. 2023Memory-Based Meta-Learning on Non-Stationary Distributionscited by 15
  24. 2022Sequential Learning Of Neural Networks for Prequential MDLcited by 13
  25. 2024Does learning the right latent variables necessarily improve in-context learning?cited by 13
  26. 2014Compress and Controlcited by 7
  27. 2024Transformers for Supervised Online Continual Learningcited by 5
  28. 2020Measuring Information Transfer in Neural Networkscited by 4
  29. 2014Auto-encoders: reconstruction versus compressioncited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 5; 2026: 3.

8 papers.