MechanisticLong read

Induction Heads and In-Context Learning Mechanisms

Researchers trace in-context learning to a simple copying circuit in transformers.

Contributing Editor · · 11 min read
Cover illustration for “Induction Heads and In-Context Learning Mechanisms”
Mechanistic · September 23, 2026 · 11 min read · 2,402 words

Induction heads are the first mechanism anyone pinned down, with real precision, for why a pre-trained transformer can pick up a new task from examples in its prompt alone, no gradient step, no weight update, nothing in the model itself touched. That should strike you as strange. Traditional machine learning explains capability as something baked into weights during training, so a model doing something that looks like learning at inference time is a genuine puzzle, not a marketing phrase. Induction heads are a specific, traceable circuit inside transformer attention layers that does a simple copying operation, and that copying operation explains a surprising share of what looks like on-the-fly learning. The capability itself ranges from finishing a pattern started in a prompt to, in larger models, carrying out tasks the model never saw during training.

How induction heads were discovered and the foundational claim

Credit for first spotting the phenomenon goes to Chris Olah, who noticed it while working with a two-layer model. The systematic study that followed came from Olah alongside Catherine Olsson, Nelson Elhage, and Neel Nanda, published as part of one research lab's interpretability agenda. The work grew out of "A Mathematical Framework for Transformer Circuits," a paper that treated small attention-only transformers as objects you could take apart piece by piece, and the fuller account landed in Olsson et al. (arXiv:2209.11895).

The claim at the center of that paper is almost embarrassingly simple to state. An induction head completes sequences shaped like [A][B]... [A] → [B]. Show the model token A followed by token B earlier in the context, then show it A again later on, and the head pushes the model to predict B next. That's the whole rule. What makes it worth a paper, and worth everything that followed, is how much downstream behavior this one rule turns out to explain.

The two-head circuit: how a previous-token head and an induction head compose to copy from context

The rule needs two attention layers working together, and that requirement is load-bearing. It's load-bearing. Induction heads are absent in single-layer models, a pattern confirmed by a formal communication-complexity argument: no one-layer transformer can solve the induction task without blowing up in size, exponentially, relative to what a two-layer model handles with ease. Depth is the minimum architecture the task requires.

The first layer holds what researchers call a previous-token head. Its job is narrow: at each position, attend back one step and copy the preceding token's information into the current position's representation. On its own, that head does nothing resembling in-context learning. It's bookkeeping.

The second layer is where the induction head proper lives, and it uses that bookkeeping to do the real work. It takes the copied information sitting in each position's representation and searches backward through the context, matching its query against keys, looking for the earlier spot where the current token last appeared. Once it finds that spot, it reads off whatever came after, in the copied information from layer one, and pushes the model toward predicting that same token again. Two heads, two layers, one simple pattern-completion machine.

Diagram: How Two Heads Compose to Complete a Pattern. Visualizes: Show the two-head induction circuit as a stepped flow across two attention layers.

The phase transition: why induction heads emerge abruptly rather than gradually during training

Induction heads do not build up slowly over the course of training the way you might expect a skill to. They snap into place. Olsson et al. document this as a sharp phase transition, a sudden drop in error on induction-style tasks that lines up with a visible bump in the training loss curve. The timing is not a coincidence: the moment ICL ability jumps is the same training step where the induction head circuit forms.

A 2025 ICML workshop paper frames this as a lazy-to-rich transition. "Lazy" means the model is relying on simple n-gram statistics, ignoring anything that depends on long-range context. "Rich" means it has switched over to the induction mechanism, which tracks dependencies across arbitrary distances in the sequence. Training on a synthetic target that mixes n-gram signals with in-context structure, the paper shows the switch from lazy to rich happening abruptly, not as a gradual blend of the two.

Research on this transition adds an important detail to the ordering: simpler statistical patterns get learned first, before the induction head itself ever forms. The circuit gets built on top of statistical scaffolding the model has already put up, not the other way around, and that sequencing matters for anyone trying to predict when a given training run will suddenly develop the capability.

The training dynamics inside parameter space: a surprisingly low-dimensional story

Musat et al. (arXiv:2511.01033, submitted November 2025, revised January 2026) pushed the question of how this emerges down to the level of parameter space itself, and the answer is stark. The training dynamics that produce an induction head are provably confined to a 19-dimensional subspace of the model's full parameter space. That is a stark finding for something happening inside networks with millions or billions of parameters.

It gets narrower once you look at what's actually doing the work. Of those 19 dimensions, only 3 account for the real emergence dynamics, empirically. The remaining 16 dimensions account for far less of the emergence dynamics than the 3 that drive the transition. Whatever is happening when an induction head forms, it's happening in a space small enough to almost sketch on paper, buried inside a model with orders of magnitude more capacity than that.

The instinct in most interpretability work has been to assume that more capacity means more complexity in how a capability forms. Musat et al. cut against that. The finding that only 3 dimensions account for emergence points to a geometry of this particular transition that is surprisingly compact relative to overall model capacity.

Generalizing the mechanism: statistical induction heads, feature learning, and n-gram Markov chains

The copying rule turns out to be one instance of a broader pattern. When a transformer is given an in-context Markov chain task, it learns what researchers call statistical induction heads: circuits that compute the correct conditional probability of the next token given every prior occurrence of the current token, approaching Bayes-optimal performance as training proceeds. That's a meaningfully more sophisticated operation than "find A, copy what followed it," even though it grows out of the same architecture.

Studying a transformer trained on n-gram Markov chain data, researchers found the resulting model implements a more sophisticated induction-like mechanism, built around a learned feature rather than a raw token match. The roles split three ways. Layer 1 acts as a copier, pulling past tokens within a window into each position's representation, much like the original circuit. The feed-forward network in between acts as a selector, building a feature vector by attending only to the tokens in context that actually carry information relevant to prediction, discarding the rest. Layer 2 then acts as a classifier, comparing the feature at the current output position against features computed across the rest of the context, and using similarity scores between them to pick the next token.

A complete mechanistic study of ICL on finite discrete Markov chains identifies distinct algorithmic phases corresponding to different regimes of memorization and generalization. One of these phases, labeled 2-Mem, uses a subcircuit unlike anything in the basic two-head story, an encoder-pool-decoder structure that builds a latent representation of the whole chain and uses it to shape how later layers respond. That circuit draws on components across a two-layer model to function, which argues that two layers is the minimal architecture capable of recapitulating the distinct algorithmic regimes, not just the simplest one.

Put together, the plain copying rule from Olsson et al. looks like the entry point into a broader family of context-adaptive computations, and the two-layer transformer is the smallest structure that can support multiple members of it.

Identifying induction heads in practice: tools researchers use to locate and isolate them

Finding these circuits inside a trained model is its own discipline. Small attention-only models can be broken down into interpretable circuits, traceable paths through the network that show, step by step, how information moves from input tokens to output predictions. That decomposition is what makes claims about induction heads checkable rather than speculative.

Mean ablation is one of the standard tools: replace a component's activations with the average activation it produces across some reference set of inputs, then check whether the model's behavior on the task falls apart. If disrupting a head's output degrades induction-style predictions, that head is causally implicated in the behavior. Activation patching and direct tracing of attention patterns, run against synthetic datasets built specifically to contain repeated-token structure, show how a given head is wired to detect a repetition and propagate the pattern that followed it earlier in context.

The most widely used quantitative signature is the prefix-matching score, a measure of how strongly a head attends to the token that came right after an earlier occurrence of the current token. A head with a high prefix-matching score is doing, numerically, what the induction-head definition describes, and the score has become close to the operational test for whether a given attention head qualifies as one.

The challenge to induction heads as the primary ICL driver in larger models

Not every finding since the original work has confirmed the original story, and one result in particular complicates it substantially. Yin and Steinhardt, published at ICML 2025 (Proceedings of the 42nd ICML, PMLR 267:72428-72461), ran detailed ablations across 12 language models, comparing the causal role of induction heads against a different class the paper calls function vector heads, or FV heads.

In larger models, few-shot ICL is driven mainly by FV heads, not by induction heads. Function vector heads don't copy tokens. Instead, they compute something more abstract, a latent encoding of the task the prompt is demonstrating, sometimes called a task vector or function vector, stored in the attention head's output at the final prompt token. Erase that vector and ICL breaks down on the spot. Patch it into a different context and the model carries out the task there instead, even without the original examples present. That's a stronger, more surgical form of causal evidence than anything the induction-head literature had produced up to that point, and it means the field's founding mechanism, real as it is, stops being sufficient once models scale up. Anyone treating induction heads as the full explanation for ICL in a frontier-scale model is working from an outdated map.

An expanding taxonomy of induction-like heads and its revelations about ICL's internal diversity

The single mechanism identified in the original work has since split into a small zoo of related but distinct circuits. Function vector heads trigger task execution wholesale. Other induction-like head variants have been described that operate at different levels of abstraction, from lexical patterns to relational structure. There are n-gram generalizations of the original head too, extending the match-and-copy logic past single-token lookback windows.

Crosbie and Shutova add another wrinkle: induction heads don't need an exact token match to fire. They can perform soft matching, responding to tokens that are similar rather than identical, which pushes the definition further from "literal copy machine" and closer to something doing real generalization. And there's evidence that abstract ICL capability survives even when a model's induction heads are weakened and its raw copying capacity is reduced, which suggests copying was never the terminal explanation for the capability, just the first mechanism clear enough to describe.

What Olsson et al. named as one circuit has turned out to be the simplest, earliest-forming member of a family. That's the usual fate of a good first mechanistic account: it becomes the baseline everything else gets measured against, and the measuring keeps turning up circuits the original account never anticipated.

Diagram: Induction Heads to Function Vectors: ICL Mechanisms at Scale. Visualizes: Show a ranked or staged contrast between two ICL mechanisms across model scale.

Beyond copying: how meta-learning ability emerges through multi-phase circuit development

The copying story has an obvious limit. It explains ICL when the correct answer is sitting right there in the context, waiting to be found and repeated. Most practical ICL doesn't work that way, though. A large model asked to translate a novel sentence, or solve a math problem structured like the few examples in its prompt, has to infer how to do the task, not retrieve an answer that's already written down somewhere in the prompt.

Minegishi et al., in "Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergence" (ICML 2025 poster), pushed directly on this gap. The method extends the standard copy task into what they call an In-Context Meta Learning setting, where the model has to infer the underlying task from a handful of examples before it can answer a new query correctly, and critically, the answer is nowhere in the context to be copied. It has to be produced.

The finding runs against the clean, single phase-transition story from earlier work. Instead of one abrupt jump, acquiring meta-learning ability unfolds across multiple distinct phases, with a separate circuit emerging at each one. Standard induction-head formation is a single snap into place. Meta-learning ability, by contrast, is a staged construction project, and that staging is itself evidence that ICL, at its most capable, is doing something structurally richer than pattern-matching against visible context.

What induction heads reveal about reading transformer behavior at scale: safety and interpretability consequences

Induction heads have become something close to a standard benchmark circuit for interpretability research generally. When a new method for circuit discovery or automated interpretability gets proposed, checking whether it can correctly recover the induction-head circuit, in a model where that circuit's structure is already well established, is a natural first test of whether the method works.

That's a real, practical legacy independent of whatever role induction heads turn out to play in the largest deployed models. The value of the original finding was never just the specific claim about copying. It was proof that a capability as consequential as in-context learning could be traced down to concrete attention heads, verified with ablations, and described with a formula simple enough to fit in one line. Everything that has followed, the function vector heads, the semantic and symbolic variants, the multi-phase meta-learning circuits, builds on that same standard of evidence. The mechanism has been challenged and expanded on repeatedly since it was first identified, and that's exactly as it should be. The method for finding mechanisms in the first place is what has held up, and it's the part of this story least likely to get overturned by the next paper.

Sources

  1. ICML Poster Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergence
  2. On the Emergence of Induction Heads for In-Context Learning
  3. aclanthology.org
  4. arxiv.org
  5. In-context Learning and Induction Heads
  6. transformer-circuits.pub
  7. proceedings.neurips.cc
Filed underMechanistic

More in Mechanistic