Language models don't learn in-context all at once: control of the answer flips first, and accuracy catches up trillions of tokens later
Synopsis
Language models do not acquire in-context learning in one step. A controlled diagnostic separates copying the nearest demonstration from composing mappings spread across the prompt; across 17 models about a third prefer the copied answer and the rest the rule-consistent one, and in OLMo-2-7B dependence on the requested value overtakes the conflicting example hundreds of billions of tokens before accuracy rises above chance. Training on synthetic definition-and-query documents flips the preference, while exposure to definitions or suppressing copy-favoring heads does not.
Interpretation
A language model can use a prompt in two ways that final accuracy cannot tell apart: it can reuse the output pattern of the demonstration closest to the query, or integrate mappings distributed across the prompt and apply them to a new combination. In ordinary in-context evaluations both behaviors predict the same output, so correctness shows the context was useful but not how it was used; the controlled diagnostic makes the two predict different answers and ranks the preference. Across 17 models, six assign at least 60% of the copied and correct candidates' combined probability to the copied answer, eight assign at most 20%, and three fall between; the correct form rarely ranks first in the high-copy group and usually does in the low-copy group, with exact generation following the same ordering, and the grouping is not a size effect, since Pythia-12B copies while Qwen3-1.7B and Gemma-3-4B compose.
During training, which prompt source controls the answer changes earlier than accuracy does. Early checkpoints are governed by the closest example's ending, and blocking that ending changes the copied-versus-correct margin far more than blocking the requested value; the balance reverses between 336B and 630B tokens. OLMo-2-7B's fitted four-choice accuracy crosses chance at about 1.5T tokens, and exact generation of the missing form arrives at about 3.6T tokens; among 16 released training series that reach composition, OLMo-3 and Comma satisfy every ordering criterion, and runs that fail to compose never sustain control by the requested value.
The training signal decides which use of the prompt is practiced, and only the practiced use transfers. Replacing about 3% of a continued-pretraining stream with synthetic documents that define endings and then query them moves SmolLM2-1.7B from copy-dominant to query-dominant; exposure to definitions in natural text, or a penalty on ten copy-favoring attention heads, only shifts the margin between candidates without producing the missing form. Synthetic-document training has driven the preference measure to near zero and exact generation to near ceiling by 50M tokens while plain continuation stays copy-dominant; at SmolLM2-360M an all-shown condition, where every queried combination already appears on another stem, crosses at the same checkpoint as the held-out condition, so resolving queries through temporary mappings does not require practicing an absent cell.
Perspective
The diagnostic is a single controlled task, and code and Southern Quechua versions carry the contrast into two further encodings. Training experiments use models up to 8B parameters and synthetic documents that share the diagnostic's format, so the transfer they produce is the format-bound transfer the design predicts; the authors name larger models and more varied training data as the next tests. Transfer from definition exercises holds on made-up and exchanged labels for TREC, DBpedia and Yahoo, while a relational-reasoning suite moves down by a few points, so the exercises teach following prompt-assigned labels rather than prompt-dependent tasks in general.
The authors note the diagnostic covers one controlled task, that in-context learning includes many other behaviors, and that the four measures only raise the question of whether those develop in the same order. Localization rests on prompt-span interventions, and the selected attention heads carry only part of the behavior. OLMo-2-13B changes sign three times during training, and OLMo-7B-0424 turns negative for good only long after its fitted accuracy onset; Marin-8B-Base is already past both thresholds at its first public checkpoint, so its ordering cannot be dated. Under standard Quechua spelling the tokenizer often fuses the stem-final vowel with the suffix, and eight models drop to near-chance correct-ranks-first rates.
