Open Interpretability Models Contributors Research Posts About

In-context Learning and Induction Heads

Source

Citation. Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann and Amanda Askell. Then Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Scott Johnston and Andy Jones. Then Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish and Chris Olah. All are at Anthropic. "In-context Learning and Induction Heads". Transformer Circuits Thread, published 8 March 2022. HTML, the canonical version. arXiv 2209.11895, v1 24 September 2022, a print of the HTML page. The thread is not a peer-reviewed venue. The page's change log has one entry, dated 2022-09-20, which revises the definition of prefix matching. The authors release no code, models or data, and the models are Anthropic's own. We found no funding disclosure.

Status. Used. The registry's head profiles measure the paper's prefix-matching pattern on repeated random tokens (openinterpretability/harness/heads.py), and the attention-head-audit skill takes its holdouts from the paper. The paper also gives the mechanism that the #4781 answer route names for L3/H3.

Read. On 2026-11-18. The HTML page is about 395,000 characters, and image data takes most of it. A web reading of it returned only the abstract, the introduction and the definitions as text. So we read the arXiv PDF instead, as text that pdftotext extracted, and we read that text ourselves, not through a summary. We have the source's own text for the abstract, the introduction, Key Concepts and Arguments 1 to 6. We also have the Model Analysis Table's prose, Model Details, Unexplained Curiosities and Discussion. Comments & Replications, the change log, the footnotes and the author contributions are in the text too. We also have the appendix on where induction heads form, the ablation methods and the head evaluators. We only looked at the headings of Related Work, and we did not read the rest of the appendix. We did not see the figures, the Model Analysis Table's plots or the interactive views. So this page has no number read from a curve.

Summary

Claim. Induction heads complete patterns of the form [A][B] … [A] → [B]. The paper gives "preliminary and indirect evidence" that they "might constitute the mechanism for the majority of all 'in-context learning' in large transformer models". The evidence is causal for small attention-only models and correlational for larger models with MLPs.

Method.

Findings, as the source reports them.

Setting Result
All models with more than one layer, over training In-context learning develops "abruptly in a narrow window early in training (roughly 2.5 to 5 billion tokens)"
In-context learning score, before and after the window Less than 0.15 nats before. About 0.4 nats after, constant across model sizes and later training
Share of the final in-context learning Over 75% forms in the window
Prefix-matching scores over training Induction heads form in the same window. The one-layer model has none, and almost no in-context learning
Training loss The window is "the only place in training where the loss is not convex"
Smeared-key models In-context learning forms in one-layer models, and earlier in two-layer models
Head ablations, small attention-only models "Almost all the in-context learning" comes from the induction heads. The authors ran no ablations on the full-scale models
13B model: literal copying head, layer 21 of 40 Copying 0.89, prefix matching 0.75
13B model: translation head, layer 7 of 40 Copying 0.20, prefix matching 0.85
13B model: pattern-matching head (layer 8 of 40 in the table, 26 in the text) Copying 0.69, prefix matching 0.94. About 65% of its attention from the colons goes to the right positions
Harry Potter text, start against end of the window Repeated sequences become easier. A token "followed by a different token than it previously was" becomes harder, for example the first " Mrs Potter" after two " Mrs Dursley"
Redwood replication, two-layer attention-only models An exact previous-token pattern recovers 99% of the loss difference of the ablation. A simple [A][B]…[A] pattern for the induction head recovers about 65%, and an [A][B][C]…[A][B] term adds 10%

Footnote 17 adds that ablating most other heads increases the in-context learning score. The authors' reason is that some tokens can come from "normal prediction" or from in-context learning. If an ablation harms normal prediction, in-context learning predicts more of those tokens.

Where the claims go beyond the evidence

Use in this repo

The head profile measures the paper's prefix-matching half. pattern_scores (openinterpretability/harness/heads.py) records previous-token, duplicate-token and induction scores, and HeadProfile (openinterpretability/core/profiles.py) cites this paper. Our version differs from the paper's evaluator in four details:

The registry reports the scores and does not gate on them.

The audit skill uses the paper's test. The attention-head-audit skill takes repeated random-token sequences as holdouts for an induction head, and repeats with the copy broken as hard negatives. Its positive control is the five known induction heads of GPT-2 small: L5H1, L5H5, L6H9, L7H2 and L7H10.

The #4781 copy heads are not all induction heads by the paper's definition. The answer route (wiki/answers/EleutherAI--pythia-70m/970a91e11d8c/20261118T234629Z.json) names L3/H3 an "induction-style copy head", with L4/H0 and L4/H7. Their induction scores on 32-token repeats are 0.13 (L3/H3), 0.33 (L4/H7) and 0.05 (L4/H0). Uniform attention over the second copy would give about 0.02. The VERIFIED explanation of L4/H0 is a head for the comma that closes a comma-delimited insertion, not an induction head. L3/H3's VERIFIED explanation is a broad induction-style head on repeats of rare words and phrases. L4/H7's VERIFIED explanation is a broad head that grows with context and fires at the second member of a series. So, on our scores, L4/H7 has the clearest prefix-matching pattern, and L3/H3 has a weaker one. None of the three has a copying score.

What the paper predicts for the " days" failure. The prompt is "A week has seven days and a year has twelve". At ' twelve', no earlier ' twelve' exists, so a literal induction head has nothing to match. The paper's fuzzy form fits instead. A* is ' seven', and the layer-0 count-word neurons make it similar to A, ' twelve'. B* is ' days', and the head copies it. The paper predicts the copy of B*, not a mapped B such as ' months'. Its only mapped case is the translation head of a 13B model. The authors say that head's output "needs to be further processed by later layers". Pythia-70m has two layers after L3. The paper also predicts the cost: the Harry Potter case shows that a token with a new continuation becomes worse after the phase change. " months" after "a year has twelve" is that case.

The answer record's probes fit this prediction, with one exception. The model copies the earlier noun whatever is true. "Twelve months make a year and seven" gives ' months', and "A week has seven colours and a year has twelve" gives ' colours'. "There are seven days in a week and twelve" gives ' days', so the count word alone is enough for the match. The exception is about which earlier match wins. "A week has seven days and a year has twelve months and a decade has ten" gives ' days', not ' months'. A head that copies after the most recent match would give ' months'. The paper says nothing on how a head chooses among several earlier matches. So it does not explain why the first clause wins.

What the paper predicts but the repo has not measured. Footnote 17 implies that the copy and the model's in-weights prediction compete for the same token. Ablating L3/H3 and L4/H7 alone, and reading the rank of ' months', would tell whether pythia-70m has a "year → months" fact that the copy hides. That is question 1 of #5015, and the result belongs there as a comment. The paper also predicts that the copy appears when the induction heads form. Pythia's checkpoints make this testable (follow-up below). papers/neuron-development/ already reads Pythia-70m at 20 checkpoints. Pythia trains on about 300B tokens in 143,000 steps (Biderman et al., 2023, not reread for this page). So the paper's 2.5 to 5 billion tokens would be near steps 1,200 to 2,400. That is a scale assumption, because the paper's window is for Anthropic's models.

Evidence for the fix campaign, not a design. In small models the paper finds that induction heads give almost all in-context learning. If that holds for pythia-70m, the " days" copy is a side effect of a general mechanism, not a fault of one prompt. A change that removes the copy at L3/H3 or L4/H7 would then also change right copies. An example is ' legs' for "A spider has eight legs and a dog has four". The answer record gives ' legs' for that prompt. The maintainer designs the campaign.

A question for the maintainer. The paper defines an induction head by prefix matching and copying together. The registry records only the attention side, and the explanations still say "induction-style". Should that word need a copying score? The scores are not gated, so this changes labels, not the decision rule.

Follow-ups.