RiRoPE co-designs positional encoding with sparse attention for long-context models
An arXiv paper argues sparse attention should reshape positional encodings during training, not just inherit dense-attention positions, and reports gains on long-context benchmarks.
In plain words
Large language models use positional encodings to track where tokens sit in a sequence, and sparse attention lets a model consider only a subset of tokens at each step. The paper's method, RiRoPE, renumbers each query's selected tokens with consecutive positions during both training and inference, so distances stay within the attention budget. The authors report stronger long-context benchmark scores than a RoPE-with-YaRN baseline and good retention at lengths far beyond training.
What was announced
The authors argue that sparse attention usually inherits positional encodings built for dense attention, even though sparsity changes each query's context, leaving large original-sequence distances poorly covered during training. Their fix makes position reindexing native to sparse-attention training: each query's selected tokens get consecutive positions in their original order at training and inference time, limiting relative distances to the attention budget rather than the full sequence length. They contrast this with inference-time reindexing in StreamingLLM, saying native training lets the model adapt to query-dependent positions rather than merely tolerate them.
Applying the rule to rotary position encoding yields RiRoPE. Because query-dependent rotations hinder reuse of rotated keys, the authors propose structure-aware rotation reuse and fused kernels that preserve tensor-core matrix multiplication without materializing per-pair rotated keys. With matched OLMo-3-7B continued pretraining, they report RiRoPE beating a sparse-attention baseline using RoPE with YaRN at 64K by 6.14 RULER points (74.10 to 80.24) and 4.40 HELMET points (42.97 to 47.37). At 512K, eight times the training length, it reportedly retains about 90% of its 64K RULER score without further training or positional retuning, and native training beats inference-only switching by 21.24 RULER points at 256K.
What it does not show
- Evidence is limited to the paper's abstract; the full article was not reviewed, so method details and experimental setup cannot be verified.
- All benchmark results are the authors' own reported numbers on RULER and HELMET; no independent confirmation is available.
- The reported gains are tied to OLMo-3-7B continued pretraining and these specific benchmarks; results for other models or settings are not established.
Sources
Source-support review completed 30 Nov 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.
Coverage: arXiv: abstract.
Updates and corrections
No corrections so far.
First published 30 Nov 2026
New to the subject? AI from the Ground Up starts from the beginning.