In-context Learning and Induction Heads
1. Research problem
Transformers exhibit in-context learning, but it was unclear what internal mechanism implements copying patterns from the prompt.
2. Motivation
The authors sought a mechanistic explanation of a concrete behavior, induction, that could in turn explain few-shot learning.
3. Previous approaches
Circuits work provided methodology; behavioral studies of in-context learning did not identify responsible components.
4. Core contribution
Identified a two-head 'induction circuit' where a previous-token head and an induction head copy patterns, showed it develops at a phase change, and linked it to in-context learning ability.
5. Mathematical formulation
Given a prefix A B ... A, the first head moves B's information to the position of the second A, and the second head uses that to predict B; attention pattern analysis and ablation support the circuit.
6. Methodology
Train small transformers on synthetic repetition tasks, analyze attention patterns, ablate heads, and correlate circuit formation with in-context learning behavior.
7. Architecture
Small decoder-only transformers trained on synthetic sequence distributions.
8. Experimental setup
Induction tasks, copy behavior, and simple in-context learning evaluations.
9. Datasets
Synthetic token-sequence datasets designed to require induction.
10. Results
Found a clear circuit whose formation coincides with a sudden improvement in in-context learning, giving one of the first mechanistic accounts of the behavior.
11. Limitations
Demonstrated in small models on synthetic tasks; larger models may use multiple redundant mechanisms; correlation with in-context learning is not fully causal.
12. Critical analysis
A rare example of a mechanistic story tied to a high-level capability, though generalization to production-scale models remains open.
13. Implementation tasks
- 1.Train a small transformer on an induction task and visualize attention patterns.
- 2.Ablate the identified heads and measure the drop in induction accuracy.
- 3.Track when the circuit forms during training and relate it to behavior.
14. Follow-up work
- 1.Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small (Wang et al., 2022)
- 2.Towards Monosemanticity: Decomposing Language Models With Dictionary Learning (Anthropic, 2023)
15. Open research questions
- 1.Do large language models rely on the same induction mechanism?
- 2.What other circuits support in-context learning?