RoPE Distinguishes Neither Positions Nor Tokens in Long Contexts, Provably
Abstract
We identify intrinsic limitations of Rotary Positional Embeddings (RoPE) in Transformer-based long-context language models. Our theoretical analysis is *only* related to the length of the context instead of its specific content. We prove that as context length increases, RoPE-based attention becomes unpredictable and loses two properties that are central to its effectiveness. First, it loses its locality bias: RoPE is no more likely to favor nearer positions than substantially farther ones. Second, it loses consistency in token relevance: a key vector that receives a higher attention score than an alternative at one position may receive a lower score at another. With a longer context, both failure modes approach a probability of 0.5, no better than random guessing. We further prove that the attention score can remain unchanged when a key token is moved to a different position, or even replaced by a different token, indicating a failure to distinguish positions or tokens. Increasing the RoPE base hyperparameter, a common practice in today’s long-context models, helps distinguish different tokens, but inevitably sacrifices the ability to distinguish positions, as modifying the RoPE base merely trades off the two objectives but cannot preserve both at the same time. Our empirical analysis shows that multi-head, multi-layer architectures are insufficient to overcome these limitations. Our findings suggest that fundamentally new mechanisms for encoding position and token order may be needed in future Transformer long-context language models.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.