MrRoPE: Mixed-radix Rotary Position Embedding

Qingyuan Tian (Shanghai Jiao Tong University), Wenhong Zhu, Xiaoran Liu, Xiaofeng Wang, Rui Wang

International Conference on Learning Representations 2026 · Oral

Overview

The rapid advancement of Large Language Models (LLMs) has highlighted the critical role of effectively encoding positional information within sequences, especially for handling long-range dependencies. Rotary Position Embedding (RoPE) has emerged as a highly successful technique for this, integrating relative positional information directly into the attention mechanism by rotating query and key vectors. However, a significant challenge for RoPE, and indeed for many positional encoding schemes, lies in their ability to generalize to sequence lengths far exceeding those encountered during training. Models trained on a specific context window often struggle when presented with much longer sequences, leading to a breakdown in positional understanding and degraded performance.

Watch on SlidesLive

Visual summary for MrRoPE: Mixed-radix Rotary Position Embedding by Qingyuan Tian, Wenhong Zhu, Xiaoran Liu, Xiaofeng Wang, Rui Wang
Visual summary for MrRoPE: Mixed-radix Rotary Position Embedding by Qingyuan Tian, Wenhong Zhu, Xiaoran Liu, Xiaofeng Wang, Rui Wang

Key moments

  1. 0:00 Introduction to RoPE and its generalization limits
  2. 2:00 The need for a unified RoPE extension theory
  3. 4:00 MrRoPE theory: RoPE as radix system, capacity solution
  4. 6:00 MrRoPE-Pro/Uni proposal and strong experimental results
  5. 7:40 Theoretical explanation: MrRoPE-Pro extends context window bounds
  6. 8:00 Conclusion: unified theory and MrRoPE-Pro's effectiveness
  7. 9:00 Q&A: Applying MrRoPE-Pro to pre-trained Llama models
  8. 10:00 Q&A: MrRoPE-Pro vs. fine-tuning and closed-source models

MrRoPE: Mixed-radix Rotary Position Embedding

Speakers: Qingyuan Tian (Shanghai Jiao Tong University); Wenhong Zhu; Xiaoran Liu; Xiaofeng Wang; Rui Wang

Conference: ICLR 2026

YouTube: https://slideslive.com/39062123

Overview

The rapid advancement of Large Language Models (LLMs) has highlighted the critical role of effectively encoding positional information within sequences, especially for handling long-range dependencies. Rotary Position Embedding (RoPE) has emerged as a highly successful technique for this, integrating relative positional information directly into the attention mechanism by rotating query and key vectors. However, a significant challenge for RoPE, and indeed for many positional encoding schemes, lies in their ability to generalize to sequence lengths far exceeding those encountered during training. Models trained on a specific context window often struggle when presented with much longer sequences, leading to a breakdown in positional understanding and degraded performance.

This talk, presented by Qingyuan Tian from Shanghai Jiao Tong University, introduces MrRoPE (Mixed-radix Rotary Position Embedding), a novel theoretical framework that provides a unified understanding of existing RoPE extensions and proposes superior methods for long-context generalization. MrRoPE reinterprets RoPE's positional encoding mechanism through the lens of radix conversion systems, revealing that RoPE's generalization failure stems from insufficient capacity in its implicit radix representation. By systematically applying mixed-radix principles, the researchers demonstrate how various RoPE extensions like NTK-RoPE and YaRN can be understood as specific forms of radix conversion.

Building on this theoretical foundation, MrRoPE proposes two new methods, MrRoPE-Uni (uniform) and MrRoPE-Pro (progressive), which implement distinct mixed-radix conversions. The core contribution is the development of MrRoPE-Pro, a training-free approach that significantly extends the effective context window of pre-trained LLMs. Experimental results on challenging long-context benchmarks, including Needle In A Haystack and InfiniteBench, show that MrRoPE-Pro consistently outperforms state-of-the-art RoPE extensions like YaRN, often enabling open-source models to match or even surpass the performance of certain closed-source, long-context-trained models. This work not only offers a deeper theoretical understanding of positional embeddings but also provides a highly practical solution for deploying LLMs with vastly extended context capabilities without the need for expensive re-training.

Background

▶ Watch: Introduction to RoPE and its generalization limits (0:00)

The ability of transformer models to capture relationships between tokens, regardless of their distance in a sequence, is largely attributed to the attention mechanism. However, transformers are inherently permutation-invariant, meaning they lack an innate understanding of token order. This necessitates the use of positional embeddings to inject sequential information. Early methods like absolute positional embeddings (e.g., sinusoidal embeddings) directly add position vectors to token embeddings. While effective, these often struggle with extrapolation to unseen sequence lengths.

Rotary Position Embedding (RoPE), introduced by Su et al. (2022), revolutionized positional encoding by integrating relative position information directly into the attention calculation. RoPE achieves this by rotating the query and key vectors based on their absolute position in the sequence. Specifically, a vector is divided into multiple 2D dimensions, and each 2D segment is rotated independently. The rotation angle for each dimension j at position m is computed as the product of a corresponding frequency theta_j and the position m (theta_j * m). The genius of RoPE lies in how these rotations naturally yield relative position information when query and key vectors are multiplied in the attention mechanism, making it highly effective for modeling long-range dependencies.

Despite its power, RoPE suffers from a critical limitation regarding length generalization. During training, models are exposed to sequences up to a certain maximum length. When inferring on much longer sequences, RoPE's performance degrades significantly. The problem manifests differently across dimensions: for lower dimensions (with higher rotation frequencies), the model observes many full rotation circles within the training context, allowing it to generalize well to larger angles. However, for higher dimensions (with much smaller rotation frequencies), the angles only span a very short arc during training. When these higher dimensions encounter positions outside this training arc, the positional encoding becomes misaligned, causing the entire system to break down.

To address this, numerous RoPE extensions have been proposed, including PI Positional Embedding (PI), NTK-RoPE, YaRN (Yet another RoPE extension), and LongRoPE. These methods typically attempt to improve length generalization by modifying the rotation angles, either by resetting frequencies or rescaling positions. While these empirical modifications have shown improved performance, they often stem from different intuitions and lack a unified theoretical foundation. This leads to a critical gap: without a principled understanding of why these modifications work or how they relate to each other, developing new, more effective solutions remains largely a trial-and-error process. MrRoPE aims to fill this gap by providing a foundational theory to explain and guide the design of RoPE extensions.

Key Findings

▶ Watch: MrRoPE theory: RoPE as radix system, capacity solution (4:00)

The MrRoPE research introduces several fundamental insights and contributions that significantly advance the understanding and application of Rotary Position Embeddings:

  1. RoPE as a Biased Estimator of a Beta-Radix System: The core theoretical finding is that the rotation angle computation in RoPE (theta_j * m) bears a striking resemblance to the equation for obtaining the j-th digit in a base-beta radix conversion system. By temporarily overlooking the floor operation and the periodic modulus inherent in radix systems, RoPE can be conceptualized as a biased approximation of a beta-radix system, where the base B (derived from the RoPE base) influences its linearity and stability. This perspective highlights that RoPE's failure to generalize to longer contexts is fundamentally due to its insufficient representational capacity within this implicit radix system.
  1. Unified Theoretical Framework for RoPE Extensions: MrRoPE proposes that any RoPE extension that follows a specific conversion formula can be understood as a form of mixed-radix system. This framework successfully reinterprets most existing RoPE extensions known for improving length generalization (such as NTK-RoPE and YaRN) as different choices of base conversion factors within this mixed-radix paradigm. This provides a principled way to compare and understand the underlying mechanisms of these previously disparate methods. For instance, YaRN is reinterpreted as implementing a "partially regressive" radix conversion.
  1. Introduction of MrRoPE-Pro (Progressive Radix Conversion): Based on the unified theory, the researchers designed two new mixed-radix conversion methods: MrRoPE-Uni (uniform scaling) and MrRoPE-Pro (progressive scaling). Through extensive experimentation, MrRoPE-Pro consistently demonstrated superior performance in long-context generalization. It adopts a piecewise function to scale up the base in a progressive manner, proving more effective than uniform or regressive approaches.
  1. Significant Performance Gains in Long-Context Benchmarks: MrRoPE-Pro achieves state-of-the-art results on challenging long-context benchmarks. On the Proof-pile dataset, it shows consistently better perplexity scores across extended context windows. In the Needle In A Haystack task, MrRoPE-Pro exhibits "much more robustic behavior" under extreme long-context settings compared to existing methods like YaRN. Furthermore, on demanding benchmarks like RULER and InfiniteBench, MrRoPE-Pro significantly outperforms YaRN across various subtasks, including retrieval QA and code generation.
  1. Extension of Context Window Upper Bound: Theoretical analysis using RoPE-bound theory reveals that MrRoPE-Pro dramatically extends the upper bound of the effective context window. It can push this bound from approximately 1,000 tokens (for original RoPE or some extensions) to an impressive 28,000 tokens, which is nearly five times larger than the bound achieved by YaRN. This theoretical grounding supports the observed empirical gains.
  1. Preservation of Attention Signal Behavior: MrRoPE-Pro is shown to maintain the attention signal closer to that of the original RoPE as the position increases. This property is crucial for reducing the risk of generalization failure at longer context lengths, ensuring that the model's understanding of relative positions remains stable and consistent.
  1. Training-Free Application for Pre-trained LLMs: A highly practical finding is that MrRoPE-Pro is a training-free method. This means it can be directly applied to existing pre-trained LLMs, such as Llama 3 8B, to extend their context window significantly (e.g., from 8,000 tokens to 128,000 tokens, a 16x increase) without requiring any further fine-tuning or re-training. This dramatically lowers the computational cost and complexity of deploying LLMs with expanded context capabilities. In some cases, an open-source Llama model equipped with MrRoPE-Pro even outperformed certain closed-source models (like Kimi-Chat) that were specifically trained on very long contexts.

Technical Deep Dive

▶ Watch: Theoretical explanation: MrRoPE-Pro extends context window bounds (7:40)

The technical foundation of MrRoPE begins with a re-examination of Rotary Position Embedding (RoPE). In RoPE, the core mechanism involves rotating query (q) and key (k) vectors. For a given position m, each 2D dimension j (formed by pairs of vector elements) is rotated by an angle angle_j = theta_j * m. Here, theta_j = 10000^(-2j/d) for a d-dimensional vector, introducing a frequency decay across dimensions.

The pivotal insight of MrRoPE is the observation that this rotation angle formula bears a striking resemblance to the equation for extracting the j-th digit in a beta-radix number system. In a beta-radix system, a number N can be represented as N = sum(d_j beta^j), where d_j is the j-th digit. Conversely, the j-th digit can be obtained using operations involving N / beta^j and modulus. Specifically, d_j = floor(N / beta^j) mod beta. Comparing RoPE's theta_j m to N / beta^j, the authors identify two primary differences: the presence of a floor function and a modulus operation in the radix system definition.

The researchers empirically demonstrate that as the base B (related to theta_j) increases, the effects of the floor function and the modulus operation gradually diminish. This renders the representation more linear and stable, supporting the interpretation of RoPE as a biased estimator of a beta-radix system. From this perspective, the generalization failure of RoPE to longer contexts is attributed to the system's inherent lack of capacity to represent very large positions accurately within its fixed radix structure.

To address this capacity limitation, MrRoPE draws inspiration from mixed-radix conversion. In a standard radix system, all digit positions share the same base. A mixed-radix system, however, allows different positions to have different bases (or scaling factors). For instance, converting a binary system with two digits (capacity 4) to a base-4 system expands its capacity to 16. MrRoPE applies this concept to RoPE by proposing to scale the original base B by a factor lambda_j for each dimension j, effectively creating a mixed-radix system for positional encoding.

The MrRoPE theory states that any RoPE extension that employs such a base conversion formula can be interpreted as a specific form of a mixed-radix system. This theoretical lens allows for a unified understanding of existing RoPE extensions. For example, YaRN, a prominent RoPE extension, is reinterpreted as implementing a "partially regressive" radix conversion, implying that its base scaling factors might decrease or remain constant for certain dimensions after an initial increase.

To explore this further, MrRoPE proposes two concrete implementations of mixed-radix conversion:

  1. MrRoPE-Uni (Uniform Mixed-Radix RoPE): This method applies a uniform scaling factor to the base across relevant dimensions. While the specific piecewise function isn't detailed in the transcript, the intuition is a consistent increase in base capacity.
  2. MrRoPE-Pro (Progressive Mixed-Radix RoPE): This method employs a progressive scaling strategy. It also uses a piecewise function, similar to YaRN, but the middle part (where the scaling occurs) uses a progressive approach to scale up the base. This suggests that lambda_j factors might progressively increase or accelerate their increase for higher dimensions, thereby extending the representational capacity more effectively for longer contexts. The core idea is to ensure that even higher dimensions, which typically only see short arcs during training, are exposed to a wider range of angles when the context is extended.

The theoretical underpinnings of MrRoPE-Pro's superiority are further explained through two key aspects:

  • RoPE-bound theory: This theory quantifies the effective context window. MrRoPE-Pro significantly extends this upper bound. For instance, it can push the context window from an approximate 1,000 tokens to 28,000 tokens. This represents a nearly five-fold increase compared to the bound achieved by YaRN, directly correlating to its enhanced long-context generalization. This extension is achieved by ensuring that the angular range covered by higher dimensions is sufficient even for significantly longer sequences, preventing the "breakdown" observed in original RoPE.
  • Attention Score Behavior: MrRoPE-Pro is designed to ensure that as the position increases, the attention signal it produces remains closer to that of the original RoPE. This stability is crucial because large deviations in attention scores at extended positions can lead to generalization failures. By maintaining this consistency, MrRoPE-Pro reduces the risk of misaligned positional encoding and ensures that the model's learned relationships remain robust across vastly different sequence lengths. This implies a smoother extrapolation of the positional information.

In essence, MrRoPE provides a principled methodology to design and analyze positional embeddings, moving beyond heuristic modifications to a systematic approach grounded in number systems theory. By understanding RoPE as a radix system and applying mixed-radix principles, MrRoPE-Pro achieves superior generalization by intelligently expanding the representational capacity of positional embeddings for unprecedented context lengths.

Experimental Setup & Results

▶ Watch: Conclusion: unified theory and MrRoPE-Pro's effectiveness (8:00)

The MrRoPE research meticulously evaluates its proposed methods, MrRoPE-Uni and MrRoPE-Pro, with a strong emphasis on training-free generalization, a crucial aspect for practical deployment. All experiments are conducted without further fine-tuning or re-training, directly assessing the ability of the methods to extend the context window of pre-trained models.

The evaluation began with the Proof-pile dataset, a common benchmark for assessing language model perplexity. Here, MrRoPE-Pro was compared against other methods, showing consistently better perplexity scores across the entire extended context window. This provides a clear and direct indication of its effectiveness in maintaining language understanding over longer sequences without additional training.

To test robustness under extreme conditions, the researchers utilized the Needle In A Haystack task. This benchmark involves embedding a specific "needle" (a piece of factual information) within a very long, irrelevant "haystack" of text and then querying the model to retrieve that information. In this challenging setup, MrRoPE-Pro demonstrated "much more robustic behavior" compared to existing RoPE extensions like YaRN, indicating its superior ability to maintain recall and understanding in highly extended contexts.

For more comprehensive and challenging long-context evaluations, MrRoPE-Pro was pitted against YaRN on benchmarks like RULER and InfiniteBench. These benchmarks are designed to test various aspects of long-context understanding, including retrieval, question answering, and code comprehension. The gap in performance between MrRoPE-Pro and YaRN became even more significant on these tasks. MrRoPE-Pro consistently beat YaRN across many subtasks, including "retrieval QA" and "code" related challenges. This broad superiority underscores the effectiveness of the progressive conversion strategy over YaRN's partially regressive approach.

A particularly striking result emerged from comparisons involving open-source models. The researchers conducted experiments using an open-source Llama 3 8B model. They found that by simply applying MrRoPE-Pro to a Llama 3 model pre-trained on an 8,000-token context window, they could scale its effective context up to an impressive 128,000 tokens (a 16x extension) without any additional training. Furthermore, in specific retrieval experiments (like "retrieval passkey" and "retrieval number" tasks) within the InfiniteBench suite, this Llama 3 model equipped with MrRoPE-Pro sometimes even outperformed certain closed-source models, such as Kimi-Chat and even GPT-4, which are known to have been trained on very long context windows. This outcome strongly supports the claim that progressive mixed-radix conversion is a more effective strategy for context extension. The optimal scaling factor for Llama 3 was found to be between 8x and 16x.

Finally, the experimental results were corroborated by theoretical evidence. The RoPE-bound theory analysis showed that MrRoPE-Pro significantly extends the upper bound of the context window from approximately 1,000 tokens to 28,000 tokens, representing a nearly five-fold improvement over YaRN's bound. This theoretical validation aligns perfectly with the observed empirical gains in perplexity and long-context task performance. Additionally, the analysis confirmed that MrRoPE-Pro's attention signals remain closer to those of the original RoPE at longer positions, mitigating the risk of generalization failure.

Practical Implications

▶ Watch: Q&A: MrRoPE-Pro vs. fine-tuning and closed-source models (10:00)

The MrRoPE framework, particularly the MrRoPE-Pro method, carries profound practical implications for the development, deployment, and utilization of Large Language Models. Its primary advantage is the ability to significantly extend the context window of pre-trained LLMs without requiring any further training or fine-tuning.

For practitioners and infrastructure teams, this is a game-changer. Re-training or fine-tuning LLMs on longer contexts is an extraordinarily resource-intensive process, demanding vast computational power (GPUs/TPUs), massive datasets, and extensive time. MrRoPE-Pro eliminates this barrier, allowing existing models to immediately benefit from extended context capabilities. For example, a pre-trained Llama 3 8B model, originally trained on an 8,000-token context, can be seamlessly upgraded to handle 128,000 tokens using MrRoPE-Pro. This translates to substantial cost savings, reduced energy consumption, and faster iteration cycles for deploying long-context-aware LLMs.

Model builders and deployers gain immense flexibility. They can now leverage a vast ecosystem of existing, high-performing pre-trained models and adapt them for applications requiring extensive context, such as processing entire documents, lengthy legal contracts, medical records, comprehensive codebases, or extended conversational histories. This capability unlocks new use cases for LLMs in areas like advanced document summarization, complex question answering over large knowledge bases, long-form content generation, and sophisticated code analysis, where the full context is critical for accurate and coherent outputs. The method provides a principled, theoretically grounded approach to choosing scaling factors, moving away from the empirical trial-and-error often associated with previous RoPE extensions.

While the talk primarily highlights the benefits, it's prudent to consider potential tradeoffs and limitations. Although MrRoPE-Pro dramatically extends the positional encoding's capacity, the overall performance of an LLM on extremely long contexts can still be influenced by other architectural factors, such as attention memory usage, computational complexity (quadratic in sequence length for standard attention), and the model's inherent ability to process and reason over such vast amounts of information. While MrRoPE solves the positional encoding challenge, it doesn't fundamentally alter the core attention mechanism's computational scaling. However, for many practical scenarios, the ability to feed more context to the model, even with existing attention mechanisms, represents a significant improvement. The speaker's results, showing MrRoPE-Pro-equipped Llama 3 outperforming some closed-source models, suggest that the benefits often outweigh these general architectural limitations for practical purposes.

In summary, MrRoPE-Pro offers a highly efficient and effective pathway to building and deploying LLMs with significantly expanded context windows. It empowers organizations to extract more value from their existing pre-trained models, accelerating innovation and reducing the resource overhead typically associated with long-context model development.

Key Takeaways

  • RoPE as a Radix System: Rotary Position Embedding (RoPE) can be understood as a biased estimator of a beta-radix number system, where its generalization failure to longer contexts stems from insufficient representational capacity within this implicit system.
  • Unified Framework for RoPE Extensions: MrRoPE provides a principled theoretical framework that reinterprets existing RoPE extensions (e.g., NTK-RoPE, YaRN) as specific forms of mixed-radix conversion, offering a unified understanding of their mechanisms.
  • MrRoPE-Pro for Superior Generalization: The proposed MrRoPE-Pro method, utilizing a progressive mixed-radix conversion, consistently outperforms existing RoPE extensions like YaRN in various long-context benchmarks, demonstrating significantly improved generalization.
  • Dramatic Context Window Extension: MrRoPE-Pro theoretically extends the effective context window upper bound significantly (e.g., from ~1,000 to ~28,000 tokens, nearly 5x that of YaRN) and maintains stable attention signals at longer positions.
  • Training-Free Application: MrRoPE-Pro is a training-free method, enabling direct application to pre-trained LLMs (e.g., scaling Llama 3 8B from 8,000 to 128,000 tokens) without any additional fine-tuning, thereby saving substantial computational resources.
  • Competitive Performance with Closed-Source Models: An open-source Llama model augmented with MrRoPE-Pro has shown the ability to match or even surpass the performance of certain closed-source, long-context-trained models on challenging retrieval tasks.

About the Speaker(s)

The talk was presented by Qingyuan Tian from Shanghai Jiao Tong University. No further biographical details were provided within the transcript. The co-authors listed are Wenhong Zhu, Xiaoran Liu, Xiaofeng Wang, and Rui Wang.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026