RoPE Distinguishes Neither Positions Nor Tokens in Long Contexts, Provably
Summary
This paper provides a theoretical proof that Rotary Positional Embeddings (RoPE) in Transformer-based language models lose their locality bias and ability to distinguish token order in long contexts, with attention scores becoming no better than random. The authors show that increasing the RoPE base trades off position vs. token distinction and that multi-head, multi-layer architectures cannot compensate for this fundamental limitation.
View Cached Full Text
Cached at: 05/18/26, 06:31 AM
# RoPE Distinguishes Neither Positions Nor Tokens in Long Contexts, Provably
Source: [https://arxiv.org/html/2605.15514](https://arxiv.org/html/2605.15514)
Yufeng Du University of Illinois at Urbana\-Champaign USA yufengd4@illinois\.edu &Phillip Harris University of Bonn Germany Minyang Tian University of Illinois at Urbana\-Champaign USA &Eliu A Huerta Argonne National Laboratory USA Srikanth Ronanki Amazon AGI USA &Subendhu Rongali Amazon AGI USA &Aram Galstyan Amazon AGI USA Hao Peng University of Illinois at Urbana\-Champaign USA haopeng@illinois\.edu
###### Abstract
We identify intrinsic limitations of Rotary Positional Embeddings \(RoPE\) in Transformer\-based long\-context language models\. Our theoretical analysis abstracts away from the specific content of the context and depends*only*on its length\. 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\. In both cases, the probability of failure approaches 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\. Adjusting the RoPE base trades off distinguishing positions against distinguishing tokens but cannot preserve both at the same time\. 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\. 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\.
## 1Introduction
Positional embeddings are essential in Transformers, because attention is otherwise permutation\-invariant and cannot distinguish token order\(Vaswaniet al\.,[2017](https://arxiv.org/html/2605.15514#bib.bib39)\)\. Among the many positional embeddings, Rotary Positional Embedding \(RoPE,Suet al\.,[2021](https://arxiv.org/html/2605.15514#bib.bib1)\) has emerged as the de facto choice in modern Transformer\-based large language models \(LLMs\)\. The popularity of RoPE emerges from several appealing properties\. Through rotary operations, RoPE encodes the relative distance between tokens, and induces a locality bias that favors nearby tokens over distant ones\(Suet al\.,[2021](https://arxiv.org/html/2605.15514#bib.bib1)\)\. Such inductive biases align well with the structure of natural language and prove beneficial for both training convergence\(Gelberget al\.,[2025](https://arxiv.org/html/2605.15514#bib.bib6)\)and extension to longer context lengths\(Presset al\.,[2022](https://arxiv.org/html/2605.15514#bib.bib5)\)\.
Despite the increasing advertised context lengths of recent LLMs\(Fuet al\.,[2024a](https://arxiv.org/html/2605.15514#bib.bib3); Teamet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib2); DeepSeek\-AI,[2026](https://arxiv.org/html/2605.15514#bib.bib4)\), many recent studies show that these models often struggle with long\-context tasks that should be well within their capabilities, even at input lengths well within their claimed context lengths\(Liuet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib31); Hsiehet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib34); Kuratovet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib35); Duet al\.,[2025](https://arxiv.org/html/2605.15514#bib.bib38)\)\. These recurring failures beg a fundamental question:*Are these failures artifacts of engineering choices, or do they reflect intrinsic limitations of RoPE itself?*Answering this question is important because it determines whether future progress in long\-context Transformers should focus primarily on improved engineering, or instead require fundamentally new new mechanisms for encoding positions and token order\.
Our answer is that RoPE itself has intrinsic limitations in long contexts\. We systematically explain this with a theoretical analysis ofsingle\-head attentionthat abstracts away from the specific content of the context and depends*only*on its length\.111We provide a discussion for the multihead and multilayer case in[AppendixE](https://arxiv.org/html/2605.15514#A5)\.We show under mild assumptions222See §[Limitations](https://arxiv.org/html/2605.15514#Sx1)\.that as context length increases, RoPE’s effect on attention becomes increasingly unpredictable and undermines the very properties that make it effective in language models, struggling on two primary objectives:
- •First, RoPE fails to distinguish positions \(§[3](https://arxiv.org/html/2605.15514#S3)\)\. As the context length grows, the same token may receive a higher attention score at a farther position than at a closer one, with probability approaching 0\.5 \(position inversion; §[3\.1](https://arxiv.org/html/2605.15514#S3.SS1)\)\. RoPE thus becomes no better than random chance at favoring nearer positions over farther ones, effectively losing its locality inductive bias\. We further identify a specific failure mode, which we callposition aliasing: for a fixed query and key, moving the key to a different position may leave its attention score unchanged, so the model no longer distinguishes positions reliably \(§[3\.2](https://arxiv.org/html/2605.15514#S3.SS2);[Fig\.˜1](https://arxiv.org/html/2605.15514#S1.F1)\)\.
- •Second, RoPE fails to distinguish tokens \(§[4](https://arxiv.org/html/2605.15514#S4)\)\. As the context length grows, the relative ranking of two different key tokens for a given query, reflected by the attention scores they receive, can be arbitrarily reversed across positions: a token ranked above another at one position may be ranked below it at another \(token inversion; §[4\.1](https://arxiv.org/html/2605.15514#S4.SS1)\)\. The probability of token inversion also approaches 0\.5, no better than random chance\. Moreover, longer context induces a phenomenon we calltoken aliasing: for a fixed query and key position, replacing the key token with a different token may leave the attention score unchanged, so the model effectively fails to distinguish tokens reliably \(§[4\.2](https://arxiv.org/html/2605.15514#S4.SS2)\)\.
The above theoretical results are derived from a key new insight in our analysis, which treats the unnormalized attention score as a normal random variable \(§[2\.2](https://arxiv.org/html/2605.15514#S2.SS2)\)\.
Figure 1:Position aliasing induces an attention invariance failure: there exist large numbers of positions where swapping two key tokens \(dog,cat\) keeps the attention output of a query tokenopeto\_\{\\texttt\{pet\}\}unchanged\.Our empirical analysis on Llama 3\.1\-8B\(Grattafioriet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib14)\), which has a claimed context length of 128K tokens, confirms our theoretical conclusions about position and token inversion\. It further shows that both position aliasing and token aliasing occur ubiquitously: across a context length of only 8K tokens, a staggering 75K pairs of positions exhibit position aliasing, appearing regardless of positional proximity; additionally, around 150 positions exhibit token aliasing in this range\. Our theory suggests that commonly used length\-extension techniques do*not*resolve the problem\. Adjusting the RoPE base hyperparameter trades off the two failure modes rather than eliminating them\. In particular, increasing the RoPE base helps preserve consistency in token relevance, but weakens the ability to distinguish positions\.
Our experiments confirm that these failures persist in real multihead, multilayer LLMs \(§[5](https://arxiv.org/html/2605.15514#S5)\)\. We tested 6 popular models from 7B to over 100B on a simple task: given a list, the model must identify the value at thekk\-th position\. This task addresses the ability to distinguish position, rather than distinguish token identities, since modern LLMs are commonly optimized for the latter through retrieval\-style objectives\(Kamradt,[2023](https://arxiv.org/html/2605.15514#bib.bib33)\)\. With just 4 distinct values in the list, all models perform no better than random guesses in as short as 4K tokens, a length disproportional to what these models were trained on\. This strengthens our theoretical analysis of the single\-head case by showing that the same positional failure persists in practical models\.
Our findings temper some of the recent optimism created by rapidly increasing advertised context lengths\. Extending the nominal context length alone is flawed if the underlying positional mechanism degrades as the context length grows\. Our analysis provides a mechanistic explanation for the recurring long\-context failures observed in recent studies\(Liuet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib31); Hsiehet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib34); Kuratovet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib35); Duet al\.,[2025](https://arxiv.org/html/2605.15514#bib.bib38)\), suggesting that the gap between the nominal context limit and reliable use of distant information may not be eliminated through better data or engineering alone; instead, they reflect the fundamental limitations of the positional mechanism\. By identifying such limitations, this work motivates further study into fundamentally new approaches to positional mechanisms better suited to long\-context language modeling\.
## 2Demystifying RoPE
Attention in transformers should achieve two objectives: \(1\)Position identification, to encode where a token occurs in the text and allow attention to distinguish positions and capture contextual dependencies shaped by word order\. Failures hurt the model’s ability to understand the context dependency and lead to errors in tasks like counting or reasoning\. \(2\)Token identification, to have each query distinguish among tokens and identify those that are contextually salient\. Failures cause the model to ignore relevant inputs and generate hallucinated content\. Long\-context tasks often require a combination of these two objectives\(Vaswaniet al\.,[2017](https://arxiv.org/html/2605.15514#bib.bib39); Liuet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib31); Baiet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib46)\)\.
We define theRoPE productas the un\-normalized attention score, i\.e\. the dot product between a query and a key after RoPE has been applied to both\. This section aims to address two questions through the lens of the RoPE product: How does the RoPE product help with position and token identification \(§[2\.1](https://arxiv.org/html/2605.15514#S2.SS1)\)? How does RoPE\-based attention behave as the context length increases \(§[2\.2](https://arxiv.org/html/2605.15514#S2.SS2)\)? We answer both through our key insight of treating the RoPE product as a normal random variable\.
Throughput the paper, our theoretical analysis abstracts away from the specific content of the context and considers its length alone\.
### 2\.1Background
For a pair of query and key vectors𝐪\\mathbf\{q\}and𝐤\\mathbf\{k\}, RoPE\(Suet al\.,[2021](https://arxiv.org/html/2605.15514#bib.bib1)\)divides theddhidden dimensions intoh=d/2h=d/2pairs of 2D vectors\. As the token position changes, each 2D vector rotates at an angular frequency that is distinct to its dimension pair\. The dot product between𝐪\\mathbf\{q\}and𝐤\\mathbf\{k\}after applying RoPE to both \(the RoPE product\) can be written as a function of their relative distance,mm:
S\(m\)=S𝐪,𝐤\(m\)=∑n=0h−1ancos\(mθn\+ϕn\)\.\\displaystyle S\(m\)=S\_\{\\mathbf\{q\},\\mathbf\{k\}\}\(m\)=\\sum\_\{n=0\}^\{h\-1\}a\_\{n\}\\cos\(m\\theta^\{n\}\+\\phi\_\{n\}\)\.The base frequency isθ=B−1/h∈\(0,1\)\\theta=B^\{\-1/h\}\\in\(0,1\)whereΘ\(B\)\>M\\Theta\(B\)\>Mis the RoPE base\.333Following standard practice we assumeM<Θ\(B\)M<\\Theta\(B\), since otherwise even the lowest frequency term oscillates and loses its uniqueness\(Liu,[2026](https://arxiv.org/html/2605.15514#bib.bib36)\)The factor can be2π2\\pi,π\\pior other values under different criteria\.Vectors𝐚\\mathbf\{a\}andϕ\\bm\{\\phi\}are determined solely by𝐪\\mathbf\{q\}and𝐤\\mathbf\{k\}\. For thenn\-th frequency component, its amplitudean\>0a\_\{n\}\>0is the product of the norms of the corresponding 2D vectors\(q2n,q2n\+1\)\(q\_\{2n\},q\_\{2n\+1\}\)and\(k2n,k2n\+1\)\(k\_\{2n\},k\_\{2n\+1\}\), and its phaseϕn∈\[0,2π\)\\phi\_\{n\}\\in\[0,2\\pi\)is the angle subtended by them\.
##### High\-frequency components oscillate; low\-frequency components decay
For a context length limit ofMM, one typical way of analyzing the RoPE product is to separate the high and low frequency components using the threshold valueλ\(M\)=Θ\(hlogBM\)\\lambda\(M\)=\\Theta\(h\\log\_\{B\}M\)\(Jonasson,[2025](https://arxiv.org/html/2605.15514#bib.bib44); Liuet al\.,[2023b](https://arxiv.org/html/2605.15514#bib.bib19); Penget al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib27); Miranda and others,[2024](https://arxiv.org/html/2605.15514#bib.bib37)\)\. Form∈\[0,M\)m\\in\[0,M\),high\-frequencycomponents complete at least one circle around the origin withn≪λ\(M\)n\\ll\\lambda\(M\);low\-frequencyones only rotate a small angle withn≫λ\(M\)n\\gg\\lambda\(M\)\.
\(a\)Overall pattern of RoPE waveform\. Shadow shows estimation ofS\(m\)S\(m\)as a normal\.
\(b\)Lowandhighfrequency parts ofS\(m\)S\(m\), andmeanandstandard deviationas a normal\.
\(c\)Full distributionofS\(m\)S\(m\)overm∈\[0,M\)m\\in\[0,M\)\.
Figure 2:Illustration of the RoPE product and its normal approximation whenS\(m\)=∑ncos\(mθn\)S\(m\)=\\sum\_\{n\}\\cos\(m\\theta^\{n\}\),m∈\[0,32,768\),h=64,B=105\.m\\in\[0,32,768\),h=64,B=10^\{5\}\.1k = 1,000\.[Fig\.˜2\(b\)](https://arxiv.org/html/2605.15514#S2.F2.sf2)illustrates the oscillation of the high\-frequency components and the decay effect of the low\-frequency ones\.444Strictly speaking, decay is not guaranteed to occur, but is nevertheless preferred\. See[AppendixA](https://arxiv.org/html/2605.15514#A1.SS0.SSS0.Px4)for a more in\-depth discussion\.RoPE helps with the two primary objectives discussed earlier\. For position identification, high\-frequency oscillation helps capture the difference between close positions, while the low\-frequency decay globally distinguishes distant position pairs, promoting a locality inductive bias\. For token identification, low\-frequency components play a stabilizing role: their slower rotations preserve the relative ordering of token relevance, as they are less perturbed by relative distances\.
### 2\.2Key Insight: The RoPE Product As a Normal Random Variable
Previous work has largely focused on low\-frequency decay due to its analytical tractability\(Miranda and others,[2024](https://arxiv.org/html/2605.15514#bib.bib37); Xuet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib22); Xionget al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib23)\)\. We develop a probabilistic characterization of the distributional behavior of the RoPE product\. This perspective yields a deeper understanding of RoPE’s behavior\. A core theoretical contribution of this paper can be informally stated as follows:
###### Remark 2\.1\.
If the distancemmbetween a query𝐪\\mathbf\{q\}and a key𝐤\\mathbf\{k\}is randomly sampled from any interval\[A,M\)\[A,M\), whereM−AM\-Ais large, then the RoPE productS𝐪,𝐤\(m\)S\_\{\\mathbf\{q\},\\mathbf\{k\}\}\(m\)can be modeled as a normal random variable
S~=S~\[A,M\)\(𝐪,𝐤\)∼N\(μM\(𝐪,𝐤\),σM2\(𝐪,𝐤\)\),\\widetilde\{S\}=\\widetilde\{S\}\_\{\[A,M\)\}\(\{\\mathbf\{q\},\\mathbf\{k\}\}\)\\sim N\(\\mu\_\{M\}\(\{\\mathbf\{q\},\\mathbf\{k\}\}\),\\sigma\_\{M\}^\{2\}\(\{\\mathbf\{q\},\\mathbf\{k\}\}\)\),with its mean decided by its low frequency terms, and its variance decided by its high frequency terms\. The high frequency threshold is determined by the context limit,MM\.
Remark[2\.1](https://arxiv.org/html/2605.15514#S2.Thmrmk1)follows from an application of the Central Limit Theorem\. See[Appendix˜B](https://arxiv.org/html/2605.15514#A2)for details and[Fig\.˜2\(c\)](https://arxiv.org/html/2605.15514#S2.F2.sf3)for empirical validation\. Remark[2\.1](https://arxiv.org/html/2605.15514#S2.Thmrmk1)provides a powerful tool to characterize the behavior of RoPE productS\(m\)S\(m\): it behaves approximately as a normal variable whose mean decreases \(decay\) and variance increases \(oscillation\) as the context length grows\.
##### Organization of the rest of the paper
The rest of the paper formalizes how RoPE’s intrinsic properties undermine the fundamental objectives of bothpositionandtokenidentification in long contexts\. We begin with a theoretical analysis of a single attention head in §[3](https://arxiv.org/html/2605.15514#S3)and §[4](https://arxiv.org/html/2605.15514#S4), where four specific failure modes are identified\. For each, we first present a theoretical result and then provide empirical verification\. Our empirical analysis probes an attention head from Llama 3\.1\-8B\(Grattafioriet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib14)\), with a 128K claimed context length\. We choose this model because of its popularity, moderate size, and representative decoder\-only architecture\.555Although Llama 3\.1 uses RoPE scaling, we show in[SectionB\.1](https://arxiv.org/html/2605.15514#A2.SS1)that the analysis for standard RoPE still applies\.We illustrate the failure modes with a long context of mostly irrelevant text containing three relevant sentences: “Alice has a cat,” “Bob has a dog,” and “What pet does Alice keep?” We analyze the key tokens “cat” and “dog” and the query token “pet”\. We use the first head in the first layer as a case study, although our method applies to any head in any layer\. See[Section˜D\.1](https://arxiv.org/html/2605.15514#A4.SS1)for implementation details\. In §[5](https://arxiv.org/html/2605.15514#S5), we then turn to an empirical study of full multi\-head, multi\-layer language models\.
## 3RoPE Fails to Distinguish Positions in Long Contexts
For the position identification objective, suppose that we are given a pair of fixed query and key tokens in an input of lengthMM\. The tokens may be placed at any position as long as the query token appears later\. This means that the relative distancemmbetween the token pair satisfies0≤m<M0\\leq m<M\.
With recency bias, we expect that the key should have a high chance of receiving larger attention weights when it is closer than when the same key token is located farther away \(i\.e\.S\(m1\)\>S\(m2\)S\(m\_\{1\}\)\>S\(m\_\{2\}\)wherem1<m2m\_\{1\}<m\_\{2\}\)\. We identify two failure modes that violate this expected behavior and explain why they can be problematic\.
\(a\)Position inversion occurs ifS\(m2\)\>S\(m1\)S\(\{\\color\[rgb\]\{1,0\.5,0\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{1,0\.5,0\}m\_\{2\}\}\)\>S\(m\_\{1\}\)despitem2≫m1\{\\color\[rgb\]\{1,0\.5,0\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{1,0\.5,0\}m\_\{2\}\}\\gg m\_\{1\}\. Local oscillations \(m1m\_\{1\},m2′m\_\{2\}^\{\\prime\}\) arenotconsidered\.
\(b\)Probability estimation \(lowerbound\) of position inversion vs\. context length\.
\(c\)Probability of position aliasing at a random distance vs\. context length\.
Figure 3:Illustrations \(a\) for position inversion and aliasing, with corresponding probability estimations under different RoPEBases \(b, c\),h=64h=64\. 1k = 1,000\.### 3\.1Failure Mode 1: Position Inversion
Position inversionis a reversal of RoPE’s locality inductive bias: given the query, moving the key to a*substantially farther*position*increases*the attention score\. We focus on distant pairs drawn from opposite halves of the context, since such inversions are more detrimental than those among nearby tokens\. We identify position inversions whenS\(m1\)<S\(m2\),m1<M/2≤m2S\(m\_\{1\}\)<S\(m\_\{2\}\),m\_\{1\}<M/2\\leq m\_\{2\}\. See[Fig\.˜3\(a\)](https://arxiv.org/html/2605.15514#S3.F3.sf1)for an illustrative example\.
###### Theorem 1\.
The probability lowerbound of position inversion increases with context lengthMMand RoPE baseBB\. The probability approaches1/21/2aslogMlogB→∞\\log M\\log B\\to\\infty\.
Theorem[1](https://arxiv.org/html/2605.15514#Thmthm1)follows directly from treating the RoPE product as a normal random variable, as discussed in Remark[2\.1](https://arxiv.org/html/2605.15514#S2.Thmrmk1)\. See[Section˜C\.1](https://arxiv.org/html/2605.15514#A3.SS1)for the formal statement and proof\.
Theorem[1](https://arxiv.org/html/2605.15514#Thmthm1)states that, given a query, moving the exact key token from a closer positionm1∈\[0,M/2\)m\_\{1\}\\in\[0,M/2\)to a substantially farther positionm2∈\[M/2,M\)m\_\{2\}\\in\[M/2,M\)can increase its attention score with probability approaching that of a coin flip\. This is problematic because, as the context length and RoPE base grow, attention becomes nearly arbitrary in its preference between nearby vs\. farther positions, making its behaviors less predictable\. This unpredictability may prevent the model from identifying a reliable positional pattern\.
In practice, the probability of position inversion can exceed0\.30\.3even at short context lengths, as shown in[Fig\.˜3\(b\)](https://arxiv.org/html/2605.15514#S3.F3.sf2)\. Following a convention used in the Turing Test\(Turing,[1950](https://arxiv.org/html/2605.15514#bib.bib47)\), we assume that this rate is already high enough to signal substantial positional ambiguity\.
\(a\)The RoPE decay happens only within the initial∼\\sim50K tokens\.
\(b\)Position inversion probability approaches 0\.5 as length increases\.
Figure 4:Position inversion for key “cat” and query “pet”\. Llama 3\.1\-8B, Layer 0, Head 0\. Here 1K = 1,024\.##### Empirical verification
As shown in[Fig\.˜4\(a\)](https://arxiv.org/html/2605.15514#S3.F4.sf1), for the query token “pet”, moving the key token “cat” across the advertised 128K context length of Llama 3\.1\-8B causes the attention score, i\.e\., the RoPE product, to reach a minimum atm≈50Km\\approx 50\\text\{K\}\. Beyond this point, the RoPE product exhibits an overall upward trend with oscillations, indicating position inversion\.
[Fig\.˜4\(b\)](https://arxiv.org/html/2605.15514#S3.F4.sf2)shows the corresponding probability of position inversion\. Within just a few thousand tokens, this probability increases to nearly0\.30\.3; oncem\>50Km\>50\\text\{K\}, it continues to increase towards0\.50\.5\. Note again that we consider only pairs\(m1,m2\)\(m\_\{1\},m\_\{2\}\)wherem1m\_\{1\}andm2m\_\{2\}lie in opposite halves of the full context\. These inversions indicate that the model can fail to properly compare a nearby token with a substantially farther one\.
### 3\.2Failure Mode 2: Position Aliasing
Position aliasingoccurs when modifying the distance between query and key does not change the attention score at all\. Position aliasing can be seen as a complete failure to distinguish two different positions\.[Fig\.˜3\(a\)](https://arxiv.org/html/2605.15514#S3.F3.sf1)provides an illustration\. Analiasing pairrefers to two distances with the same attention score\.
###### Theorem 2\.
The probability that a random distance admits an aliasing pair converges to11exponentially fast as the context lengthMMincreases\. Moreover, the total number of aliasing pairs increases with both the context lengthMMand the RoPE baseBB\.
The intuition behind Theorem[2](https://arxiv.org/html/2605.15514#Thmthm2)is that the difference between the RoPE products at two independent positions can be modeled as a zero\-mean normal random variable\. This allows us to estimate how often its absolute value falls below the datatype resolution used for the RoPE product\. See §[C\.2](https://arxiv.org/html/2605.15514#A3.SS2)for the formal statement and proof\. See[Fig\.˜3\(c\)](https://arxiv.org/html/2605.15514#S3.F3.sf3)for the probability estimation\.
Theorem[2](https://arxiv.org/html/2605.15514#Thmthm2)states that position aliasing is inevitable with increased context lengths\. In practice, the issue can be amplified by limited numerical precision: it occurs when the difference between two RoPE products falls below the resolution limit of the data type\. Even when the attention scores for two distances are not exactly identical under higher precision, very small differences may be lost due to limited numerical precision\.
\(a\)Position aliasing pairs for key “cat” and query “pet”\.
\(b\)Position aliasing pairs for key “dog” and query “pet”\.
\(c\)Attention invariance pairs for “cat”, “dog” and “pet”\.
Figure 5:Heat maps of position aliasing and attention invariance pairs under BF16, showing the ubiquity of position aliasing\. Llama 3\.1\-8B, Layer 0 Head 0\. Pairs are grouped into a total of200×200200\\times 200bins for position aliasing, and16×1616\\times 16bins for attention invariance\. 1K = 1,024\.##### Empirical verification
As shown in[Figs\.˜5\(a\)](https://arxiv.org/html/2605.15514#S3.F5.sf1)and[5\(b\)](https://arxiv.org/html/2605.15514#S3.F5.sf2), under an 8K context length and commonly\-used BF16 precision, almost every distancem1m\_\{1\}is involved in at least one aliasing pair\(m1,m2\)\(m\_\{1\},m\_\{2\}\), and there are already more than 75k aliasing pairs, the density of which increasing with the context length\. This empirically confirms Theorem[2](https://arxiv.org/html/2605.15514#Thmthm2)and suggests that position aliasing is a common issue even at relatively short context lengths\.
##### Attention invariance caused by position aliasing
Position aliasing implies a specific failure mode: given a query𝐪\\mathbf\{q\}and two keys𝐤1\\mathbf\{k\}\_\{1\}and𝐤2\\mathbf\{k\}\_\{2\}at aliasing positions, swapping𝐤1\\mathbf\{k\}\_\{1\}and𝐤2\\mathbf\{k\}\_\{2\}does not change the attention output at all, as illustrated in[Fig\.˜1](https://arxiv.org/html/2605.15514#S1.F1)\.[Fig\.˜5\(c\)](https://arxiv.org/html/2605.15514#S3.F5.sf3)empirically verifies this failure mode, showing 1,491 such invariance cases even within an 8K context length\. This further demonstrates that position aliasing can be damaging even at short context lengths\.
## 4RoPE Fails to Distinguish Tokens in Long Contexts
For token identification, we may apply a similar analysis\. Let𝐪\\mathbf\{q\}be a query vector and let𝐤1\\mathbf\{k\}\_\{1\}and𝐤2\\mathbf\{k\}\_\{2\}be two key vectors\. We consider the relative distances between the query and keys alone, but not a specific input context\. LetS1\(m\)S\_\{1\}\(m\)denote the RoPE product between𝐪\\mathbf\{q\}and𝐤1\\mathbf\{k\}\_\{1\}at distancemm, and letS2\(m\)S\_\{2\}\(m\)denote the corresponding RoPE product between𝐪\\mathbf\{q\}and𝐤2\\mathbf\{k\}\_\{2\}\. Assume that atm=0m=0, where RoPE effectively has no effect, the first key is more relevant, i\.e\.S1\(0\)\>S2\(0\)S\_\{1\}\(0\)\>S\_\{2\}\(0\)\. Intuitively, this relevance ordering should be preserved when both keys are placed at a new relative distancemm, i\.e\.S1\(m\)\>S2\(m\)S\_\{1\}\(m\)\>S\_\{2\}\(m\)\. We identify the following violations\.
### 4\.1Failure Mode 3: Token Inversion
Token inversionoccurs when the relevance ordering of the two keys is reversed at distancemm, i\.e\.S1\(m\)−S2\(m\)<0S\_\{1\}\(m\)\-S\_\{2\}\(m\)<0despiteS1\(0\)\>S2\(0\)S\_\{1\}\(0\)\>S\_\{2\}\(0\)\(See[Fig\.˜6\(a\)](https://arxiv.org/html/2605.15514#S4.F6.sf1)\)\.
###### Theorem 3\.
The probability lower bound for token inversion increases with the context lengthMM, approaching1/21/2asMMapproaches the natural context limitΘ\(B\)\\Theta\(B\)\. In contrast, the lower bound decreases with the RoPE baseBB\.
See §[C\.3](https://arxiv.org/html/2605.15514#A3.SS3)for the formal statement and proof\.
Theorem[3](https://arxiv.org/html/2605.15514#Thmthm3)states that RoPE can reverse the original ordering between two keys at some nonzero relative distance\. Similarly to position inversion \(§[3\.1](https://arxiv.org/html/2605.15514#S3.SS1)\), the main problem with token inversion is its unpredictability: it can occur with probability approaching that of a coin flip\. Suppose thatS1\(m\)\>S2\(m\)S\_\{1\}\(m\)\>S\_\{2\}\(m\)for some values ofmmbutS1\(m\)<S2\(m\)S\_\{1\}\(m\)<S\_\{2\}\(m\)for others, with comparable frequencies; then it becomes unclear whether the model can reliably distinguish the two keys at those distances\.
\(a\)Token inversion:S1\(0\)\>S2\(0\)S\_\{1\}\(0\)\>S\_\{2\}\(0\)but
S1\(m\)<S2\(m\)S\_\{1\}\(m\)<S\_\{2\}\(m\)\. Token aliasing:S1\(m\)=S2\(m\)S\_\{1\}\(m\)=S\_\{2\}\(m\)\.
\(b\)Typical token aliasing probabilities at different RoPEBases, using BF16\.
Figure 6:Illustration of token inversion and aliasing\.\(a\)RoPE products for two key \- query pairs \(left\) and their difference \(right\)\.
\(b\)Distribution \(left\) and probability \(right\) of token aliasing\.
Figure 7:Token aliasing probabilities under BF16, for querypet, and keyscat\(S1S\_\{1\}\) anddog\(S2S\_\{2\}\)\. Llama 3\.1\-8B, Layer 0 Head 0\. Here, 1K = 1,024\.##### Empirical verification
For the query tokenpet, we select a highly relevant key token,cat, and a less relevant key token,number\. LetS1S\_\{1\}denote the RoPE product betweenpetandcat, and letS2S\_\{2\}denote the RoPE product betweenpetandnumber\.[Fig\.˜8](https://arxiv.org/html/2605.15514#S4.F8)shows the differenceD=S1−S2D=S\_\{1\}\-S\_\{2\}and the probability curve of token inversion\. Initially,D\>0D\>0, as desired, indicating thatcatreceives a higher score thannumber\. However, in fewer than 10 tokens,DDdrops below zero and the relevance ordering between the two tokens is already reversed\. Asmmincreases, the probability of inversion exhibits an increasing lower bound, consistent with Theorem[3](https://arxiv.org/html/2605.15514#Thmthm3)\. Whenm≥20Km\\geq 20K, the probability approaches 0\.5; with an oscillatingDD, it becomes unpredictable whethercatornumberreceives the higher attention score\.
Figure 8:Token inversion for keys “cat”, “number” and query “pet”\. Left: difference of RoPE product vs\. distance, whereS1S\_\{1\}corresponds to “cat”, andS2S\_\{2\}to “number”\. Right: Probability\. Llama 3\.1\-8B, Layer 0 Head 0\.
### 4\.2Failure Mode 4: Token Aliasing
At relative distancemm, replacing𝐤1\\mathbf\{k\}\_\{1\}with a different key𝐤2\\mathbf\{k\}\_\{2\}can leave the attention score unchanged, i\.e\.,S1\(m\)=S2\(m\)S\_\{1\}\(m\)=S\_\{2\}\(m\)\. We refer to this phenomenon astoken aliasing, which indicates that attention fails to distinguish between two different tokens at that position, as illustrated in[Fig\.˜6\(a\)](https://arxiv.org/html/2605.15514#S4.F6.sf1)\.
###### Theorem 4\.
The number of token aliasing positions increases withMMand decreases withBB\. For a sufficiently long context of lengthMM, it is bounded byΘ\(2−fhM\)\\Theta\(2^\{\-f\}\\sqrt\{h\}M\), whereffis the explicit fraction bits of the data type used, andhhis the half hidden dimension\.
See[Section˜C\.4](https://arxiv.org/html/2605.15514#A3.SS4)for the formal statement and proof\. Similar to position aliasing, token aliasing is amplified by limited numerical precision, such as BF16 where there aref=7f=7explicit fraction bits\(Henryet al\.,[2019](https://arxiv.org/html/2605.15514#bib.bib51)\)\.
Table 1:Summary of failure modes and how the chances of occurrence change with context lengthMMand RoPE baseBB\. It is preferable to havesmallerprobabilities as opposed tolargerones: for inversion this means better predictability, and for aliasing this means less ambiguity\.Token aliasing can be mitigated by increasing RoPE base \(see[Fig\.˜6\(b\)](https://arxiv.org/html/2605.15514#S4.F6.sf2)\); nevertheless, it is almost always present in long inputs\. Ifh=64h=64, using BF16, up to 5% of the total positions exhibit token aliasing\. This means 1\.6K aliasing positions in 32K tokens\.
##### Empirical verification
For querypetand two keyscatanddog,[Fig\.˜7\(a\)](https://arxiv.org/html/2605.15514#S4.F7.sf1)shows the difference between the two corresponding RoPE productsD\(m\)=S1\(m\)−S2\(m\)D\(m\)=S\_\{1\}\(m\)\-S\_\{2\}\(m\)\. Under BF16 precision, we count the aliasing positions whereD\(m\)=0D\(m\)=0and calculate the aliasing probability \([Fig\.˜7\(b\)](https://arxiv.org/html/2605.15514#S4.F7.sf2)\)\. According to Theorem[4](https://arxiv.org/html/2605.15514#Thmthm4), the probability should converge to a value of around 0\.05, which matches the illustrated result\.[Fig\.˜7\(b\)](https://arxiv.org/html/2605.15514#S4.F7.sf2)left shows that the frequency of token aliasing is negatively correlated with the RoPE products, which demonstrates how decay affects token aliasing\.
We close §[3](https://arxiv.org/html/2605.15514#S3)and §[4](https://arxiv.org/html/2605.15514#S4)with[Table˜1](https://arxiv.org/html/2605.15514#S4.T1)summarizing the four failure modes, along with the following takeaways:
TakeawaysAs the context length increases, all four failure modes become more likely, and RoPE\-based attention becomes increasingly likely to fail at distinguishing both positions and tokens\. The choice of RoPE baseBBtrades off the failure modes: While increasing RoPE base can mitigate token inversion and token aliasing, it does not fully resolve them; moreover, it worsens position inversion and position aliasing\. In this sense, each attention head has a maximum effective context length\. Beyond this limit, at least some of the four failure modes occur with sufficiently high frequency and compromise attention, regardless of how RoPE base is adjusted\.
## 5How Do Multilayer, Multihead Transformer LLMs Fare?
We have shown the four failure modes of a single attention head\. But do multilayer, multihead Transformer LLMs overcome the limitations in practice? This section addresses this question empirically\.
We conduct a controlled evaluation of six open RoPE\-based long\-context LLMs of different sizes, as shown in[Fig\.˜9](https://arxiv.org/html/2605.15514#S5.F9)\. We do not evaluate closed\-source proprietary models, since their architectures and positional\-embedding choices are not publicly known\. Moreover, many recent long\-context models are explicitly optimized for retrieval\-based tasks, such as Needle\-in\-a\-Haystack\(Kamradt,[2023](https://arxiv.org/html/2605.15514#bib.bib33)\), which are essentially token\-identification tasks\. Our theoretical results predict that optimizing for distinguishing tokens inevitably trades off against distinguishing positions; therefore, we focus on the latter through controlled experiments\.
\(a\)The indexing task\.
\(b\)Small models \(≤\\leq8B\)\.
\(c\)Large models \(≥\\geq100B\)\.
Figure 9:\(a\) We ask models to extract thekk\-th element in an array consisting of only integers 0\-3\. \(b, c\) Dots and shadows represent mean and standard deviation of accuracy\. Selected models:Grattafioriet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib14)\); Mistral AI Team \([2024](https://arxiv.org/html/2605.15514#bib.bib48)\); Yanget al\.\([2025a](https://arxiv.org/html/2605.15514#bib.bib54)\); DeepSeek\-AIet al\.\([2025](https://arxiv.org/html/2605.15514#bib.bib49)\); Teamet al\.\([2026a](https://arxiv.org/html/2605.15514#bib.bib55)\); OpenAIet al\.\([2025](https://arxiv.org/html/2605.15514#bib.bib53)\)##### The indexing task
In our position identification task, the model is presented with a Python listarr, and is required to answer the value of the given indexarr\[i\]\. Each model receives the same input\. For each list length, we test the models with 100 samples\. The list only contains integers 0, 1, 2, and 3\. This turns the task into a multiple\-choice problem, allowing us to compare with the random\-guess accuracy: if a model cannot identify the single target position \(each element takes 1 token\), it answers a random element with an accuracy of 0\.25\.
##### Results
As shown in[Fig\.˜9](https://arxiv.org/html/2605.15514#S5.F9), all models start with near\-perfect accuracy but quickly drop to a level close to random guessing\. These real long\-context models face serious position confusion with as short as several thousands of tokens, a cost they pay for optimizing token identification\.
See[Appendix˜D](https://arxiv.org/html/2605.15514#A4)for more details on the experiment settings\.
## 6Conclusion and Discussion
Our theoretic analysis shows that RoPE intrinsically fails to distinguish both position and token identity in long inputs, and the selection of RoPE base only acts as a tradeoff between the two objectives\. The same bottleneck persists in practical multi\-head multi\-layer models, as observed in the empirical verifications\.
Our conclusion suggests that a robust positional mechanism should maintain the ability to distinguish positions and tokens, and context length cannot be effectively extended without addressing the two objectives\. At the same time, we are encouraged by recent efforts that explore alternatives to direct length extension, including improved context management and alternative paradigms such as recursive or agentic language models\. Although these approaches do not directly resolve the intrinsic limitations of RoPE identified in this work, they reflect a broader shift away from treating context extension alone as sufficient\. We hope that this work encourages further research into fundamentally new positional mechanisms for long\-context language models\.
## Limitations
##### Ambiguity of the frequency threshold
It may be noticed in the illustrations of normal approximation of the RoPE product, that the real distribution is slightly skewed compared to our approximation\. We provide only a rough thresholdλ\(M\)=Θ\(hlogBM\)\\lambda\(M\)=\\Theta\(h\\log\_\{B\}M\), following the common practice of dividing the entire frequency domain into two categories of high and low\. Strictly speaking, the threshold frequencies wheren=Θ\(hlogBM\)n=\\Theta\(h\\log\_\{B\}M\)should be considered separately: their rotations are around 1 complete circle\. We mostly ignore these terms, since there are onlyO\(h/logB\)O\(h/\\log B\)of them, usually not exceeding 10\. We believe that ignoring them only affects the precision of approximation, not the fundamental conclusions\.
##### Assumption of regular rotary amplitudes
We assume in this paper that the amplitudes of the RoPE products,\{an\}\\\{a\_\{n\}\\\}, are relatively uniform \(no terms dominate\)\. This is for simplicity in calculation\. In real attention heads, we often observe several dimensions that have amplitudes significantly larger than others\. While we did not discuss this in the paper, these dominating terms reduce the effects of other components; this heuristically works like reducing the total number of dimensions, and simplifying the oscillation patterns\. The effective context length limit shortens to the maximum wavelength with a non\-negligible amplitude\. Smaller amplitudes for high frequency terms reduce oscillation; this may affect position identification for close position pairs, which is discussed inLiu \([2026](https://arxiv.org/html/2605.15514#bib.bib36)\)\. In short, we assume that non\-regular amplitudes are suboptimal, shortening the effective context length in the sense of the failure modes we discuss in this paper\.
##### Real models
We do not theoretically analyze the multi\-layer multi\-head attention, or conduct experiments that categorize the failure modes, since real models are significantly more complicated, and one actual failure can be caused by mixed factors\. Our final experiment merely serves as a demonstration that real models, regardless of their size, still face either position or token confusion, which we analyzed for a single head, and must sacrifice position confusion for better token identification\. We do not intend to propose any new benchmarks or metrics, or make the task any realistic\. While our experiments on real models do not directly prove that the failures are actually caused by the RoPE confusions, they indicate that the redundancy provided by multiple heads and layers may have limited protection\. In[Appendix˜E](https://arxiv.org/html/2605.15514#A5), we provide discussions that may serve as a preliminary insight for future investigations on how the failures accumulate with heads and propagate across layers\.
##### RoPE scaling
While we show in[Section˜B\.1](https://arxiv.org/html/2605.15514#A2.SS1)that certain RoPE scaling methods may be reduced to standard RoPE, we do not provide a more detailed analysis for any specific variant\. However, we use Llama\-3\.1 in our case study, which uses RoPE scaling, to illustrate that the scaling does not fundamentally resolve the problem, if it helps at all\.
## Acknowledgement
This work was supported by a grant from Coefficient Giving, an Amazon AICE Award, gift funding from AI2, and by Laboratory Directed Research and Development \(LDRD\) funding from Argonne National Laboratory, provided by the Director, Office of Science, of the U\.S\. Department of Energy under Contract No\. DE\-AC02\-06CH11357\. The work used resources of the Argonne Leadership Computing Facility, a DOE Office of Science User Facility supported under Contract DE\-AC02\-06CH11357\. EAH acknowledges support from National Science Foundation \(NSF\) awards OAC\-2514142 and OAC\-2209892 \. PH was supported by Deutsche Forschungsgemeinschaft \(DFG\) Grant No\. SFB\-TRR 358/1 2023 — 491392403\. This research also used the Delta advanced computing and data resources, which is supported by the National Science Foundation \(award OAC 2005572\) and the State of Illinois\. Delta is a joint effort of the University of Illinois Urbana\-Champaign and its National Center for Supercomputing Applications\. This research used the DeltaAI advanced computing and data resource, which is supported by the National Science Foundation \(award OAC 2320345\) and the State of Illinois\. DeltaAI is a joint effort of the University of Illinois Urbana\-Champaign and its National Center for Supercomputing Applications\.
## References
- NTK\-aware scaled rope allows llama models to have extended \(8k\+\) context size without any fine\-tuning and minimal perplexity degradation\.Note:[https://www\.reddit\.com/r/LocalLLaMA/comments/14lz7j5/ntkaware\_scaled\_rope\_allows\_llama\_models\_to\_have/](https://www.reddit.com/r/LocalLLaMA/comments/14lz7j5/ntkaware_scaled_rope_allows_llama_models_to_have/)Reddit post on r/LocalLLaMACited by:[§B\.1](https://arxiv.org/html/2605.15514#A2.SS1.p5.1)\.
- Y\. Bai, X\. Lv, J\. Zhang, H\. Lyu, J\. Tang, Z\. Huang, Z\. Du, X\. Liu, A\. Zeng, L\. Hou, Y\. Dong, J\. Tang, and J\. Li \(2024\)LongBench: a bilingual, multitask benchmark for long context understanding\.External Links:2308\.14508,[Link](https://arxiv.org/abs/2308.14508)Cited by:[§2](https://arxiv.org/html/2605.15514#S2.p1.1)\.
- Y\. Chen, A\. Lv, T\. Lin, C\. Chen, Y\. Wu, F\. Huang, Y\. Li, and R\. Yan \(2024\)Fortify the shortest stave in attention: enhancing context awareness of large language models for effective tool\-use\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 11160–11174\.Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px3.p1.1)\.
- G\. Comanici, E\. Bieber, M\. Schaekermann, I\. Pasupat, N\. Sachdeva, I\. Dhillon, M\. Blistein, O\. Ram, D\. Zhang, E\. Rosen,et al\.\(2025\)Gemini 2\.5: pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capabilities\.arXiv preprint arXiv:2507\.06261\.Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- T\. Dao, D\. Y\. Fu, S\. Ermon, A\. Rudra, and C\. Ré \(2022\)FlashAttention: fast and memory\-efficient exact attention with IO\-awareness\.InAdvances in Neural Information Processing Systems,Vol\.35,pp\. 16344–16359\.External Links:[Link](https://proceedings.neurips.cc/paper_files/paper/2022/hash/67d57c32e20fd0a7a302cb81d36e40d5-Abstract-Conference.html)Cited by:[2nd item](https://arxiv.org/html/2605.15514#A4.I1.i2.p1.1),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- DeepSeek\-AI, A\. Liu, B\. Feng, B\. Xue, B\. Wang, B\. Wu, C\. Lu, C\. Zhao, C\. Deng, C\. Zhang, C\. Ruan, D\. Dai, D\. Guo, D\. Yang, D\. Chen, D\. Ji, E\. Li, F\. Lin, F\. Dai, F\. Luo, G\. Hao, G\. Chen, G\. Li, H\. Zhang, H\. Bao, H\. Xu, H\. Wang, H\. Zhang, H\. Ding, H\. Xin, H\. Gao, H\. Li, H\. Qu, J\. L\. Cai, J\. Liang, J\. Guo, J\. Ni, J\. Li, J\. Wang, J\. Chen, J\. Chen, J\. Yuan, J\. Qiu, J\. Li, J\. Song, K\. Dong, K\. Hu, K\. Gao, K\. Guan, K\. Huang, K\. Yu, L\. Wang, L\. Zhang, L\. Xu, L\. Xia, L\. Zhao, L\. Wang, L\. Zhang, M\. Li, M\. Wang, M\. Zhang, M\. Zhang, M\. Tang, M\. Li, N\. Tian, P\. Huang, P\. Wang, P\. Zhang, Q\. Wang, Q\. Zhu, Q\. Chen, Q\. Du, R\. J\. Chen, R\. L\. Jin, R\. Ge, R\. Zhang, R\. Pan, R\. Wang, R\. Xu, R\. Zhang, R\. Chen, S\. S\. Li, S\. Lu, S\. Zhou, S\. Chen, S\. Wu, S\. Ye, S\. Ye, S\. Ma, S\. Wang, S\. Zhou, S\. Yu, S\. Zhou, S\. Pan, T\. Wang, T\. Yun, T\. Pei, T\. Sun, W\. L\. Xiao, W\. Zeng, W\. Zhao, W\. An, W\. Liu, W\. Liang, W\. Gao, W\. Yu, W\. Zhang, X\. Q\. Li, X\. Jin, X\. Wang, X\. Bi, X\. Liu, X\. Wang, X\. Shen, X\. Chen, X\. Zhang, X\. Chen, X\. Nie, X\. Sun, X\. Wang, X\. Cheng, X\. Liu, X\. Xie, X\. Liu, X\. Yu, X\. Song, X\. Shan, X\. Zhou, X\. Yang, X\. Li, X\. Su, X\. Lin, Y\. K\. Li, Y\. Q\. Wang, Y\. X\. Wei, Y\. X\. Zhu, Y\. Zhang, Y\. Xu, Y\. Xu, Y\. Huang, Y\. Li, Y\. Zhao, Y\. Sun, Y\. Li, Y\. Wang, Y\. Yu, Y\. Zheng, Y\. Zhang, Y\. Shi, Y\. Xiong, Y\. He, Y\. Tang, Y\. Piao, Y\. Wang, Y\. Tan, Y\. Ma, Y\. Liu, Y\. Guo, Y\. Wu, Y\. Ou, Y\. Zhu, Y\. Wang, Y\. Gong, Y\. Zou, Y\. He, Y\. Zha, Y\. Xiong, Y\. Ma, Y\. Yan, Y\. Luo, Y\. You, Y\. Liu, Y\. Zhou, Z\. F\. Wu, Z\. Z\. Ren, Z\. Ren, Z\. Sha, Z\. Fu, Z\. Xu, Z\. Huang, Z\. Zhang, Z\. Xie, Z\. Zhang, Z\. Hao, Z\. Gou, Z\. Ma, Z\. Yan, Z\. Shao, Z\. Xu, Z\. Wu, Z\. Zhang, Z\. Li, Z\. Gu, Z\. Zhu, Z\. Liu, Z\. Li, Z\. Xie, Z\. Song, Z\. Gao, and Z\. Pan \(2025\)DeepSeek\-v3 technical report\.External Links:2412\.19437,[Link](https://arxiv.org/abs/2412.19437)Cited by:[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p3.1),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9.2.1)\.
- DeepSeek\-AI, A\. Xu, B\. Lin, B\. Xue,et al\.\(2026\)DeepSeek\-v4: towards highly efficient million\-token context intelligence\.Technical reportDeepSeek\-AI\.Note:Technical reportExternal Links:[Link](https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro/blob/main/DeepSeek_V4.pdf)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1)\.
- DeepSeek\-AI \(2026\)DeepSeek\-v4: towards highly efficient million\-token context intelligence\.Technical reportDeepSeek\-AI\.Note:Technical reportExternal Links:[Link](https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro/blob/main/DeepSeek_V4.pdf)Cited by:[§1](https://arxiv.org/html/2605.15514#S1.p2.1)\.
- Y\. Du, M\. Tian, S\. Ronanki, S\. Rongali, S\. Bodapati, A\. Galstyan, A\. Wells, R\. Schwartz, E\. A\. Huerta, and H\. Peng \(2025\)Context length alone hurts llm performance despite perfect retrieval\.External Links:2510\.05381,[Link](https://arxiv.org/abs/2510.05381)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[§1](https://arxiv.org/html/2605.15514#S1.p2.1),[§1](https://arxiv.org/html/2605.15514#S1.p6.1)\.
- C\. Esseen \(1942\)On the liapunov limit error in the theory of probability\.Ark\. Mat\. Astr\. Fys\.28,pp\. 1–19\.Cited by:[Appendix B](https://arxiv.org/html/2605.15514#A2.SS0.SSS0.Px5.p1.3)\.
- Y\. Fu, R\. Panda, X\. Niu, X\. Yue, H\. Hajishirzi, Y\. Kim, and H\. Peng \(2024a\)Data engineering for scaling language models to 128k context\.InProceedings of the 41st International Conference on Machine Learning,ICML’24\.Cited by:[§1](https://arxiv.org/html/2605.15514#S1.p2.1)\.
- Y\. Fu, R\. Panda, X\. Niu, X\. Yue, H\. Hajishirzi, Y\. Kim, and H\. Peng \(2024b\)Data engineering for scaling language models to 128k context\.arXiv preprint arXiv:2402\.10171\.Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- T\. Gao, A\. Wettig, H\. Yen, and D\. Chen \(2025\)How to train long\-context language models \(effectively\)\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),Vienna, Austria,pp\. 7376–7399\.External Links:[Document](https://dx.doi.org/10.18653/v1/2025.acl-long.366),[Link](https://aclanthology.org/2025.acl-long.366/)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1)\.
- Y\. Gelberg, K\. Eguchi, T\. Akiba, and E\. Cetin \(2025\)Extending the context of pretrained llms by dropping their positional embeddings\.External Links:2512\.12167,[Link](https://arxiv.org/abs/2512.12167)Cited by:[§1](https://arxiv.org/html/2605.15514#S1.p1.1)\.
- A\. Grattafiori, A\. Dubey, A\. Jauhri, A\. Pandey, A\. Kadian, A\. Al\-Dahle, A\. Letman, A\. Mathur, A\. Schelten, A\. Vaughan, A\. Yang, A\. Fan, A\. Goyal, A\. Hartshorn, A\. Yang, A\. Mitra, A\. Sravankumar, A\. Korenev, A\. Hinsvark, A\. Rao, A\. Zhang, A\. Rodriguez, A\. Gregerson, A\. Spataru, B\. Roziere, B\. Biron, B\. Tang, B\. Chern, C\. Caucheteux, C\. Nayak, C\. Bi, C\. Marra, C\. McConnell, C\. Keller, C\. Touret, C\. Wu, C\. Wong, C\. C\. Ferrer, C\. Nikolaidis, D\. Allonsius, D\. Song, D\. Pintz, D\. Livshits, D\. Wyatt, D\. Esiobu, D\. Choudhary, D\. Mahajan, D\. Garcia\-Olano, D\. Perino, D\. Hupkes, E\. Lakomkin, E\. AlBadawy, E\. Lobanova, E\. Dinan, E\. M\. Smith, F\. Radenovic, F\. Guzmán, F\. Zhang, G\. Synnaeve, G\. Lee, G\. L\. Anderson, G\. Thattai, G\. Nail, G\. Mialon, G\. Pang, G\. Cucurell, H\. Nguyen, H\. Korevaar, H\. Xu, H\. Touvron, I\. Zarov, I\. A\. Ibarra, I\. Kloumann, I\. Misra, I\. Evtimov, J\. Zhang, J\. Copet, J\. Lee, J\. Geffert, J\. Vranes, J\. Park, J\. Mahadeokar, J\. Shah, J\. van der Linde, J\. Billock, J\. Hong, J\. Lee, J\. Fu, J\. Chi, J\. Huang, J\. Liu, J\. Wang, J\. Yu, J\. Bitton, J\. Spisak, J\. Park, J\. Rocca, J\. Johnstun, J\. Saxe, J\. Jia, K\. V\. Alwala, K\. Prasad, K\. Upasani, K\. Plawiak, K\. Li, K\. Heafield, K\. Stone, K\. El\-Arini, K\. Iyer, K\. Malik, K\. Chiu, K\. Bhalla, K\. Lakhotia, L\. Rantala\-Yeary, L\. van der Maaten, L\. Chen, L\. Tan, L\. Jenkins, L\. Martin, L\. Madaan, L\. Malo, L\. Blecher, L\. Landzaat, L\. de Oliveira, M\. Muzzi, M\. Pasupuleti, M\. Singh, M\. Paluri, M\. Kardas, M\. Tsimpoukelli, M\. Oldham, M\. Rita, M\. Pavlova, M\. Kambadur, M\. Lewis, M\. Si, M\. K\. Singh, M\. Hassan, N\. Goyal, N\. Torabi, N\. Bashlykov, N\. Bogoychev, N\. Chatterji, N\. Zhang, O\. Duchenne, O\. Çelebi, P\. Alrassy, P\. Zhang, P\. Li, P\. Vasic, P\. Weng, P\. Bhargava, P\. Dubal, P\. Krishnan, P\. S\. Koura, P\. Xu, Q\. He, Q\. Dong, R\. Srinivasan, R\. Ganapathy, R\. Calderer, R\. S\. Cabral, R\. Stojnic, R\. Raileanu, R\. Maheswari, R\. Girdhar, R\. Patel, R\. Sauvestre, R\. Polidoro, R\. Sumbaly, R\. Taylor, R\. Silva, R\. Hou, R\. Wang, S\. Hosseini, S\. Chennabasappa, S\. Singh, S\. Bell, S\. S\. Kim, S\. Edunov, S\. Nie, S\. Narang, S\. Raparthy, S\. Shen, S\. Wan, S\. Bhosale, S\. Zhang, S\. Vandenhende, S\. Batra, S\. Whitman, S\. Sootla, S\. Collot, S\. Gururangan, S\. Borodinsky, T\. Herman, T\. Fowler, T\. Sheasha, T\. Georgiou, T\. Scialom, T\. Speckbacher, T\. Mihaylov, T\. Xiao, U\. Karn, V\. Goswami, V\. Gupta, V\. Ramanathan, V\. Kerkez, V\. Gonguet, V\. Do, V\. Vogeti, V\. Albiero, V\. Petrovic, W\. Chu, W\. Xiong, W\. Fu, W\. Meers, X\. Martinet, X\. Wang, X\. Wang, X\. E\. Tan, X\. Xia, X\. Xie, X\. Jia, X\. Wang, Y\. Goldschlag, Y\. Gaur, Y\. Babaei, Y\. Wen, Y\. Song, Y\. Zhang, Y\. Li, Y\. Mao, Z\. D\. Coudert, Z\. Yan, Z\. Chen, Z\. Papakipos, A\. Singh, A\. Srivastava, A\. Jain, A\. Kelsey, A\. Shajnfeld, A\. Gangidi, A\. Victoria, A\. Goldstand, A\. Menon, A\. Sharma, A\. Boesenberg, A\. Baevski, A\. Feinstein, A\. Kallet, A\. Sangani, A\. Teo, A\. Yunus, A\. Lupu, A\. Alvarado, A\. Caples, A\. Gu, A\. Ho, A\. Poulton, A\. Ryan, A\. Ramchandani, A\. Dong, A\. Franco, A\. Goyal, A\. Saraf, A\. Chowdhury, A\. Gabriel, A\. Bharambe, A\. Eisenman, A\. Yazdan, B\. James, B\. Maurer, B\. Leonhardi, B\. Huang, B\. Loyd, B\. D\. Paola, B\. Paranjape, B\. Liu, B\. Wu, B\. Ni, B\. Hancock, B\. Wasti, B\. Spence, B\. Stojkovic, B\. Gamido, B\. Montalvo, C\. Parker, C\. Burton, C\. Mejia, C\. Liu, C\. Wang, C\. Kim, C\. Zhou, C\. Hu, C\. Chu, C\. Cai, C\. Tindal, C\. Feichtenhofer, C\. Gao, D\. Civin, D\. Beaty, D\. Kreymer, D\. Li, D\. Adkins, D\. Xu, D\. Testuggine, D\. David, D\. Parikh, D\. Liskovich, D\. Foss, D\. Wang, D\. Le, D\. Holland, E\. Dowling, E\. Jamil, E\. Montgomery, E\. Presani, E\. Hahn, E\. Wood, E\. Le, E\. Brinkman, E\. Arcaute, E\. Dunbar, E\. Smothers, F\. Sun, F\. Kreuk, F\. Tian, F\. Kokkinos, F\. Ozgenel, F\. Caggioni, F\. Kanayet, F\. Seide, G\. M\. Florez, G\. Schwarz, G\. Badeer, G\. Swee, G\. Halpern, G\. Herman, G\. Sizov, Guangyi, Zhang, G\. Lakshminarayanan, H\. Inan, H\. Shojanazeri, H\. Zou, H\. Wang, H\. Zha, H\. Habeeb, H\. Rudolph, H\. Suk, H\. Aspegren, H\. Goldman, H\. Zhan, I\. Damlaj, I\. Molybog, I\. Tufanov, I\. Leontiadis, I\. Veliche, I\. Gat, J\. Weissman, J\. Geboski, J\. Kohli, J\. Lam, J\. Asher, J\. Gaya, J\. Marcus, J\. Tang, J\. Chan, J\. Zhen, J\. Reizenstein, J\. Teboul, J\. Zhong, J\. Jin, J\. Yang, J\. Cummings, J\. Carvill, J\. Shepard, J\. McPhie, J\. Torres, J\. Ginsburg, J\. Wang, K\. Wu, K\. H\. U, K\. Saxena, K\. Khandelwal, K\. Zand, K\. Matosich, K\. Veeraraghavan, K\. Michelena, K\. Li, K\. Jagadeesh, K\. Huang, K\. Chawla, K\. Huang, L\. Chen, L\. Garg, L\. A, L\. Silva, L\. Bell, L\. Zhang, L\. Guo, L\. Yu, L\. Moshkovich, L\. Wehrstedt, M\. Khabsa, M\. Avalani, M\. Bhatt, M\. Mankus, M\. Hasson, M\. Lennie, M\. Reso, M\. Groshev, M\. Naumov, M\. Lathi, M\. Keneally, M\. Liu, M\. L\. Seltzer, M\. Valko, M\. Restrepo, M\. Patel, M\. Vyatskov, M\. Samvelyan, M\. Clark, M\. Macey, M\. Wang, M\. J\. Hermoso, M\. Metanat, M\. Rastegari, M\. Bansal, N\. Santhanam, N\. Parks, N\. White, N\. Bawa, N\. Singhal, N\. Egebo, N\. Usunier, N\. Mehta, N\. P\. Laptev, N\. Dong, N\. Cheng, O\. Chernoguz, O\. Hart, O\. Salpekar, O\. Kalinli, P\. Kent, P\. Parekh, P\. Saab, P\. Balaji, P\. Rittner, P\. Bontrager, P\. Roux, P\. Dollar, P\. Zvyagina, P\. Ratanchandani, P\. Yuvraj, Q\. Liang, R\. Alao, R\. Rodriguez, R\. Ayub, R\. Murthy, R\. Nayani, R\. Mitra, R\. Parthasarathy, R\. Li, R\. Hogan, R\. Battey, R\. Wang, R\. Howes, R\. Rinott, S\. Mehta, S\. Siby, S\. J\. Bondu, S\. Datta, S\. Chugh, S\. Hunt, S\. Dhillon, S\. Sidorov, S\. Pan, S\. Mahajan, S\. Verma, S\. Yamamoto, S\. Ramaswamy, S\. Lindsay, S\. Lindsay, S\. Feng, S\. Lin, S\. C\. Zha, S\. Patil, S\. Shankar, S\. Zhang, S\. Zhang, S\. Wang, S\. Agarwal, S\. Sajuyigbe, S\. Chintala, S\. Max, S\. Chen, S\. Kehoe, S\. Satterfield, S\. Govindaprasad, S\. Gupta, S\. Deng, S\. Cho, S\. Virk, S\. Subramanian, S\. Choudhury, S\. Goldman, T\. Remez, T\. Glaser, T\. Best, T\. Koehler, T\. Robinson, T\. Li, T\. Zhang, T\. Matthews, T\. Chou, T\. Shaked, V\. Vontimitta, V\. Ajayi, V\. Montanez, V\. Mohan, V\. S\. Kumar, V\. Mangla, V\. Ionescu, V\. Poenaru, V\. T\. Mihailescu, V\. Ivanov, W\. Li, W\. Wang, W\. Jiang, W\. Bouaziz, W\. Constable, X\. Tang, X\. Wu, X\. Wang, X\. Wu, X\. Gao, Y\. Kleinman, Y\. Chen, Y\. Hu, Y\. Jia, Y\. Qi, Y\. Li, Y\. Zhang, Y\. Zhang, Y\. Adi, Y\. Nam, Yu, Wang, Y\. Zhao, Y\. Hao, Y\. Qian, Y\. Li, Y\. He, Z\. Rait, Z\. DeVito, Z\. Rosnbrick, Z\. Wen, Z\. Yang, Z\. Zhao, and Z\. Ma \(2024\)The llama 3 herd of models\.External Links:2407\.21783,[Link](https://arxiv.org/abs/2407.21783)Cited by:[§D\.1](https://arxiv.org/html/2605.15514#A4.SS1.p1.1),[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p3.1),[§1](https://arxiv.org/html/2605.15514#S1.p4.1),[§2\.2](https://arxiv.org/html/2605.15514#S2.SS2.SSS0.Px1.p1.1),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9.2.1)\.
- G\. Henry, P\. T\. P\. Tang, and A\. Heinecke \(2019\)Leveraging the bfloat16 artificial intelligence datatype for higher\-precision computations\.External Links:1904\.06376,[Link](https://arxiv.org/abs/1904.06376)Cited by:[§C\.2](https://arxiv.org/html/2605.15514#A3.SS2.p10.4),[§4\.2](https://arxiv.org/html/2605.15514#S4.SS2.p2.1)\.
- C\. Hsieh, S\. Sun, S\. Kriman, S\. Acharya, D\. Rekesh, F\. Jia, Y\. Zhang, and B\. Ginsburg \(2024\)RULER: what’s the real context size of your long\-context language models?\.arXiv preprint arXiv:2404\.06654\.Note:This work is licensed under the Apache License 2\.0\.Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[§1](https://arxiv.org/html/2605.15514#S1.p2.1),[§1](https://arxiv.org/html/2605.15514#S1.p6.1)\.
- M\. Javaheripi, S\. Bubeck, M\. Abdin, J\. Aneja, S\. Bubeck, C\. C\. T\. Mendes, W\. Chen, A\. Del Giorno, R\. Eldan, S\. Gopi,et al\.\(2023\)Phi\-2: the surprising power of small language models\.Microsoft Research Blog1\(3\),pp\. 3\.Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1)\.
- A\. Jonasson \(2025\)Rotary offset features in large language models\.External Links:2503\.01832,[Link](https://arxiv.org/abs/2503.01832)Cited by:[Appendix A](https://arxiv.org/html/2605.15514#A1.SS0.SSS0.Px2.p4.3),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px3.p1.1),[§2\.1](https://arxiv.org/html/2605.15514#S2.SS1.SSS0.Px1.p1.5)\.
- P\. Kahardipraja, R\. Achtibat, T\. Wiegand, W\. Samek, and S\. Lapuschkin \(2025\)The atlas of in\-context learning: how attention heads shape in\-context retrieval augmentation\.External Links:2505\.15807,[Link](https://arxiv.org/abs/2505.15807)Cited by:[Appendix E](https://arxiv.org/html/2605.15514#A5.p2.1)\.
- G\. Kamradt \(2023\)Needle in a haystack \- pressure testing llms\.GitHub\.Note:[https://github\.com/gkamradt/LLMTest\_NeedleInAHaystack/tree/7b90d285651b68d39a94f3d3bd3672f84192c989](https://github.com/gkamradt/LLMTest_NeedleInAHaystack/tree/7b90d285651b68d39a94f3d3bd3672f84192c989)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[§1](https://arxiv.org/html/2605.15514#S1.p5.1),[§5](https://arxiv.org/html/2605.15514#S5.p2.1)\.
- Y\. Kuratov, A\. Bulatov, P\. Anokhin, I\. Rodkin, D\. Sorokin, A\. Sorokin, and M\. Burtsev \(2024\)BABILong: testing the limits of llms with long context reasoning\-in\-a\-haystack\.External Links:2406\.10149Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[§1](https://arxiv.org/html/2605.15514#S1.p2.1),[§1](https://arxiv.org/html/2605.15514#S1.p6.1)\.
- S\. Li, F\. Xue, C\. Baranwal, Y\. Li, and Y\. You \(2023\)Sequence parallelism: long sequence training from system perspective\.InProceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),Toronto, Canada,pp\. 2391–2404\.External Links:[Document](https://dx.doi.org/10.18653/v1/2023.acl-long.134),[Link](https://aclanthology.org/2023.acl-long.134/)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- Y\. Lin, Z\. Li, Y\. Xing, P\. He, Y\. Cui, Y\. Li, B\. Ding, J\. Zhou, and J\. Tang \(2026\)Retrieval heads are dynamic\.External Links:2602\.11162,[Link](https://arxiv.org/abs/2602.11162)Cited by:[Appendix E](https://arxiv.org/html/2605.15514#A5.p2.1)\.
- F\. Liu \(2026\)Rotary positional embeddings as phase modulation: theoretical bounds on the rope base for long\-context transformers\.External Links:2602\.10959,[Link](https://arxiv.org/abs/2602.10959)Cited by:[Appendix A](https://arxiv.org/html/2605.15514#A1.SS0.SSS0.Px3.p1.11),[§C\.2](https://arxiv.org/html/2605.15514#A3.SS2.p1.1),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px4.p1.1),[Assumption of regular rotary amplitudes](https://arxiv.org/html/2605.15514#Sx1.SS0.SSS0.Px2.p1.1),[footnote 3](https://arxiv.org/html/2605.15514#footnote3)\.
- H\. Liu, M\. Zaharia, and P\. Abbeel \(2023a\)Ring attention with blockwise transformers for near\-infinite context\.arXiv preprint arXiv:2310\.01889\.External Links:[Link](https://arxiv.org/abs/2310.01889)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- N\. F\. Liu, K\. Lin, J\. Hewitt, A\. Paranjape, M\. Bevilacqua, F\. Petroni, and P\. Liang \(2024\)Lost in the middle: how language models use long contexts\.Transactions of the Association for Computational Linguistics12,pp\. 157–173\.External Links:[Link](https://aclanthology.org/2024.tacl-1.9/),[Document](https://dx.doi.org/10.1162/tacl%5Fa%5F00638)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[§1](https://arxiv.org/html/2605.15514#S1.p2.1),[§1](https://arxiv.org/html/2605.15514#S1.p6.1),[§2](https://arxiv.org/html/2605.15514#S2.p1.1)\.
- X\. Liu, H\. Yan, S\. Zhang, C\. An, X\. Qiu, and D\. Lin \(2023b\)Scaling laws of rope\-based extrapolation\.arXiv preprint arXiv:2310\.05209\.Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px3.p1.1),[§2\.1](https://arxiv.org/html/2605.15514#S2.SS1.SSS0.Px1.p1.5)\.
- Magic \(2024\)100M token context windows\.External Links:[Link](https://magic.dev/blog/100m-token-context-windows)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- Meta \(2025\)The Llama 4 herd: the beginning of a new era of natively multimodal AI innovation\.Note:https://ai\.meta\.com/blog/llama\-4\-multimodal\-intelligence/Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- D\. Mirandaet al\.\(2024\)Round and round we go\! what makes rotary positional encodings useful?\.arXiv preprint arXiv:2410\.06205\.Cited by:[Appendix A](https://arxiv.org/html/2605.15514#A1.SS0.SSS0.Px2.p4.3),[Appendix A](https://arxiv.org/html/2605.15514#A1.SS0.SSS0.Px4.p1.8),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px3.p1.1),[§2\.1](https://arxiv.org/html/2605.15514#S2.SS1.SSS0.Px1.p1.5),[§2\.2](https://arxiv.org/html/2605.15514#S2.SS2.p1.1)\.
- Mistral AI Team \(2024\)Mistral\-7b\-instruct\-v0\.3\.Note:[https://huggingface\.co/mistralai/Mistral\-7B\-Instruct\-v0\.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3)Model card\. Accessed: 2026\-05\-03Cited by:[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p3.1),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9.2.1)\.
- OpenAI, :, S\. Agarwal, L\. Ahmad, J\. Ai, S\. Altman, A\. Applebaum, E\. Arbus, R\. K\. Arora, Y\. Bai, B\. Baker, H\. Bao, B\. Barak, A\. Bennett, T\. Bertao, N\. Brett, E\. Brevdo, G\. Brockman, S\. Bubeck, C\. Chang, K\. Chen, M\. Chen, E\. Cheung, A\. Clark, D\. Cook, M\. Dukhan, C\. Dvorak, K\. Fives, V\. Fomenko, T\. Garipov, K\. Georgiev, M\. Glaese, T\. Gogineni, A\. Goucher, L\. Gross, K\. G\. Guzman, J\. Hallman, J\. Hehir, J\. Heidecke, A\. Helyar, H\. Hu, R\. Huet, J\. Huh, S\. Jain, Z\. Johnson, C\. Koch, I\. Kofman, D\. Kundel, J\. Kwon, V\. Kyrylov, E\. Y\. Le, G\. Leclerc, J\. P\. Lennon, S\. Lessans, M\. Lezcano\-Casado, Y\. Li, Z\. Li, J\. Lin, J\. Liss, Lily, Liu, J\. Liu, K\. Lu, C\. Lu, Z\. Martinovic, L\. McCallum, J\. McGrath, S\. McKinney, A\. McLaughlin, S\. Mei, S\. Mostovoy, T\. Mu, G\. Myles, A\. Neitz, A\. Nichol, J\. Pachocki, A\. Paino, D\. Palmie, A\. Pantuliano, G\. Parascandolo, J\. Park, L\. Pathak, C\. Paz, L\. Peran, D\. Pimenov, M\. Pokrass, E\. Proehl, H\. Qiu, G\. Raila, F\. Raso, H\. Ren, K\. Richardson, D\. Robinson, B\. Rotsted, H\. Salman, S\. Sanjeev, M\. Schwarzer, D\. Sculley, H\. Sikchi, K\. Simon, K\. Singhal, Y\. Song, D\. Stuckey, Z\. Sun, P\. Tillet, S\. Toizer, F\. Tsimpourlas, N\. Vyas, E\. Wallace, X\. Wang, M\. Wang, O\. Watkins, K\. Weil, A\. Wendling, K\. Whinnery, C\. Whitney, H\. Wong, L\. Yang, Y\. Yang, M\. Yasunaga, K\. Ying, W\. Zaremba, W\. Zhan, C\. Zhang, B\. Zhang, E\. Zhang, and S\. Zhao \(2025\)Gpt\-oss\-120b & gpt\-oss\-20b model card\.External Links:2508\.10925,[Link](https://arxiv.org/abs/2508.10925)Cited by:[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p3.1),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9.2.1)\.
- OpenAI \(2025\)Introducing GPT\-5\.Note:https://openai\.com/index/introducing\-gpt\-5/Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- B\. Peng, J\. Quesnelle, H\. Fan, and E\. Shippole \(2024\)YaRN: efficient context window extension of large language models\.InThe Twelfth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=wHBfxhZu1u)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px3.p1.1),[§2\.1](https://arxiv.org/html/2605.15514#S2.SS1.SSS0.Px1.p1.5)\.
- O\. Press, N\. Smith, and M\. Lewis \(2022\)Train short, test long: attention with linear biases enables input length extrapolation\.InInternational Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=R8sQPpGCv0)Cited by:[§1](https://arxiv.org/html/2605.15514#S1.p1.1)\.
- J\. Su, Y\. Lu, S\. Pan, B\. Wen, and Y\. Liu \(2021\)RoFormer: enhanced transformer with rotary position embedding\.External Links:2104\.09864Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[§1](https://arxiv.org/html/2605.15514#S1.p1.1),[§2\.1](https://arxiv.org/html/2605.15514#S2.SS1.p1.7)\.
- G\. Team, P\. Georgiev, V\. I\. Lei, R\. Burnell, L\. Bai, A\. Gulati, G\. Tanzer, D\. Vincent, Z\. Pan, S\. Wang, S\. Mariooryad, Y\. Ding, X\. Geng, F\. Alcober, R\. Frostig, M\. Omernick, L\. Walker, C\. Paduraru, C\. Sorokin, A\. Tacchetti, C\. Gaffney, S\. Daruki, O\. Sercinoglu, Z\. Gleicher, J\. Love, P\. Voigtlaender, R\. Jain, G\. Surita, K\. Mohamed, R\. Blevins, J\. Ahn, T\. Zhu, K\. Kawintiranon, O\. Firat, Y\. Gu, Y\. Zhang, M\. Rahtz, M\. Faruqui, N\. Clay, J\. Gilmer, J\. Co\-Reyes, I\. Penchev, R\. Zhu, N\. Morioka, K\. Hui, K\. Haridasan, V\. Campos, M\. Mahdieh, M\. Guo, S\. Hassan, K\. Kilgour, A\. Vezer, H\. Cheng, R\. de Liedekerke, S\. Goyal, P\. Barham, D\. Strouse, S\. Noury, J\. Adler, M\. Sundararajan, S\. Vikram, D\. Lepikhin, M\. Paganini, X\. Garcia, F\. Yang, D\. Valter, M\. Trebacz, K\. Vodrahalli, C\. Asawaroengchai, R\. Ring, N\. Kalb, L\. B\. Soares, S\. Brahma, D\. Steiner, T\. Yu, F\. Mentzer, A\. He, L\. Gonzalez, B\. Xu, R\. L\. Kaufman, L\. E\. Shafey, J\. Oh, T\. Hennigan, G\. van den Driessche, S\. Odoom, M\. Lucic, B\. Roelofs, S\. Lall, A\. Marathe, B\. Chan, S\. Ontanon, L\. He, D\. Teplyashin, J\. Lai, P\. Crone, B\. Damoc, L\. Ho, S\. Riedel, K\. Lenc, C\. Yeh, A\. Chowdhery, Y\. Xu, M\. Kazemi, E\. Amid, A\. Petrushkina, K\. Swersky, A\. Khodaei, G\. Chen, C\. Larkin, M\. Pinto, G\. Yan, A\. P\. Badia, P\. Patil, S\. Hansen, D\. Orr, S\. M\. R\. Arnold, J\. Grimstad, A\. Dai, S\. Douglas, R\. Sinha, V\. Yadav, X\. Chen, E\. Gribovskaya, J\. Austin, J\. Zhao, K\. Patel, P\. Komarek, S\. Austin, S\. Borgeaud, L\. Friso, A\. Goyal, B\. Caine, K\. Cao, D\. Chung, M\. Lamm, G\. Barth\-Maron, T\. Kagohara, K\. Olszewska, M\. Chen, K\. Shivakumar, R\. Agarwal, H\. Godhia, R\. Rajwar, J\. Snaider, X\. Dotiwalla, Y\. Liu, A\. Barua, V\. Ungureanu, Y\. Zhang, B\. Batsaikhan, M\. Wirth, J\. Qin, I\. Danihelka, T\. Doshi, M\. Chadwick, J\. Chen, S\. Jain, Q\. Le, A\. Kar, M\. Gurumurthy, C\. Li, R\. Sang, F\. Liu, L\. Lamprou, R\. Munoz, N\. Lintz, H\. Mehta, H\. Howard, M\. Reynolds, L\. Aroyo, Q\. Wang, L\. Blanco, A\. Cassirer, J\. Griffith, D\. Das, S\. Lee, J\. Sygnowski, Z\. Fisher, J\. Besley, R\. Powell, Z\. Ahmed, D\. Paulus, D\. Reitter, Z\. Borsos, R\. Joshi, A\. Pope, S\. Hand, V\. Selo, V\. Jain, N\. Sethi, M\. Goel, T\. Makino, R\. May, Z\. Yang, J\. Schalkwyk, C\. Butterfield, A\. Hauth, A\. Goldin, W\. Hawkins, E\. Senter, S\. Brin, O\. Woodman, M\. Ritter, E\. Noland, M\. Giang, V\. Bolina, L\. Lee, T\. Blyth, I\. Mackinnon, M\. Reid, O\. Sarvana, D\. Silver, A\. Chen, L\. Wang, L\. Maggiore, O\. Chang, N\. Attaluri, G\. Thornton, C\. Chiu, O\. Bunyan, N\. Levine, T\. Chung, E\. Eltyshev, X\. Si, T\. Lillicrap, D\. Brady, V\. Aggarwal, B\. Wu, Y\. Xu, R\. McIlroy, K\. Badola, P\. Sandhu, E\. Moreira, W\. Stokowiec, R\. Hemsley, D\. Li, A\. Tudor, P\. Shyam, E\. Rahimtoroghi, S\. Haykal, P\. Sprechmann, X\. Zhou, D\. Mincu, Y\. Li, R\. Addanki, K\. Krishna, X\. Wu, A\. Frechette, M\. Eyal, A\. Dafoe, D\. Lacey, J\. Whang, T\. Avrahami, Y\. Zhang, E\. Taropa, H\. Lin, D\. Toyama, E\. Rutherford, M\. Sano, H\. Choe, A\. Tomala, C\. Safranek\-Shrader, N\. Kassner, M\. Pajarskas, M\. Harvey, S\. Sechrist, M\. Fortunato, C\. Lyu, G\. Elsayed, C\. Kuang, J\. Lottes, E\. Chu, C\. Jia, C\. Chen, P\. Humphreys, K\. Baumli, C\. Tao, R\. Samuel, C\. N\. dos Santos, A\. Andreassen, N\. Rakićević, D\. Grewe, A\. Kumar, S\. Winkler, J\. Caton, A\. Brock, S\. Dalmia, H\. Sheahan, I\. Barr, Y\. Miao, P\. Natsev, J\. Devlin, F\. Behbahani, F\. Prost, Y\. Sun, A\. Myaskovsky, T\. S\. Pillai, D\. Hurt, A\. Lazaridou, X\. Xiong, C\. Zheng, F\. Pardo, X\. Li, D\. Horgan, J\. Stanton, M\. Ambar, F\. Xia, A\. Lince, M\. Wang, B\. Mustafa, A\. Webson, H\. Lee, R\. Anil, M\. Wicke, T\. Dozat, A\. Sinha, E\. Piqueras, E\. Dabir, S\. Upadhyay, A\. Boral, L\. A\. Hendricks, C\. Fry, J\. Djolonga, Y\. Su, J\. Walker, J\. Labanowski, R\. Huang, V\. Misra, J\. Chen, R\. Skerry\-Ryan, A\. Singh, S\. Rijhwani, D\. Yu, A\. Castro\-Ros, B\. Changpinyo, R\. Datta, S\. Bagri, A\. M\. Hrafnkelsson, M\. Maggioni, D\. Zheng, Y\. Sulsky, S\. Hou, T\. L\. Paine, A\. Yang, J\. Riesa, D\. Rogozinska, D\. Marcus, D\. E\. Badawy, Q\. Zhang, L\. Wang, H\. Miller, J\. Greer, L\. L\. Sjos, A\. Nova, H\. Zen, R\. Chaabouni, M\. Rosca, J\. Jiang, C\. Chen, R\. Liu, T\. Sainath, M\. Krikun, A\. Polozov, J\. Lespiau, J\. Newlan, Z\. Cankara, S\. Kwak, Y\. Xu, P\. Chen, A\. Coenen, C\. Meyer, K\. Tsihlas, A\. Ma, J\. Gottweis, J\. Xing, C\. Gu, J\. Miao, C\. Frank, Z\. Cankara, S\. Ganapathy, I\. Dasgupta, S\. Hughes\-Fitt, H\. Chen, D\. Reid, K\. Rong, H\. Fan, J\. van Amersfoort, V\. Zhuang, A\. Cohen, S\. S\. Gu, A\. Mohananey, A\. Ilic, T\. Tobin, J\. Wieting, A\. Bortsova, P\. Thacker, E\. Wang, E\. Caveness, J\. Chiu, E\. Sezener, A\. Kaskasoli, S\. Baker, K\. Millican, M\. Elhawaty, K\. Aisopos, C\. Lebsack, N\. Byrd, H\. Dai, W\. Jia, M\. Wiethoff, E\. Davoodi, A\. Weston, L\. Yagati, A\. Ahuja, I\. Gao, G\. Pundak, S\. Zhang, M\. Azzam, K\. C\. Sim, S\. Caelles, J\. Keeling, A\. Sharma, A\. Swing, Y\. Li, C\. Liu, C\. G\. Bostock, Y\. Bansal, Z\. Nado, A\. Anand, J\. Lipschultz, A\. Karmarkar, L\. Proleev, A\. Ittycheriah, S\. H\. Yeganeh, G\. Polovets, A\. Faust, J\. Sun, A\. Rrustemi, P\. Li, R\. Shivanna, J\. Liu, C\. Welty, F\. Lebron, A\. Baddepudi, S\. Krause, E\. Parisotto, R\. Soricut, Z\. Xu, D\. Bloxwich, M\. Johnson, B\. Neyshabur, J\. Mao\-Jones, R\. Wang, V\. Ramasesh, Z\. Abbas, A\. Guez, C\. Segal, D\. D\. Nguyen, J\. Svensson, L\. Hou, S\. York, K\. Milan, S\. Bridgers, W\. Gworek, M\. Tagliasacchi, J\. Lee\-Thorp, M\. Chang, A\. Guseynov, A\. J\. Hartman, M\. Kwong, R\. Zhao, S\. Kashem, E\. Cole, A\. Miech, R\. Tanburn, M\. Phuong, F\. Pavetic, S\. Cevey, R\. Comanescu, R\. Ives, S\. Yang, C\. Du, B\. Li, Z\. Zhang, M\. Iinuma, C\. H\. Hu, A\. Roy, S\. Bijwadia, Z\. Zhu, D\. Martins, R\. Saputro, A\. Gergely, S\. Zheng, D\. Jia, I\. Antonoglou, A\. Sadovsky, S\. Gu, Y\. Bi, A\. Andreev, S\. Samangooei, M\. Khan, T\. Kocisky, A\. Filos, C\. Kumar, C\. Bishop, A\. Yu, S\. Hodkinson, S\. Mittal, P\. Shah, A\. Moufarek, Y\. Cheng, A\. Bloniarz, J\. Lee, P\. Pejman, P\. Michel, S\. Spencer, V\. Feinberg, X\. Xiong, N\. Savinov, C\. Smith, S\. Shakeri, D\. Tran, M\. Chesus, B\. Bohnet, G\. Tucker, T\. von Glehn, C\. Muir, Y\. Mao, H\. Kazawa, A\. Slone, K\. Soparkar, D\. Shrivastava, J\. Cobon\-Kerr, M\. Sharman, J\. Pavagadhi, C\. Araya, K\. Misiunas, N\. Ghelani, M\. Laskin, D\. Barker, Q\. Li, A\. Briukhov, N\. Houlsby, M\. Glaese, B\. Lakshminarayanan, N\. Schucher, Y\. Tang, E\. Collins, H\. Lim, F\. Feng, A\. Recasens, G\. Lai, A\. Magni, N\. D\. Cao, A\. Siddhant, Z\. Ashwood, J\. Orbay, M\. Dehghani, J\. Brennan, Y\. He, K\. Xu, Y\. Gao, C\. Saroufim, J\. Molloy, X\. Wu, S\. Arnold, S\. Chang, J\. Schrittwieser, E\. Buchatskaya, S\. Radpour, M\. Polacek, S\. Giordano, A\. Bapna, S\. Tokumine, V\. Hellendoorn, T\. Sottiaux, S\. Cogan, A\. Severyn, M\. Saleh, S\. Thakoor, L\. Shefey, S\. Qiao, M\. Gaba, S\. Chang, C\. Swanson, B\. Zhang, B\. Lee, P\. K\. Rubenstein, G\. Song, T\. Kwiatkowski, A\. Koop, A\. Kannan, D\. Kao, P\. Schuh, A\. Stjerngren, G\. Ghiasi, G\. Gibson, L\. Vilnis, Y\. Yuan, F\. T\. Ferreira, A\. Kamath, T\. Klimenko, K\. Franko, K\. Xiao, I\. Bhattacharya, M\. Patel, R\. Wang, A\. Morris, R\. Strudel, V\. Sharma, P\. Choy, S\. H\. Hashemi, J\. Landon, M\. Finkelstein, P\. Jhakra, J\. Frye, M\. Barnes, M\. Mauger, D\. Daun, K\. Baatarsukh, M\. Tung, W\. Farhan, H\. Michalewski, F\. Viola, F\. de Chaumont Quitry, C\. L\. Lan, T\. Hudson, Q\. Wang, F\. Fischer, I\. Zheng, E\. White, A\. Dragan, J\. Alayrac, E\. Ni, A\. Pritzel, A\. Iwanicki, M\. Isard, A\. Bulanova, L\. Zilka, E\. Dyer, D\. Sachan, S\. Srinivasan, H\. Muckenhirn, H\. Cai, A\. Mandhane, M\. Tariq, J\. W\. Rae, G\. Wang, K\. Ayoub, N\. FitzGerald, Y\. Zhao, W\. Han, C\. Alberti, D\. Garrette, K\. Krishnakumar, M\. Gimenez, A\. Levskaya, D\. Sohn, J\. Matak, I\. Iturrate, M\. B\. Chang, J\. Xiang, Y\. Cao, N\. Ranka, G\. Brown, A\. Hutter, V\. Mirrokni, N\. Chen, K\. Yao, Z\. Egyed, F\. Galilee, T\. Liechty, P\. Kallakuri, E\. Palmer, S\. Ghemawat, J\. Liu, D\. Tao, C\. Thornton, T\. Green, M\. Jasarevic, S\. Lin, V\. Cotruta, Y\. Tan, N\. Fiedel, H\. Yu, E\. Chi, A\. Neitz, J\. Heitkaemper, A\. Sinha, D\. Zhou, Y\. Sun, C\. Kaed, B\. Hulse, S\. Mishra, M\. Georgaki, S\. Kudugunta, C\. Farabet, I\. Shafran, D\. Vlasic, A\. Tsitsulin, R\. Ananthanarayanan, A\. Carin, G\. Su, P\. Sun, S\. V, G\. Carvajal, J\. Broder, I\. Comsa, A\. Repina, W\. Wong, W\. W\. Chen, P\. Hawkins, E\. Filonov, L\. Loher, C\. Hirnschall, W\. Wang, J\. Ye, A\. Burns, H\. Cate, D\. G\. Wright, F\. Piccinini, L\. Zhang, C\. Lin, I\. Gog, Y\. Kulizhskaya, A\. Sreevatsa, S\. Song, L\. C\. Cobo, A\. Iyer, C\. Tekur, G\. Garrido, Z\. Xiao, R\. Kemp, H\. S\. Zheng, H\. Li, A\. Agarwal, C\. Ngani, K\. Goshvadi, R\. Santamaria\-Fernandez, W\. Fica, X\. Chen, C\. Gorgolewski, S\. Sun, R\. Garg, X\. Ye, S\. M\. A\. Eslami, N\. Hua, J\. Simon, P\. Joshi, Y\. Kim, I\. Tenney, S\. Potluri, L\. N\. Thiet, Q\. Yuan, F\. Luisier, A\. Chronopoulou, S\. Scellato, P\. Srinivasan, M\. Chen, V\. Koverkathu, V\. Dalibard, Y\. Xu, B\. Saeta, K\. Anderson, T\. Sellam, N\. Fernando, F\. Huot, J\. Jung, M\. Varadarajan, M\. Quinn, A\. Raul, M\. Le, R\. Habalov, J\. Clark, K\. Jalan, K\. Bullard, A\. Singhal, T\. Luong, B\. Wang, S\. Rajayogam, J\. Eisenschlos, J\. Jia, D\. Finchelstein, A\. Yakubovich, D\. Balle, M\. Fink, S\. Agarwal, J\. Li, D\. Dvijotham, S\. Pal, K\. Kang, J\. Konzelmann, J\. Beattie, O\. Dousse, D\. Wu, R\. Crocker, C\. Elkind, S\. R\. Jonnalagadda, J\. Lee, D\. Holtmann\-Rice, K\. Kallarackal, R\. Liu, D\. Vnukov, N\. Vats, L\. Invernizzi, M\. Jafari, H\. Zhou, L\. Taylor, J\. Prendki, M\. Wu, T\. Eccles, T\. Liu, K\. Kopparapu, F\. Beaufays, C\. Angermueller, A\. Marzoca, S\. Sarcar, H\. Dib, J\. Stanway, F\. Perbet, N\. Trdin, R\. Sterneck, A\. Khorlin, D\. Li, X\. Wu, S\. Goenka, D\. Madras, S\. Goldshtein, W\. Gierke, T\. Zhou, Y\. Liu, Y\. Liang, A\. White, Y\. Li, S\. Singh, S\. Bahargam, M\. Epstein, S\. Basu, L\. Lao, A\. Ozturel, C\. Crous, A\. Zhai, H\. Lu, Z\. Tung, N\. Gaur, A\. Walton, L\. Dixon, M\. Zhang, A\. Globerson, G\. Uy, A\. Bolt, O\. Wiles, M\. Nasr, I\. Shumailov, M\. Selvi, F\. Piccinno, R\. Aguilar, S\. McCarthy, M\. Khalman, M\. Shukla, V\. Galic, J\. Carpenter, K\. Villela, H\. Zhang, H\. Richardson, J\. Martens, M\. Bosnjak, S\. R\. Belle, J\. Seibert, M\. Alnahlawi, B\. McWilliams, S\. Singh, A\. Louis, W\. Ding, D\. Popovici, L\. Simicich, L\. Knight, P\. Mehta, N\. Gupta, C\. Shi, S\. Fatehi, J\. Mitrovic, A\. Grills, J\. Pagadora, T\. Munkhdalai, D\. Petrova, D\. Eisenbud, Z\. Zhang, D\. Yates, B\. Mittal, N\. Tripuraneni, Y\. Assael, T\. Brovelli, P\. Jain, M\. Velimirovic, C\. Akbulut, J\. Mu, W\. Macherey, R\. Kumar, J\. Xu, H\. Qureshi, G\. Comanici, J\. Wiesner, Z\. Gong, A\. Ruddock, M\. Bauer, N\. Felt, A\. GP, A\. Arnab, D\. Zelle, J\. Rothfuss, B\. Rosgen, A\. Shenoy, B\. Seybold, X\. Li, J\. Mudigonda, G\. Erdogan, J\. Xia, J\. Simsa, A\. Michi, Y\. Yao, C\. Yew, S\. Kan, I\. Caswell, C\. Radebaugh, A\. Elisseeff, P\. Valenzuela, K\. McKinney, K\. Paterson, A\. Cui, E\. Latorre\-Chimoto, S\. Kim, W\. Zeng, K\. Durden, P\. Ponnapalli, T\. Sosea, C\. A\. Choquette\-Choo, J\. Manyika, B\. Robenek, H\. Vashisht, S\. Pereira, H\. Lam, M\. Velic, D\. Owusu\-Afriyie, K\. Lee, T\. Bolukbasi, A\. Parrish, S\. Lu, J\. Park, B\. Venkatraman, A\. Talbert, L\. Rosique, Y\. Cheng, A\. Sozanschi, A\. Paszke, P\. Kumar, J\. Austin, L\. Li, K\. Salama, B\. Perz, W\. Kim, N\. Dukkipati, A\. Baryshnikov, C\. Kaplanis, X\. Sheng, Y\. Chervonyi, C\. Unlu, D\. de Las Casas, H\. Askham, K\. Tunyasuvunakool, F\. Gimeno, S\. Poder, C\. Kwak, M\. Miecnikowski, V\. Mirrokni, A\. Dimitriev, A\. Parisi, D\. Liu, T\. Tsai, T\. Shevlane, C\. Kouridi, D\. Garmon, A\. Goedeckemeyer, A\. R\. Brown, A\. Vijayakumar, A\. Elqursh, S\. Jazayeri, J\. Huang, S\. M\. Carthy, J\. Hoover, L\. Kim, S\. Kumar, W\. Chen, C\. Biles, G\. Bingham, E\. Rosen, L\. Wang, Q\. Tan, D\. Engel, F\. Pongetti, D\. de Cesare, D\. Hwang, L\. Yu, J\. Pullman, S\. Narayanan, K\. Levin, S\. Gopal, M\. Li, A\. Aharoni, T\. Trinh, J\. Lo, N\. Casagrande, R\. Vij, L\. Matthey, B\. Ramadhana, A\. Matthews, C\. Carey, M\. Johnson, K\. Goranova, R\. Shah, S\. Ashraf, K\. Dasgupta, R\. Larsen, Y\. Wang, M\. R\. Vuyyuru, C\. Jiang, J\. Ijazi, K\. Osawa, C\. Smith, R\. S\. Boppana, T\. Bilal, Y\. Koizumi, Y\. Xu, Y\. Altun, N\. Shabat, B\. Bariach, A\. Korchemniy, K\. Choo, O\. Ronneberger, C\. Iwuanyanwu, S\. Zhao, D\. Soergel, C\. Hsieh, I\. Cai, S\. Iqbal, M\. Sundermeyer, Z\. Chen, E\. Bursztein, C\. Malaviya, F\. Biadsy, P\. Shroff, I\. Dhillon, T\. Latkar, C\. Dyer, H\. Forbes, M\. Nicosia, V\. Nikolaev, S\. Greene, M\. Georgiev, P\. Wang, N\. Martin, H\. Sedghi, J\. Zhang, P\. Banzal, D\. Fritz, V\. Rao, X\. Wang, J\. Zhang, V\. Patraucean, D\. Du, I\. Mordatch, I\. Jurin, L\. Liu, A\. Dubey, A\. Mohan, J\. Nowakowski, V\. Ion, N\. Wei, R\. Tojo, M\. A\. Raad, D\. A\. Hudson, V\. Keshava, S\. Agrawal, K\. Ramirez, Z\. Wu, H\. Nguyen, J\. Liu, M\. Sewak, B\. Petrini, D\. Choi, I\. Philips, Z\. Wang, I\. Bica, A\. Garg, J\. Wilkiewicz, P\. Agrawal, X\. Li, D\. Guo, E\. Xue, N\. Shaik, A\. Leach, S\. M\. Khan, J\. Wiesinger, S\. Jerome, A\. Chakladar, A\. W\. Wang, T\. Ornduff, F\. Abu, A\. Ghaffarkhah, M\. Wainwright, M\. Cortes, F\. Liu, J\. Maynez, A\. Terzis, P\. Samangouei, R\. Mansour, T\. Kępa, F\. Aubet, A\. Algymr, D\. Banica, A\. Weisz, A\. Orban, A\. Senges, E\. Andrejczuk, M\. Geller, N\. D\. Santo, V\. Anklin, M\. A\. Merey, M\. Baeuml, T\. Strohman, J\. Bai, S\. Petrov, Y\. Wu, D\. Hassabis, K\. Kavukcuoglu, J\. Dean, and O\. Vinyals \(2024\)Gemini 1\.5: unlocking multimodal understanding across millions of tokens of context\.External Links:2403\.05530,[Link](https://arxiv.org/abs/2403.05530)Cited by:[§1](https://arxiv.org/html/2605.15514#S1.p2.1)\.
- K\. Team, T\. Bai, Y\. Bai, Y\. Bao, S\. H\. Cai, Y\. Cao, Y\. Charles, H\. S\. Che, C\. Chen, G\. Chen, H\. Chen, J\. Chen, J\. Chen, J\. Chen, J\. Chen, K\. Chen, L\. Chen, R\. Chen, X\. Chen, Y\. Chen, Y\. Chen, Y\. Chen, Y\. Chen, Y\. Chen, Y\. Chen, Y\. Chen, Y\. Chen, Z\. Chen, Z\. Chen, D\. Cheng, M\. Chu, J\. Cui, J\. Deng, M\. Diao, H\. Ding, M\. Dong, M\. Dong, Y\. Dong, Y\. Dong, A\. Du, C\. Du, D\. Du, L\. Du, Y\. Du, Y\. Fan, S\. Fang, Q\. Feng, Y\. Feng, G\. Fu, K\. Fu, H\. Gao, T\. Gao, Y\. Ge, S\. Geng, C\. Gong, X\. Gong, Z\. Gongque, Q\. Gu, X\. Gu, Y\. Gu, L\. Guan, Y\. Guo, X\. Hao, W\. He, W\. He, Y\. He, C\. Hong, H\. Hu, J\. Hu, Y\. Hu, Z\. Hu, K\. Huang, R\. Huang, W\. Huang, Z\. Huang, T\. Jiang, Z\. Jiang, X\. Jin, Y\. Jing, G\. Lai, A\. Li, C\. Li, C\. Li, F\. Li, G\. Li, G\. Li, H\. Li, H\. Li, J\. Li, J\. Li, J\. Li, L\. Li, M\. Li, W\. Li, W\. Li, X\. Li, X\. Li, Y\. Li, Y\. Li, Y\. Li, Y\. Li, Z\. Li, Z\. Li, W\. Liao, J\. Lin, X\. Lin, Z\. Lin, Z\. Lin, C\. Liu, C\. Liu, H\. Liu, L\. Liu, S\. Liu, S\. Liu, S\. Liu, T\. Liu, T\. Liu, W\. Liu, X\. Liu, Y\. Liu, Y\. Liu, Y\. Liu, Y\. Liu, Y\. Liu, Z\. Liu, Z\. Liu, E\. Lu, H\. Lu, Z\. Lu, J\. Luo, T\. Luo, Y\. Luo, L\. Ma, Y\. Ma, S\. Mao, Y\. Mei, X\. Men, F\. Meng, Z\. Meng, Y\. Miao, M\. Ni, K\. Ouyang, S\. Pan, B\. Pang, Y\. Qian, R\. Qin, Z\. Qin, J\. Qiu, B\. Qu, Z\. Shang, Y\. Shao, T\. Shen, Z\. Shen, J\. Shi, L\. Shi, S\. Shi, F\. Song, P\. Song, T\. Song, X\. Song, H\. Su, J\. Su, Z\. Su, L\. Sui, J\. Sun, J\. Sun, T\. Sun, F\. Sung, Y\. Tai, C\. Tang, H\. Tang, X\. Tang, Z\. Tang, J\. Tao, S\. Teng, C\. Tian, P\. Tian, A\. Wang, B\. Wang, C\. Wang, C\. Wang, C\. Wang, D\. Wang, D\. Wang, D\. Wang, F\. Wang, H\. Wang, H\. Wang, H\. Wang, H\. Wang, H\. Wang, J\. Wang, J\. Wang, J\. Wang, K\. Wang, L\. Wang, Q\. Wang, S\. Wang, S\. Wang, S\. Wang, W\. Wang, X\. Wang, X\. Wang, Y\. Wang, Y\. Wang, Y\. Wang, Y\. Wang, Y\. Wang, Y\. Wang, Z\. Wang, Z\. Wang, Z\. Wang, Z\. Wang, Z\. Wang, Z\. Wang, C\. Wei, M\. Wei, C\. Wen, Z\. Wen, C\. Wu, H\. Wu, J\. Wu, R\. Wu, W\. Wu, Y\. Wu, Y\. Wu, Y\. Wu, Z\. Wu, C\. Xiao, J\. Xie, X\. Xie, Y\. Xie, Y\. Xin, B\. Xing, B\. Xu, J\. Xu, J\. Xu, J\. Xu, L\. H\. Xu, L\. Xu, S\. Xu, W\. Xu, X\. Xu, X\. Xu, Y\. Xu, Y\. Xu, Y\. Xu, Z\. Xu, Z\. Xu, J\. Yan, Y\. Yan, G\. Yang, H\. Yang, J\. Yang, K\. Yang, N\. Yang, R\. Yang, X\. Yang, X\. Yang, Y\. Yang, Y\. Yang, Y\. Yang, Z\. Yang, Z\. Yang, Z\. Yang, H\. Yao, D\. Ye, W\. Ye, Z\. Ye, B\. Yin, C\. Yu, L\. Yu, T\. Yu, T\. Yu, E\. Yuan, M\. Yuan, X\. Yuan, Y\. Yue, W\. Zeng, D\. Zha, H\. Zhan, D\. Zhang, H\. Zhang, J\. Zhang, P\. Zhang, Q\. Zhang, R\. Zhang, X\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Y\. Zhang, Z\. Zhang, C\. Zhao, F\. Zhao, J\. Zhao, S\. Zhao, X\. Zhao, Y\. Zhao, Z\. Zhao, H\. Zheng, R\. Zheng, S\. Zheng, T\. Zheng, J\. Zhong, L\. Zhong, W\. Zhong, M\. Zhou, R\. Zhou, X\. Zhou, Z\. Zhou, J\. Zhu, L\. Zhu, X\. Zhu, Y\. Zhu, Z\. Zhu, J\. Zhuang, W\. Zhuang, Y\. Zou, and X\. Zu \(2026a\)Kimi k2\.5: visual agentic intelligence\.External Links:2602\.02276,[Link](https://arxiv.org/abs/2602.02276)Cited by:[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p3.1),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9.2.1)\.
- K\. Team, G\. Chen, Y\. Zhang, J\. Su, W\. Xu, S\. Pan, Y\. Wang, Y\. Wang, G\. Chen, B\. Yin, Y\. Chen, J\. Yan, M\. Wei, Y\. Zhang, F\. Meng, C\. Hong, X\. Xie, S\. Liu, E\. Lu, Y\. Tai, Y\. Chen, X\. Men, H\. Guo, Y\. Charles, H\. Lu, L\. Sui, J\. Zhu, Z\. Zhou, W\. He, W\. Huang, X\. Xu, Y\. Wang, G\. Lai, Y\. Du, Y\. Wu, Z\. Yang, and X\. Zhou \(2026b\)Attention residuals\.External Links:2603\.15031Cited by:[Appendix E](https://arxiv.org/html/2605.15514#A5.p3.1)\.
- Together AI \(n\.d\.\)Together AI Docs\.Note:[https://docs\.together\.ai/](https://docs.together.ai/)Accessed: 2026\-05\-04Cited by:[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p4.1)\.
- A\. M\. Turing \(1950\)Computing machinery and intelligence\.Mind59\(236\),pp\. 433–460\(English\)\.External Links:ISSN 00264423,[Link](http://www.jstor.org/stable/2251299)Cited by:[§3\.1](https://arxiv.org/html/2605.15514#S3.SS1.p4.1)\.
- S\. Tworkowski, K\. Staniszewski, M\. Pacek, Y\. Wu, H\. Michalewski, and P\. Miłoś \(2023\)Focused transformer: contrastive training for context scaling\.External Links:2307\.03170Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1)\.
- A\. Vaswani, N\. Shazeer, N\. Parmar, J\. Uszkoreit, L\. Jones, A\. N\. Gomez, Ł\. Kaiser, and I\. Polosukhin \(2017\)Attention is all you need\.InAdvances in Neural Information Processing Systems,Vol\.30\.Cited by:[§1](https://arxiv.org/html/2605.15514#S1.p1.1),[§2](https://arxiv.org/html/2605.15514#S2.p1.1)\.
- J\. Wang, T\. Ji, Y\. Wu, H\. Yan, T\. Gui, Q\. Zhang, X\. Huang, and X\. Wang \(2024\)Length generalization of causal transformers without position encoding\.External Links:2404\.12224,[Link](https://arxiv.org/abs/2404.12224)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1)\.
- T\. Wolf, L\. Debut, V\. Sanh, J\. Chaumond, C\. Delangue, A\. Moi, P\. Cistac, T\. Rault, R\. Louf, M\. Funtowicz, J\. Davison, S\. Shleifer, P\. von Platen, C\. Ma, Y\. Jernite, J\. Plu, C\. Xu, T\. Le Scao, S\. Gugger, M\. Drame, Q\. Lhoest, and A\. M\. Rush \(2020\)Transformers: state\-of\-the\-art natural language processing\.InProceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations,Online,pp\. 38–45\.External Links:[Link](https://aclanthology.org/2020.emnlp-demos.6)Cited by:[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p4.1)\.
- W\. Wu, Y\. Wang, G\. Xiao, H\. Peng, and Y\. Fu \(2024\)Retrieval head mechanistically explains long\-context factuality\.External Links:2404\.15574,[Link](https://arxiv.org/abs/2404.15574)Cited by:[Appendix E](https://arxiv.org/html/2605.15514#A5.p2.1)\.
- G\. Xiao, Y\. Tian, B\. Chen, S\. Han, and M\. Lewis \(2023\)Efficient streaming language models with attention sinks\.arXiv\.Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px1.p1.1)\.
- W\. Xiong, J\. Liu, I\. Molybog, H\. Zhang, P\. Bhargava, R\. Hou, L\. Martin, R\. Rungta, K\. A\. Sankararaman, B\. Oguz, M\. Khabsa, H\. Fang, Y\. Mehdad, S\. Narang, K\. Malik, A\. Fan, S\. Bhosale, S\. Edunov, M\. Lewis, S\. Wang, and H\. Ma \(2024\)Effective long\-context scaling of foundation models\.InProceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 1: Long Papers\),K\. Duh, H\. Gomez, and S\. Bethard \(Eds\.\),Mexico City, Mexico,pp\. 4643–4663\.External Links:[Link](https://aclanthology.org/2024.naacl-long.260/),[Document](https://dx.doi.org/10.18653/v1/2024.naacl-long.260)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px3.p1.1),[§2\.2](https://arxiv.org/html/2605.15514#S2.SS2.p1.1)\.
- M\. Xu, X\. Men, B\. Wang, Q\. Zhang, H\. Lin, Y\. Lu, X\. Han, and W\. Chen \(2024\)Base of rope bounds context length\.InAdvances in Neural Information Processing Systems,A\. Globerson, L\. Mackey, D\. Belgrave, A\. Fan, U\. Paquet, J\. Tomczak, and C\. Zhang \(Eds\.\),Vol\.37,pp\. 87386–87410\.External Links:[Document](https://dx.doi.org/10.52202/079017-2773),[Link](https://proceedings.neurips.cc/paper_files/paper/2024/file/9f12dd32d552f3ad9eaa0e9dfec291be-Paper-Conference.pdf)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1),[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px3.p1.1),[§2\.2](https://arxiv.org/html/2605.15514#S2.SS2.p1.1)\.
- A\. Yang, A\. Li, B\. Yang, B\. Zhang, B\. Hui, B\. Zheng, B\. Yu, C\. Gao, C\. Huang, C\. Lv, C\. Zheng, D\. Liu, F\. Zhou, F\. Huang, F\. Hu, H\. Ge, H\. Wei, H\. Lin, J\. Tang, J\. Yang, J\. Tu, J\. Zhang, J\. Yang, J\. Yang, J\. Zhou, J\. Zhou, J\. Lin, K\. Dang, K\. Bao, K\. Yang, L\. Yu, L\. Deng, M\. Li, M\. Xue, M\. Li, P\. Zhang, P\. Wang, Q\. Zhu, R\. Men, R\. Gao, S\. Liu, S\. Luo, T\. Li, T\. Tang, W\. Yin, X\. Ren, X\. Wang, X\. Zhang, X\. Ren, Y\. Fan, Y\. Su, Y\. Zhang, Y\. Zhang, Y\. Wan, Y\. Liu, Z\. Wang, Z\. Cui, Z\. Zhang, Z\. Zhou, and Z\. Qiu \(2025a\)Qwen3 technical report\.External Links:2505\.09388,[Link](https://arxiv.org/abs/2505.09388)Cited by:[§D\.2](https://arxiv.org/html/2605.15514#A4.SS2.p3.1),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9),[Figure 9](https://arxiv.org/html/2605.15514#S5.F9.2.1)\.
- B\. Yang, B\. Venkitesh, D\. Talupuru, H\. Lin, D\. Cairuz, P\. Blunsom, and A\. Locatelli \(2025b\)Rope to nope and back again: a new hybrid attention strategy\.External Links:2501\.18795,[Link](https://arxiv.org/abs/2501.18795)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1)\.
- M\. Zhong, C\. Zhang, Y\. Lei, X\. Liu, Y\. Gao, Y\. Hu, K\. Chen, and M\. Zhang \(2024\)Understanding the rope extensions of long\-context llms: an attention perspective\.External Links:2406\.13282,[Link](https://arxiv.org/abs/2406.13282)Cited by:[Appendix F](https://arxiv.org/html/2605.15514#A6.SS0.SSS0.Px2.p1.1)\.
## Appendix ARotary Positional Embedding
LetX=\(x0,x1,…,xM−1\)X=\(x\_\{0\},x\_\{1\},\\ldots,x\_\{M\-1\}\)be the input word embeddings, whereMMis the number of input tokens, andxi∈ℝdx\_\{i\}\\in\\mathbb\{R\}^\{d\}be the word embedding of tokenii\. The word embeddings are then transformed into query, key and value representations, the transformation typically being linear, where the positional information is embedded\.
RoPE applies the same multiplication\-based positional embedding to the query vector𝐪\\mathbf\{q\}and key vector𝐤\\mathbf\{k\}:
q^i=RΘ,idqi=RΘ,idWQxi,\\displaystyle\\hat\{q\}\_\{i\}=R\_\{\\Theta,i\}^\{d\}q\_\{i\}=R\_\{\\Theta,i\}^\{d\}W\_\{Q\}x\_\{i\},k^j=RΘ,jdkj=RΘ,jdWKxj,\\displaystyle\\hat\{k\}\_\{j\}=R\_\{\\Theta,j\}^\{d\}k\_\{j\}=R\_\{\\Theta,j\}^\{d\}W\_\{K\}x\_\{j\},
where
RΘ,md=\(cosmθ0−sinmθ000…00sinmθ0cosmθ000…0000cosmθ1−sinmθ1…0000sinmθ1cosmθ1…00⋮⋮⋮⋮⋱⋮⋮0000…cosmθd/2−1−sinmθd/2−10000…sinmθd/2−1cosmθd/2−1\)\.R\_\{\\Theta,m\}^\{d\}=\\begin\{pmatrix\}\\cos m\\theta^\{0\}&\-\\sin m\\theta^\{0\}&0&0&\\ldots&0&0\\\\ \\sin m\\theta^\{0\}&\\cos m\\theta^\{0\}&0&0&\\ldots&0&0\\\\ 0&0&\\cos m\\theta^\{1\}&\-\\sin m\\theta^\{1\}&\\ldots&0&0\\\\ 0&0&\\sin m\\theta^\{1\}&\\cos m\\theta^\{1\}&\\ldots&0&0\\\\ \\vdots&\\vdots&\\vdots&\\vdots&\\ddots&\\vdots&\\vdots\\\\ 0&0&0&0&\\ldots&\\cos m\\theta^\{d/2\-1\}&\-\\sin m\\theta^\{d/2\-1\}\\\\ 0&0&0&0&\\ldots&\\sin m\\theta^\{d/2\-1\}&\\cos m\\theta^\{d/2\-1\}\\\\ \\end\{pmatrix\}\.
The attention mechanism features the “attention score”, defined as
A=softmax\(Q^⊺K^d\),A=\\text\{softmax\}\\left\(\\frac\{\\hat\{Q\}^\{\\intercal\}\\hat\{K\}\}\{\\sqrt\{d\}\}\\right\),
whereQ^=\(q^0,q^1,…,q^M−1\)\\hat\{Q\}=\(\\hat\{q\}\_\{0\},\\hat\{q\}\_\{1\},\\ldots,\\hat\{q\}\_\{M\-1\}\)andK^=\(k^0,k^1,…,k^M−1\)\\hat\{K\}=\(\\hat\{k\}\_\{0\},\\hat\{k\}\_\{1\},\\ldots,\\hat\{k\}\_\{M\-1\}\)\.
The attention scoreai,ja\_\{i,j\}is the normalization of the inner product betweenq^i\\hat\{q\}\_\{i\}andk^j\\hat\{k\}\_\{j\}\. For the sake of simplicity, we call this inner product the “RoPE product”\. RoPE is designed such that only the relative distance,i−ji\-j, matters in RoPE product:
q^i⊺k^j=\(RΘ,idqi\)⊺\(RΘ,jdkj\)=qiRΘ,i−jdkj\.\\hat\{q\}^\{\\intercal\}\_\{i\}\\hat\{k\}\_\{j\}=\(R\_\{\\Theta,i\}^\{d\}q\_\{i\}\)^\{\\intercal\}\(R\_\{\\Theta,j\}^\{d\}k\_\{j\}\)=q\_\{i\}R\_\{\\Theta,i\-j\}^\{d\}k\_\{j\}\.
##### Conventions
We use the following conventions throughout this paper:
- •All indices start from 0;
- •dd— hidden dimension of an attention head;
- •h≡d/2h\\equiv d/2— half dimension;
- •BB— the RoPE base \(also called “the RoPE theta” in some literature\);
- •θ≡B−1/h\\theta\\equiv B^\{\-1/h\}— the basic RoPE frequency \(not “the RoPE theta”\);
- •mm— the distance between the query token,tokidxquery\\text\{tok\}\_\{\\text\{idx\}\_\{\\text\{query\}\}\}, and the key token,tokidxkey\\text\{tok\}\_\{\\text\{idx\}\_\{\\text\{key\}\}\}, defined asm=idxquery−idxkeym=\\text\{idx\}\_\{\\text\{query\}\}\-\\text\{idx\}\_\{\\text\{key\}\}\. For causal models,m≥0m\\geq 0;
- •𝐪,𝐤\\mathbf\{q\},\\mathbf\{k\}— the query and key vectors;
- •S𝐪,𝐤\(m\)S\_\{\\mathbf\{q\},\\mathbf\{k\}\}\(m\)— the RoPE product of the given query and key vectors, w\.r\.t\. their distancemm\. By default, when referring to𝐪\\mathbf\{q\}and𝐤\\mathbf\{k\}, we use the abbreviatedS\(m\)S\(m\);
- •𝐚,ϕ\\mathbf\{a\},\\bm\{\\phi\}— the amplitudes and phases of the RoPE product, defined as an=\\displaystyle a\_\{n\}=an\(𝐪,𝐤\)=\(q2n2\+q2n\+12\)\(k2n2\+k2n\+12\),\\displaystyle a\_\{n\}\(\\mathbf\{q\},\\mathbf\{k\}\)=\\sqrt\{\(q\_\{2n\}^\{2\}\+q\_\{2n\+1\}^\{2\}\)\(k\_\{2n\}^\{2\}\+k\_\{2n\+1\}^\{2\}\)\},ϕn=\\displaystyle\\phi\_\{n\}=ϕn\(𝐪,𝐤\)=atan2\(q2nk2n\+1−q2n\+1k2n,q2nk2n\+q2n\+1k2n\+1\);\\displaystyle\\phi\_\{n\}\(\\mathbf\{q\},\\mathbf\{k\}\)=\\text\{atan2\}\(q\_\{2n\}k\_\{2n\+1\}\-q\_\{2n\+1\}k\_\{2n\},q\_\{2n\}k\_\{2n\}\+q\_\{2n\+1\}k\_\{2n\+1\}\);
- •λ\(M\)\\lambda\(M\)— the threshold dimensionλ\(M\)=Θ\(hlogBM\)\\lambda\(M\)=\\Theta\(h\\log\_\{B\}M\)\.
Table 2:A summary of notations we use\.
##### The High and Low Frequencies of RoPE Product
We use the threshold valueλ=λ\(M\)=Θ\(hlogBM\)\\lambda=\\lambda\(M\)=\\Theta\(h\\log\_\{B\}M\)to separate high and low frequencies: the terms with smaller indices,n≪λ\(M\)n\\ll\\lambda\(M\), are considered high frequency terms, and the others are low frequency terms\. This is not a strict division; generally, low frequency terms should rotate no more than a complete circle within the context length limit\.
The high frequency components correspond to the oscillation effect\. Across the distancemm, these rapid rotations create a distinction in the RoPE products of close position pairs\.
The low frequency components cause the decaying effect \(the recency bias feature\)\. The low frequency terms rotate slowly, and are generally within the decaying interval\. More specifically, whenn≫λ\(M\)n\\gg\\lambda\(M\), we havemθn\+ϕn∈\[0,π\]m\\theta^\{n\}\+\\phi\_\{n\}\\in\[0,\\pi\], socos\(mθn\+ϕn\)\\cos\(m\\theta^\{n\}\+\\phi\_\{n\}\)decreases withmmonm∈\[0,M\)m\\in\[0,M\)\. This decaying effect identifies distant positions\.[Fig\.˜2\(b\)](https://arxiv.org/html/2605.15514#S2.F2.sf2)illustrates both the oscillation and the decaying effect\.
The low frequency components also help preserve token relevance\. For a low frequency termn≫λ\(M\)n\\gg\\lambda\(M\)with very little rotation,mθn\+ϕn≈ϕnm\\theta^\{n\}\+\\phi\_\{n\}\\approx\\phi\_\{n\}, and the cosine term changes little from its initial value\. It has been shown\(Miranda and others,[2024](https://arxiv.org/html/2605.15514#bib.bib37); Jonasson,[2025](https://arxiv.org/html/2605.15514#bib.bib44)\)that for query\-key pairs that reflect longer text dependency, the low frequency terms tend to have higher amplitudesana\_\{n\}, so that the RoPE product is less affected by the distance\.
##### The Natural Context Length Limit
If the context lengthMMis too large, even the lowest frequency term begins to oscillate\. From a signal processing perspective, the lowest frequency termn=h−1n=h\-1determines the fundamental frequencyθh−1=B−h−1h≈B−1\\theta^\{h\-1\}=B^\{\-\\frac\{h\-1\}\{h\}\}\\approx B^\{\-1\}, with a fundamental wavelength of2πB2\\pi B666Assuming that the lowest frequency amplitudeah−1\>0a\_\{h\-1\}\>0\.\. IfM≥2πBM\\geq 2\\pi B, the fundamental frequency term loses its uniqueness and the positional embedding becomes ambiguous\(Liu,[2026](https://arxiv.org/html/2605.15514#bib.bib36)\)\. Therefore, given a RoPE baseBB,M<2πBM<2\\pi Bis a natural upperbound for context lengthMM\. If we expect RoPE to maintain recency bias, then the lowest frequencies must be in their decreasing phase, lowering this bound even further to aroundπB\\pi B\. In this paper, we use a rough estimationΘ\(B\)\\Theta\(B\)as the natural context length limit; by default,MMdoes not exceed this limit\.
##### Decay
It is worth noticing that for the actual RoPE productS\(m\)S\(m\), the decay is not universal\. First, the decay is the collective effect of multiple low\-frequency rotations, so it occurs only within an interval, after which even the lowest frequency starts oscillating\. Second, it is possible that the RoPE product does not decay from the beginning; the initial decay only occurs when the low frequency phasesϕn\\phi\_\{n\}are mostly small\(<π/2\)\(<\\pi/2\)\. In fact, for any distancemm, we may construct a phase vectorϕ\\bm\{\\phi\}so thatS\(m\)S\(m\)reaches its maxima atmm\(Miranda and others,[2024](https://arxiv.org/html/2605.15514#bib.bib37)\)777A more accurate statement on decay should be: ifS~∼N\(μM,σM2\)\\widetilde\{S\}\\sim N\(\\mu\_\{M\},\\sigma\_\{M\}^\{2\}\), then the upperbounds of the 99\.7% probability thresholdμM\+3σM\\mu\_\{M\}\+3\\sigma\_\{M\}decrease withM∈\[0,Bh1/h\)M\\in\[0,B^\{h\_\{1\}/h\}\), whereh1h\_\{1\}is the largest index such thatah1/amax≫0a\_\{h\_\{1\}\}/a\_\{\\max\}\\gg 0, i\.e\. the lowest frequency component with a non\-negligible amplitude\.\. It is not uncommon in reality thatS\(m\)S\(m\)reaches its peak before starting the decay\. However, as we show in[Section˜3](https://arxiv.org/html/2605.15514#S3), the decay is a preferred behavior: a lack of decay indicates that there is no global monotonicity, leading to a failure to identify distant positions \(position inversion\)\.
##### Non\-Uniform Rotary Amplitudes
We assume that the magnitudes\{an\}\\\{a\_\{n\}\\\}across frequency terms are relatively uniform\. When, as seen in real models, the low frequency terms instead have a negligible magnitude compared to high frequency ones, the actual base wavelength shrinks to match with the first term with a substantial magnitude\. This in effect equals applying a smallerBB: it shortens the natural context length limit, and causes a shorter decay interval\.
## Appendix BRoPE Product Can Be Seen as a Normal Variable
Consider the high frequency parts wheren<λ\(m\)n<\\lambda\(m\)\. For any integer0<A≤h0<A\\leq h, define the partial RoPE product as
Sn<A\(m\)=∑n<Aancos\(mθn\+ϕn\)\.S\_\{n<A\}\(m\)=\\sum\_\{n<A\}a\_\{n\}\\cos\(m\\theta^\{n\}\+\\phi\_\{n\}\)\.
We shall show that ifmmis uniformly chosen on\[A,M\)\[A,M\)whereM−AM\-Ais large, thenSn<λ\(M\)\(m\)S\_\{n<\\lambda\(M\)\}\(m\)heuristically behaves like a normal variable\. Then, by estimating the low dimension terms asSn≥λ\(M\)\(m\)≈∑n≥λ\(M\)ancosϕnS\_\{n\\geq\\lambda\(M\)\}\(m\)\\approx\\sum\_\{n\\geq\\lambda\(M\)\}a\_\{n\}\\cos\\phi\_\{n\}, we can estimate the distribution of the whole RoPE product\.
Suppose that we are interested in the integer intervalIA=\[A,A\+M\)I\_\{A\}=\[A,A\+M\), on whichmmis a uniform random variable\. OnIAI\_\{A\}, define the mean exponential sum
GM\(α,A\)=\\displaystyle G\_\{M\}\(\\alpha,A\)=1M∑m=AA\+M−1eiαm\\displaystyle\\frac\{1\}\{M\}\\sum\_\{m=A\}^\{A\+M\-1\}e^\{i\\alpha m\}=\\displaystyle=sin\(Mα/2\)Msin\(α/2\)eiα\(A\+\(M−1\)/2\)\.\\displaystyle\\frac\{\\sin\(M\\alpha/2\)\}\{M\\sin\(\\alpha/2\)\}e^\{i\\alpha\(A\+\(M\-1\)/2\)\}\.
We have
\|GM\(α,A\)\|≪min\(1,1Msin\(α/2\)\)\.\|G\_\{M\}\(\\alpha,A\)\|\\ll\\min\\left\(1,\\frac\{1\}\{M\\sin\(\\alpha/2\)\}\\right\)\.
For higher frequencies,M≫1sin\(α/2\)M\\gg\\frac\{1\}\{\\sin\(\\alpha/2\)\}, and\|GM\(α,A\)\|≪2/Mθn\.\|G\_\{M\}\(\\alpha,A\)\|\\ll 2/M\\theta^\{n\}\.
##### The Moments: Expectation and Variance
The mean cosine sum,μM\(A\)\\mu\_\{M\}\(A\), can be defined as
μM\(A\)=\\displaystyle\\mu\_\{M\}\(A\)=1M∑m=AA\+M−1S\(m\)\\displaystyle\\frac\{1\}\{M\}\\sum\_\{m=A\}^\{A\+M\-1\}S\(m\)=\\displaystyle=∑n=0λ\(m\)−1anℜ\(eiϕnGM\(θn,A\)\)\.\\displaystyle\\sum\_\{n=0\}^\{\\lambda\(m\)\-1\}a\_\{n\}\\Re\(e^\{i\\phi\_\{n\}\}G\_\{M\}\(\\theta^\{n\},A\)\)\.
Let us first calculate the variances of individual frequency terms\. For the weighted cosine value at thenn\-th dimension pair, the termΨn=ancos\(mθn\+ϕn\)\\Psi\_\{n\}=a\_\{n\}\\cos\(m\\theta^\{n\}\+\\phi\_\{n\}\)is a random variable, with the following results:
Em\[Ψn\]=\\displaystyle E\_\{m\}\[\\Psi\_\{n\}\]=anℜ\(eiϕnGM\(θn,A\)\)≈2an/Mθn→0,\\displaystyle a\_\{n\}\\Re\(e^\{i\\phi\_\{n\}\}G\_\{M\}\(\\theta^\{n\},A\)\)\\approx 2a\_\{n\}/M\\theta^\{n\}\\to 0,Em\[Ψn2\]=\\displaystyle E\_\{m\}\[\\Psi\_\{n\}^\{2\}\]=an22\(1\+ℜ\(e2iϕnGM\(2θn,A\)\)\)≈an22\(1\+14Mθn\)→an22\.\\displaystyle\\frac\{a\_\{n\}^\{2\}\}\{2\}\\left\(1\+\\Re\(e^\{2i\\phi\_\{n\}\}G\_\{M\}\(2\\theta^\{n\},A\)\)\\right\)\\approx\\frac\{a\_\{n\}^\{2\}\}\{2\}\\left\(1\+\\frac\{1\}\{4M\\theta^\{n\}\}\\right\)\\to\\frac\{a\_\{n\}^\{2\}\}\{2\}\.
Next, let us estimate the cross variance terms\. Letn,pn,pbe two frequency indices such thatn<pn<p\. Usingcosacosb=12cos\(a\+b\)\+12cos\(a−b\)\\cos a\\cos b=\\frac\{1\}\{2\}\\cos\(a\+b\)\+\\frac\{1\}\{2\}\\cos\(a\-b\), andθn−θp≍θn\+θp≍θn,\\theta^\{n\}\-\\theta^\{p\}\\asymp\\theta^\{n\}\+\\theta^\{p\}\\asymp\\theta^\{n\},
\|Em\[ΨnΨp\]\|≪anapM\(1−θ\)θn∼anapMθn\(1/2\+hlogB\)\.\\displaystyle\|E\_\{m\}\[\\Psi\_\{n\}\\Psi\_\{p\}\]\|\\ll\\frac\{a\_\{n\}a\_\{p\}\}\{M\(1\-\\theta\)\\theta^\{n\}\}\\sim\\frac\{a\_\{n\}a\_\{p\}\}\{M\\theta^\{n\}\}\(1/2\+\\frac\{h\}\{\\log B\}\)\.
WhenMθn≫1M\\theta^\{n\}\\gg 1\(h/logBh/\\log Bto be exact\), the only significant terms related to the variance are the variants of individual cosine terms, and we may ignore the covariances, withO\(h/logB\)O\(h/\\log B\)exceptions of sizeO\(anaph/logB\)O\(a\_\{n\}a\_\{p\}h/\\log B\)\.
Var\(Sn<λ\(M\)\)=\\displaystyle Var\(S\_\{n<\\lambda\(M\)\}\)=∑n<λ\(M\)Var\(Ψn\)\+∑n<λ\(M\)∑n<p<λ\(M\)Cov\(Ψn,Ψp\)\\displaystyle\\sum\_\{n<\\lambda\(M\)\}Var\(\\Psi\_\{n\}\)\+\\sum\_\{n<\\lambda\(M\)\}\\sum\_\{n<p<\\lambda\(M\)\}Cov\(\\Psi\_\{n\},\\Psi\_\{p\}\)≍\\displaystyle\\asymp∑nan2/2\+o\(∑n,panaplog2B\)\.\\displaystyle\\sum\_\{n\}a\_\{n\}^\{2\}/2\+o\(\\frac\{\\sum\_\{n,p\}a\_\{n\}a\_\{p\}\}\{\\log^\{2\}B\}\)\.
The second \(covariance\) term depends on11−θ=Θ\(h/logB\+1/2\)\.\\frac\{1\}\{1\-\\theta\}=\\Theta\(h/\\log B\+1/2\)\.We shall proceed to show that this term may be neglected\. In fact, if the numbers
12π,θ2π,…,θλ\(M\)2π\\displaystyle\\frac\{1\}\{2\\pi\},\\frac\{\\theta\}\{2\\pi\},\\ldots,\\frac\{\\theta^\{\\lambda\(M\)\}\}\{2\\pi\}\(1\)
are linearly independent overℚ\\mathbb\{Q\}\(i\.e\. for any𝐤∈ℚλ\(M\)\+1\\mathbf\{k\}\\in\\mathbb\{Q\}^\{\\lambda\(M\)\+1\},∑nknθn/2π=0\\sum\_\{n\}k\_\{n\}\\theta^\{n\}/2\\pi=0iff𝐤=𝟎\\mathbf\{k\}=\\mathbf\{0\}\), then according to the multi\-dimensional generalization of Weyl’s Criterion, the vector sequence\{𝐯m\}\\\{\\mathbf\{v\}\_\{m\}\\\}is equidistributed modulo11, where
𝐯m=\(m2π,mθ2π,…,mθλ\(M\)2π\)\.\\mathbf\{v\}\_\{m\}=\(\\frac\{m\}\{2\\pi\},\\frac\{m\\theta\}\{2\\pi\},\\ldots,\\frac\{m\\theta^\{\\lambda\(M\)\}\}\{2\\pi\}\)\.
The independence of sequence[1](https://arxiv.org/html/2605.15514#A2.E1)is equivalent to that of the sequence
1,θ,…,θλ\(M\)\.1,\\theta,\\ldots,\\theta^\{\\lambda\(M\)\}\.
Indeed, this sequence is linearly dependent overℚ\\mathbb\{Q\}if and only ifθ\\thetais a root of a rational polynomial of degree at mostλ\(M\)<h\\lambda\(M\)<h\.
##### Pseudo Independence
Sinceθ=B−1/h\\theta=B^\{\-1/h\}, or equivalentlyBθh−1=0B\\theta^\{h\}\-1=0, wherehhis a positive integer,θ\\thetamay be a root of such a polynomial only ifBBis a perfect power, i\.e\.∃g,c,α,β,γi∈ℕ\\exists g,c,\\alpha,\\beta,\\gamma\_\{i\}\\in\\mathbb\{N\}s\.t\.B=cβB=c^\{\\beta\},c=∏ipiγic=\\prod\_\{i\}p\_\{i\}^\{\\gamma\_\{i\}\},g=β⋅gcdi\{γi\}g=\\beta\\cdot\\gcd\_\{i\}\\\{\\gamma\_\{i\}\\\}andgcd\(g,h\)\>1\\text\{gcd\}\(g,h\)\>1\. Actually, this can be easily constructed: an example isB=65536=216,h=32B=65536=2^\{16\},h=32, whereθ=1/2\\theta=1/\\sqrt\{2\}is a root with degree 2\. However, even ifθk\\theta^\{k\}is rational for somek=h/gcd\(g,h\)k=h/\\text\{gcd\}\(g,h\), this only means that the sequence can be divided intoO\(h/k\)=O\(gcd\(g,h\)\)O\(h/k\)=O\(\\text\{gcd\}\(g,h\)\)independent groups of sizeO\(k\)O\(k\)\. One bound is thatk≥2k\\geq 2wheneverB<2hB<2^\{h\}\. For most cases whereBBis not a perfect power,gcd\(g,h\)=1,k=h\\gcd\(g,h\)=1,k=h\. Therefore, we can heuristically viewXj=mθjX\_\{j\}=m\\theta^\{j\}as \(largely\) independent random variables that follow uniform distribution on\[0,2π\)\[0,2\\pi\), with negligible covariances between any two terms\.
##### What ifkkis small?
We only need to study the covariances of the dependent pairs\. Letn,pn,pbe the indices of a dependent pair wheren<p,n<λ\(M\),B=bh/k,θ=b−1/k,b≥2n<p,n<\\lambda\(M\),B=b^\{h/k\},\\theta=b^\{\-1/k\},b\\geq 2,k=2k=2\(the smallestkkpossible\)\. Thenp=cknp=cknfor some integerc≥1c\\geq 1\.
ΨnΨp=\\displaystyle\\Psi\_\{n\}\\Psi\_\{p\}=12anap\(cos\(mθn\+mθp\+ϕn\+ϕp\)\+cos\(mθn−mθp\+ϕn−ϕp\)\)\\displaystyle\\frac\{1\}\{2\}a\_\{n\}a\_\{p\}\(\\cos\(m\\theta^\{n\}\+m\\theta^\{p\}\+\\phi\_\{n\}\+\\phi\_\{p\}\)\+\\cos\(m\\theta^\{n\}\-m\\theta^\{p\}\+\\phi\_\{n\}\-\\phi\_\{p\}\)\)
wheremθn\+mθp=mθn\(1\+θ\(ck−1\)n\)≥mθn,m\\theta^\{n\}\+m\\theta^\{p\}=m\\theta^\{n\}\(1\+\\theta^\{\(ck\-1\)n\}\)\\geq m\\theta^\{n\},mθn−mθp=mθn\(1−θ\(ck−1\)n\)≥mθn\(1−θn\),m\\theta^\{n\}\-m\\theta^\{p\}=m\\theta^\{n\}\(1\-\\theta^\{\(ck\-1\)n\}\)\\geq m\\theta^\{n\}\(1\-\\theta^\{n\}\),
so
Em\[ΨnΨp\]≪anapMθn\(1−θ\)=anapMθn\(1−b−1/2\)≤anap\(1−1/2\)Mθn=o\(anap\)\.E\_\{m\}\[\\Psi\_\{n\}\\Psi\_\{p\}\]\\ll\\frac\{a\_\{n\}a\_\{p\}\}\{M\\theta^\{n\}\(1\-\\theta\)\}=\\frac\{a\_\{n\}a\_\{p\}\}\{M\\theta^\{n\}\(1\-b^\{\-1/2\}\)\}\\leq\\frac\{a\_\{n\}a\_\{p\}\}\{\(1\-1/\\sqrt\{2\}\)M\\theta^\{n\}\}=o\(a\_\{n\}a\_\{p\}\)\.
Ifkkis small, the covariances between dependent terms become much smaller than the variance terms \(Θ\(an2\)\\Theta\(a\_\{n\}^\{2\}\)\) and may be ignored\.
##### Normal Approximation
Since\{an\}\\\{a\_\{n\}\\\}is assumed with no dominating terms, we can apply Lindenberg’s CLT and approximate the sumSn<λ\(M\)S\_\{n<\\lambda\(M\)\}as a normal distributed random variable with zero mean\.
The estimated distribution of the full RoPE sum is therefore:
S~M∼N\(μM,σM2\),\\displaystyle\\widetilde\{S\}\_\{M\}\\sim N\(\\mu\_\{M\},\\sigma^\{2\}\_\{M\}\),\(2\)
where
μ≈\\displaystyle\\mu\\approx∑n=λ\(M\)h−1ancosϕn≤∑n=λ\(M\)h−1an,\\displaystyle\\sum\_\{n=\\lambda\(M\)\}^\{h\-1\}a\_\{n\}\\cos\\phi\_\{n\}\\leq\\sum\_\{n=\\lambda\(M\)\}^\{h\-1\}a\_\{n\},\(3\)σ≈\\displaystyle\\sigma\\approx∑n=0λ\(M\)−1an22\.\\displaystyle\\sqrt\{\\sum\_\{n=0\}^\{\\lambda\(M\)\-1\}\\frac\{a\_\{n\}^\{2\}\}\{2\}\}\.\(4\)
##### Error Estimation
Since CLT is used to derive the normal approximation, it is good whenλ\(M\)\\lambda\(M\)is large\. Following the Berry\-Esseen Theorem\(Esseen,[1942](https://arxiv.org/html/2605.15514#bib.bib11)\), the distribution approximation error is on the order ofO\(ρσ3λ\(M\)\),O\\left\(\\frac\{\\rho\}\{\\sigma^\{3\}\\sqrt\{\\lambda\(M\)\}\}\\right\),whereρ=E\(\|ancosxn\|3\)=O\(an3\)\.\\rho=E\(\|a\_\{n\}\\cos x\_\{n\}\|^\{3\}\)=O\(a\_\{n\}^\{3\}\)\.Therefore, the error is
O\(1λ\(M\)\)\.O\\left\(\\frac\{1\}\{\\sqrt\{\\lambda\(M\)\}\}\\right\)\.
Empirically, the practical convergence is usually better, andλ\(M\)\>20\\lambda\(M\)\>20is usually good enough\. Forh=64h=64, this means that the estimation is good whenM\>B3M\>\\sqrt\[3\]\{B\}\.
### B\.1RoPE Scaling
For any variant of RoPE, we need to analyze the linear independence of its frequencies \(angular frequenciesωn\\omega\_\{n\}over2π2\\pi\), i\.e\.
ω02π,ω12π,…,ωλ\(M\)2π\\frac\{\\omega\_\{0\}\}\{2\\pi\},\\frac\{\\omega\_\{1\}\}\{2\\pi\},\\ldots,\\frac\{\\omega\_\{\\lambda\(M\)\}\}\{2\\pi\}
We study RoPE scalings where thenn\-th angular frequency is a polynomial ofθn\\theta^\{n\}, i\.e\.
ωn=∑p=0Enκn,pθnp,κn,En\>0,En\>0\.\\omega\_\{n\}=\\sum\_\{p=0\}^\{E\_\{n\}\}\\kappa\_\{n,p\}\\theta^\{np\},\\kappa\_\{n,E\_\{n\}\}\>0,E\_\{n\}\>0\.
This includes most RoPE scaling variants, such as the NTK scaling\(/u/bloc97,[2023](https://arxiv.org/html/2605.15514#bib.bib8)\)used in Llama models\.
If allκn,p\\kappa\_\{n,p\}are rational, then such independence can be largely analyzed the same way: it can be secured ifθ\\thetais not a root of any rational polynomial ofλ\(M\)⋅max\{En\}\\lambda\(M\)\\cdot\\max\\\{E\_\{n\}\\\}\. Again, this is rarely the case\. If for some specific selections ofBBandhhh,θkmaxEn\\theta^\{k\\max E\_\{n\}\}is rational for somek\>1k\>1, then1−θ1\-\\thetashould beO\(1\)O\(1\), and the resulting covariances of the dependent terms should also be negligible\.
The subsequent analyses are similar\. The only major difference is thatλ\(M\)\\lambda\(M\)should be modified accordingly to satisfyMωλ\(M\)=Θ\(1\)M\\omega\_\{\\lambda\(M\)\}=\\Theta\(1\)\.
## Appendix CThe Failure Modes
### C\.1Position Inversion
###### Definition C\.1\.
For a pair of query and key vectors𝐪,𝐤\\mathbf\{q\},\\mathbf\{k\}, context length limitMM, uniformly selectm1∈\[0,M/2\)m\_\{1\}\\in\[0,M/2\)andm2∈\[M/2,M\)m\_\{2\}\\in\[M/2,M\)\. Aposition inversionoccurs for the pair\(m1,m2\)\(m\_\{1\},m\_\{2\}\)if and only ifS\(m1\)<S\(m2\)\.S\(m\_\{1\}\)<S\(m\_\{2\}\)\.The probability of “position inversion” can be defined as
Pr\(inversion\|θ,M,𝐪,𝐤\)=Pr\(S𝐪,𝐤,θ\(m1\)<S𝐪,𝐤,θ\(m2\)\)\.\\displaystyle Pr\(\\text\{inversion\}\|\\theta,M,\\mathbf\{q\},\\mathbf\{k\}\)=Pr\(S\_\{\\mathbf\{q\},\\mathbf\{k\},\\theta\}\(m\_\{1\}\)<S\_\{\\mathbf\{q\},\\mathbf\{k\},\\theta\}\(m\_\{2\}\)\)\.
The difference between the two RoPE products,
D=\\displaystyle D=S\(m1\)−S\(m2\),\\displaystyle S\(m\_\{1\}\)\-S\(m\_\{2\}\),
may be separately viewed as the difference of two independent normal variables following[Appendix˜B](https://arxiv.org/html/2605.15514#A2):
D~=S~M/2−S~M∼N\(μ1−μ2,σ12\+σ22\),\\widetilde\{D\}=\\widetilde\{S\}\_\{M/2\}\-\\widetilde\{S\}\_\{M\}\\sim N\(\\mu\_\{1\}\-\\mu\_\{2\},\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}\),
where
μ1−μ2=\\displaystyle\\mu\_\{1\}\-\\mu\_\{2\}=∑n=λ\(M/2\)λ\(M\)ancosϕn≤∑n=λ\(M/2\)λ\(M\)an,\\displaystyle\\sum\_\{n=\\lambda\(M/2\)\}^\{\\lambda\(M\)\}a\_\{n\}\\cos\\phi\_\{n\}\\leq\\sum\_\{n=\\lambda\(M/2\)\}^\{\\lambda\(M\)\}a\_\{n\},σ12\+σ22=\\displaystyle\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}=1/2∑n=λ\(M/2\)λ\(M\)an2\+∑n=0λ\(M/2\)an2\.\\displaystyle 1/2\\sum\_\{n=\\lambda\(M/2\)\}^\{\\lambda\(M\)\}a\_\{n\}^\{2\}\+\\sum\_\{n=0\}^\{\\lambda\(M/2\)\}a\_\{n\}^\{2\}\.
and the probability of position inversion should be
Pr\(D~<0\)=Φ\(−μ1−μ2σ12\+σ22\),\\displaystyle Pr\(\\widetilde\{D\}<0\)=\\Phi\\left\(\-\\frac\{\\mu\_\{1\}\-\\mu\_\{2\}\}\{\\sqrt\{\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}\}\}\\right\),
whereΦ\\Phiis the cumulative distribution function of the standard normal distribution\.
To more accurately estimate the probability, we need the actual values ofana\_\{n\}andϕn\\phi\_\{n\}, which are dependent on𝐪,𝐤\\mathbf\{q\},\\mathbf\{k\}\. However, if we assume that\{an\}\\\{a\_\{n\}\\\}are regular enough, then we have the following estimation:
###### Theorem 5\.
If∑nan/h≈∑nan2/h≈amax\>0\\sum\_\{n\}\{a\_\{n\}\}/h\\approx\\sqrt\{\\sum\_\{n\}\{a\_\{n\}^\{2\}\}/h\}\\approx a\_\{\\max\}\>0, then
Pr\(S~M/2−S~M<0\)≥Φ\(−log2hlogB\(logM−0\.5log2\)\)\.\\displaystyle Pr\(\\widetilde\{S\}\_\{M/2\}\-\\widetilde\{S\}\_\{M\}<0\)\\geq\\Phi\\left\(\-\\log 2\\sqrt\{\\frac\{\{h\}\}\{\{\\log B\(\\log M\-0\.5\\log 2\)\}\}\}\\right\)\.\(5\)
###### Proof\.
WhenMMis so large thatλ\(M\)=λ\(M/2\)=h\\lambda\(M\)=\\lambda\(M/2\)=h, thenμ1=μ2\\mu\_\{1\}=\\mu\_\{2\}\. In this case,D~∼N\(0,σ12\+σ22\)\\widetilde\{D\}\\sim N\(0,\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}\), and the probabilityPr=0\.5Pr=0\.5\. Since−log2hlogB\(logM−0\.5log2\)<0\-\\log 2\\sqrt\{\\frac\{\{h\}\}\{\{\\log B\(\\log M\-0\.5\\log 2\)\}\}\}<0, the right hand side of[Eq\.˜5](https://arxiv.org/html/2605.15514#A3.E5)is less than 0\.5 and therefore less than the questioned probability\.
WhenM≤BM\\leq B, we haveh≥λ\(M\)\>λ\(M/2\)h\\geq\\lambda\(M\)\>\\lambda\(M/2\),
μ1−μ2σ12\+σ22≲\\displaystyle\\frac\{\\mu\_\{1\}\-\\mu\_\{2\}\}\{\\sqrt\{\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}\}\}\\lesssimλ\(M\)−λ\(M/2\)λ\(M\)/2\+λ\(M/2\)/2\.\\displaystyle\\frac\{\\lambda\(M\)\-\\lambda\(M/2\)\}\{\\sqrt\{\\lambda\(M\)/2\+\\lambda\(M/2\)/2\}\}\.≤\\displaystyle\\leqhlog2logBh2logM−log22logB\\displaystyle\\frac\{h\\frac\{\\log 2\}\{\\log B\}\}\{\\sqrt\{h\\frac\{2\\log M\-\\log 2\}\{2\\log B\}\}\}=\\displaystyle=log2hlogB\(logM−0\.5log2\)\.\\displaystyle\\log 2\\sqrt\{\\frac\{\{h\}\}\{\{\\log B\(\\log M\-0\.5\\log 2\)\}\}\}\.
Whenh=λ\(M\)\>λ\(M/2\)h=\\lambda\(M\)\>\\lambda\(M/2\), we have
μ1−μ2σ12\+σ22≲\\displaystyle\\frac\{\\mu\_\{1\}\-\\mu\_\{2\}\}\{\\sqrt\{\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}\}\}\\lesssimh−λ\(M/2\)h/2\+λ\(M/2\)/2\.\\displaystyle\\frac\{h\-\\lambda\(M/2\)\}\{\\sqrt\{h/2\+\\lambda\(M/2\)/2\}\}\.
Letx=λ\(M/2\)∈\[h\(1−logB2\),h\]x=\\lambda\(M/2\)\\in\[h\(1\-\\log\_\{B\}2\),h\], andf\(x\)=h−xh/2\+x/2f\(x\)=\\frac\{h\-x\}\{\\sqrt\{h/2\+x/2\}\}\. Sinceffis a continuous function that decreases withxx, it reaches its maximum atx=h\(1−logB2\)x=h\(1\-\\log\_\{B\}2\), that is whenM=BM=B\. Then,f\(x\)=log2hlogB\(logB−0\.5log2\)=log2hlogB\(logM−0\.5log2\)\.f\(x\)=\\log 2\\sqrt\{\\frac\{\{h\}\}\{\{\\log B\(\\log B\-0\.5\\log 2\)\}\}\}=\\log 2\\sqrt\{\\frac\{\{h\}\}\{\{\\log B\(\\log M\-0\.5\\log 2\)\}\}\}\.
∎
This gives a lowerbound for the probability of position inversion\. AslogM\\log MorlogB\\log Bincreases,μ1−μ2σ12\+σ22\\frac\{\\mu\_\{1\}\-\\mu\_\{2\}\}\{\\sqrt\{\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}\}\}decreases, and the probability of position inversion increases\. As shown in the proof, whenM→Θ\(B\)M\\to\\Theta\(B\), this probability goes to1/21/2\. On the other hand, ifBBincreases, this probability also increases; if we apply a threshold probabilityα\\alpha, and constrainPr<αPr<\\alpha, then asBBincreases, the maximum possibleMMdecreases\. See[Table˜3](https://arxiv.org/html/2605.15514#A3.T3)\.
Table 3:SmallestMMfor selectedBBsuch that the probability of position inversion is no less than 0\.3, whenh=64h=64\.
### C\.2Position Aliasing
###### Definition C\.2\.
LetS\(m\)S\(m\)be the RoPE product of𝐪,𝐤\\mathbf\{q\},\\mathbf\{k\}at distancemm, andS^\(m\)=S^dtype\(m\)\\hat\{S\}\(m\)=\\hat\{S\}\_\{\\texttt\{dtype\}\}\(m\)be the numerical result ofS\(m\)S\(m\)using a certain datatypedtype\. If form1≠m2m\_\{1\}\\neq m\_\{2\},S^\(m1\)=S^\(m2\)\\hat\{S\}\(m\_\{1\}\)=\\hat\{S\}\(m\_\{2\}\), then the pair\(m1,m2\)\(m\_\{1\},m\_\{2\}\)exhibitsposition aliasing\.
This is not to be confused with the concept of “aliasing” in signal reconstruction, where a high frequency signal beyond the Nyquist Limit is mistaken as a lower one\(Liu,[2026](https://arxiv.org/html/2605.15514#bib.bib36)\)\. This type of aliasing happens whenM\>Θ\(B\)M\>\\Theta\(B\), as pointed out in[Section˜2\.1](https://arxiv.org/html/2605.15514#S2.SS1)\.
For any integerM\>0M\>0and errorε\>0\\varepsilon\>0, which is related to the datatype resolution, if we independently take two random distancesm1,m2<Mm\_\{1\},m\_\{2\}<M, what is the probability such that\|S\(m1\)−S\(m2\)\|<ε\|S\(m\_\{1\}\)\-S\(m\_\{2\}\)\|<\\varepsilon?
Sincem1m\_\{1\}andm2m\_\{2\}are independent, we can see the two sums as two i\.i\.d\. normal variables, i\.e\.
S~m1,S~m2∼i\.i\.d\.N\(μ,σ2\)\.\\widetilde\{S\}\_\{m\_\{1\}\},\\widetilde\{S\}\_\{m\_\{2\}\}\\overset\{i\.i\.d\.\}\{\\sim\}N\(\\mu,\\sigma^\{2\}\)\.
Then the differenceD~\\widetilde\{D\}is also a normal variable:
D~=S~m1−S~m2∼N\(0,2σ2\)\.\\displaystyle\\widetilde\{D\}=\\widetilde\{S\}\_\{m\_\{1\}\}\-\\widetilde\{S\}\_\{m\_\{2\}\}\\sim N\(0,2\\sigma^\{2\}\)\.
We have
Pr\(\|D~\|<ε\)=\\displaystyle Pr\(\|\\widetilde\{D\}\|<\\varepsilon\)=Φ\(ε2σ\)−Φ\(−ε2σ\)\\displaystyle\\Phi\(\\frac\{\\varepsilon\}\{\\sqrt\{2\}\\sigma\}\)\-\\Phi\(\-\\frac\{\\varepsilon\}\{\\sqrt\{2\}\\sigma\}\)=\\displaystyle=2Φ\(ε2σ\)−1\.\\displaystyle 2\\Phi\(\\frac\{\\varepsilon\}\{\\sqrt\{2\}\\sigma\}\)\-1\.
In reality,ε\\varepsilonis related to the computational precision\. Now let us calculate the resolution limit of numerical operations involved\.
Suppose the floating data type hasffexplicit fraction bits — for a numberxxin the normal range, this means a resolution ofε0\(x\)=Θ\(2−fx\)\\varepsilon\_\{0\}\(x\)=\\Theta\(2^\{\-f\}x\)\. For BF16, FP16, FP32, FP64,f=7,10,23,52f=7,10,23,52respectively\(Henryet al\.,[2019](https://arxiv.org/html/2605.15514#bib.bib51)\)\.
For two dot products to be considered “different”, they must have different attention scores, i\.e\. different values after the normalized softmax\. Letssbe a positive integer\. Let𝐱∈ℝs\\mathbf\{x\}\\in\\mathbb\{R\}^\{s\}, and𝐲=softmax\(𝐱/d\)\.\\mathbf\{y\}=\\text\{softmax\}\(\\mathbf\{x\}/\\sqrt\{d\}\)\.For somei≠ji\\neq j, we need to know the minimum value of\|xi−xj\|\|x\_\{i\}\-x\_\{j\}\|such that\|yi−yj\|<ε0\(y\)\|y\_\{i\}\-y\_\{j\}\|<\\varepsilon\_\{0\}\(y\)\.
Whenyi=yj=yy\_\{i\}=y\_\{j\}=y, disturbxi−xjx\_\{i\}\-x\_\{j\}\. Then
∂\(yi−yj\)∂\(xi−xj\)=yd\.\\frac\{\\partial\{\(y\_\{i\}\-y\_\{j\}\)\}\}\{\\partial\(x\_\{i\}\-x\_\{j\}\)\}=\\frac\{y\}\{\\sqrt\{d\}\}\.
This means that to ensureyi≠yjy\_\{i\}\\neq y\_\{j\},
\|xi−xj\|≥dε0\(y\)y=Θ\(2−fd\)\.\|x\_\{i\}\-x\_\{j\}\|\\geq\\frac\{\\sqrt\{d\}\\varepsilon\_\{0\}\(y\)\}\{y\}=\\Theta\(2^\{\-f\}\\sqrt\{d\}\)\.
This is the effective resolution for the dot product, i\.e\.εs=Θ\(2−fd\)\\varepsilon\_\{s\}=\\Theta\(2^\{\-f\}\\sqrt\{d\}\), from the restriction of softmax\.
Also, the dot product itself has the resolution limit ofεd=Θ\(2−f∑nan\)\.\\varepsilon\_\{d\}=\\Theta\(2^\{\-f\}\\sum\_\{n\}a\_\{n\}\)\.Therefore the final resolution constraint is
ε=Θ\(2−fmax\(d,∑nan\)\)\.\\varepsilon=\\Theta\\left\(2^\{\-f\}\\max\{\\left\(\\sqrt\{d\},\\sum\_\{n\}a\_\{n\}\\right\)\}\\right\)\.
In our hypothesis that no singleaadominates,
∑n<λ\(M\)an2/\|λ\(M\)\|∼∑n<han/h=Θ\(amax\)\.\\sqrt\{\\sum\_\{n<\\lambda\(M\)\}a\_\{n\}^\{2\}/\|\\lambda\(M\)\|\}\\sim\\sum\_\{n<h\}\{a\_\{n\}\}/h=\\Theta\(a\_\{\\max\}\)\.
Therefore,
ε/σ=Θ\(2−fmax\(d,hamax\)/σ\)=Θ\(2−fmax\(d/\(λ\(M\)amax\),h/λ\(M\)\)\)\.\\varepsilon/\\sigma=\\Theta\(2^\{\-f\}\\max\(\\sqrt\{d\},ha\_\{\\max\}\)/\\sigma\)=\\Theta\(2^\{\-f\}\\max\{\(\\sqrt\{d\}/\(\\sqrt\{\\lambda\(M\)\}a\_\{\\max\}\),h/\\sqrt\{\\lambda\(M\)\}\)\}\)\.
Consider a simplified case wherean=1a\_\{n\}=1\. For a RoPE base of 10,000, if we use FP16, the probability of having the same positional value is 5\.6‰ at 32k context length\. If the RoPE base increases to 100,000, then the probability becomes 6\.5‰\. For a randompairof distances, this is the probability of the pair having the exact same attention score\. This may not seem like a large number, but if we consider that there areO\(M2\)O\(M^\{2\}\)pairs of position, this leads to an astonishing 3\.5 million pairs of possible position aliasing\.
###### Theorem 6\.
Uniformly and randomly choose distancem1∈\[0,M\)m\_\{1\}\\in\[0,M\)\. Letp\(M\)p\(M\)denote the probability that there exists a different distancem2∈\[0,M\)/\{m1\}m\_\{2\}\\in\[0,M\)/\\\{m\_\{1\}\\\}such that\|S\(m1\)−S\(m2\)\|<ε\|S\(m\_\{1\}\)\-S\(m\_\{2\}\)\|<\\varepsilon, whereε=Θ\(2−fmax\(d,∑nan\)\)\\varepsilon=\\Theta\\left\(2^\{\-f\}\\max\{\\left\(\\sqrt\{d\},\\sum\_\{n\}a\_\{n\}\\right\)\}\\right\)is the absolute resolution limit for the datatype withffexplicit fraction bits\. We havep\(M\)≥1−\(1−E\)M−1p\(M\)\\geq 1\-\(1\-E\)^\{M\-1\}andlimM→\+∞p\(M\)=1\\lim\_\{M\\to\+\\infty\}p\(M\)=1\.
###### Proof\.
For a randomm1m\_\{1\}in a given context lengthMM, the target probability is
p\(M\)=1−\(1−Pr\(\|D~\|<ε\)\)M−1\.p\(M\)=1\-\(1\-Pr\(\|\\widetilde\{D\}\|<\\varepsilon\)\)^\{M\-1\}\.
Since
Pr\(\|D~\|<ε\)≥2Φ\(2−fh/λ\(M\)\)−1≥2Φ\(2−fh\)−1,Pr\(\|\\widetilde\{D\}\|<\\varepsilon\)\\geq 2\\Phi\\left\(2^\{\-f\}h/\\sqrt\{\\lambda\(M\)\}\\right\)\-1\\geq 2\\Phi\(2^\{\-f\}\\sqrt\{h\}\)\-1,
letE=2Φ\(2−fh\)−1E=2\\Phi\(2^\{\-f\}\\sqrt\{h\}\)\-1\. Then
p\(M\)≥1−\(1−E\)M−1\.p\(M\)\\geq 1\-\(1\-E\)^\{M\-1\}\.
Sincep\(M\)≤1p\(M\)\\leq 1, we have
limM→\+∞p\(M\)=1\.\\lim\_\{M\\to\+\\infty\}p\(M\)=1\.∎
Table 4:Prob\. of positional aliasing for a single pair when𝐚=𝟏\\mathbf\{a\}=\\mathbf\{1\}\.
### C\.3Token Inversion
For the token identification objective, we want to consider how relevant the key token \(corresponding to the given𝐤\\mathbf\{k\}\) is to the query token \(corresponding to the given𝐪\\mathbf\{q\}\)\.
###### Definition C\.3\.
For a query vector𝐪\\mathbf\{q\}and two key vectors𝐤1,𝐤2\\mathbf\{k\}\_\{1\},\\mathbf\{k\}\_\{2\}, ifS𝐪,𝐤1\(0\)<S𝐪,𝐤2\(0\)S\_\{\\mathbf\{q\},\\mathbf\{k\}\_\{1\}\}\(0\)<S\_\{\\mathbf\{q\},\\mathbf\{k\}\_\{2\}\}\(0\), but for somem\>0m\>0,S𝐪,𝐤1\(m\)\>S𝐪,𝐤2\(m\)S\_\{\\mathbf\{q\},\\mathbf\{k\}\_\{1\}\}\(m\)\>S\_\{\\mathbf\{q\},\\mathbf\{k\}\_\{2\}\}\(m\), then atoken inversionoccurs atmm\.
For the following analysis, we apply an important simplification to the definition\. Since for the same\(𝐪,𝐤\)\(\\mathbf\{q\},\\mathbf\{k\}\)pair, the theoretical upper bound of the RoPE product, denoted bySmaxS\_\{\\max\}, is
∑n=0h−1ajcos\(mθn\+ϕn\)≤∑n=0h−1an≡Smax,\\sum\_\{n=0\}^\{h\-1\}a\_\{j\}\\cos\(m\\theta^\{n\}\+\\phi\_\{n\}\)\\leq\\sum\_\{n=0\}^\{h\-1\}a\_\{n\}\\equiv S\_\{\\max\},
for the pair\(𝐪,𝐤\)\(\\mathbf\{q\},\\mathbf\{k\}\), we may introduce a hypothetic key token, called the “prime” token, whose key vector is denoted by𝐤′\\mathbf\{k\}^\{\\prime\}, that reaches this RoPE product atm=0m=0\. That is to say, The pair\(𝐪,𝐤′\)\(\\mathbf\{q\},\\mathbf\{k\}^\{\\prime\}\)shares the same set of amplitudes,aja\_\{j\}, as\(𝐪,𝐤\)\(\\mathbf\{q\},\\mathbf\{k\}\), with all initial phase biasesϕj=0\\phi\_\{j\}=0\. Now, if we randomly select0≤m<M0\\leq m<M, we wish to see the probability that this “prime” key token has a smaller RoPE product than a key token at distancemm\.
Formally, for a given pair\(𝐪,𝐤\)\(\\mathbf\{q\},\\mathbf\{k\}\), let the “prime” key vector be𝐤′\\mathbf\{k\}^\{\\prime\}\. Randomly and uniformly select integermmbetween\[0,M\)\[0,M\)\. We assume that\{ϕn\}\\\{\\phi\_\{n\}\\\}are not all 0, since otherwise𝐤=𝐤′\\mathbf\{k\}=\\mathbf\{k\}^\{\\prime\}\. We also assumeamax\>0a\_\{\\max\}\>0, otherwise either𝐪\\mathbf\{q\}or𝐤\\mathbf\{k\}is zero\.
Using the conclusion in[Appendix˜B](https://arxiv.org/html/2605.15514#A2), the difference is
D=\\displaystyle D=∑n=0h−1ancos\(mθn\+ϕn\)−∑n=0h−1ancos\(mθn\)\\displaystyle\\sum\_\{n=0\}^\{h\-1\}a\_\{n\}\\cos\(m\\theta^\{n\}\+\\phi\_\{n\}\)\-\\sum\_\{n=0\}^\{h\-1\}a\_\{n\}\\cos\(m\\theta^\{n\}\)=−2\\displaystyle=\-2∑n=0h−1ansin\(ϕn/2\)sin\(mθn\+ϕn/2\)\\displaystyle\\sum\_\{n=0\}^\{h\-1\}a\_\{n\}\\sin\(\\phi\_\{n\}/2\)\\sin\(m\\theta^\{n\}\+\\phi\_\{n\}/2\)
LetAn=−2ansin\(ϕn/2\)A\_\{n\}=\-2a\_\{n\}\\sin\(\\phi\_\{n\}/2\),φn=ϕn/2−π/2\\varphi\_\{n\}=\\phi\_\{n\}/2\-\\pi/2\. Then
D=∑n=0h−1Ancos\(mθn\+φn\)\.D=\\sum\_\{n=0\}^\{h\-1\}A\_\{n\}\\cos\(m\\theta^\{n\}\+\\varphi\_\{n\}\)\.
This form is exactly what is studied in[Appendix˜B](https://arxiv.org/html/2605.15514#A2)\. Just like any RoPE product,DDcan also be seen as a normal variableD~∼N\(μ,σ\)\\widetilde\{D\}\\sim N\(\\mu,\\sigma\)\.
###### Theorem 7\.
The probabilityPr\(D~\>0\)Pr\\left\(\\widetilde\{D\}\>0\\right\)satisfies
Pr\(D~\>0\)=\\displaystyle Pr\\left\(\\widetilde\{D\}\>0\\right\)=Φ\(μσ\),\\displaystyle\\Phi\\left\(\\frac\{\\mu\}\{\\sigma\}\\right\),\(6\)where
μ=\\displaystyle\\mu=∑n≥λ\(M\)an\(cosϕn−1\),\\displaystyle\\sum\_\{n\\geq\\lambda\(M\)\}a\_\{n\}\(\\cos\\phi\_\{n\}\-1\),σ=\\displaystyle\\sigma=∑n<λ\(M\)an2sin2ϕn\.\\displaystyle\\sqrt\{\\sum\_\{n<\\lambda\(M\)\}a\_\{n\}^\{2\}\\sin^\{2\}\\phi\_\{n\}\}\.WhenM=Θ\(B\)M=\\Theta\(B\)andλ\(M\)=h\\lambda\(M\)=h,Pr\(D~\>0\)=1/2Pr\\left\(\\widetilde\{D\}\>0\\right\)=1/2\.
###### Proof\.
μ\\muandσ\\sigmacan be obtained by applying[Eq\.˜3](https://arxiv.org/html/2605.15514#A2.E3)and[Eq\.˜4](https://arxiv.org/html/2605.15514#A2.E4)on\{An\}\\\{A\_\{n\}\\\}and\{φn\}\\\{\\varphi\_\{n\}\\\}\. The probability then follows that for normal distribution\.
Whenλ\(M\)=h\\lambda\(M\)=h,μ=0\\mu=0\. Since we assume that\{ϕn\}\\\{\\phi\_\{n\}\\\}are not all 0 and\{an\}\\\{a\_\{n\}\\\}are not all 0,σ≠0\\sigma\\neq 0, givingPr\(D~\>0\)=1/2Pr\\left\(\\widetilde\{D\}\>0\\right\)=1/2\. ∎
### C\.4Token Aliasing
###### Definition C\.4\.
For a query vector𝐪\\mathbf\{q\}and two key vectors𝐤1,𝐤2\\mathbf\{k\}\_\{1\},\\mathbf\{k\}\_\{2\}, if the numerical results of RoPE product under a certain datatypeS^𝐪,𝐤1\|dtype\(m\)=S^𝐪,𝐤2\|dtype\(m\)\\hat\{S\}\_\{\\mathbf\{q\},\\mathbf\{k\}\_\{1\}\|\\texttt\{dtype\}\}\(m\)=\\hat\{S\}\_\{\\mathbf\{q\},\\mathbf\{k\}\_\{2\}\|\\texttt\{dtype\}\}\(m\)for somemm, then atoken aliasingoccurs atmm\.
For the purpose of simplicity, we make an assumption that in a fixed transformer head, for all pairs\(𝐪,𝐤\)\(\\mathbf\{q\},\\mathbf\{k\}\), for all0≤n<h0\\leq n<h, the magnitude at the given dimension pairan\(q,k\)=\|\(q2n,q2n\+1\)\|\|\(k2n,k2n\+1\)\|a\_\{n\}\(q,k\)=\{\|\(q\_\{2n\},q\_\{2n\+1\}\)\|\|\(k\_\{2n\},k\_\{2n\+1\}\)\|\}stays the same\. For real attention heads, we may make the assumption that for a fixed frequency componentnnand randomly chosenq,kq,kpairs,ana\_\{n\}follows some normal distribution, and we may take its mean asana\_\{n\}discussed here\.
If for query vector𝐪\\mathbf\{q\}and key vectors𝐤1\\mathbf\{k\}\_\{1\}and𝐤2\\mathbf\{k\}\_\{2\},
S1\(m\)=⟨𝐪,𝐤1⟩m=∑n=0h−1ancos\(mθn\+ϕ1,n\)S\_\{1\}\(m\)=\\langle\\mathbf\{q\},\\mathbf\{k\}\_\{1\}\\rangle\_\{m\}=\\sum\_\{n=0\}^\{h\-1\}a\_\{n\}\\cos\(m\\theta^\{n\}\+\\phi\_\{1,n\}\)
and
S2\(m\)=⟨𝐪,𝐤2⟩m=∑n=0h−1ancos\(mθn\+ϕ2,n\)S\_\{2\}\(m\)=\\langle\\mathbf\{q\},\\mathbf\{k\}\_\{2\}\\rangle\_\{m\}=\\sum\_\{n=0\}^\{h\-1\}a\_\{n\}\\cos\(m\\theta^\{n\}\+\\phi\_\{2,n\}\)
are independent, then forε\>0,\\varepsilon\>0,the probability of token aliasing can be expressed as
Pr\(\|S1\(m\)−S2\(m\)\|<ε\)\.Pr\(\|S\_\{1\}\(m\)\-S\_\{2\}\(m\)\|<\\varepsilon\)\.
The differenceD=S1\(m\)−S2\(m\)D=S\_\{1\}\(m\)\-S\_\{2\}\(m\)can be seen as a normal variable
D~∼N\(μ1−μ2,σ12\+σ22\)\.\\widetilde\{D\}\\sim N\(\\mu\_\{1\}\-\\mu\_\{2\},\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}\)\.
###### Theorem 8\.
If∑nan/h≈∑nan2/h≈amax\\sum\_\{n\}\{a\_\{n\}\}/h\\approx\\sqrt\{\\sum\_\{n\}\{a\_\{n\}^\{2\}\}/h\}\\approx a\_\{\\max\}, then
Pr\(\|D~\|<ε\)≈22−fhλ\(m\)pdf\(hλ\(m\)−λ\(m\)\),Pr\(\|\\widetilde\{D\}\|<\\varepsilon\)\\approx 2\\frac\{2^\{\-f\}h\}\{\\sqrt\{\\lambda\(m\)\}\}\\textrm\{pdf\}\\left\(\\frac\{h\}\{\\sqrt\{\\lambda\(m\)\}\}\-\\sqrt\{\\lambda\(m\)\}\\right\),
where pdf is the probability density function of standard normal distribution,
pdf\(x\)=12πe−x2/2\.\\textrm\{pdf\}\(x\)=\\frac\{1\}\{\\sqrt\{2\\pi\}\}e^\{\-x^\{2\}/2\}\.
###### Proof\.
Without loss of generality, assumeμ1\>μ2\\mu\_\{1\}\>\\mu\_\{2\}\. We have
μ=μ1−μ2=∑n≥λ\(m\)an\(cosϕ1,n−cosϕ2,n\)≤2∑n≥λ\(m\)an,\\mu=\\mu\_\{1\}\-\\mu\_\{2\}=\\sum\_\{n\\geq\\lambda\(m\)\}a\_\{n\}\(\\cos\\phi\_\{1,n\}\-\\cos\\phi\_\{2,n\}\)\\leq 2\\sum\_\{n\\geq\\lambda\(m\)\}a\_\{n\},
σ2=σ12\+σ22=2σ12=∑n<λ\(m\)an2\.\\sigma^\{2\}=\\sigma\_\{1\}^\{2\}\+\\sigma\_\{2\}^\{2\}=2\\sigma\_\{1\}^\{2\}=\\sum\_\{n<\\lambda\(m\)\}a\_\{n\}^\{2\}\.
So
Pr\(\|D~\|<ε\)=Φ\(ε−μσ\)−Φ\(−ε−μσ\)\.\\displaystyle Pr\(\|\\widetilde\{D\}\|<\\varepsilon\)=\\Phi\\left\(\\frac\{\\varepsilon\-\\mu\}\{\\sigma\}\\right\)\-\\Phi\\left\(\\frac\{\-\\varepsilon\-\\mu\}\{\\sigma\}\\right\)\.
Since noana\_\{n\}dominates, using the same estimations for position aliasing,
μ/σ=\\displaystyle\\mu/\\sigma=Θ\(hλ\(m\)−λ\(m\)\),\\displaystyle\\Theta\(\\frac\{h\}\{\\sqrt\{\\lambda\(m\)\}\}\-\\sqrt\{\\lambda\(m\)\}\),ε/σ≥\\displaystyle\\varepsilon/\\sigma\\geqΘ\(2−fhλ\(m\)\),\\displaystyle\\Theta\(\\frac\{2^\{\-f\}h\}\{\\sqrt\{\\lambda\(m\)\}\}\),Φ\(ε−μσ\)−Φ\(−ε−μσ\)≈\\displaystyle\\Phi\\left\(\\frac\{\\varepsilon\-\\mu\}\{\\sigma\}\\right\)\-\\Phi\\left\(\\frac\{\-\\varepsilon\-\\mu\}\{\\sigma\}\\right\)\\approx22−fhλ\(m\)pdf\(hλ\(m\)−λ\(m\)\)\.\\displaystyle 2\\frac\{2^\{\-f\}h\}\{\\sqrt\{\\lambda\(m\)\}\}\\text\{pdf\}\(\\frac\{h\}\{\\sqrt\{\\lambda\(m\)\}\}\-\\sqrt\{\\lambda\(m\)\}\)\.∎
Whenλ\(m\)=h\\lambda\(m\)=h, the probability converges toΘ\(21−fh/2π\)\\Theta\(2^\{1\-f\}\\sqrt\{h\}/\\sqrt\{2\\pi\}\)\.
## Appendix DExperiment Details
### D\.1Case Study
We use Head 0, Layer 0 of Llama3\.1\-8B\(Grattafioriet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib14)\)as the case study sample\. However, our method is applicable to any head in any layer of any RoPE\-based decoder transformer model\.
Each failure mode features a query token and one to two key tokens\. For each key token, we calculate its RoPE product with the query,S\(m\)S\(m\), for everymmin the context range\(0,M\]\(0,M\]\. We calculateS\(m\)S\(m\)for a certain head using the following steps:
- •we construct an input following the format<bos\>888The<bos\>token is added for the input sanity and is crucial if the target head is not from the first layer\.\[key\] \.\.\. \[key\] \[query\], where the key token is repeatedMMtimes\.
- •We calculate the hidden states for the target layer\. This involves a forward pass through the embedding layer and every transformer layer before the one which contains our selected head\. This standard process can be accelerated by FlashAttention\(Daoet al\.,[2022](https://arxiv.org/html/2605.15514#bib.bib26)\)\.
- •For the selected head, we obtain theun\-normalizedattention score, i\.e\. with neither thed\\sqrt\{d\}normalization nor softmax\. We only calculate the final row of the attention score matrix, since we are interested in the RoPE products involving the query token\.
- •The result,𝒐\\bm\{o\}, is an\(M\+2\)\(M\+2\)\-d array starting at index 0\. For0<m≤M0<m\\leq M, we haveS\(m\)=oM\+1−mS\(m\)=o\_\{M\+1\-m\}\.
The occurrences of the four failure modes are then identified using the definitions[C\.1](https://arxiv.org/html/2605.15514#A3.Thmrmk1),[C\.2](https://arxiv.org/html/2605.15514#A3.Thmrmk2),[C\.3](https://arxiv.org/html/2605.15514#A3.Thmrmk3)999For simplicity of implementation, we useS\(1\)S\(1\)instead ofS\(0\)S\(0\)when identifying token inversion\.,[C\.4](https://arxiv.org/html/2605.15514#A3.Thmrmk4)in[Appendix˜C](https://arxiv.org/html/2605.15514#A3)\.
For larger models or heads not located in the first layer, GPUs with memory corresponding to the model size are recommended\. However, for our case study, we only load the first layer and the whole case study is conducted using a lap\-top grade CPU with 64GB memory\.
#### D\.1\.1Aliasing Probs for FP16 in Case Study
FP16 has 10 explicit fraction bits, and the aliasing probabilities are different from using BF16\. For position aliasing, see[Fig\.˜10](https://arxiv.org/html/2605.15514#A4.F10)\.
\(a\)Distribution of position aliasing pairs for key “cat” and query “pet”\.
\(b\)Position aliasing pairs for key “dog” and query “pet”\.
\(c\)Attention invariance pairs for “cat”, “dog” and “pet”\.
Figure 10:Heat maps of position aliasing and attention invariance pairs\. FP16, Llama3\.1\-8B, Layer 0 Head 0\. Pairs are grouped into a total of200×200200\\times 200bins for position aliasing, and16×1616\\times 16bins for attention invariance\. 1K = 1024\.For token aliasing, see[Fig\.˜11](https://arxiv.org/html/2605.15514#A4.F11)\.
Figure 11:Distribution and probability of token aliasing for keys “cat” and “dog” and query “pet”\. Llama3\.1\-8B, Layer 0 Head 0\. The probability converges to what is close to the estimated probability of 0\.006\.
### D\.2The Indexing Task
We randomly generate a listarr\. The list only contains integers 0, 1, 2 and 3\. We control the length of the list to be powers of 2, ranging from 4 to 4096, and usef"\{arr\}"to convert it into a string\. The model is required to answer the value of the given indexarr\[i\]\. Different models may not tokenize the input or apply the chat template the same way, but the correspondence is roughly 3 tokens per element, and we only evaluate model performance based on token count\. For each length, we test the models on 10 randomly generated lists\. For each list, we generate 10 independent query sessions with random indices\. For each list, we report the average input tokens and mean accuracy across the 10 query sessions\. We aggregate the results for different lists by also reporting the mean standard deviation of accuracy\.
We use the following prompt:arr = \{arr\}\\nGiven the above array, don’t think and directly answer the corresponding value concisely: arr\[\{key\}\] =
We use the following models: smaller models \(less than 10 B\), including Llama\-3\.1\-8B\-Instruct\(Grattafioriet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib14)\), Mistral\-7B\-Instruct\-v0\.3\(Mistral AI Team,[2024](https://arxiv.org/html/2605.15514#bib.bib48)\), Qwen3\-8B\(Yanget al\.,[2025a](https://arxiv.org/html/2605.15514#bib.bib54)\); larger models \(more than 100B\), including DeepSeek\-V3\.1\(DeepSeek\-AIet al\.,[2025](https://arxiv.org/html/2605.15514#bib.bib49)\), Kimi\-K2\.5\(Teamet al\.,[2026a](https://arxiv.org/html/2605.15514#bib.bib55)\), gpt\-oss\-120b\(OpenAIet al\.,[2025](https://arxiv.org/html/2605.15514#bib.bib53)\)\.
For models less than 10B, we use the HuggingFace transformers implementation\(Wolfet al\.,[2020](https://arxiv.org/html/2605.15514#bib.bib52)\)\. These inferences can be done on a GPU of more than 40GB\. For models larger than 100B, we use the TogetherAI API\(Together AI,[n\.d\.](https://arxiv.org/html/2605.15514#bib.bib50)\)\. We disable reasoning mode where possible, and prompt the model to answer directly, but do not limit the generation length\. We retrieve the last number from the model generation\.
## Appendix ERoPE in Real Models
As suggested in the experiment section §[5](https://arxiv.org/html/2605.15514#S5), the multiple heads and layers in a real model may only offer redundancies that provide limited protection\. We provide the following discussions that are open\-ended and intuitive rather than evidence\-based, which may serve as preliminary insights for future analyses using more realistic models:
First, redundancy across attention heads is limited, since the heads are highly specialized and sparsely activated\. Prior work\(Kahardiprajaet al\.,[2025](https://arxiv.org/html/2605.15514#bib.bib41); Wuet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib42); Linet al\.,[2026](https://arxiv.org/html/2605.15514#bib.bib43)\)has shown that different heads are often responsible for text dependencies of different ranges, and that only a small number of heads are active at the same time\. As an example, consider a long input with a 50% probability of position inversion\. Even if 8 out of 32 heads are actively retrieving, a proportion larger than what is commonly observed\(Wuet al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib42)\), once every 250 tokens,allretrieval heads will simultaneously exhibit position inversion\.
Second, redundancy across layers is largely limited due to the residue connection\. Errors introduced by earlier layers carry on to later ones connected in series\. Improved architectures likeTeamet al\.\([2026b](https://arxiv.org/html/2605.15514#bib.bib40)\)apply residue connections in parallel\. This aggregation strategy potentially reduces the accumulative error\. Even in such cases, errors in the final layer never get the chance to be calibrated\. An attention invariance failure in the final layer can directly lead to a wrong output token\.
Finally, the underlying mechanism applies beyond the number of heads and layers\. As context increases, an increasing oscillation leads to less positional uniqueness, and an increasing decay reduces the value of RoPE product and compresses token\-wise difference\. This means that the position and token identity of faraway text are increasingly likely to be poorly distinguished, leading to a weak or erroneous contribution to the context\-aware representation\.
## Appendix FRelated Works
##### Long Context Models
State\-of\-the\-art language models are delivered with increasingly larger context window limits, some of them well beyond 1 million tokens \(citations likeComaniciet al\.\([2025](https://arxiv.org/html/2605.15514#bib.bib7)\); Meta \([2025](https://arxiv.org/html/2605.15514#bib.bib15)\); OpenAI \([2025](https://arxiv.org/html/2605.15514#bib.bib16)\); Magic \([2024](https://arxiv.org/html/2605.15514#bib.bib17)\)\)\. To deliver and utilize long\-context models, apart from improvements in data curation \(Fuet al\.\([2024b](https://arxiv.org/html/2605.15514#bib.bib18)\)\), training optimization \(Daoet al\.\([2022](https://arxiv.org/html/2605.15514#bib.bib26)\); Liet al\.\([2023](https://arxiv.org/html/2605.15514#bib.bib29)\); Liuet al\.\([2023a](https://arxiv.org/html/2605.15514#bib.bib28)\)\), and efficient deployment \(Xiaoet al\.\([2023](https://arxiv.org/html/2605.15514#bib.bib32)\)\), one of the main strategies is to adjust the value of RoPE base, which in the original paper is 10,000, “the worst base value” \(Liuet al\.\([2023b](https://arxiv.org/html/2605.15514#bib.bib19)\)\)\.
##### A War of Increasing RoPE Base
Rotary Positional Embedding \(RoPE,Suet al\.\([2021](https://arxiv.org/html/2605.15514#bib.bib1)\)\) exhibits a decaying effect on attention scores of distant tokens\. It is purposefully designed this way to model natural language with decreased dependency over longer distance \(Suet al\.\([2021](https://arxiv.org/html/2605.15514#bib.bib1)\)\)\. However, it is widely believed that this decay at least partially limits long\-context performance \(Tworkowskiet al\.\([2023](https://arxiv.org/html/2605.15514#bib.bib20)\); Xuet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib22)\); Zhonget al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib21)\); Miranda and others \([2024](https://arxiv.org/html/2605.15514#bib.bib37)\)\)\. Therefore, attempts to extend context length usually feature increased values of RoPE base, which leads to slower decay \(Penget al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib27)\); Gaoet al\.\([2025](https://arxiv.org/html/2605.15514#bib.bib30)\)\)\. As a variant, some works remove RoPE at least partially from attention calculation\(Wanget al\.,[2024](https://arxiv.org/html/2605.15514#bib.bib13); Yanget al\.,[2025b](https://arxiv.org/html/2605.15514#bib.bib9)\), or only apply RoPE to certain dimensions\(Javaheripiet al\.,[2023](https://arxiv.org/html/2605.15514#bib.bib10); DeepSeek\-AIet al\.,[2026](https://arxiv.org/html/2605.15514#bib.bib12)\), which, according to our analysis, is equivalent to applying an infinitely large RoPE base\. However, although the resulting long\-context models excel in retrieval\-based tasks such as Needle\-in\-a\-Haystack \(Kamradt \([2023](https://arxiv.org/html/2605.15514#bib.bib33)\)\), they still suffer a substantial performance drop on tasks that involve reasoning, variable tracking or other long\-term dependency, well within their context limit \(Duet al\.\([2025](https://arxiv.org/html/2605.15514#bib.bib38)\); Hsiehet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib34)\); Kuratovet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib35)\); Liuet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib31)\)\)\.
##### RoPE as a Function of Distance
Multiple works have analyses on the dot product after applying RoPE \(the RoPE product\) as a function w\.r\.t\. distance between two tokens\. Works likeJonasson \([2025](https://arxiv.org/html/2605.15514#bib.bib44)\); Liuet al\.\([2023b](https://arxiv.org/html/2605.15514#bib.bib19)\); Miranda and others \([2024](https://arxiv.org/html/2605.15514#bib.bib37)\)identify high and low frequencies based on whether a rotary component completes a full circle\. Works that mainly focus on the decaying nature of RoPE, and its effect on the decreased attention score assigned to distant tokens \(Xuet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib22)\); Xionget al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib23)\); Chenet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib24)\)\), lead to suggested lower bounds of the RoPE base for certain context lengths \(Xuet al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib22)\); Penget al\.\([2024](https://arxiv.org/html/2605.15514#bib.bib27)\)\)\. However, these only focus on one side of the full picture: there are few systematic discussions about the oscillation in the waveform affected by the high\-frequency terms, and how this can lead to upper bounds for the RoPE base selection\. As a function of distance, the mathematical properties of the RoPE product are still little studied in depth, let alone their practical implications\.
##### The Long\-Context Dilemma
Liu \([2026](https://arxiv.org/html/2605.15514#bib.bib36)\)is among the first to study the oscillation using signal processing techniques, introducing a theoretical upper\-bound where the numeric precision and Nyquist Limit are involved\.Liu \([2026](https://arxiv.org/html/2605.15514#bib.bib36)\)shows that as long as we must use transformer with RoPE to process long data, we must face some sort of uncertainty and are forced to choose between positional and token\-wise accuracy\. It is natural to think that transformers with RoPE have limited capacity to deal with long\-context data\. One must doubt whether the current ways of utilizing long\-context models are the most adequate: are the reasoning models that rely on long chain of thoughts really capable of being responsible to their own thought process? Can chat models really recall distant history? Is it really worth it to train models with context lengths of tens of millions of tokens just to pass the Needle in a Haystack test? It is possible that to make language models really process large volumes of text, we need some other sorts of model structures, or strategies to keep the current models within their effective context range\.Similar Articles
RoPE Distinguishes Neither Positions Nor Tokens in Long Contexts, Provably
This paper proves that RoPE-based attention fails to distinguish token positions and identity in long contexts, explaining LLM failures within advertised context lengths. Experimental verification shows models optimized for retrieval struggle on simple list tasks.
RoVE: Rotary Value Embeddings Attention for Relative Position-dependent Value Pathways
This paper proposes RoVE, a parameter-free modification to Rotary Position Embeddings that makes value pathways position-sensitive by rotating values simultaneously with keys, transforming RoPE attention into attentive convolution. Experiments on GPT-2 models show consistent gains in few-shot in-context learning, out-of-distribution perplexity, and long-context retrieval.
Position Encoding in Transformers: From Absolute and Relative Methods to Rotary Position Embeddings and Long-Context Scaling
A technical survey on position encoding methods in Transformers, covering absolute and relative methods, RoPE, and long-context scaling techniques like Position Interpolation, NTK-aware scaling, YaRN, and LongRoPE.
Enhancing Transformer-based Routing by Encoding Distance via Relative Positional Encoding
This paper explores Relative Positional Encoding (RPE) as an additive bias in Transformer architectures to solve the Team Orienteering Problem, demonstrating consistent improvements in collected rewards and optimality gaps over vanilla Transformer architectures.
T-RoPE: Time-Aware Rotary Position Embedding for Sequential Recommendation
The paper introduces T-RoPE, a time-aware modification to Rotary Position Embedding for sequential recommendation systems, demonstrating significant performance improvements on benchmarks and real-world impact in e-commerce.