Abstract
In the study of mechanistic interpretability, "induction heads" have been identified as a primary driver of in-context learning in large language models. While empirical evidence suggests these heads typically emerge in the second layer or deeper, a formal explanation for this requirement has been lacking. This paper provides a theoretical proof using communication complexity to demonstrate that one-layer transformers are fundamentally inefficient at solving the induction task. We show that for a one-layer model to succeed, its parameter size must grow linearly with the input sequence length, whereas a two-layer model can solve the task with logarithmic efficiency. This result establishes a rigorous mathematical basis for the necessity of depth in transformer architectures.
Introduction
Transformers have revolutionized natural language processing through their ability to perform in-context learning—predicting the next token based on patterns established earlier in a sequence. Mechanistic interpretability research has pinpointed "induction heads" as the specific circuit responsible for this behavior. An induction head implements a simple yet powerful logic: if it sees token A, it searches the past for previous occurrences of A, identifies the token B that followed it, and increases the probability of B appearing next.
While previous research has constructively proven that two layers are sufficient to implement these heads, one-layer models consistently fail to develop them in practice. This paper addresses the "negative" side of that observation: why is a single layer insufficient? By framing the transformer's attention mechanism as a communication problem, we prove that one-layer models face an inescapable mathematical bottleneck.
The Induction Task and Communication Complexity
To analyze the limits of a single layer, the authors define a formal "1-hop" induction task. In this task, the model must identify the rightmost previous occurrence of the current token and predict the token that immediately followed it.
To prove the difficulty of this task for one-layer models, the authors utilize Communication Complexity, a framework from theoretical computer science. They map the induction task onto the classic INDEX problem, which involves two parties, Alice and Bob:
- Alice receives a long string of bits.
- Bob receives a specific index (position) within that string.
- Alice must send a single message to Bob that allows him to determine the bit at his specific index.
In a one-layer transformer, the attention mechanism acts as the communication channel. The "message" consists of the information Alice (the sequence prefix) can pack into the hidden states that Bob (the current token) eventually attends to. If a one-layer transformer could solve the induction task, it would effectively be solving the INDEX problem by compressing the entire sequence into its internal representation.
The Mathematical Bottleneck
The core of the paper's argument lies in the "size" of the transformer, defined by the product $hmp$, where:
- $h$ is the number of attention heads.
- $m$ is the embedding dimension.
- $p$ is the bits of numerical precision.
The authors prove that for a one-layer transformer to solve the induction task, the total capacity $hmp$ must be at least proportional to the input length $n$ (expressed as $hmp = \Omega(n)$). This means that as the context window grows, a one-layer model requires a massive, linear increase in parameters to maintain performance. For a sequence of 1,000 tokens, the model would need thousands of dimensions or heads just to perform basic pattern matching.
The Power of Composition
The reason two-layer models avoid this bottleneck is composition. In a two-layer architecture, the first layer does not need to solve the task; it merely needs to "mark" positions or prepare the data. The second layer then "looks up" the values at those marked positions.
This division of labor allows a two-layer transformer to solve the induction task with $h=O(1)$, $m=O(1)$, and $p=O(\log n)$. This represents an exponential gap in efficiency. While a one-layer model must effectively memorize the entire input string into its hidden state, a two-layer model uses its depth to navigate the sequence more intelligently, requiring only a handful of dimensions regardless of sequence length.
Precision and Real-World Implications
Unlike many theoretical models that assume infinite precision, this proof explicitly accounts for the number of bits ($p$) used in calculations. This makes the findings highly relevant to modern LLM optimization, such as FP16 or INT8 quantization. The results suggest that the inability of one-layer models to perform induction is not a matter of training data or optimization quirks, but a fundamental constraint of the architecture's expressive power.
Conclusion
This paper provides a rigorous theoretical foundation for the necessity of depth in transformers. By proving that one-layer models are exponentially less efficient than two-layer models at the induction task, the authors explain why the most basic building blocks of in-context learning only emerge in deeper networks. Future work may extend these communication complexity arguments to more complex "k-hop" tasks or explore how non-linearities like GLU affect these lower bounds. For now, the result stands as a clear explanation for why depth is a non-negotiable requirement for functional language models.
Summary updated