Introduction
Mechanistic interpretability has long identified "induction heads" as the core mechanism behind In-Context Learning (ICL). These circuits enable Transformers to recognize and complete patterns like [A][B] ... [A] -> [B]. However, standard induction heads typically operate under the assumption of a fixed causal structure—a single rule governing token relationships. In natural language, these relationships are dynamic; the relevance of a past token often depends on a context-specific "lag" or rule. This paper investigates how Transformers dynamically select the correct causal structure when multiple possibilities exist.
The Interleaved Markov Chain Framework
To study this selection process, the authors introduce Interleaved Markov Chains. In this synthetic setup, a sequence is generated from a fixed transition matrix, but the "lag" ($k$)—the distance between a token and its parent—is unknown and must be inferred from the context.
The task for the model is to predict the next token $s_{i+1}$ by identifying which lag (e.g., $k=1$ or $k=2$) is currently active based on the preceding sequence. This requires the model to perform in-context model selection before it can perform the actual copying operation.
The 3-Layer Selective Induction Circuit
The researchers mathematically constructed and empirically verified a 3-layer attention-only Transformer circuit designed to solve this task. This "Selective Induction Head" operates in three distinct stages:
- Layer 1 (Extraction): This layer identifies potential transition probabilities for every possible lag encountered during training. It looks back at various distances to see which tokens could have transitioned to the current one.
- Layer 2 (Aggregation): This layer sums the evidence for each potential lag across the entire history of the sequence. By averaging these signals, the model builds a "vote" for which causal structure is most likely.
- Layer 3 (Selection & Copying): The final layer acts as a "hardmax" selector. It attends to the specific past position corresponding to the lag with the highest aggregated evidence and copies that token to the output.
Key Insights and Results
A critical finding of this work is that depth is a fundamental requirement. The authors demonstrate both theoretically and empirically that 2-layer Transformers are insufficient for this task. A minimum of three layers is necessary: one to identify transitions, one to aggregate evidence, and one to execute the selection.
Furthermore, models trained from scratch via gradient descent naturally converge to the exact attention patterns derived in the authors' mathematical construction. This "emergent alignment" suggests that the Selective Induction Head is an optimal, natural solution for in-context model selection. The resulting 3-layer mechanism matches the performance of theoretical benchmarks like the Maximum Likelihood Estimator (MLE).
Conclusion
The discovery of Selective Induction Heads extends our understanding of Transformer internals beyond simple pattern matching. By demonstrating how models can dynamically select between competing causal rules, this research provides a foundation for interpreting more complex reasoning tasks where the "rules of the game" change based on context. Future work will explore how these circuits scale to the more intricate, non-linear dependencies found in natural language.
Summary updated