Back to AI Research

AI Research

RiRoPE trains sparse attention with query-specific position reindexing

Key Takeaways

  • RiRoPE reindexes selected tokens during training and inference, reporting matched OLMo-3-7B gains on RULER and HELMET with long-context extrapolation.
  • RiRoPE assigns consecutive positions to the tokens each query actually attends to.
  • Matched continued-pretraining experiments compare that training-time geometry with inherited positional encodings and inference-only switching.
  • RiRoPE assigns consecutive positions to the keys selected for each query during both training and inference.
  • The paper, dated November 27, 2026, studies how position reindexing can complement Sparse attention when the selected context contains large gaps.

RiRoPE assigns consecutive positions to the keys selected for each query during both training and inference. The paper, dated November 27, 2026, studies how position reindexing can complement Sparse attention when the selected context contains large gaps.
Reducing the number of attended keys does not automatically reduce the positional distances between them. The authors instead measure distance within the selected tokens, preserving their order while omitting gaps left by unselected tokens.

What changes in the position encoding?

RiRoPE applies that indexing rule to RoPE. The distance range is bounded by the attention budget rather than by the full sequence length. When no tokens are skipped, the rule reduces to ordinary position indexing.
The important distinction is that the model encounters these query-specific positions during training. The study contrasts that approach with switching positions only at inference, after training under a different geometry.

What did the matched experiments report?

The experiments use continued pretraining of OLMo-3-7B with a shared sparse backbone. At a 64K training length, the authors report RULER scores rising from 74.10 to 80.24 and HELMET scores from 42.97 to 47.37 against sparse RoPE with YaRN.
At 512K, RiRoPE scores 72.17 on RULER, about 90% of its 64K score, without additional training or positional retuning. These are benchmark results under the paper’s setup; they should not be read as a guarantee that every task uses an extended context window equally well.

What makes the method practical?

A key can need different rotations for different queries, making naive implementations expensive. The authors develop rotation reuse and fused kernels that preserve tensor-core matrix multiplication without storing a separately rotated key for every pair.
The reported experiments use a block-sparse implementation compatible with OLMo-3’s architecture. Franklin’s interpretation is that positional design and sparse selection should be evaluated together; the results do not establish a drop-in improvement for every existing sparse-attention model.

Comments