Abstract
Recent empirical observations in Large Language Models (LLMs) have highlighted persistent positional biases, such as the "lost-in-the-middle" phenomenon and the emergence of "attention sinks." While these behaviors are well-documented, their theoretical origins remain under-explored. This paper investigates the emergence of position bias through a graph-theoretic lens, demonstrating that causal masking and multi-layer attention architectures inherently concentrate influence on specific "center nodes," primarily the initial tokens of a sequence. We prove that this structural bias exists independently of training data and interacts dynamically with positional encodings to shape the model's internal representation flow.
1. Introduction
The Transformer architecture has revolutionized natural language processing, yet its inductive biases—the architectural "shortcuts" it adopts—are not fully understood. Two specific phenomena have puzzled researchers: the "lost-in-the-middle" effect, where models struggle to retrieve information from the center of long contexts, and "attention sinks," where models disproportionately attend to the first token regardless of its semantic value.
This research provides a rigorous theoretical framework to explain these biases. By modeling multi-layer attention as a directed graph, we show that position bias is not merely a training artifact but a fundamental property of the interaction between causal masks and positional encodings.
2. Methodology: A Graph-Theoretic Framework
The authors introduce a framework that treats the attention mechanism as a directed graph $G = (V, E)$. In this graph, each token is a node, and an edge exists from token $j$ to token $i$ if $i$ can attend to $j$.
2.1 Attention Rollout and Center Nodes
To analyze how influence propagates through the network, the study utilizes Attention Rollout Analysis. This treats cumulative attention across $L$ layers as a probability distribution, tracking the flow of information from input to final representation. A critical concept introduced is the "center node"—a node reachable by every other node in the graph. In a standard causal mask, the first token ($t=1$) serves as the ultimate center node, as every subsequent token is permitted to attend to it.
2.2 Theoretical Convergence
The researchers provide formal proofs regarding the behavior of attention weights in deep networks. Specifically, Theorem 4.1 demonstrates that in a deep network with a causal mask, the probability of attending to the first token converges to 1 exponentially fast as the number of layers increases ($L \to \infty$). This suggests that the "sink" effect is a mathematical inevitability of the architecture's depth.
3. The Mechanics of Position Bias
The paper identifies several key drivers of positional bias:
- The Causal Funnel: In causal masking, the first token is unique because it never attends to any other token. As information passes through successive layers, the first token’s influence is amplified because it is a constant point of reference for all subsequent contextualized representations.
- The Softmax Constraint: Because the Softmax function produces a probability distribution where weights never reach absolute zero, it cannot fully "disconnect" an edge. Consequently, some amount of information must always flow toward the center nodes.
- The Tug-of-War: Modern Transformers often employ positional encodings like RoPE (Rotary Positional Encoding) or ALiBi, which introduce a "recency bias" (favoring nearby tokens). This creates a non-monotonic, U-shaped bias: the structural mask pulls attention toward the start (primacy bias), while the encoding pulls it toward the end (recency bias).
4. Empirical Validation and Results
To isolate architectural bias from semantic data bias, the authors conducted experiments using synthetic datasets:
- Gaussian Mixture Models (GMM): Tokens were sampled from distinct classes in high-dimensional space to test retrieval capabilities based purely on position.
- Anisotropic Embeddings: This setup mimicked the "narrow cone" distribution of real-world LLM embeddings.
The results confirmed that even without positional encodings, a model can learn a sense of position purely from the causal mask, though this is primarily limited to identifying the sequence start. Furthermore, Theorem 4.2 explored Sliding Window Attention (as seen in models like Mistral), finding that while it slows the rate of funneling toward the first token, it does not eliminate the underlying structural bias.
5. Discussion and Limitations
While the framework provides a robust explanation for position bias, certain limitations exist. The theoretical proofs assume single-head attention and simplify aspects like LayerNorm and residual scaling. Additionally, while synthetic GMMs are effective for isolation, natural language contains complex semantic dependencies that may interact with these structural biases in ways not fully captured here.
6. Conclusion
This research clarifies that attention sinks and positional biases are structural features of the Transformer's causal architecture. Understanding the "causal funnel" allows for better-informed architectural decisions, such as the strategic placement of "anchor tokens" in long-context prompts or the development of new masking strategies to mitigate unwanted inductive biases.
Summary updated