Papers › Data Distributional Properties Drive Emergent In-Context Learning in Transformers

Data Distributional Properties Drive Emergent In-Context Learning in Transformers

22 Apr 2022arXiv:2205.05055archive 2025-07-28

Stephanie C. Y. Chan, Adam Santoro, Andrew K. Lampinen, Jane X. Wang, Aaditya Singh, Pierre H. Richemond, Jay McClelland, Felix Hill

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2205.05055")

Code

Syntology Ran 3 of 9 code samples harvested from 2 repositories linked to this paper; 6 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: official repository: 6 samples from 1 repository, 0 ran; community (archive-listed): 3 samples from 1 repository, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

deepmind/emergent_in_context_learning officialmentioned in papermentioned on GitHubjaxApache-2.0 report
aadityasingh/icl-dynamics mentioned on GitHubjax report
aadityasingh/icl-transience mentioned on GitHubjax report
google-deepmind/emergent_in_context_learning mentioned on GitHubjaxApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 3 ran; 1 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · our draft was wrong
1ran · fixture could not drive it
6unverified

Licence: 3 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

conv1 deepmind/emergent_in_context_learning/modules/transformer_core.py official repository unverified Apache-2.0 (permissive) · 652a0680a67dcd73 · report
get_pos_start deepmind/emergent_in_context_learning/modules/transformer_core.py official repository unverified Apache-2.0 (permissive) · 4821ab9352b9a1c1 · report
layer_norm deepmind/emergent_in_context_learning/modules/transformer_core.py official repository unverified Apache-2.0 (permissive) · 5d83309868b4e1a6 · report
prepare_seqs_for_transformer deepmind/emergent_in_context_learning/datasets/utils.py official repository unverified Apache-2.0 (permissive) · 2fa569a9eb572a35 · report
reduce_fn deepmind/emergent_in_context_learning/modules/losses.py official repository unverified Apache-2.0 (permissive) · 34959b5d69981166 · report
softmax_cross_entropy deepmind/emergent_in_context_learning/modules/losses.py official repository unverified Apache-2.0 (permissive) · c8b1743b116dcfc8 · report
apply_rope aadityasingh/icl-dynamics/models.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · 369d990a59246f7f · report
create_sinusoidal_positions aadityasingh/icl-dynamics/models.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · 6c3305fbafc272c8 · report
make_cache_assign aadityasingh/icl-dynamics/models.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 45325303dac3d895 · report

Tasks

Few-Shot LearningIn-Context Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections