NLP Foundations
Induction Heads
A specific, mechanistically understood attention circuit that copies patterns it has seen once in the current context, and the closest thing the field has to a concrete explanation for in-context learning.
advanced · 10 min read · Premium
Most claims about what an attention head "does" are informed guesses backed by attention-weight visualisation. Induction heads are different: they are one of the few attention circuits that has been reverse-engineered end to end, with the actual weight computation identified and verified, and with a documented causal link to a measurable capability, in-context learning. That combination, a concrete mechanism plus a concrete behavioural signature, makes induction heads the sharpest existing example of transformer interpretability actually explaining something.
The behaviour: complete the pattern
An induction head implements a simple algorithm: given a sequence like ... A B ... A, predict B next. If token A was followed by token B earlier in the context, and A shows up again, an induction head pushes the model to predict B again. This sounds almost too simple to matter, but it is a strict, prefix-based pattern completion running over arbitrary content, not memorised training data, and it generalises immediately to novel tokens the model has never seen paired that way before. Olsson et al., 2022, from Anthropic's interpretability team, is the paper that named and characterised the mechanism in depth.
The mechanism: two heads working across two layers
A single attention head cannot implement this algorithm alone, because the computation needs two hops: first, find where the current token last appeared, then look at what came right after that earlier occurrence. Induction heads are implemented by a circuit of two heads in different layers:
- A previous-token head in an earlier layer writes information about "what token came immediately before me" into each position's residual stream.
- An induction head in a later layer uses that written information: its key for position
jeffectively encodes "the token beforej," so when the current query tokenAmatches that key, the induction head attends to positionj(the earlier occurrence ofA) and copies forward whatever came afterj, namelyB.
This is a composition of two attention operations through the residual stream, not something visible in either head's attention pattern alone. Finding it required tracing information flow across layers, which is part of why it stayed hidden until dedicated mechanistic-interpretability tooling made the composition legible.
The evidence linking it to in-context learning
Olsson et al. found something sharper than a plausible story: across many model sizes, there is a sudden, simultaneous shift early in training where induction heads form and, at almost exactly the same point, the model's in-context learning score (how much better it gets at predicting a token when given more preceding context, sometimes visible as a bump in the loss curve) jumps. The timing correlation across model scales, combined with ablation experiments (removing induction heads measurably degrades in-context pattern-following while leaving other capabilities comparatively intact), is the strongest evidence that a specific attention circuit is causally responsible for a specific, important capability, rather than merely correlated with it. See in-context-learning for what the capability itself looks like from the outside.
Keep reading with Pro.
You're reading the preview. Unlock the full concept plus the library, study plans, the AI mentor, and daily emails.