Introduction
Standard Transformer architectures are fundamentally permutation-invariant, meaning they treat input sequences as unordered sets unless explicitly provided with positional information. Traditionally, researchers have addressed this by adding positional embeddings—either learned vectors or fixed sinusoidal functions—to the input representations. However, recent empirical observations have shown that causal Transformer language models (TLMs) can still perform surprisingly well even when these embeddings are entirely removed. This paper investigates the underlying mechanism of this phenomenon, identifying a latent "clock" built into the geometry of causal self-attention.
The Mechanism: Causal Leakage and Variance Shrinkage
The researchers identify that the causal mask used in models like GPT creates a fundamental statistical asymmetry. In a causal model, the $m$-th token in a sequence can only attend to itself and the $m-1$ preceding tokens. Consequently, the self-attention mechanism averages across a different number of neighbors for every position in the sequence.
Variance as a Coordinate System
The core discovery is that the variance of a token's output naturally "shrinks" as its position $m$ increases. Specifically, the authors mathematically derive that the variance of the self-attention output is inversely proportional to the position ($1/m$). As a sequence progresses, the signal becomes statistically more stable and less volatile. This "variance shrinkage" provides a natural, latent coordinate system that the model can exploit to determine a token's relative and absolute position without any explicit external signal.
Methodology
To verify this latent signal, the authors employed a three-pronged approach:
- Probing Random Weights: They used a "frozen" Transformer with completely random weights and fed it Gaussian noise instead of text. By training a simple linear probe on the output, they attempted to predict the position of each token.
- Theoretical Derivation: The team derived the distribution of values through each stage of a Transformer layer, including Layer Normalization, Self-Attention, and Residual Connections, to predict the exact curve of variance decay.
- Empirical Validation: They compared these theoretical predictions against simulations and a 162M parameter Transformer trained from scratch on the OpenWebText2 dataset.
Key Findings
- Position is Decodable from Noise: Even in models with random, untrained weights, a simple probe could predict token positions with a Mean Absolute Error (MAE) of approximately 50 in a 512-token sequence. This confirms that the positional signal is a property of the architecture's geometry, not a learned feature.
- Mathematical Alignment: The theoretical curves for log-variance matched experimental simulations with high precision, confirming the $1/m$ scaling law.
- Bidirectional Contrast: The authors explain why bidirectional models (like BERT) require positional embeddings. Because every token in a BERT-style model attends to the full sequence length $L$, the variance remains constant ($1/L$) across all positions, providing no positional clues.
- Layer-wise Signal Decay: The positional signal is most prominent in the initial layers of the network. In deeper layers, the model tends to overwrite this architectural signal with complex semantic and linguistic information.
Discussion and Limitations
While this latent signal is robust in short-to-medium sequences, the $1/m$ nature of the curve implies a "long-sequence plateau." The difference in variance between token 1,000 and 1,001 is mathematically negligible, suggesting that this inherent clock may lose resolution in extremely long contexts. Additionally, the theory assumes a degree of randomness in input tokens; highly repetitive sequences might "blur" the variance signal, potentially impacting the model's ability to track position.
Conclusion
By demonstrating that a "clock" is inherent to the mathematics of causal attention, this research explains why modern language models are less dependent on explicit positional encoding than previously thought. These insights suggest possibilities for simplifying Transformer architectures and improving the efficiency of pre-training by leveraging the model's natural geometric properties.
Summary updated