VideoRoPE: What Makes for Good Video Rotary Position Embedding?

Xilin Wei, Xiaoran Liu, Yuhang Zang, Xiaoyi Dong, Pan Zhang, Yuhang Cao, Jian Tong, Haodong Duan, Qipeng Guo, Jiaqi Wang, Xipeng Qiu, Dahua Lin · DOI

Introduction

Rotary Position Embedding (RoPE) has become the gold standard for Large Language Models (LLMs) due to its ability to preserve relative positional information across long sequences. However, as the field moves toward Video LLMs, the transition from 1D text to 3D video data (comprising temporal, horizontal, and vertical dimensions) presents significant challenges. Naive adaptations of RoPE often fail to capture the complex spatial-temporal relationships inherent in video, leading to performance degradation in long-range reasoning.

This paper introduces VideoRoPE, a novel 3D positional encoding scheme designed specifically for video. By strategically allocating frequencies and spatial layouts, VideoRoPE prevents "hash collisions"—a phenomenon where distant frames receive nearly identical embeddings—thereby enhancing the model's ability to distinguish between relevant content and visual distractors.

The Challenge of 3D Positional Encoding

Previous attempts to adapt RoPE for video typically followed one of two paths: flattening the video into a 1D sequence or using a basic 3D structure like M-RoPE. Flattening destroys spatial relationships, while existing 3D structures often assign high-frequency dimensions to the temporal axis.

Because RoPE utilizes periodic sine and cosine functions, high-frequency dimensions oscillate rapidly. The authors discovered that this rapid oscillation causes distant video frames to have overlapping positional embeddings. This "hash collision" forces the model to rely on local context, making it vulnerable to "distractors"—irrelevant but similar-looking frames placed at periodic intervals.

Illustration of the V-NIAH-D benchmark, where distractors are inserted to test the model's temporal reasoning and robustness against hash collisions.

Methodology: The Four Pillars of VideoRoPE

To address these limitations, VideoRoPE is built upon four foundational design principles:

  1. Explicit 3D Structure: VideoRoPE explicitly models the temporal ($t$), horizontal ($x$), and vertical ($y$) dimensions, ensuring that the spatial-temporal geometry of the video is preserved.
  2. Low-frequency Temporal Allocation (LTA): In a departure from previous designs, VideoRoPE assigns lower-frequency (higher index) dimensions to the temporal axis. This prevents rapid periodic oscillations, ensuring that distant frames remain positionally distinct.
  3. Diagonal Layout (DL): By arranging visual tokens diagonally in 3D space, VideoRoPE maintains "spatial symmetry." This ensures visual tokens are mathematically equidistant from surrounding text tokens, eliminating biases related to input order.
  4. Adjustable Temporal Spacing (ATS): Recognizing the different information densities of video frames versus text tokens, the authors introduce a scaling factor ($\delta$) to calibrate the relative "distance" between frames.

Evaluation and Benchmarking

The model was trained on a 1.3 million Question-Answer pair subset of the LLaVA-Video-178k dataset. Evaluation spanned several dimensions:

  • Understanding: LongVideoBench, MLVU, and Video-MME.
  • Hallucination: VideoHallucer.
  • Retrieval: V-NIAH (Visual Needle-In-A-Haystack) and a newly introduced benchmark, V-NIAH-D.

V-NIAH-D specifically targets the "hash collision" problem by periodically inserting semantically similar distractors. This benchmark reveals whether a model truly understands global temporal context or is simply matching local patterns.

Key Results and Insights

VideoRoPE demonstrates superior performance across all evaluated benchmarks. Notably, it outperformed the previous state-of-the-art, M-RoPE, by +12.4% on both standard V-NIAH and the distractor-heavy V-NIAH-D. This consistency proves that VideoRoPE's low-frequency allocation effectively neutralizes the threat of distractors.

Comparison of VideoRoPE against baseline methods across various benchmarks and a summary of architectural features.

In video understanding tasks at a 64k context length, VideoRoPE achieved gains of +2.9 points on LongVideoBench and +4.5 points on MLVU. Furthermore, it significantly reduced hallucinations, showing a 29.5% improvement in temporal hallucination scores on the VideoHallucer benchmark. These results validate the importance of frequency allocation and spatial symmetry in 3D embeddings.

Conclusion

VideoRoPE provides a robust framework for 3D positional encoding in Video LLMs. By prioritizing low-frequency temporal allocation and maintaining spatial symmetry, it overcomes the "hash collision" issues that plague existing models. While performance still shows some degradation at extreme context lengths (e.g., 128k), VideoRoPE represents a significant step forward in enabling models to reason over long, complex video sequences without being misled by visual noise.

Summary updated

BibTeX
@inproceedings{wei2025videorope,
  author = {Xilin Wei and Xiaoran Liu and Yuhang Zang and Xiaoyi Dong and Pan Zhang and Yuhang Cao and Jian Tong and Haodong Duan and Qipeng Guo and Jiaqi Wang and Xipeng Qiu and Dahua Lin},
  title = {{VideoRoPE: What Makes for Good Video Rotary Position Embedding?}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=tO7OVZkCo1},
}
Figure