ArXiv: 2502.20082
🎯 Pitch
Extending an LLM’s context window usually kills its original short-range abilities—but LongRoPE2 recovers over 98.5% of them while reaching 128K tokens, using just 10B training tokens. The trick is pinpointing which RoPE dimensions are critically undertrained and fixing only those, with a needle-in-a-haystack perplexity probe that picks the golden rescaling factors.
1. Executive Summary
LongRoPE2 introduces a near-lossless method for extending the effective context window of pre-trained LLMs to a target length—128K in experiments—while preserving performance on the original shorter context window. The approach operates on LLaMA3-8B and Phi3-mini-3.8B, combining three mechanisms: a new RoPE OOD hypothesis that insufficient training in higher RoPE dimensions causes undertrained empirical rotation periods and shifts the true critical dimension earlier than theory predicts; a needle-driven PPL-guided evolutionary search that identifies the true critical dimension and optimal per-dimension rescaling factors (evaluating perplexity exclusively on retrieved needle tokens rather than averaging across all tokens); and mixed context window training that fine-tunes model weights using both original RoPE on short packed sequences and rescaled RoPE on long sequences, eliminating the short-context performance degradation that plagues prior methods. LongRoPE2 extends LLaMA3-8B to a 128K effective context length using only 10B training tokens—80× fewer than Meta's approach—while retaining over 98.5% of original short-context performance, establishing that near-lossless context extension with dramatically reduced training cost is achievable, though the method's inference-time RoPE switching incurs a one-time KV cache recomputation cost when crossing the pre-trained context boundary.
2. Context and Motivation
The Core Problem: Extending Context Windows Without Breaking What Already Works
The fundamental challenge LongRoPE2 tackles is this: how do you take a pre-trained LLM that works well on short sequences (say, 2K–8K tokens) and extend its effective context window to a much longer target length (say, 128K tokens) without crippling its original short-context performance? This is not merely about making the model able to process longer inputs—it's about making it actually good at understanding them, while retaining the capabilities it was originally trained to have.
This problem matters enormously for practical LLM deployment. As the paper notes in Section 1, a 128K context window has become standard in recent models like GPT-4o and LLaMA3.1. Long-context capabilities unlock critical applications: document summarization over entire books, multi-turn conversations that don't forget early exchanges, code-base-level reasoning, scientific literature review across dozens of papers, and in-context learning with thousands of examples. If extending context length comes at the cost of degrading performance on normal-length tasks—reasoning, factual recall, instruction following—then the extended model becomes a worse product overall, not a better one.
The paper frames this as a near-lossless extension problem: the goal is to achieve the target long-context length while retaining >97% of the original model's short-context benchmark performance. Prior methods (Figure 2c, Table 4) lose 3–15 absolute percentage points on MMLU and comparable benchmarks when extending context—a degradation that would be unacceptable in production.
The RoPE OOD Problem: Why Direct Extrapolation Fails
To understand why context extension is difficult, we need to understand the core mechanism at play. Modern LLMs (LLaMA, Phi, Mistral, Qwen) overwhelmingly use Rotary Position Embeddings (RoPE) to encode positional information into attention computations. The key intuition is in Equation 5 (Section 2.1):
Each RoPE dimension rotates at a different frequency . Lower dimensions (small ) rotate quickly—completing many full periods within a single training sequence. Higher dimensions (large ) rotate slowly—potentially not even completing a single full period within the pre-trained context length.
This incomplete rotation is the root cause of the out-of-distribution (OOD) problem. When the model sees a token at position 2500 during training, the cosine value for a high RoPE dimension at that position falls somewhere on a sine wave. But if that dimension's period is, say, 50,000 positions, the model has only seen positions 0–2047 during pre-training—roughly 4% of the full period. Positions 2048–4095, when encountered during extrapolation, produce cosine values the model has literally never seen during training. As the paper states in Section 2.2:
"When input sequence length exceeds the predefined context window, the perplexity can shoot up to levels comparable to completely untrained models (i.e., > 10³)."
This is not a subtle degradation—it's catastrophic collapse. Figure 2(a) visualizes this: the 40th cosine dimension completes only a fraction of its period within the 2K pre-training window. The region from 2K to 4K (highlighted in red) contains RoPE values that are entirely OOD.
Prior Approaches and Their Limitations
The field has converged on RoPE rescaling as the remedy: modify the per-dimension rotation angles by a scaling factor so that the rescaled periods fit within the range the model has already seen during pre-training. Equation 8 formalizes this:
The RoPE OOD theory (Section 2.2) says that for dimensions beyond the theoretical critical dimension —the dimension where the RoPE period first exceeds the pre-training length—the scaling factors must satisfy , where is the extension ratio. For extending from 2K to 128K, that ratio is 64. Various methods differ in how they set :
-
PI (Positional Interpolation): sets uniformly across all dimensions. This is simple but "crowds" positional information, making it hard for the model to distinguish closely positioned tokens because all relative distances are compressed by the same factor.
-
NTK-aware scaling: recognizes that uniform scaling destroys high-frequency positional information in lower dimensions. It instead increases the effective RoPE base value so that lower dimensions (with shorter periods) are minimally affected while higher dimensions receive larger scaling factors. The paper uses the formulation from Liu et al. (2023), where the new base is derived from the theoretical critical dimension, ensuring for while applying progressively smaller factors to lower dimensions.
-
YaRN: takes a three-zone approach (Figure 2b). Lower dimensions (high frequency) get no interpolation (), preserving their ability to distinguish nearby tokens. Higher dimensions get PI scaling (). A middle zone uses linearly increasing factors. This is the method used by LLaMA3.1 for its 128K extension.
-
LongRoPE (the predecessor): abandons theoretical derivation entirely in favor of a perplexity-guided evolutionary search that finds per-dimension scaling factors. It enforces a monotonic non-decreasing constraint () to maintain NTK-like behavior.
Despite these efforts, two major challenges remain unsolved (Section 2.4).
Challenge 1: Rescaling Theory Is Insufficient—The True Critical Dimension Is Earlier
Figure 2(c) shows a critical empirical finding: when extending Phi3-mini from 2K to 128K, NTK and LongRoPE both significantly outperform YaRN on RULER (a long-context stress test), even though all three methods satisfy the theoretical OOD constraint ( for ). The paper highlights two observations:
"(1) The theoretical lower bound, , is often suboptimal. Beyond dimension , YaRN strictly adheres to this bound (), but NTK and LongRoPE use larger values to achieve much better performance. (2) Beyond , larger scale factors don't always improve long-context performance."
This raises a fundamental question the paper addresses head-on: if is theoretically sufficient to keep rescaled periods within the pre-trained range, why do empirically larger factors consistently outperform? The answer, which forms the paper's central hypothesis (Section 3.1), is that the theoretical periods in higher RoPE dimensions are too optimistic—the empirical effective periods are longer because these dimensions are undertrained.
The intuition (Figure 3) is elegant. Lower RoPE dimensions have short periods (e.g., the 8th dimension completes a full rotation every 24 tokens in Phi3-mini). A single 2048-token training sample thus covers this dimension thousands of times—full, repeated training across the entire period. But the 48th dimension has a theoretical period of ~52,000 tokens, and within a 2048-token sample, the model sees only ~4% of one period. Worse, because real text rarely contains maximum-distance token dependencies (the last word of a document rarely depends directly on the first word), the effective range of relative positions actually encountered during training is even smaller. This under-training means the empirical period is effectively longer than theory predicts, and the true critical dimension—where OOD actually occurs—is shifted earlier (to a lower index) than the theoretical .
This hypothesis explains a persistent empirical puzzle in the literature: why prior work (Meta, 2024; Men et al., 2024a; Wang et al., 2024) found that "marginally larger scale factors than the extension ratio empirically improve performance." If the empirical periods are longer than theoretical, then larger rescaling factors are needed to bring those periods back within the model's effective training range.
Challenge 2: Short-Context Performance Collapse
The second unresolved challenge is equally critical for deployment. Every prior RoPE rescaling method causes substantial degradation on the original short-context tasks that the pre-trained model was good at. Table 4 quantifies this:
- For Phi3-mini extended to 128K: YaRN drops 7.56 MMLU points and 21.15 GSM8K points; NTK drops 4.35 MMLU points and 14.55 GSM8K points; even LongRoPE, the previous best, drops 3.52 MMLU points and 11.37 GSM8K points.
- For LLaMA3-8B: similar patterns of 1.5–4.4 MMLU point drops and 5–11.6 GSM8K point drops.
The industry's response to this problem has been brute force: massive continued pre-training. LLaMA3.1 (Dubey et al., 2024) uses a six-stage progressive extension process consuming 800B tokens to go from 8K to 128K. This is expensive, complex, and still doesn't fully solve the problem—as Figure 1 shows, LLaMA3.1-8B-128K's RULER performance degrades significantly beyond 64K.
The paper frames this as a fundamental tension: changing RoPE to accommodate long sequences alters the positional representation that the model's weights were optimized for during pre-training, and simply fine-tuning on long data doesn't restore the original representation for short sequences. Prior attempts to mitigate this through training-free short factors (LongRoPE) or data replay (Hu et al., 2024b) have been partial solutions at best.
Positioning: A Unified Diagnosis and Treatment
LongRoPE2 positions itself not as yet another rescaling formula, but as a method that diagnoses and fixes the root causes of both failures simultaneously:
-
The diagnosis (Section 3.1): The OOD problem isn't solved by any rescaling method that uses the theoretical critical dimension, because the true critical dimension is earlier due to undertraining. The paper provides a concrete, falsifiable hypothesis about why this happens.
-
The treatment for OOD (Section 3.2): Instead of deriving rescaling factors from theory, LongRoPE2 uses evolutionary search—but with a crucial innovation over its predecessor LongRoPE. The search is guided by needle-driven perplexity: rather than averaging PPL over all tokens (which obscures long-range dependency signals in irrelevant filler text), it synthesizes documents where a "needle" is inserted at the start and the model must retrieve it at the end, then computes PPL only on the needle tokens. This focuses the search metric on the exact capability that matters for long-context understanding.
-
The treatment for short-context collapse (Section 3.3): Instead of progressively extending or replaying pre-training data, LongRoPE2 uses mixed context window training—a conceptually simple approach where short sequences are packed to the target length, trained with the original RoPE and cross-document attention masking, while long sequences are trained with the rescaled RoPE and full attention. At inference time, the model switches between original and rescaled RoPE based on whether the input exceeds the pre-trained context length.
The paper explicitly contrasts itself with Meta's approach (Section 1): "using only 10B tokens—80× fewer than Meta's approach, which fails to reach the target effective context length." This is not just about efficiency—it's about effectiveness. Meta's 800B-token progressive extension still doesn't achieve the claimed 128K on RULER (Figure 1), while LongRoPE2's 10B-token approach does, and simultaneously preserves >98.5% of short-context performance. The paper is claiming a genuine breakthrough: that the right diagnosis of the OOD problem (undertrained higher dimensions shifting the critical dimension) combined with the right training strategy (mixed context windows) makes near-lossless extension possible at a fraction of the cost.
The Gap This Fills
Prior work treated RoPE rescaling as a solved problem with an unsolved implementation challenge (how to train efficiently). LongRoPE2 argues that the rescaling problem itself was never properly solved—existing methods use the wrong critical dimension because they don't account for undertraining. Once the correct critical dimension is identified (via needle-driven search) and the training strategy is aligned with the dual-use requirement (mixed context windows), both the long-context OOD problem and the short-context degradation problem are solved simultaneously.
This reframes the field's understanding: the bottlenecks weren't primarily about training data volume or progressive scheduling, but about a systematic misalignment between RoPE theory and RoPE practice that, once corrected, dramatically reduces the data and compute needed for effective context extension.
3. Technical Approach
3.1 Reader Orientation
LongRoPE2 is a context window extension system that takes a pre-trained LLM (which works on short sequences) and produces a modified version of that same model that works well on sequences up to 128K tokens long while retaining nearly all of its original short-sequence capability. The core problem it solves is the simultaneous failure of existing methods on two fronts: they don't actually achieve the claimed long-context performance (because they use the wrong critical RoPE dimension), and they degrade short-context performance (because they overwrite the original positional representation during fine-tuning). The shape of the solution is a diagnose-then-treat pipeline: diagnose the true critical dimension where RoPE values actually go out-of-distribution (via needle-driven evolutionary search), then treat both the long-context OOD problem (via rescaled RoPE with those discovered factors) and the short-context preservation problem (via mixed context window training that keeps the original RoPE active for short sequences).
3.2 Big-Picture Architecture (Diagram in Words)
The system has four major components connected in a linear pipeline:
-
Synthetic Needle Data Generator — creates controlled long documents where a specific "needle" text is placed at the start and a retrieval question at the end. This produces the evaluation signal for the search. Input: base documents from PG19 validation set. Output: needle-injected long documents with known correct answers.
-
Needle-Driven PPL Evaluator — takes a candidate set of RoPE rescaling factors, applies them to the frozen pre-trained LLM, runs the model on the needle documents, and computes perplexity exclusively on the needle-retrieval answer tokens. This metric focuses the search on long-range dependency understanding rather than averaging over irrelevant filler. Input: rescaling factors, pre-trained LLM, needle documents. Output: a scalar PPL score per candidate.
-
Critical-Dimension-Aware Evolutionary Search — initializes a population of rescaling factor vectors, evaluates them via the needle-PPL evaluator, and iteratively mutates the best performers to find the true critical RoPE dimension () and the optimal per-dimension scaling factors above it. The search respects a monotonic non-decreasing constraint and uses NTK scaling below . Input: pre-trained LLM configuration, target length, search hyperparameters. Output: the optimal and per-dimension rescaling factors .
-
Mixed Context Window Training — takes the discovered rescaling factors and fine-tunes the pre-trained LLM using two types of sequences packed to the target length: short sequences trained with the original RoPE and cross-document attention masking, and long sequences trained with the rescaled RoPE and full attention. At inference, the system switches RoPE based on input length. Input: pre-trained LLM, rescaling factors, mixed short/long training corpus. Output: a fine-tuned model that handles both short and long contexts.
Information flows sequentially: needle data is generated (component 1) → evolutionary search evaluates candidate rescaling factors against this data (components 2 and 3) → optimal factors are discovered → mixed context window training fine-tunes the model with dual RoPE representations (component 4) → inference-time length-based switching activates the appropriate RoPE.
3.3 Roadmap for the Deep Dive
-
First, the new RoPE OOD hypothesis (Section 3.1 of the paper)—why the theoretical critical dimension is wrong, what "insufficient training in higher dimensions" means mechanistically, and how this explains prior empirical puzzles. This is the intellectual foundation that motivates the entire method.
-
Second, the needle-driven PPL evaluation—how synthetic needle data is constructed, why standard PPL fails for long-context evaluation, and what the needle-based metric actually measures. This is the search objective, so understanding it is prerequisite to understanding the search.
-
Third, the critical-dimension-aware evolutionary search algorithm—initialization (Algorithm 1), mutation (Algorithm 2), how the search space is constrained, and what makes it different from LongRoPE's search. This is how the optimal rescaling factors are discovered.
-
Fourth, the mixed context window training procedure—how short and long sequences are packed and differentiated, how attention masking prevents cross-document leakage, and the inference-time RoPE switching mechanism. This is how the model is fine-tuned to use the discovered factors without losing short-context capabilities.
-
Fifth, the inference-time behavior—how the model decides which RoPE to use, the one-time KV cache recomputation cost, and the practical deployment implications.
3.4 Detailed, Sentence-Based Technical Breakdown
This is primarily an empirical analysis and systems paper whose core idea is that the true critical RoPE dimension differs from the theoretical one due to undertraining, and that fixing this diagnosis—combined with a dual-RoPE training strategy—enables near-lossless context extension at dramatically lower training cost.
The New RoPE OOD Hypothesis: Undertraining Shifts the Critical Dimension Earlier
What the hypothesis claims. The paper proposes that the empirical rotation periods of higher RoPE dimensions are longer than their theoretical values of , and that this discrepancy is caused by insufficient training on those dimensions during pre-training. As a consequence, the real critical dimension —the dimension index where RoPE values actually become out-of-distribution for extended positions—is smaller (earlier, corresponding to a lower cosine dimension index) than the theoretical critical dimension derived from Equation 7. The hypothesis is stated formally in Section 3.1:
"Insufficient training in higher RoPE dimensions extends empirical rotation periods beyond the theoretical . This discrepancy necessitates larger scale factors to mitigate RoPE OOD and lowering the critical dimension index below its theoretical ."
The mechanism of undertraining. To understand why higher dimensions are undertrained, the paper distinguishes between how lower and higher RoPE dimensions experience pre-training data. Figure 3 provides the visual intuition, but the operational explanation is as follows:
Lower RoPE dimensions (small index ) have short periods. For example, in Phi3-mini with and , the 8th cosine dimension has a period of:
which works out to approximately 24 tokens. Within a single 2048-token training sequence, the model sees the full rotation cycle of this dimension roughly times. Every possible relative position within that period is covered exhaustively, and the attention mechanism learns robust representations for all phase angles this dimension can produce.
Higher RoPE dimensions (large index ) have very long periods. The 48th cosine dimension (the highest in Phi3-mini, since ) has:
This is far longer than the pre-training context window of 2048. Within one training sequence, the model sees only of a single rotation period—a narrow arc of the cosine wave, not the full cycle.
Why this matters after self-attention. The crucial additional insight is that RoPE values are consumed through self-attention, where the relevant quantity is the relative position between query token and key token . Equation 4 shows that the attention inner product depends on , which means the effective RoPE range is determined by the maximum token distance that actually occurs in meaningful attention patterns, not by the absolute sequence length. Real-world text rarely contains long-range dependencies where the last token attends meaningfully to the first token—most attention is local. Consequently, the effective relative position range experienced during training is even smaller than the nominal sequence length, further compressing the portion of the cosine period that the model has learned to process. The paper states:
"As real-world data rarely contains long-range dependencies (e.g., distances of 2048 tokens), higher RoPE dimensions tend to be under-trained, amplifying period discrepancies."
The consequence: longer empirical periods. Because the model has only been trained on a small fraction of the theoretical period for higher dimensions, it has not actually learned the full cosine function for those dimensions. The effective period—the range of phase angles the model can reliably process—is shorter than the theoretical period. Equivalently, if we think about what range of cosine values the model has been exposed to during training and can generalize within, the practical rotation period is effectively stretched: a given change in relative position produces a smaller change in the model's internal representation than theory would predict, because the model's weights are underfit to the full cosine function.
This leads directly to the central empirical prediction: the critical dimension where OOD actually occurs must be earlier than theory predicts, because dimensions that theoretically should just barely complete a period within the pre-training window actually do not have sufficient training coverage to have learned that full period. The paper quantifies this concretely:
"Our rescaling factors shift the theoretical critical dimension from 31 to 25 and from 35 to 30, respectively."
For Phi3-mini (2K → 128K), the theoretical critical dimension is the 31st cosine dimension (index 31, corresponding to in the full RoPE dimension indexing). LongRoPE2's search finds that the real critical dimension is actually the 25th cosine dimension—six dimensions earlier. For LLaMA3-8B (8K → 128K), the theoretical critical dimension is 35, and the real one is 30—five dimensions earlier.
Why this hypothesis explains prior results. The hypothesis resolves the puzzle from Section 2.4: why do empirically larger rescaling factors than consistently improve performance? If the empirical periods are longer than the theoretical periods, then the theoretical lower bound is insufficient—it brings the rescaled periods within the theoretical range, but not within the effective range that the model has actually learned. Larger scaling factors are needed to compress the periods further, into the narrower range of phase angles the model has been robustly trained on.
Similarly, the hypothesis explains why methods that use the theoretical critical dimension (like YaRN, which strictly sets for ) underperform: they leave a gap of dimensions—those between and —that are treated as if they had full-period training but actually don't. These dimensions remain OOD after rescaling, and the model's performance degrades when it encounters them at extended positions.
What the hypothesis does NOT claim. The paper is careful not to claim that higher RoPE dimensions receive fewer training steps or gradient updates—the model is trained end-to-end on every token position. Rather, the claim is about coverage of the function space: higher dimensions have a larger input domain (more possible phase angles) but are trained on a smaller fraction of that domain due to the combination of long theoretical periods and limited effective relative positions in real text. This is an issue of functional undertraining—the model's weights for processing high-dimensional RoPE values are underdetermined by the training data distribution.
Needle-Driven Perplexity Evaluation
The failure of standard perplexity for long-context evaluation. The paper identifies a fundamental flaw in using standard perplexity to guide rescaling factor search (Section 3.2). Standard language modeling PPL averages the negative log-likelihood over all tokens in a sequence:
This formulation weights every token equally, but in a long document, the vast majority of tokens are predictable from local context alone. The final token of a 128K-token book can almost always be predicted from the preceding paragraph without any dependency on the first chapter. Standard PPL is therefore dominated by short-range prediction accuracy, which is largely unaffected by long-range RoPE quality.
This creates a perverse incentive for rescaling factor search: factors that optimize standard PPL may look good on the metric while failing to enable genuine long-range understanding. The paper states:
"First, long sequences often contain irrelevant or low-dependency tokens, reducing the effective maximum token dependency... Second, standard PPL, by averaging over all token equally, fails to effectively capture the long-context abilities and can be dominated by irrelevant tokens, obscuring key answer tokens."
Synthetic needle data construction. To solve this, LongRoPE2 constructs synthetic evaluation documents with controlled, maximal token dependency distances. The procedure (Section 3.2, with an example in Appendix C) is:
- Sample 10 books from the PG19 validation set to serve as background "haystack" text.
- At the start of each sample, insert a needle—a specific piece of information that must be memorized. The example in Appendix C is:
"One of the special magic numbers for numerous-kite is: 6716097." - Append the sampled book text after the needle, padded or truncated to the target context length (128K tokens).
- At the very end of the document (at the maximum possible token distance from the needle), append a retrieval question:
"What is the special magic number for numerous-kite mentioned in the provided text?" - The correct continuation—the needle answer tokens—are
"6716097."
The key design property: every token between the needle and the retrieval question is irrelevant filler with no dependency on the needle. To correctly predict the answer tokens, the model must attend across the full 128K-token distance back to the needle at the start. This isolates the long-range attention capability that rescaling factors are supposed to enable.
Needle-driven PPL computation. The evaluator computes perplexity only on the needle answer tokens, not on the entire document. Formally, let the sequence be where is the target context length, and let the needle answer occupy positions (the retrieval answer at the end). The needle-driven PPL is:
where the prediction is computed using the LLM with the candidate rescaling factors applied to RoPE.
What this measures. The needle-driven PPL evaluates whether the rescaled RoPE enables the model to attend effectively across the maximum token distance in the document. If the rescaling factors properly address the OOD issue for all RoPE dimensions, the model can retrieve the needle information from the distant context and predict the answer tokens with low perplexity. If the rescaling factors are insufficient or over-aggressive, the positional representation degrades, the model cannot associate the retrieval question with the distant needle, and the perplexity on the answer tokens spikes.
Why needle-based rather than accuracy-based. Using PPL on the answer tokens rather than a binary retrieval accuracy metric provides a continuous, differentiable-like signal (in the sense of being sensitive to small improvements) that enables the evolutionary search to distinguish between candidate rescaling factors that are all capable of sometimes retrieving the needle but with varying confidence. It also avoids the need for generation and answer parsing during the search loop, making evaluation faster and more reliable.
Comparison to naive PPL search (Table 6). The paper validates this design choice by comparing rescaling factors found by needle-PPL-guided search versus standard PG19-128K PPL-guided search, using identical search and mid-training procedures. The needle-PPL factors yield substantially higher RULER scores at 128K: 58.81 vs. 50.23 for Phi3-mini and 82.03 vs. 78.68 for LLaMA3-8B. The gap is largest at longer context lengths (the difference at 4K is small—90.41 vs. 91.16 for Phi3-mini), confirming that the needle-PPL metric specifically improves long-range capabilities. The paper notes:
"Naive PPL-guided search fails to ensure effective rescaling factors, as it struggles to identify the correct critical dimension and tends to yield slightly smaller scaling factors."
Critical-Dimension-Aware Evolutionary Search
Search objective. The goal of the evolutionary search is to find:
- The real critical dimension (a single integer index)
- The per-dimension rescaling factors for (a vector of values for dimensions at and above the critical dimension)
- The NTK base value for dimensions (derived from )
such that when these rescaling factors are applied to the frozen pre-trained LLM, the needle-driven PPL is minimized.
What the search optimizes over. For a model with RoPE dimension (so there are cosine dimensions), and a candidate critical dimension , the search space consists of:
- The value of itself (a discrete choice among candidate indices from to , where is the dimension index where the theoretical RoPE period equals 10 periods within the pre-training window)
- The scaling factors for dimensions above and including the critical dimension
- Each factor is constrained to the range , where is the extension ratio (64 for 2K → 128K)
- The factors must satisfy the monotonic non-decreasing constraint: for all , following the NTK insight that higher dimensions (with longer periods) need at least as much rescaling as lower dimensions
- Dimensions are not searched; they are deterministically set via NTK scaling using a base value derived from the rescaling factor at
Initialization (Algorithm 1). The population is initialized with candidate solutions (population size , stated in Appendix B). The initialization procedure works as follows:
-
Compute , the dimension index where the theoretical RoPE period equals (i.e., 10 full periods within the pre-training window). This serves as the lower bound for candidate critical dimensions—dimensions below this have seen so many periods that they are almost certainly not undertrained.
-
For each candidate critical dimension in the range :
- Randomly sample a scale factor from the integer range
- Set for all (initially uniform scaling for the OOD region)
- Compute the adjusted base value as the value that, when used with NTK scaling, produces a factor of at dimension :
- Apply standard NTK-aware scaling (from Liu et al., 2023) for all dimensions using this adjusted base
- Add the complete scaling factor vector to the population
This initialization ensures that the population covers diverse candidate critical dimensions while each candidate satisfies the theoretical OOD lower bound ( for ) and respects the monotonic constraint.
Evaluation. For each candidate scaling factor vector in the population:
- Apply the rescaling factors to the frozen pre-trained LLM's RoPE (modify at each dimension)
- Run the model on the needle-injected synthetic documents
- Compute needle-driven PPL as described above
- Record the PPL as the fitness score (lower is better)
The evaluation is done with the base model weights frozen—no training is performed during search. This makes the search purely about finding rescaling factors that best preserve the pre-trained positional knowledge while extending the effective context.
Mutation (Algorithm 2). In each evolutionary iteration, the algorithm:
- Selects the top- candidates from the current population (elite selection; the specific is not stated but is implied to be a fraction of the population size)
- For each elite candidate, creates a mutated copy:
- Splits the rescaling factors at into two groups
- For the higher group (): applies mutation with probability (stated in Appendix B). The mutation perturbs individual scaling factors while respecting the monotonic non-decreasing constraint () and staying within the search space
- After mutation, updates the adjusted base based on the new value of (the first mutated dimension):
- For the lower group (): recomputes scaling factors via NTK scaling using the updated
- Evaluates all mutated candidates via needle-driven PPL
- Adds the mutated candidates to the population, keeping the population size constant (replacing the worst performers)
The search runs for 40 iterations (Appendix B), producing a final population from which the candidate with the lowest needle-driven PPL is selected as the optimal solution.
Why the search is constrained to . An ablation in Appendix B (Table 10) shows that allowing the search to optimize all dimensions (including those below ) actually underperforms the restricted search. The paper hypothesizes:
"Limiting the search to higher dimensions significantly reduces the search space, enabling a more effective discovery of the optimal solution."
This is a classic exploration-exploitation tradeoff: the unrestricted search space is combinatorially large ( dimensions with continuous-valued factors), making it difficult for a population of 64 to cover effectively. By restricting search to the dimensions most affected by OOD (and using principled NTK scaling for the well-trained lower dimensions), the search converges to better solutions faster.
Why monotonic non-decreasing constraint. The constraint encodes the NTK insight that higher RoPE dimensions (with longer periods) need at least as much rescaling as lower dimensions. This is both a theoretical prior (it's what all NTK-derived methods naturally produce) and a practical regularization that prevents the search from exploring degenerate solutions where, say, a middle dimension receives huge rescaling while adjacent dimensions receive none.
Search hyperparameters summary (from Appendix B). Population size , evolution iterations , mutation probability . The search space for scaling factors is . The evaluated models are the frozen pre-trained LLMs; no training occurs during search.
Search results (Figure 4). The discovered rescaling factors for Phi3-mini-128K show (vs. theoretical ), with scaling factors for dimensions 25–48 ranging approximately from 70 to 120, compared to YaRN's flat 64, NTK's much larger values (200+ at dimension 48), and LongRoPE's intermediate values. For LLaMA3-8B-128K, (vs. theoretical ). The key pattern is that LongRoPE2's scaling factors are:
- Larger than YaRN/PI for the OOD dimensions (because the theoretical lower bound is insufficient)
- Smaller than NTK especially at the highest dimensions (because NTK's global base adjustment over-corrects, crowding positional information more than necessary)
- Starting earlier (at a lower dimension index) than any method using the theoretical critical dimension
Mixed Context Window Training
The dual-RoPE training strategy. Once the optimal rescaling factors are discovered, they must be integrated into the LLM through fine-tuning. The paper introduces mixed context window training (Section 3.3, Figure 5), which trains the model to simultaneously handle short sequences (using original RoPE) and long sequences (using rescaled RoPE).
The core insight is that RoPE rescaling changes the positional representation that the model's weights were optimized for during pre-training. Simply fine-tuning on long data with rescaled RoPE causes the model to "forget" its original short-context positional understanding—this is why prior methods show substantial drops on MMLU and GSM8K. Mixed context window training avoids this by explicitly maintaining both representations during fine-tuning.
Training data construction. The paper constructs a mixed training corpus (Table 1) with two types of data:
Short context window data (3B tokens total):
- Sequences with length (the pre-trained context window: 2K for Phi3-mini, 8K for LLaMA3-8B)
- Sampled from Fineweb-Edu (1B tokens) and the short end of the long-context data distribution (2B tokens of sequences from RedPajama/StarCoder)
- These short sequences are packed concatenated to fill the full target length : multiple short documents are concatenated with BOS and EOS tokens separating them
Long context window data (7B tokens total):
- Sequences with lengths from to 200K tokens
- Sampled from RedPajama-v1 (4.5B tokens), RedPajama-v2 (2.5B tokens), and StarCoder (2B tokens), following the per-source upsampling from Fu et al. (2024)
- Long documents are chunked into 128K-token segments with BOS and EOS tokens, padded or truncated as needed
How the training differentiates short from long sequences (Figure 5). The key mechanism is in the attention computation. For each packed 128K-token training sample, the data loader attaches a label indicating whether the sample is a "short context window" sample (packed from short documents) or a "long context window" sample (chunked from a long document):
-
Short context window samples (Figure 5a): The model uses original RoPE (no rescaling) with cross-document attention masking. The attention mask is constructed using the
cu_seqlens(cumulative sequence lengths) functionality of FlashAttention-2, which restricts self-attention to only tokens within the same original short document. Tokens from document cannot attend to tokens from document , even though they are adjacent in the packed sequence. This ensures the model processes each short document independently using its pre-trained positional representation. -
Long context window samples (Figure 5b): The model uses rescaled RoPE (with the discovered scaling factors) with full causal attention across the entire 128K-token segment. Tokens can attend to any previous token in the segment, up to the full 128K distance.
The two types of samples are interleaved during training: the model sees both short-packed batches and long-full-attention batches within each epoch. This means the model's weights are updated to handle both RoPE variants simultaneously.
Training hyperparameters (Section 4.1 and Appendix B). The model is trained for 1 epoch on the 10B-token dataset using 64 A100 GPUs with FlashAttention-2 and nnScaler for distributed training. The global batch size is 64 sequences of 128K tokens each. The initial learning rate is with a cosine learning rate scheduler. Training takes approximately 39 hours for Phi3-mini and 54 hours for LLaMA3-8B.
Why this solves the short-context degradation problem. During fine-tuning, the model's weights are updated through gradients from both short-context training (with original RoPE) and long-context training (with rescaled RoPE). The short-context gradients explicitly reinforce the original positional representations, preventing the model from overwriting them. The long-context gradients adapt the model to the new rescaled positional representation for positions beyond .
The paper notes an interesting emergent benefit (Table 7 ablation):
"Interestingly, mixed context window training not only preserves short performance but also improves long-context performance (8k–128k). This may be attributed to the preservation of pre-trained RoPE for shorter contexts, allowing long-context training to focus more effectively on adapting to the new introduced token positions."
In other words, by keeping the original RoPE for short contexts, the model doesn't have to "relearn" how to process positions 0– under the rescaled RoPE—that part of the positional representation is preserved from pre-training. The long-context training can then focus exclusively on learning the new positional relationships introduced by the rescaled RoPE at positions , making more efficient use of the limited training budget.
Comparison to alternative training strategies. Prior work has used:
- Progressive extension (LLaMA3.1): extend context in stages (8K → 16K → 32K → 64K → 128K), each with its own rescaling and training phase. This is expensive (800B tokens) and still doesn't preserve short-context performance—each stage partially overwrites the positional representation, and without explicit short-context training, the accumulated degradation is substantial.
- Pre-training data replay (Hu et al., 2024b): mix in original pre-training data during long-context fine-tuning. This helps but doesn't directly address the positional representation mismatch—the model still only sees one RoPE variant during training.
- Training-free short factors (LongRoPE): use a separate set of rescaling factors for short sequences and switch at inference. This is computationally elegant but fails to fully close the performance gap (Table 4 shows LongRoPE still loses 3.52 MMLU points on Phi3-mini) because the model weights haven't been trained with the original RoPE at all during fine-tuning.
Mixed context window training is conceptually simpler than progressive extension, more effective than data replay, and more principled than training-free factor switching—it trains the model to handle both RoPE variants, making the inference-time switch a natural operation rather than a hack.
Inference-Time RoPE Switching
The switching mechanism. At inference time, the model must decide which RoPE variant to use for a given input. The rule is (Appendix B, Figure 10 pseudocode):
"The switch between rescaled and original RoPE is triggered when the combined length of the input context and generated tokens exceeds the pre-trained context window."
Concretely:
- If the input sequence length (context + generated tokens so far) is , use the original RoPE with the pre-trained and no rescaling.
- If the sequence length exceeds , switch to the rescaled RoPE with the discovered per-dimension scaling factors .
This means that for short queries (a few paragraphs, typical chat interactions), the model uses exactly the same positional encoding it was pre-trained with—zero degradation. Only when the conversation or document grows beyond the pre-trained context window does the model switch to rescaled RoPE.
The one-time KV cache recomputation cost. Switching RoPE mid-sequence is not free. The key-value (KV) cache computed up to the switch point was calculated using the original RoPE. After switching, the model needs KV representations computed with the rescaled RoPE for all previous tokens. This requires a one-time recomputation of the entire KV cache for the input context when crossing the boundary.
The paper acknowledges this as a limitation:
"Switching to rescaled RoPE for long-context inference requires a one-time recalculation of the KV cache, a potential limitation we leave for future work."
The cost of this recomputation is proportional to the input length at the switch point—essentially one forward pass through the model for the prefix tokens. For a switch at 8K tokens (LLaMA3-8B's pre-trained context), this is a modest cost relative to generating 128K tokens of output. For latency-sensitive applications, this could be optimized by pre-computing both KV caches (original and rescaled) for the input or by developing a conversion function that maps original-RoPE KV states to rescaled-RoPE KV states without a full recomputation.
Why the switch point is at rather than earlier or later. The mixed context window training aligns with this switch point: the model has been trained with original RoPE for sequences and rescaled RoPE for sequences . Switching at is therefore the natural boundary that matches the training distribution. Switching earlier would use rescaled RoPE on positions the model was trained to process with original RoPE (potential degradation); switching later would use original RoPE on positions beyond its training range (OOD collapse).
The pseudocode (Figure 10). The implementation is straightforward: the RoPE computation function checks if (torch.max(position_ids) + 1) > original_max_position_embeddings and selects ext_factors = long_factor if true, ext_factors = short_factor (which equals 1, i.e., no scaling) if false. This check happens once per forward pass and applies uniformly to all tokens in the sequence for that pass.
Summary of Design Choices and Their Justifications
- Search restricted to candidate values starting from rather than : Dimensions below have seen 10+ full periods during pre-training and are almost certainly not undertrained. Including them in the search would expand the search space enormously without benefit—Table 10 confirms that unrestricted search performs worse.
- NTK scaling for rather than searching those dimensions: The lower dimensions are well-trained and NTK provides a principled, theory-grounded way to minimally adjust them. Searching them would risk overfitting to the needle data while providing marginal gains.
- Needle-driven PPL rather than retrieval accuracy as the search objective: PPL provides a continuous signal sensitive to confidence calibration, not just binary correctness. This enables the evolutionary search to distinguish between candidates that all achieve correct retrieval but with varying degrees of certainty and robustness.
- Monotonic non-decreasing constraint on : Encodes the NTK insight that higher dimensions need at least as much rescaling as lower ones. Acts as a strong regularizer on the search space.
- Mixed context window training rather than progressive extension or data replay: Directly addresses the root cause of short-context degradation (positional representation mismatch) rather than working around it. Simpler, cheaper, and more effective than alternatives.
- RoPE switching at rather than continuous blending: Matches the training distribution exactly. The model has seen original RoPE for positions up to and rescaled RoPE for positions beyond—the switch boundary is cleanly defined by training.
4. Key Insights and Innovations
Innovation 1: Undertraining in Higher RoPE Dimensions as a Diagnostic Concept
The paper's most intellectually distinctive contribution is not a new rescaling formula but a diagnostic hypothesis about why existing rescaling methods fail. The field had converged on the RoPE OOD theory (Liu et al., 2023; Chen et al., 2023): dimensions where the rotation period exceeds the pre-training length produce out-of-distribution values at extended positions, and rescaling factors must satisfy λ_i ≥ L/L_train for those dimensions. This theory gives a clean, analytically derived critical dimension d_tcd (Equation 7) that partitions dimensions into "safe" and "OOD" groups.
LongRoPE2 makes a fundamental challenge to this theory: the empirical rotation periods in higher dimensions are longer than the theoretical values because those dimensions are undertrained. The mechanism is not that the model receives fewer gradient updates—it's that the functional coverage is incomplete. A dimension with a theoretical period of 62,000 tokens, trained on sequences of 2,048 tokens where real text rarely contains maximal-distance dependencies, has effectively never experienced a full rotation. The model's weights are underfit to the complete cosine function, and the practical rotation period is stretched beyond the theoretical 2π/θ_i.
Figure 4 makes this concrete: for Phi3-mini, the theoretical critical dimension shifts from cosine dimension 31 to dimension 25. Six RoPE dimensions—roughly 13% of all dimensions—that prior theory treated as well-trained and safe are actually in the OOD regime. For LLaMA3-8B, the shift is from 35 to 30.
Why this is conceptually novel. Prior work observed empirically that larger scaling factors than L/L_train improved performance (Meta, 2024; Men et al., 2024a; Wang et al., 2024), but treated this as a tuning artifact—a "slightly larger is better" heuristic without a mechanistic explanation. LongRoPE2 provides the explanation: larger factors are necessary because the empirical periods are longer than theory predicts, so the theoretical lower bound on rescaling is insufficient to bring periods within the model's effective training range. The paper converts an empirical puzzle into a falsifiable hypothesis with a specific mechanism (insufficient functional coverage of high-dimension cosine periods) and a quantitative prediction (the critical dimension shifts earlier). The ablation in Table 5 validates this: applying only the corrected critical dimension to YaRN and NTK (YaRN-rcd and NTK-rcd) improves their long-context performance substantially, confirming that the critical dimension shift—independent of the specific scaling factors—is a genuine driver of the gains.
Significance beyond performance. This hypothesis reframes context extension from "find the right scaling formula" to "diagnose the actual training coverage of each RoPE dimension." It implies that the effective critical dimension is not a fixed mathematical property of θ_base and L_train but a model-specific, data-dependent quantity that depends on what relative positions the model actually encountered during pre-training. A model trained on code (with long-range syntactic dependencies) might have a different effective critical dimension than one trained on short-form dialogue. This opens a new axis for analysis: measuring effective RoPE training coverage rather than assuming theoretical periods are fully learned.
Innovation 2: Needle-Driven Perplexity as a Search Objective That Isolates Long-Range Capability
The paper's second conceptual contribution is the insight that standard perplexity is a fundamentally broken metric for evaluating and optimizing long-context positional encoding, and that a targeted, dependency-controlled evaluation signal—needle-driven PPL—is both necessary and sufficient for discovering effective rescaling factors.
Standard language modeling PPL averages the model's predictive loss over all tokens in a sequence. The paper identifies a specific failure mode: in a 128K-token document, the overwhelming majority of tokens are predictable from local context (the preceding paragraph). The perplexity signal from these tokens swamps the signal from rare tokens that actually depend on long-range attention, like the answer to a question about information presented 100K tokens earlier. A rescaling factor that destroys the model's ability to attend across 100K tokens will look nearly identical in standard PPL to one that preserves it, because 99% of the tokens don't require that capability.
This is not a minor implementation detail—it is a measurement validity problem at the heart of prior work. LongRoPE (Ding et al., 2024) used standard PPL-guided evolutionary search, and while it outperformed theoretically-derived methods, the paper's results suggest that search was operating on a degraded signal. Table 6 quantifies this: rescaling factors found by needle-PPL-guided search yield 8.6 and 3.4 absolute percentage point improvements at 128K on RULER for Phi3-mini and LLaMA3-8B respectively, compared to factors found by standard PPL search with identical search and training procedures.
The conceptual move: from corpus-based to capability-based evaluation. The paper's synthetic needle construction is not just a better dataset—it's a methodological principle. By inserting a memorization target at the start of a document and measuring prediction quality exclusively on the retrieval answer at the end, the evaluation isolates the maximum-distance attention capability that rescaling factors are supposed to enable. The filler text between needle and query ensures that every intervening token is a distractor with no dependency on the needle, amplifying the signal from long-range attention failure. This is analogous to the difference between evaluating a student on "read this book and I'll randomly quiz you on any sentence" versus "read this book and tell me the specific fact from page 1"—the latter directly measures long-range information retention while the former is dominated by local comprehension.
Why this matters beyond this paper. The needle-driven PPL concept generalizes to any long-context optimization problem where the evaluation metric needs to isolate specific capabilities from the background of short-range prediction. As the field moves toward million-token contexts, the signal-to-noise problem in standard PPL will only worsen—an even larger fraction of tokens will be locally predictable. Needle-driven evaluation provides a template for constructing targeted metrics that measure the specific long-range capabilities that context extension methods are designed to enable.
Innovation 3: Mixed Context Window Training as a Unified Solution to the Short-Context Degradation Problem
The paper's third conceptual contribution is reframing the short-context performance degradation problem and solving it through simultaneous dual-representation training rather than post-hoc mitigation.
Prior work treated short-context degradation as a side effect of context extension that must be compensated for: either through massive data replay during training (Hu et al., 2024b), progressive multi-stage extension to soften the representation shift (Dubey et al., 2024), or training-free factor switching that approximates original-RoPE behavior at short lengths (LongRoPE, Ding et al., 2024). Each of these approaches accepts the premise that fine-tuning with rescaled RoPE will overwrite the original positional representation, and then tries to either slow down the overwriting or patch it afterward.
LongRoPE2 makes a different move: train the model to handle both RoPE variants simultaneously. Short sequences are packed and trained with original RoPE + cross-document attention masking. Long sequences are trained with rescaled RoPE + full attention. The model's weights learn to route positional information through the appropriate representation based on the RoPE variant active during each sample. At inference, switching RoPE based on sequence length is not a hack—it's exactly what the model was trained to do.
Why this is conceptually distinct from prior approaches. Progressive extension (LLaMA3.1's six-stage, 800B-token process) can be understood as temporal separation: the model first learns one representation, then another, each partially overwriting the previous. Data replay can be understood as data mixing: the model sees both short and long content, but only one RoPE representation. Mixed context window training is representational coexistence: the model maintains both positional encoding schemes and learns when to use each. The fact that this works—and Table 7 shows it actually improves long-context performance compared to training with rescaled RoPE alone—suggests that the model benefits from not having to "relearn" short-range positional relationships. The original RoPE preserves the pre-trained positional knowledge, and the rescaled RoPE only needs to be learned for the new, extended positions.
Significance as a design principle. This framing suggests a more general principle for any model modification that changes the input representation: rather than transitioning from old representation to new representation and then trying to recover the old behavior, maintain both representations during the transition and let the model learn to route between them. This is conceptually similar to multi-task learning, where shared representations are trained on multiple tasks to prevent catastrophic forgetting—but applied to positional encoding rather than task objectives. The approach could generalize to other representation modifications beyond RoPE rescaling, such as vocabulary expansion or modality addition.
The efficiency implication is a consequence, not the innovation. The paper highlights that LongRoPE2 uses 80× fewer training tokens than Meta's approach. But the intellectual contribution is not the efficiency—it's the insight that progressive extension and data replay are both attacking the wrong problem. They assume that degradation is caused by insufficient training on the original data distribution, when it's actually caused by representation overwriting. Once you prevent the overwriting, you don't need massive replay or progressive scheduling.
Innovation 4: Verifier-Informed Search Space Design Through Dimension Partitioning
The paper makes a subtle but important contribution in how it constrains the evolutionary search space by partitioning RoPE dimensions at the critical dimension and applying different treatment to each partition.
LongRoPE (Ding et al., 2024) also used evolutionary search to find rescaling factors, but LongRoPE2 introduces a specific architectural constraint: search is restricted to dimensions i ≥ d_rcd, while dimensions i < d_rcd are deterministically set via NTK scaling using a base value derived from d_rcd. The search algorithm (Algorithm 1) initializes candidates by iterating over possible critical dimensions, and the mutation operator (Algorithm 2) updates the NTK-derived lower dimensions whenever the higher-dimension scaling factors change.
This is not merely an efficiency hack to reduce search space (though it does that). It is an inductive bias informed by the undertraining hypothesis: the paper's diagnosis says that lower dimensions are well-trained and higher dimensions are not, so the search should focus its representational capacity on the problematic dimensions while using theory-grounded defaults for the trustworthy ones. The ablation in Table 10 confirms that unrestricted search over all dimensions underperforms the partitioned search—the unconstrained search finds scaling factors that yield worse RULER scores at 128K. This is a non-obvious result: given more degrees of freedom, the search finds worse solutions, likely because it overfits to the needle data or explores degenerate configurations that standard PPL cannot distinguish but that fail on real long-context tasks.
Why this is conceptually interesting. It's a case study in how domain knowledge (the undertraining hypothesis) can be encoded as a search space constraint to make black-box optimization more effective. The search is not just "find 48 scaling factors"—it's "find the boundary between well-trained and undertrained dimensions, then optimize only the undertrained ones." This partitions the problem into a discrete structural choice (where is d_rcd?) and a continuous optimization (what scaling factors above d_rcd?), with the discrete choice having outsized impact on the search because it determines which dimensions get searched vs. theory-grounded defaults.
The paper also introduces the monotonic non-decreasing constraint (λ_i ≤ λ_{i+1}), inherited from NTK-aware methods, as a regularization on the mutation operator. This prevents the search from exploring solutions where, say, dimension 30 receives a scaling factor of 120 while dimension 31 receives 70—configurations that would create discontinuities in the positional representation and likely fail to generalize. This is a soft form of physics-informed machine learning: the optimization respects the known structure of the problem (higher dimensions need at least as much rescaling as lower ones) while still exploring freely within that constraint.
5. Experimental Analysis
Evaluation Methodology
-
Dataset. The paper uses a 10B-token mid-training corpus constructed from multiple sources. For long-context data (7B tokens): 4.5B tokens from RedPajama-v1, 2.5B tokens from RedPajama-v2, and 2B tokens from StarCoder, following the per-source upsampling strategy from Fu et al. (2024), covering sequence lengths from 8K to 200K tokens. For short-context data (3B tokens): 1B tokens from Fineweb-Edu plus short sequences (≤ L_train) from the long-context data sources. For evaluation, the paper uses RULER (13 synthetic long-context tasks plus needle-in-a-haystack at multiple lengths), three real-world long-context benchmarks (LOFT with 7 retrieval tasks, InfiniteBench with key-value retrieval and multi-choice QA, and LongBench with in-context learning and code completion), and standard short-context benchmarks (MMLU, MMLU-Pro, HellaSwag, TruthfulQA, GSM8K) evaluated within a 4096-token context window.
-
Base model(s). The paper experiments on LLaMA3-8B (8K pre-trained context) and Phi3-mini-3.8B (2K pre-trained context). Phi3-mini is chosen as a "rigorous testbed for evaluating RoPE rescaling methods" because its limited capabilities (3.8B parameters) make it particularly sensitive to OOD issues, while LLaMA3-8B represents a more capable model at a scale commonly deployed in practice. Both models use RoPE with θ_base = 10000 and are extended to a 128K target context window.
-
Metrics. The primary long-context metric is the average score across all 13 RULER tasks evaluated at multiple context lengths (4K, 8K, 16K, 32K, 64K, 128K), with per-task breakdowns provided in Tables 8 and 9. Real-world long-context benchmarks report task-specific metrics: LOFT uses accuracy/retrieval scores per task (ArguAna, FEVER, HotPotQA, MS MACRO, NQ, Quora, SciFact); InfiniteBench reports key-value retrieval accuracy and English multi-choice QA accuracy; LongBench reports TriviaQA, TREC (in-context learning), LCC, and RepoBench-P (code) scores. Standard benchmarks use their conventional metrics: MMLU and MMLU-Pro use accuracy; HellaSwag uses accuracy; TruthfulQA uses MC1; GSM8K uses exact match accuracy. Needle-in-a-haystack is evaluated by running 10 trials at each (document length, needle depth) combination and reporting retrieval accuracy as a heatmap.
-
Baselines. The paper compares against three prior RoPE rescaling methods, all using the same mid-training procedure for fairness: YaRN (Peng et al., 2023), which divides RoPE dimensions into three zones with PI scaling for high dimensions, no interpolation for low dimensions, and linear interpolation in between; NTK (as formulated by Liu et al., 2023), which computes a new RoPE base θ_ntk from the theoretical critical dimension and applies NTK-aware scaling across all dimensions; and LongRoPE (Ding et al., 2024), which uses PPL-guided evolutionary search to find per-dimension scaling factors with a monotonic non-decreasing constraint. For LLaMA3-8B, an additional comparison is made against Meta's LLaMA3.1-8B-128K (Dubey et al., 2024), which uses YaRN rescaling with 800B tokens of progressive six-stage training, including the instruction-tuned LLaMA3.1-8B-Instruct variant for needle-in-a-haystack tests.
-
Generation budget / compute accounting. Training compute is measured in training tokens (10B total for LongRoPE2 vs. 800B for LLaMA3.1), with wall-clock time reported as 39 hours for Phi3-mini and 54 hours for LLaMA3-8B on 64 A100 GPUs using FlashAttention-2 and nnScaler for distributed training. The search phase uses a population size of P=64 evaluated over 40 evolutionary iterations with a mutation probability of p=0.3 (Appendix B). For evaluation, long-context benchmarks measure accuracy at the target context lengths without generation budget constraints—the models are evaluated at each specified length (4K through 128K) using the appropriate RoPE variant. The needle-driven PPL search uses 10 synthetic documents constructed from PG19 validation set books as described in Section 3.2.
-
Cross-validation / statistical protocol. No cross-validation or statistical significance testing is reported. The evolutionary search selects the single rescaling factor configuration with the lowest needle-driven PPL, which is then applied in a single mid-training run. Evaluation results are reported as point estimates without confidence intervals. For needle-in-a-haystack, 10 trials are run at each (length, depth) combination to produce the heatmap visualizations (Figures 6, 7, and 8).
Main Quantitative Results
Long-Context Performance on RULER
The headline result for long-context stress testing appears in Table 2. LongRoPE2 achieves the highest RULER scores across all evaluation lengths for both model sizes, with the advantage growing at longer contexts. For LLaMA3-8B at 128K, LongRoPE2 achieves 82.03, compared to NTK's 73.19, LongRoPE's 73.40, and YaRN's 49.39. The critical pattern is that prior methods degrade substantially as context length increases beyond 64K: YaRN drops from 84.67 at 16K to 49.39 at 128K; NTK drops from 91.93 at 16K to 73.19 at 128K; LongRoPE drops from 91.01 at 16K to 73.40 at 128K. LongRoPE2, by contrast, maintains 92.31 at 16K and 82.03 at 128K—a much shallower degradation curve (roughly 10 points vs. 35–18 points for baselines). For Phi3-mini-3.8B at 128K, LongRoPE2 achieves 58.81, compared to LongRoPE's 53.71, NTK's 49.37, and YaRN's 39.37. The paper notes that the 58.81 score is "skewed by tasks with low scores on smaller LLMs, such as CWE, which achieves only 1% accuracy," with full per-task breakdowns in Tables 8 and 9 showing that needle-in-a-haystack tasks (NIAH single 1–3) achieve 95–100% accuracy at 128K while multi-hop QA drops to 34% (Phi3-mini) and 50% (LLaMA3-8B).
A notable pattern in the per-task results (Tables 8 and 9): for both models, single-key needle retrieval tasks (NIAH single 1, 2, 3) remain at 95–100% accuracy at 128K, while multi-key tasks degrade more (NIAH multikey 2 drops to 40% for Phi3-mini at 128K). The variable tracking (VT) task shows reasonable preservation (35.2% for Phi3-mini, 92.6% for LLaMA3-8B at 128K), while the common word extraction (CWE) task is near floor for Phi3-mini (0.3% at 128K) and heavily degraded for LLaMA3-8B (9% at 128K), confirming that some synthetic tasks are fundamentally hard for smaller models regardless of context extension quality.
Needle-in-a-Haystack Pressure Tests
Figure 6 (and the expanded Figures 7–8 in Appendix B) shows near-perfect needle retrieval across all document lengths and depths for LongRoPE2 on both models. In contrast, NTK fails at longer contexts (the heatmaps show degraded regions at the highest lengths), and LLaMA3.1-8B extended by YaRN—despite 800B tokens of training—"fails beyond 100k" according to the paper's heatmap comparison. LLaMA3.1-8B-Instruct also shows degraded retrieval at the longest context lengths. This is a critical result because it demonstrates that massive training data budgets (80× more tokens) cannot compensate for suboptimal rescaling factors: YaRN's rescaling with the theoretical critical dimension, even with 800B tokens of fine-tuning, still fails to achieve effective 128K retrieval.
Real-World Long-Context Benchmarks
Table 3 reports results on LOFT, InfiniteBench, and LongBench. The aggregate pattern is consistent: LongRoPE2 outperforms all baselines across nearly all tasks. For LLaMA3-8B, LongRoPE2 achieves the highest LOFT average (74.28 vs. NTK's 67.14 and LongRoPE's 60.85), the highest InfiniteBench key-value retrieval (88.0 vs. NTK's 66.0 and LongRoPE's 74.0), and comparable or better LongBench scores. The LOFT per-task breakdown reveals that LongRoPE2's gains are concentrated on harder retrieval tasks: HotPotQA (70.0 vs. NTK's 53.0 and LongRoPE's 25.0), MS MACRO (80.0 vs. 75.0 and 57.0), and Quora (79.0 vs. 71.0 and 74.0). For tasks where all methods perform well (FEVER: 28.0 vs. 22.0 and 22.0; NQ: 94.0 vs. 89.0 and 90.0), the gap is smaller. For Phi3-mini-3.8B, LongRoPE2 achieves 55.23 on InfiniteBench average vs. NTK's 52.31 and LongRoPE's 50.67, with the key-value retrieval task showing the largest gap (12.0 vs. 5.1 and 5.6). The paper notes that "scores are lower than post-training results" because models are evaluated without instruction tuning or RLHF, meaning the absolute numbers are not comparable to production models but the relative rankings are informative.
Standard Short-Context Benchmarks
Table 4 presents the critical short-context preservation results. LongRoPE2 is the only method that retains near-original performance on standard benchmarks. For Phi3-mini-3.8B, the pre-trained model achieves an average score of 63.2 across the five benchmarks. LongRoPE2 retains 61.7 (97.6% of original), while YaRN drops to 53.6, NTK to 57.3, and LongRoPE to 58.5. The most sensitive benchmark is GSM8K, where the original model scores 78.54—LongRoPE2 retains 73.62 (a drop of 4.92 points), while YaRN collapses to 57.39 (drop of 21.15), NTK drops to 63.99 (14.55), and LongRoPE drops to 67.17 (11.37). For LLaMA3-8B, LongRoPE2 achieves an average of 55.7 (98.6% of the original 56.5), improving over LongRoPE's 54.6 and NTK's 54.0. Interestingly, LongRoPE2 actually improves over the original LLaMA3-8B on TruthfulQA (46.17 vs. 44.04) while the original LLaMA3-8B's GSM8K was already modest (54.05), and LongRoPE2 retains 50.80—a smaller absolute drop (3.25 points) than YaRN (loss of 11.6) or NTK (loss of 7.13). For comparison, Meta's LLaMA3.1-8B-128K, which uses YaRN with 800B tokens of training, achieves an average of 57.2—higher than the original LLaMA3-8B's 56.5 but on different benchmarks (the MMLU score of 66.33 is actually comparable to LongRoPE2's 65.01, while LLaMA3.1's GSM8K of 56.18 exceeds LongRoPE2's 50.80, likely reflecting the benefit of 80× more training tokens on reasoning capabilities).
Ablation Studies and Robustness Checks
Real critical dimension drcd (Table 5): Applying the corrected critical dimension to YaRN and NTK (yielding YaRN-rcd and NTK-rcd variants) improves long-context performance for both methods. For YaRN-rcd on Phi3-mini, 128K RULER improves from 39.37 to 44.39 (+5.02 points), and on LLaMA3-8B, from 49.39 to 71.46 (+22.07 points). For NTK-rcd on Phi3-mini, 128K improves from 49.37 to 54.42 (+5.05 points), and on LLaMA3-8B, from 73.19 to 77.25 (+4.06 points). This validates the central hypothesis: the theoretical critical dimension misidentifies which dimensions are OOD, and fixing this alone—without changing the underlying scaling methodology—yields substantial gains. However, LongRoPE2 still outperforms both YaRN-rcd and NTK-rcd, confirming that correcting the critical dimension is necessary but not sufficient; the specific scaling factors above drcd also matter. Notably, YaRN-rcd shows a small degradation on short-context benchmarks (MMLU drops from 63.22 to 62.30 for Phi3-mini), suggesting that the corrected critical dimension alone can slightly affect short-context performance if the scaling factors aren't optimized.
Needle-PPL guided search vs. standard PPL (Table 6): Using standard PG19-128K PPL as the search metric instead of needle-driven PPL produces worse rescaling factors. For Phi3-mini at 128K, standard PPL-guided factors achieve 50.23 on RULER vs. 58.81 for needle-PPL (+8.58 points). For LLaMA3-8B, standard PPL achieves 78.68 vs. 82.03 (+3.35 points). The gap is largest at the longest context lengths and smallest at 4K (91.16 vs. 90.41 for Phi3-mini—a negligible difference), confirming the paper's argument that standard PPL fails specifically at measuring long-range dependency understanding. The paper states that standard PPL "struggles to identify the correct critical dimension and tends to yield slightly smaller scaling factors," though the exact critical dimension found by standard PPL search is not reported.
Mixed context window training (Table 7): Removing mixed context window training (i.e., training with only rescaled RoPE) causes significant degradation on standard short-context benchmarks. For Phi3-mini, MMLU drops from 70.07 to 66.56 (-3.51 points), MMLU-Pro from 40.30 to 34.86 (-5.44), and GSM8K from 73.62 to 64.67 (-8.95). For LLaMA3-8B, MMLU drops from 65.01 to 64.57 (-0.44, a smaller effect), MMLU-Pro from 34.61 to 33.83 (-0.78), and GSM8K from 50.80 to 48.37 (-2.43). Interestingly, removing mixed context window training also degrades long-context RULER performance at longer lengths: for LLaMA3-8B at 128K, the score drops from 82.03 to 80.18 (-1.85). The paper hypothesizes that "preservation of pre-trained RoPE for shorter contexts allows long-context training to focus more effectively on adapting to the new introduced token positions."
Number of searched dimensions (Table 10, Appendix B): Allowing the evolutionary search to optimize all RoPE dimensions (not just those above drcd) underperforms the restricted search. For Phi3-mini at 128K, unrestricted search achieves 57.34 on RULER vs. 58.81 for the restricted search (-1.47). For LLaMA3-8B at 128K, unrestricted search achieves 78.07 vs. 82.03 (-3.96). The paper attributes this to the unrestricted search space being too large for effective optimization with a population size of 64: "limiting the search to higher dimensions significantly reduces the search space, enabling a more effective discovery of the optimal solution." Short-context performance is roughly comparable between the two search variants (Phi3-mini MMLU: 69.96 vs. 70.07; LLaMA3-8B MMLU: 64.34 vs. 65.01), suggesting the unrestricted search doesn't harm short-context performance but doesn't find better long-context factors either.
Phi3-mini per-task analysis (Tables 8 and 9): These tables provide granularity on which RULER tasks drive the aggregate scores and where different methods succeed or fail. For LongRoPE2-extended Phi3-mini, single-key needle tasks maintain 95–100% accuracy at all lengths, while multi-key needle tasks degrade from 91–97% at 4K to 18–92% at 128K (with multikey2 suffering worst at 40%). The CWE task is at floor for all lengths beyond 32K (0.3–0.4%), suggesting it is a capability limitation of the 3.8B model rather than a context extension failure. For LLaMA3-8B, single-key needle tasks remain at 99–100% at 128K, multi-key tasks at 91–96%, and CWE degrades more gracefully to 9% at 128K (from 98.5% at 4K).
Critical Assessment
Does the paper demonstrate that LongRoPE2 achieves a 128K effective context window? The RULER results (Table 2) provide strong evidence for LLaMA3-8B, where the 128K score of 82.03 represents a shallower degradation curve than any baseline. The per-task breakdown (Table 9) shows that needle retrieval tasks remain near-perfect at 128K while multi-hop QA and CWE degrade, which is consistent with effective long-context extension that preserves retrieval while exposing reasoning limitations of the base model. For Phi3-mini, the 128K score of 58.81 is substantially better than baselines but is dominated by tasks where the model achieves near-zero (CWE at 0.3%). Whether this qualifies as an "effective" 128K is debatable—the model clearly retrieves needles successfully but fails on harder synthetic tasks, which may be a base capability issue rather than a context extension success. The needle-in-a-haystack heatmaps (Figures 6–8) provide complementary evidence for retrieval effectiveness across all positions.
Does the paper demonstrate near-lossless short-context performance preservation (>97%)? The claim is supported for the average across five benchmarks: Phi3-mini retains 97.6% (61.7/63.2) and LLaMA3-8B retains 98.6% (55.7/56.5) of original average performance (Table 4). However, the average masks substantial per-task variance. On Phi3-mini's GSM8K, the retention is 73.62/78.54 = 93.7%, which is below the 97% threshold—the model loses 4.92 absolute points on the most sensitive benchmark. On the less sensitive benchmarks (MMLU: 70.07 vs. 70.78, HellaSwag: 77.07 vs. 77.96), LongRoPE2 is indeed near-lossless. The paper's "over 98.5%" claim (Section 1) refers to LLaMA3-8B specifically, where the average is 55.7/56.5 = 98.6%. But on individual benchmarks: MMLU retains 97.6% (65.01/66.62), GSM8K retains 94.0% (50.80/54.05), and MMLU-Pro retains 96.5% (34.61/35.87). So "near-lossless" is accurate for the average and for most benchmarks but GSM8K shows a modest degradation even with LongRoPE2. This is still dramatically better than baselines—YaRN loses 21.5% on GSM8K for Phi3-mini—but not zero-loss.
Does the paper demonstrate that the true critical dimension is earlier than the theoretical one? This claim is strongly supported by the YaRN-rcd and NTK-rcd ablations (Table 5). Simply applying the corrected critical dimension to these methods improves their long-context performance substantially (YaRN-rcd improves LLaMA3-8B 128K RULER by 22.07 points). This is a clean causal test: if the only thing changed is the critical dimension boundary, and performance improves, then the hypothesis is validated. The paper also shows (in Table 5) that correcting the critical dimension alone does not fully close the gap to LongRoPE2, confirming that the specific per-dimension scaling factors also matter—the critical dimension shift is necessary but not sufficient.
Does the paper demonstrate that needle-PPL guided search is superior to standard PPL for this problem? Table 6 provides a clean comparison: identical search and training procedures, different evaluation metrics during search. The 8.58 and 3.35 point improvements at 128K for Phi3-mini and LLaMA3-8B respectively are substantial. However, one limitation is that the paper does not report what critical dimension or scaling factors were found by standard PPL search, making it impossible to diagnose whether the failure mode was finding the wrong drcd, suboptimal scaling factors above drcd, or both. The statement that standard PPL "struggles to identify the correct critical dimension and tends to yield slightly smaller scaling factors" is a qualitative observation without quantitative backing in the paper.
Does the paper demonstrate that mixed context window training outperforms conventional training? Table 7 supports this with both short-context preservation gains and an unexpected long-context improvement. However, the ablation only compares mixed training vs. single-RoPE training (rescaled only). It does not compare against alternative approaches to short-context preservation such as progressive extension or data replay, which are the industry-standard methods used by Meta. Without a direct comparison against a data-replay baseline (where short documents are included in the training data but with rescaled RoPE), it's unclear whether the benefit comes from dual-RoPE training specifically or simply from including short data. The paper argues that data replay is insufficient because the model still only sees rescaled RoPE (Section 3.3), but this claim is not experimentally verified—it's a theoretical argument.
Weaknesses in the experimental design. Several limitations should be noted: (1) Single model family and architecture. All experiments use LLaMA3-8B and Phi3-mini-3.8B, both dense transformer models with standard RoPE (θ_base = 10000). Results may not generalize to models with different RoPE bases, different architectures (MoE, non-RoPE position encodings), or different pre-training data distributions that might produce different effective critical dimensions. (2) Small test set for difficulty estimation. The needle-driven PPL search uses only 10 synthetic documents from the PG19 validation set. The evolutionary search selects rescaling factors based on performance on these 10 documents, which is an extremely small sample. There is no analysis of how sensitive the discovered factors are to the specific needle documents used. (3) No multiple restarts or variance analysis. The evolutionary search is run once with a fixed random seed (population size 64, 40 iterations). Given the stochastic nature of evolutionary algorithms, different runs might find different rescaling factors. No variance across runs is reported. (4) The search cost is unaccounted for in the efficiency claim. The paper emphasizes that LongRoPE2 uses 80× fewer training tokens than Meta's approach (10B vs. 800B). However, the search phase—evaluating 64 candidates over 40 iterations (roughly 2,560 forward passes through the LLM on 128K-token sequences)—is a non-trivial compute cost that is not compared to any baseline search cost. (5) No comparison against a larger model with identical training budget. The paper compares against LLaMA3.1-8B-128K (800B tokens, YaRN) but not against, for instance, NTK or LongRoPE with 800B tokens of training. It's possible that the gap between LongRoPE2 (10B tokens) and baselines (also 10B tokens) would narrow if baselines were given 80× more training data. The paper's argument is that the baselines fail to achieve effective 128K regardless of training budget (as evidenced by LLaMA3.1's degradation beyond 64K), but this is not tested with LongRoPE2's baselines at larger token counts. (6) No instruction-tuned model evaluation. All results are on base models without instruction tuning. Real-world long-context applications typically use instruction-tuned models, and the interaction between RoPE rescaling and instruction following is unexplored.
Missing experiments that would strengthen the paper. Several experiments would have been informative: (a) A direct ablation comparing mixed context window training against a data-replay baseline (short data with rescaled RoPE), to isolate the benefit of dual-RoPE representation from the benefit of including short data. (b) Running the needle-PPL search with multiple different sets of 10 needle documents to assess stability of the discovered drcd and scaling factors. (c) Comparing LongRoPE2 against baselines at equivalent training budgets by scaling NTK/YaRN training to 10B+ tokens (the baselines already use 10B tokens in the paper's setup, but scaling to, say, 100B tokens would test whether training compute can compensate for suboptimal rescaling). (d) Evaluating on larger models (e.g., LLaMA3-70B) to test whether the critical dimension shift is model-scale-dependent. (e) Evaluating on models with different RoPE bases (e.g., θ_base = 500,000 as used in some recent models) where the theoretical critical dimension would differ substantially.
Overall assessment. The experiments provide robust support for the paper's central claim that LongRoPE2 achieves better long-context performance and better short-context preservation than existing RoPE rescaling methods when all methods are trained on the same 10B-token budget. The ablation studies (corrected critical dimension, needle-PPL vs. standard PPL search, mixed context window training, restricted vs. unrestricted search) provide a coherent causal narrative that aligns with the paper's undertraining hypothesis. The comparison against LLaMA3.1 demonstrates that LongRoPE2's approach is competitive with or exceeds a production system trained with 80× more data, which is practically significant. The main limitations are the small scale of the search validation (10 documents), the absence of variance analysis for the evolutionary search, and the lack of direct comparisons against data-replay or progressive-extension training strategies that would isolate the specific contribution of dual-RoPE training.
6. Limitations and Trade-offs
The Difficulty Estimation Problem: Search Cost Is Unaccounted for in the Headline Efficiency Claim
The assumption or constraint. LongRoPE2's central efficiency claim is that it achieves near-lossless 128K extension using only 10B training tokens—"80× fewer than Meta's approach" (Section 1). However, this 10B token figure accounts only for the mid-training phase. It does not include the cost of the evolutionary search that discovers the rescaling factors. The search evaluates a population of 64 candidates over 40 evolutionary iterations (Appendix B), with each evaluation requiring a forward pass of the frozen pre-trained LLM on synthetic 128K-token needle documents to compute needle-driven PPL. This amounts to approximately 2,560 forward passes through the model on full-length sequences before any training begins. The paper does not convert this to an equivalent token count or FLOP cost, nor does it compare the search cost against the training cost or against any baseline search cost (e.g., LongRoPE's standard PPL-guided search, or the cost of simply deriving rescaling factors analytically as YaRN and NTK do).
The consequence. A practitioner evaluating whether to adopt LongRoPE2 needs to account for total compute, not just training tokens. If the search phase costs, say, the equivalent of 1B additional tokens (a rough back-of-envelope: 2,560 forward passes × 128K tokens × 2 models across Phi3-mini and LLaMA3-8B settings), then the true total compute is somewhat higher than the 10B figure implies. More critically, the search is not a one-time cost that can be amortized across many deployments—the paper argues that the effective critical dimension is model-specific and depends on the pre-training data distribution (Section 3.1: "insufficient training in higher dimensions"). This means the search must be re-run for each new base model, and potentially for each new pre-training data distribution, making it a recurring engineering cost in any pipeline that regularly extends new models. The paper acknowledges this implicitly by noting that the discovered critical dimension differs between Phi3-mini (d_rcd = 25) and LLaMA3-8B (d_rcd = 30) (Section 3.2), confirming the model-specificity of the result.
What evidence exists in the paper. The paper does not quantify the search cost at all. The computational setup in Appendix B reports training time (39 hours for Phi3-mini, 54 hours for LLaMA3-8B on 64 A100 GPUs) and search hyperparameters (population size P = 64, iterations = 40, mutation probability p = 0.3), but gives no wall-clock time, FLOP count, or token-equivalent cost for the search phase. The 10B token figure appears throughout the paper (Section 1, Section 4.1, Section 5) without qualification. Table 6 demonstrates that needle-PPL search is better than standard PPL search, but not whether that improvement is worth whatever additional compute it requires (the paper does not report whether standard PPL search itself is cheaper, comparably expensive, or more expensive).
Mitigation status. The paper does not address this issue. There is no discussion of search cost, no comparison of search cost against the 10B training budget, and no proposal for reducing search expense (e.g., using a shorter context length during search, evaluating fewer candidates, or training a predictor that maps model configuration to rescaling factors without search). The authors do not flag this as a limitation or as future work. For a method whose headline contribution is efficiency (80× fewer training tokens than Meta), the omission of search cost from the efficiency accounting is a significant gap.
Generalization Is Limited to Two Model Families with Standard RoPE Configuration
The assumption or constraint. All experiments in the paper use exactly two models: LLaMA3-8B (8K pre-trained context) and Phi3-mini-3.8B (2K pre-trained context). Both are dense transformer models with standard Rotary Position Embeddings using θ_base = 10000. The paper argues that "Phi3-mini, with its limited capabilities, serves as a rigorous testbed for evaluating RoPE rescaling methods" (Section 4.1), but the converse is not established: there is no evidence that the findings transfer to models with substantially different configurations. Specifically, the paper does not test:
- Different RoPE base values. Recent models have moved to much larger θ_base values. For example, some models use θ_base = 500,000 or θ_base = 1,000,000, which dramatically changes the theoretical critical dimension and the relationship between dimension index and period length. A model with θ_base = 500,000 would have many more dimensions completing periods within the pre-training window, potentially shifting the effective critical dimension much closer to the theoretical one or making the undertraining effect less pronounced.
- Different model scales. Both tested models are in the 3.8B–8B parameter range. Larger models (70B+) might learn RoPE representations differently—their greater capacity could lead to more complete functional coverage of higher-dimensional cosine periods even with the same pre-training data, potentially reducing or eliminating the gap between empirical and theoretical critical dimensions.
- Different architectures. The method assumes standard dense attention with RoPE. Models using mixture-of-experts (MoE) layers, grouped-query attention (GQA), multi-query attention (MQA), or non-RoPE position encodings (ALiBi, learned positional embeddings, NoPE) are entirely outside scope.
- Different pre-training data distributions. The undertraining hypothesis (Section 3.1) explicitly depends on the effective relative position distribution in pre-training data: "As real-world data rarely contains long-range dependencies (e.g., distances of 2048 tokens), higher RoPE dimensions tend to be under-trained." A model pre-trained primarily on code—which has long-range syntactic dependencies (matching braces, function definitions referenced hundreds of lines later)—might have materially different effective RoPE coverage than one trained on short-form dialogue or Wikipedia articles. The paper provides no evidence on this point.
The consequence. A practitioner cannot assume that the specific rescaling factors discovered for LLaMA3-8B or Phi3-mini-3.8B would work for their model. More fundamentally, they cannot assume that the method itself—the needle-PPL search for drcd and rescaling factors—would produce substantial gains over analytically derived methods for models with different θ_base values or pre-training data distributions. If a model with θ_base = 500,000 shows minimal undertraining in higher dimensions (because more dimensions complete periods within the pre-training window), then the central diagnosis driving LongRoPE2's advantage might not apply, and the search might discover rescaling factors very similar to NTK's theoretical derivation—making the search cost pure overhead with no gain.
What evidence exists in the paper. The paper provides results for exactly two models in Table 2 (RULER), Table 3 (real-world long-context benchmarks), and Table 4 (standard short-context benchmarks). The discovered critical dimensions differ between the two models (25 vs. 30 cosine dimensions, Figure 4), which the authors present as evidence supporting the hypothesis rather than as a limitation of generalization. However, both models share the same θ_base and similar architecture, so this difference demonstrates within-family sensitivity but not cross-family robustness. There are no experiments varying θ_base, model scale, architecture, or pre-training data.
Mitigation status. The paper does not claim generalization beyond the tested models and does not discuss this as a limitation. The authors state they "believe this model is representative of the capabilities of many contemporary LLMs" (implicitly, given the prior sections' framing), but this is an assertion without evidence. No future work is proposed to validate the method on different model configurations. A practitioner would need to replicate the full search and training pipeline for each new model they wish to extend, with no a priori guarantee that the gains over simpler methods (like NTK with the original drcd correction from Table 5) would justify the additional complexity.
The One-Time KV Cache Recomputation at Inference Is a Latency and Throughput Tax
The assumption or constraint. LongRoPE2's inference-time behavior relies on switching between original RoPE and rescaled RoPE when the sequence length crosses the pre-trained context window boundary L_train (Section 3.3, Appendix B). The paper states explicitly:
"Switching to rescaled RoPE for long-context inference requires a one-time recalculation of the KV cache, a potential limitation we leave for future work."
This means that when a user's input or conversation exceeds L_train tokens (2K for Phi3-mini, 8K for LLaMA3-8B), the model must recompute the key-value cache for all preceding tokens using the rescaled RoPE rather than the original RoPE that was used during the initial encoding. This is a full re-encoding of the prefix through all transformer layers—equivalent in cost to processing the prefix a second time.
The consequence. The latency impact depends on when the switch occurs and how long the prefix is. For the common case where a user's input is already longer than L_train (e.g., a 50K-token document submitted for summarization), the model can start with rescaled RoPE immediately and no recomputation is needed. However, in interactive settings where context accumulates gradually—long conversations, iterative code editing, multi-turn agent interactions—the model starts with original RoPE for the first L_train tokens, then must recompute when the conversation crosses the boundary. At LLaMA3-8B's L_train of 8K tokens, recomputing 8K tokens of KV cache on each request that crosses the boundary adds latency proportional to encoding 8K tokens. For Phi3-mini with L_train of 2K, the boundary is crossed more frequently (since 2K is easily exceeded in most practical long-context scenarios), triggering recomputation on a larger fraction of requests.
This also interacts poorly with KV cache caching optimizations commonly used in serving systems. If the system caches the KV states for a long system prompt or shared prefix, that cache becomes invalid when the sequence length crosses L_train and a switch to rescaled RoPE is needed—the cached KV states were computed with original RoPE and must be discarded and recomputed with rescaled RoPE.
The paper does not quantify the frequency of boundary-crossing in realistic workloads, the latency overhead of recomputation, or whether the recomputation can be optimized (e.g., by pre-computing both KV variants for common prefixes, or by developing a mathematical conversion between original-RoPE and rescaled-RoPE KV states).
What evidence exists in the paper. The limitation is acknowledged in a single sentence in Appendix B. No experiments measure recomputation overhead, latency impact, or frequency of switching in any workload. The paper does not compare LongRoPE2's inference latency to baselines that use a single RoPE variant for all sequence lengths (all prior methods—YaRN, NTK, LongRoPE—use rescaled RoPE uniformly after extension, avoiding any switching cost).
Mitigation status. The paper explicitly leaves this to future work: "a potential limitation we leave for future work." No mitigation strategies are proposed. A practitioner deploying LongRoPE2 in a latency-sensitive application would need to either (a) always use rescaled RoPE and accept the short-context performance degradation that mixed context window training was designed to prevent, or (b) engineer around the switching cost through speculative pre-computation, caching both RoPE variants, or restricting the system to avoid boundary-crossing scenarios.
The Search Validates Rescaling Factors on Only 10 Synthetic Documents
The assumption or constraint. The needle-driven PPL evaluation that guides the evolutionary search is computed on an extremely small sample: 10 synthetic documents constructed from books in the PG19 validation set (Section 3.2, Appendix C). Each document is constructed by inserting a needle at the start, padding with PG19 text to 128K tokens, and appending a retrieval query at the end. The rescaling factors that minimize perplexity on the needle answer tokens across these 10 documents are selected as the optimal solution and applied to the full mid-training run.
The consequence. This creates a search-time overfitting risk that is not measured or discussed. With only 10 documents, the evolutionary search has 40 iterations to find rescaling factors that minimize PPL on this specific set of needle-retrieval problems. The search could discover factors that are genuinely optimal for these 10 documents—with their specific needle phrasings, specific PG19 filler text, and specific query formats—but that generalize poorly to the diverse long-context scenarios encountered in RULER, LOFT, InfiniteBench, and real-world use. The paper provides no variance analysis: if the search were run with a different random sample of 10 PG19 books, would it discover the same d_rcd? The same scaling factors? Would the RULER performance be materially different?
The small validation set also means the search signal may be noisy. With only 10 documents, one or two documents where the needle is particularly easy or hard to retrieve could disproportionately influence the average needle-PPL, steering the search toward factors that optimize for outliers rather than typical long-range retrieval.
What evidence exists in the paper. The paper provides no direct evidence on search stability or the sensitivity of results to the specific 10 documents used. The closest proxy is the comparison in Table 6, which shows that needle-PPL search outperforms standard PG19-128K PPL search on RULER. But this only demonstrates that needle-PPL is a better search metric than standard PPL for this problem—it does not demonstrate that 10 documents is sufficient to find stable, generalizable factors. The RULER evaluation itself (Table 2) tests generalization from the search's 10 PG19-derived needle documents to RULER's 13 synthetic tasks, but the RULER tasks include needle-in-a-haystack variants that are structurally similar to the search documents (insert fact, retrieve it later), so this tests generalization to new instances of a similar task paradigm rather than to fundamentally different long-context challenges.
Mitigation status. The paper does not discuss this limitation or propose any mitigation. In principle, one could increase the number of needle documents, use cross-validation to select factors (evaluating different candidate factor sets on held-out needle documents), or validate the stability of discovered factors by re-running the search with different random seeds and document samples. None of these are done. A practitioner who adopts LongRoPE2 is implicitly trusting that 10 PG19 needle documents are representative enough of the long-context retrieval challenges their application will face—a trust that the paper provides no evidence to support.
Hard Long-Context Tasks Receive Little to No Benefit
The assumption or constraint. LongRoPE2 is designed to address the RoPE OOD problem that prevents effective attention across long token distances. It does not address—and does not claim to address—the base model's fundamental capability limitations on complex long-context reasoning tasks. When the base model simply cannot perform a task regardless of positional encoding quality, better RoPE rescaling provides no benefit.
The consequence. The per-task RULER breakdowns (Tables 8 and 9) reveal that certain tasks see minimal improvement from LongRoPE2, particularly on the smaller model. For Phi3-mini-3.8B at 128K: the Common Word Extraction (CWE) task scores 0.3% for LongRoPE2 versus 0.4% for NTK and 0.3% for YaRN—floor performance regardless of rescaling method. The multi-hop QA task scores 34% for LongRoPE2—better than LongRoPE's 29% or NTK's 34%, but still far from usable. For LLaMA3-8B at 128K: CWE scores 9% (vs. 98.5% at 4K), revealing a task that degrades severely with length regardless of rescaling quality. These tasks represent long-context challenges that go beyond simple needle retrieval: CWE requires identifying the most frequently occurring words in a long document, and multi-hop QA requires synthesizing information from multiple distant locations. The rescaling factors that enable effective attention across 128K distances do not help if the model lacks the reasoning capability to perform these operations at scale.
This is an inherent ceiling of any RoPE rescaling method: it enables the model to attend to long-range information, but it does not improve the model's ability to process that information. The paper's FLOPs-matched comparison (in prior sections) shows that on the hardest problems, test-time compute cannot compensate for capability gaps—the same principle applies here: positional encoding quality cannot compensate for reasoning quality.
What evidence exists in the paper. Tables 8 and 9 provide the per-task evidence. Figure 1 shows that even LLaMA3.1-8B-128K, with 800B tokens of training, fails on tasks beyond simple needle retrieval at long contexts. The paper acknowledges that the Phi3-mini 128K aggregate score is "skewed by tasks with low scores on smaller LLMs" (Section 4.2), but does not analyze which tasks are fundamentally beyond the base model's capabilities versus which are limited by OOD issues that could theoretically be solved by better rescaling.
Mitigation status. The paper does not attempt to address this limitation, and to be fair, it does not claim to. LongRoPE2 is explicitly a RoPE rescaling and training method, not a general long-context reasoning improvement technique. The limitation is inherent to the problem formulation. However, a practitioner evaluating LongRoPE2 for a specific long-context application needs to understand that passing RULER needle retrieval tests (which LongRoPE2 does well) does not guarantee strong performance on their specific long-context task (summarization, multi-hop QA, document comparison), especially if the base model has limited capabilities. The paper provides no guidance on which types of long-context tasks benefit most from rescaling improvements versus which are bottlenecked by base model capability.
Mixed Context Window Training Is Not Compared Against Data Replay or Progressive Extension
The assumption or constraint. The paper claims that mixed context window training is superior to alternative approaches for preserving short-context performance: progressive extension (used by LLaMA3.1 with 800B tokens over six stages) and pre-training data replay (mixing in original pre-training data during long-context fine-tuning, as in Hu et al., 2024b). However, the only experimental comparison in the paper is between mixed context window training and training with only rescaled RoPE (Table 7). There is no direct experimental comparison against a data replay baseline (where short documents are included in the training data but all training uses rescaled RoPE) or a progressive extension baseline (where context is extended in stages with intermediate training).
The consequence. The paper cannot distinguish between two competing explanations for why mixed context window training preserves short-context performance:
- The dual-RoPE hypothesis (the paper's claim): Training with both original RoPE (for short sequences) and rescaled RoPE (for long sequences) prevents the model from overwriting its pre-trained positional representations, and this dual representation is the key mechanism.
- The data inclusion hypothesis (a simpler alternative): Including short sequences in the training data—regardless of which RoPE variant is used—is sufficient to maintain short-context performance. Under this hypothesis, a data replay baseline that uses rescaled RoPE for all sequences but includes short documents in the training mix might perform similarly to mixed context window training.
If the data inclusion hypothesis is correct, then mixed context window training's additional complexity (managing two RoPE variants, attention masking for short packed sequences, inference-time RoPE switching with KV cache recomputation) provides no benefit over the simpler approach of using rescaled RoPE uniformly and including short training data. The paper's ablation (Table 7) removes both short training data and original RoPE simultaneously (training with only rescaled RoPE on only long sequences), so it conflates these two factors.
What evidence exists in the paper. Table 7 shows that removing mixed context window training (and thus removing both dual-RoPE and short training data) degrades short-context performance: Phi3-mini MMLU drops 3.51 points and GSM8K drops 8.95 points. This establishes that something in the mixed training approach is important, but does not isolate whether it's the dual RoPE, the short data, or the combination. The paper argues theoretically that data replay is insufficient because the model "only sees one RoPE variant during training" (Section 3.3), but this claim is not experimentally tested.
Mitigation status. The paper does not include a data replay baseline and does not acknowledge this as a missing comparison. The authors present the theoretical argument for dual-RoPE training as if it were self-evident, but the empirical question—does training on short data with rescaled RoPE preserve short-context performance?—is both testable and important for practitioners making implementation decisions. A simple experiment would be: train with rescaled RoPE on the same data mix as LongRoPE2 (including short packed sequences, but using rescaled RoPE and full attention throughout), and compare short-context benchmark performance against the dual-RoPE version. If the data-replay version performs similarly, the dual-RoPE complexity is unnecessary. If it performs worse, the dual-RoPE mechanism is validated. Neither result exists in the paper.
7. Implications and Future Directions
How This Work Changes the Landscape
LongRoPE2 makes a conceptual shift in how the field thinks about context window extension: it reframes the problem from "find the right rescaling formula" to "diagnose the actual training coverage of each RoPE dimension and fix what's broken." This is neither a paradigm shift—the underlying mechanisms (RoPE rescaling, continued pre-training) remain the same—nor a minor incremental refinement. It is best understood as a diagnostic correction that explains why prior rescaling methods underperform and provides a principled procedure for fixing the diagnosis, with the practical consequence of reducing training cost by roughly two orders of magnitude (10B vs. 800B tokens) while achieving better long-context performance.
The diagnostic itself—that higher RoPE dimensions are functionally undertrained and that the true critical dimension is earlier than theory predicts—resolves a persistent empirical puzzle in the literature. Prior work (Meta, 2024; Men et al., 2024a; Wang et al., 2024) consistently found that rescaling factors slightly larger than the extension ratio L/L_train improved performance, but treated this as a tuning heuristic without a mechanistic explanation. LongRoPE2 provides that explanation: larger factors are necessary because the empirical rotation periods are longer than the theoretical 2π/θ_i, so the theoretical lower bound is insufficient. The causal evidence for this claim is unusually clean for an empirical ML paper: applying only the corrected critical dimension to existing methods (YaRN-rcd and NTK-rcd in Table 5) improves their long-context performance by 5–22 RULER points without changing their underlying scaling methodology. This is a strong, falsifiable, and validated hypothesis—not a post-hoc rationalization.
This diagnostic reframing changes which research directions look promising. Before LongRoPE2, the implicit assumption in the field was that the RoPE OOD problem was theoretically understood and the bottleneck was training efficiency—hence LLaMA3.1's 800B-token, six-stage progressive extension. LongRoPE2 demonstrates that the OOD problem was not correctly diagnosed, and that fixing the diagnosis (finding the right critical dimension and rescaling factors) dramatically reduces the training budget needed. This shifts research attention from "how do we train more efficiently with suboptimal rescaling?" to "how do we measure and correct the actual effective RoPE coverage for a given model?"
The paper also reframes the short-context degradation problem. Prior work treated degradation as an inevitable side effect of context extension—to be compensated for through massive data replay or progressive scheduling. LongRoPE2 shows that the degradation is not inevitable; it is caused by representation overwriting, and the fix is to maintain both positional representations during training rather than transitioning from one to another. This is a different class of solution entirely—representational coexistence rather than temporal separation—and its success (Table 7 shows it actually improves long-context performance compared to single-RoPE training) suggests it may generalize to other settings where model modifications risk catastrophic forgetting of original capabilities.
The most important negative signal in the paper is equally significant: training data volume cannot compensate for suboptimal rescaling. LLaMA3.1 uses YaRN rescaling with the theoretical critical dimension and 800B tokens of training—80× more than LongRoPE2—yet still fails to achieve effective 128K context on RULER (Figure 1) and Needle-in-a-Haystack (Figure 6). This is a powerful existence proof that better rescaling factors dominate training budget in determining the ceiling of context extension. It implies that organizations investing in massive continued pre-training for context extension should first verify that their rescaling factors are actually addressing the OOD problem—otherwise they may be burning compute on a lost cause.
Follow-Up Research This Work Enables
Measuring effective RoPE training coverage without expensive evolutionary search. LongRoPE2's needle-PPL-guided search with 2,560 model evaluations is the most computationally expensive component of the method (and unaccounted for in the 10B-token headline figure). A direct follow-up would develop a lightweight diagnostic that estimates the effective critical dimension for a given model without search. One approach: for each RoPE dimension, measure the model's perplexity on tokens at the maximum relative position within the pre-training context using a controlled synthetic benchmark where long-range dependencies are guaranteed (e.g., needle documents at the pre-training length). Dimensions where PPL is substantially higher than at shorter relative positions are functionally undertrained. This could be done with a single forward pass over a few hundred synthetic documents, reducing the search cost from 2,560 evaluations to O(1). If such a diagnostic correlates with the search-discovered d_rcd across multiple models (LLaMA3-8B, Phi3-mini, plus additional models with different θ_base and pre-training data), it would transform LongRoPE2 from a search-based method to a measurement-based one.
Does the critical dimension shift depend on pre-training data distribution? The paper's undertraining hypothesis (Section 3.1) explicitly links the effective critical dimension to the relative position distribution in pre-training data: "As real-world data rarely contains long-range dependencies (e.g., distances of 2048 tokens), higher RoPE dimensions tend to be under-trained." This makes a testable prediction: a model pre-trained on code (which contains long-range syntactic dependencies—function definitions referenced hundreds of lines later, matching braces across files) should have a smaller gap between d_rcd and d_tcd than a model pre-trained on short-form text. A strong follow-up would apply the needle-PPL search to, for example, DeepSeek-Coder (pre-trained primarily on code) versus an otherwise comparable model pre-trained on general web text, and measure whether the discovered critical dimension differs systematically in the predicted direction. A null result—no difference in d_rcd shift despite different pre-training data—would challenge the mechanistic explanation while leaving the empirical finding intact.
Can the inference-time KV cache recomputation be eliminated? The paper explicitly flags the one-time KV cache recomputation when crossing the L_train boundary as "a potential limitation we leave for future work" (Appendix B). A concrete follow-up would develop a conversion function that maps KV states computed with original RoPE to equivalent KV states under rescaled RoPE, avoiding the need for recomputation entirely. The mathematical structure of RoPE—a rotation applied independently at each dimension with known scaling factors—suggests that a closed-form conversion might exist. For a given dimension i, the original RoPE applies a rotation by angle θ_i at position n, while the rescaled RoPE applies a rotation by θ_i/λ_i. The KV state contains information about the original rotation; developing a linear (or approximately linear) transformation that "re-rotates" the cached states would be a meaningful theoretical contribution with immediate practical impact. Even a approximate conversion with bounded error would be valuable if it keeps the KV cache valid across the switch boundary. A strong result would measure the conversion error against the ground-truth recomputed KV cache and the downstream accuracy impact on RULER tasks.
Scaling the method to different RoPE bases and larger models. The paper tests exactly two models, both with θ_base = 10000 and 3.8B–8B parameters. A replication study across the model design space would determine which findings are universal and which are configuration-specific. The most important dimension to vary is θ_base: models with θ_base = 500,000 or 1,000,000 have many more dimensions completing periods within the pre-training window, which should shift d_tcd later and potentially shrink the gap between d_rcd and d_tcd. If the gap disappears entirely at large θ_base, then LongRoPE2's search-based approach offers no advantage over analytical NTK scaling for those models—a practically useful negative result. Model scale is the second dimension: larger models (70B+) might learn more complete functional coverage of high-dimensional cosine periods simply through greater capacity, even with identical pre-training data. A strong study would run the needle-PPL search on LLaMA3-8B, LLaMA3-70B, and a model with θ_base = 500,000 (e.g., a configuration matching recent frontier models) and report d_rcd vs. d_tcd for each. The prediction from the undertraining hypothesis is that the shift d_tcd - d_rcd should decrease with both larger θ_base and larger model scale.
Combining LongRoPE2 with architectural innovations for long context. The paper notes in Appendix A that LongRoPE2 is "complementary" to efficient attention mechanisms (FlashAttention, linear attention, SSMs) and RAG/agent-based approaches, but provides no experimental combination. A natural follow-up would test whether LongRoPE2's rescaling factors, which improve the model's ability to attend across 128K tokens, provide additional benefit on top of retrieval-based long-context methods (where retrieved chunks might themselves be 8K–32K tokens and benefit from better within-chunk long-range attention). A concrete experiment: take a RAG pipeline that retrieves 32K-token chunks from a 1M-token corpus, extend the underlying LLM to 32K using LongRoPE2 vs. NTK vs. YaRN (with the same training budget), and measure end-to-end QA accuracy. This would test whether better positional encoding within retrieved chunks—a regime where prior work has not evaluated rescaling methods—provides practical gains in a deployed system.
Practical Applications and Downstream Use Cases
Cost-efficient context extension for open-weight model deployments. Organizations that deploy open-weight LLMs (LLaMA, Mistral, Phi) and need to extend them to 128K for document processing, legal contract review, or long-form content generation can use LongRoPE2 to achieve this with roughly 10B training tokens instead of the 800B tokens used by Meta's approach. The training cost difference is substantial: the paper reports 54 hours on 64 A100 GPUs for LLaMA3-8B, versus an estimated 4,320 GPU-hours (54 × 80) for an 800B-token equivalent. For teams with limited compute budgets, this is the difference between feasible in-house extension and being forced to use a vendor's pre-extended model (which may have different licensing or not exist for their base model). The key deployment consideration is that the needle-PPL search must be re-run for each base model, and the search cost—which the paper does not quantify—should be benchmarked against the training savings before committing to the approach.
Improving retrieval-augmented generation pipelines. RAG systems typically chunk long documents and retrieve the most relevant chunks, but the retrieved chunks themselves may be 4K–32K tokens. If the underlying LLM has been extended to 128K using a suboptimal rescaling method (e.g., YaRN as in LLaMA3.1), its ability to attend within a 16K-token retrieved chunk may already be degraded compared to the original pre-trained model's performance at 8K. LongRoPE2's RULER curves (Table 2) show much shallower degradation as context length increases: LLaMA3-8B with LongRoPE2 drops from 94.61 at 4K to 90.49 at 32K (a 4.1-point drop), versus NTK's drop from 94.38 to 87.33 (7.1 points). For RAG pipelines where retrieved chunks are in this 8K–32K range, switching from YaRN-extended or NTK-extended models to LongRoPE2-extended models could improve within-chunk comprehension without any change to the retrieval architecture. The practical test would be an end-to-end RAG benchmark (e.g., LOFT tasks, which the paper already evaluates) comparing identical retrieval pipelines with different underlying context extension methods.
On-device and edge deployment of long-context models. Tiny models like Phi3-mini-3.8B are designed for on-device deployment (the original Phi3 paper's title emphasizes "locally on your phone"), but prior context extension methods caused severe short-context degradation on this model (YaRN: -7.56 MMLU points, -21.15 GSM8K points in Table 4). LongRoPE2 preserves 97.6% of Phi3-mini's original performance while extending to 128K, making it the first method that enables long-context processing on edge devices without sacrificing the model's core reasoning capabilities. A mobile application that previously needed to truncate long documents or offload processing to a cloud API could instead process 128K-token documents entirely on-device using LongRoPE2-extended Phi3-mini. The inference-time RoPE switch latency (KV cache recomputation at the 2K boundary) is the main engineering concern for interactive applications, but for batch document processing (where the full document is available upfront and the model can start with rescaled RoPE immediately), there is no switching cost.
When to Prefer This Method
The paper positions LongRoPE2 as a replacement for existing RoPE rescaling methods (YaRN, NTK, LongRoPE) when extending pre-trained LLMs to long context windows, particularly when both long-context effectiveness and short-context preservation are required. The tradeoffs can be summarized concretely:
-
Prefer LongRoPE2 when: You need to extend a pre-trained LLM with standard RoPE (θ_base = 10000) to 128K or beyond AND you require the extended model to retain >97% of its original short-context benchmark performance. This is the regime where the paper's results are most compelling: LLaMA3-8B retains 98.6% and Phi3-mini-3.8B retains 97.6% of their original average scores (Table 4), while baselines lose 2–15 percentage points. LongRoPE2 is also preferred when training compute is constrained: 10B tokens vs. 800B tokens for Meta's progressive extension approach. The method requires that you can run the needle-PPL evolutionary search (population size 64, 40 iterations) on your specific base model before training.
-
The practical cost to consider that the paper does not quantify: The evolutionary search phase evaluates 2,560 candidate rescaling factor configurations on 128K-token synthetic documents. The compute cost of this search is not reported and is not included in the 10B-token figure. If the search cost is comparable to, say, 1B training tokens, then the total compute advantage over Meta's 800B tokens remains overwhelming (roughly 11B vs. 800B equivalent). But if the search cost is substantially higher—or if the search must be repeated many times during experimentation with different target lengths or data mixtures—a practitioner should benchmark the search cost before committing. For models with very different θ_base values (e.g., 500,000) where the undertraining gap may be smaller, analytical methods like NTK may achieve comparable results without search, and the cost-benefit calculation shifts.
-
The inference-time tradeoff not discussed in the paper: LongRoPE2's dual-RoPE approach requires switching from original to rescaled RoPE when the sequence exceeds L_train, incurring a one-time KV cache recomputation. In interactive applications where context accumulates gradually (long conversations), this adds latency. In batch processing where inputs are available upfront and typically exceed L_train (e.g., document summarization), no switching cost is incurred because the model can use rescaled RoPE from the start. A practitioner should evaluate whether their workload pattern triggers frequent boundary-crossing before adopting LongRoPE2 over a method that uses a single RoPE variant for all sequence lengths (all prior methods).