Data Distributional Properties Drive Emergent In-Context Learning in Transformers
Open accessAbstract
Large transformer-based models are able to perform in-context few-shot learning, without being explicitly trained for it. This observation raises the question: what aspects of the training regime lead to this emergent behavior? Here, we show that this behavior is driven by the distributions of the training data itself. In-context learning emerges when the training data exhibits particular distributional properties such as burstiness (items appear in clusters rather than being uniformly distributed over time) and having large numbers of rarely occurring classes. In-context learning also emerges more strongly when item meanings or interpretations are dynamic rather than fixed. These properties are exemplified by natural language, but are also inherent to naturalistic data in a wide range of other domains. They also depart significantly from the uniform, i.i.d. training distributions typically used for standard supervised learning. In our initial experiments, we found that in-context learning traded off against more conventional weight-based learning, and models were unable to achieve both simultaneously. However, our later experiments uncovered that the two modes of learning could co-exist in a single model when it was trained on data following a skewed Zipfian distribution -- another common property of naturalistic data, including language. In further experiments, we found that naturalistic data distributions were only able to elicit in-context learning in transformers, and not in recurrent models. In sum, our findings indicate how the transformer architecture works together with particular properties of the training data to drive the intriguing emergent in-context learning behaviour of large language models, and how future work might encourage both in-context and in-weights learning in domains beyond language.
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
For a system to have beliefs, it must genuinely engage with the world as its representations depict it.
“it must”
From Talking about Large Language Models (2024) · cites this paper as [33]
The Discussion (p. 9) addresses in-context learning in transformers, not whether a system must engage with the world to have beliefs. Searches for beliefs, representations, and engagement with the world found no passage addressing that requirement. (LLM, conf=0.76)
Experimental — accuracy not yet measured
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Cites
No references could be resolved yet.
Part of this paper’s reference list could not be split into single entries.
Research works printed but not linked: 11
- [3]3. Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. arXiv:1703.03400 [cs] , March 2017. URL http://arxiv.org/abs/1703. 03400 . arXiv: 1703.03400. - W. Nelson Francis and Henry Kucera. Brown Corpus Manual, 1979. URL http://korpus.uib. no/icame/brown/bcm.html . · arXiv
- [5]5. William A. Gale, Kenneth W. Church, and David Yarowsky. One Sense Per Discourse. In Speech and Natural Language: Proceedings of a Workshop Held at Harriman, New York, February 23-26, 1992 , 1992. URL https://aclanthology.org/H92-1045 .
- [6]6. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. arXiv:1512.03385 [cs] , December 2015. URL http://arxiv.org/abs/1512. 03385 . arXiv: 1512.03385. · arXiv
- [7]7. Felix Hill, Olivier Tieleman, Tamara von Glehn, Nathaniel Wong, Hamza Merzic, and Stephen Clark. Grounded Language Learning Fast and Slow. arXiv:2009.01719 [cs] , October 2020. URL http://arxiv.org/abs/2009.01719 . arXiv: 2009.01719. · arXiv
- [8]8. Sepp Hochreiter and Jürgen Schmidhuber. Long Short-Term Memory. Neural Computation , 9(8): 1735-1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. Conference Name: Neural Computation. · DOI · Paper page
- [9]9. Angelos Katharopoulos and François Fleuret. Not All Samples Are Created Equal: Deep Learning with Importance Sampling. arXiv:1803.00942 [cs] , October 2019. URL http://arxiv.org/ abs/1803.00942 . arXiv: 1803.00942. · arXiv
- [10]10. Dmitry Krotov and John Hopfield. Large Associative Memory Problem in Neurobiology and Machine Learning. arXiv:2008.06996 [cond-mat, q-bio, stat] , April 2021. URL http://arxiv.org/ abs/2008.06996 . arXiv: 2008.06996. · arXiv
- [11]11. Dharshan Kumaran, Demis Hassabis, and James L. McClelland. What Learning Systems do Intelligent Agents Need? Complementary Learning Systems Theory Updated. Trends in Cognitive Sciences , 20(7):512-534, July 2016. ISSN 13646613. doi: 10.1016/j.tics.2016.05.004. URL https: //linkinghub.elsevier.com/retrieve/pii/S1364661316300432 . · DOI · Paper page
- [12]12. Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. The Omniglot Challenge: A 3-Year Progress Report. arXiv:1902.03477 [cs] , February 2019. URL http://arxiv.org/abs/ 1902.03477 . arXiv: 1902.03477. · arXiv
- [13]13. Renaud Lambiotte, Lionel Tabourier, and Jean-Charles Delvenne. Burstiness and spreading on temporal networks. The European Physical Journal B , 86(7):320, July 2013. ISSN 1434-6028, 1434-6036. doi: 10.1140/epjb/e2013-40456-9. URL http://arxiv.org/abs/1305.0543 . arXiv:1305.0543 [physics, q-bio]. · DOI
- [14]14. James L McClelland and Randall C O'Reilly. Why There Are Complementary Learning Systems in the Hippocampus and Neocortex:InsightsFrom the Successesand Failuresof Connectionist Models of Learning and Memory. page 39, 1995.
Cited by
Sorted by citations
Talking about Large Language Models
Shanahan, M. (2024) · Communications of the ACM · doi:10.1145/3624724 · Cited by 381 · see citing works
Impact of Pretraining Term Frequencies on Few-Shot Numerical Reasoning
Razeghi, Y., Logan IV, R. L., Gardner, M., & Singh, S. (2022) · Findings of the Association for Computational Linguistics: EMNLP 2022 · doi:10.18653/v1/2022.findings-emnlp.59 · Cited by 89 · see citing works
Consciousness beyond the human case
LeDoux, J., Birch, J., Andrews, K., Clayton, N. S., Daw, N. D., Frith, C., Lau, H., Peters, M. A. K., Schneider, S., Seth, A., et al. (2023) · Current Biology · doi:10.1016/j.cub.2023.06.067 · Cited by 67 · see citing works
Towards Revealing the Mystery behind Chain of Thought: a Theoretical Perspective
Feng, G., Zhang, B., Gu, Y., Ye, H., He, D., & Wang, L. (2023) · arXiv · doi:10.48550/arxiv.2305.15408 · Cited by 69 · see citing works
“, length extrapolation (Figure 3)) [55, 12].”
What In-Context Learning “Learns” In-Context: Disentangling Task Recognition and Task Learning
Pan, J., Gao, T., Chen, H., & Chen, D. (2023) · Findings of the Association for Computational Linguistics: ACL 2023 · doi:10.18653/v1/2023.findings-acl.527 · Cited by 29 · see citing works
In-context Reinforcement Learning with Algorithm Distillation
Laskin, M., Wang, L., Oh, J., Parisotto, E., Spencer, S., Steigerwald, R., Strouse, D., Hansen, S., Filos, A., Brooks, E., et al. (2022) · arXiv · doi:10.48550/arxiv.2210.14215 · Cited by 14 · see citing works
“We use the terms ‘in-weights learning’ and ‘in-context learning’ from prior work on sequence models (Brown et al., 2020; Chan et al., 2022) to distinguish between gradient-based learning with parameter updates and gradient-free learning from context, respectively.”
MethodLarge Language Models can Implement Policy Iteration
Brooks, E., Walls, L., Lewis, R. L., & Singh, S. (2022) · arXiv · doi:10.48550/arxiv.2210.03821 · Cited by 9 · see citing works
Trusting Your Evidence: Hallucinate Less with Context-aware Decoding
Shi, W., Han, X., Lewis, M., Tsvetkov, Y., Zettlemoyer, L., & Yih, S. W.-T. (2023) · arXiv · doi:10.48550/arxiv.2305.14739 · Cited by 6 · see citing works
- Authors
- Chan, S. C. Y., Santoro, A., Lampinen, A. K., Wang, J. X., Singh, A., Richemond, P. H., McClelland, J., & Hill, F.
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2022
- Pages
- 18878-18891
- ISSN
- 1049-5258 (ISSN-L)
- arXiv
- 2205.05055
- OpenAlex
- W7133195599
- Cited by
- 69
- References
- 0
- Citations by year
- 2026: 11 · 2025: 9 · 2024: 27 · 2023: 18 · 2022: 4
- FWCI
- 8.00
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- neural information processing systems (publishedVersion)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University) (cc-by)
- Funders
- DeepMind
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › Domain Adaptation and Few-Shot Learning
- Physical Sciences › Computer Science › Artificial Intelligence › Neural Networks and Applications
- Keywords
- in-context learning, transformer models, data distribution, emergent behavior, distributional properties, large language models, prompt learning
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review