Native Position Reindexing for Sparse Attention

Lei Zhu, Zexuan Qiu, Zhiwei Li, Zhongwei Wan, Tong Che, Huayang Li, Tian Liang, Hao Gu and 3 others

Tencent HY Team · The Chinese University of Hong Kong · Hong Kong University of Science and Technology (Guangzhou) · Nvidia · Hong Kong University of Science and Technology

Published November 27, 2026 · on the feed December 1, 2026 · ▲ 29 · arXiv 2611.37952

The abstract

Sparse attention typically inherits positional encodings designed for dense attention, despite changing each query's context. Although sparse attention bounds the number of attended keys, these encodings retain large original-sequence distances poorly covered or unseen during training. We argue that positional distances should instead be co-designed with sparse attention, letting long-range interactions share positional representations with short-range ones. To realize this co-design, we make position reindexing native to sparse-attention training: each query's selected tokens receive consecutive positions in their original order during both training and inference, limiting relative distances to the attention budget rather than the full sequence length. Unlike inference-time reindexing in StreamingLLM, native training lets the model adapt to these query-dependent positions rather than merely tolerate them. Applying this rule to rotary position encoding (RoPE) yields ReIndexing RoPE (RiRoPE). A challenge is that query-dependent rotations hinder reuse of rotated keys, erasing the efficiency gains of sparse attention; we address it with 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, RiRoPE outperforms 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 retains about 90\% of its 64K RULER score without further training or positional retuning. Native training also outperforms inference-only switching by 21.24 RULER points at 256K. Our work motivates co-designing positional encodings with sparse attention, reframing sparsity not merely as a computational constraint but as an opportunity for better long-context modeling.

The Brief

3:02

A short podcast summary of the paper. Written and voiced by AI.

Transcript

Native Position Reindexing for Sparse Attention. By Lei Zhu and ten others, from Tencent HY Team, the Chinese University of Hong Kong, and three other institutions. Published on the twenty-seventh of November.

Sparse attention changes which tokens each query attends to, but it usually keeps the positional encodings that were designed for dense attention. The mismatch shows up in distances. Sparse attention bounds how many keys a query attends, yet the encodings still carry the large distances of the original sequence, and those distances were poorly covered, or never seen at all, during training. The model is asked to interpret positions it was not prepared for.

The authors argue that positional distances should be co-designed with sparse attention, so that long-range interactions share positional representations with short-range ones. Their rule is position reindexing, made native to training. Each query's selected tokens receive consecutive positions, in their original order, during both training and inference. Relative distances are then limited by the attention budget rather than by the full length of the sequence. Picture a query that selects a handful of tokens, some nearby and some very far back. Under reindexing, those tokens are numbered one after another in the order they appeared, so the farthest of them sits no further away, positionally, than the size of the selection allows. A long-range interaction is expressed with the same positional vocabulary as a short one.

The word native separates this from inference-time reindexing as done in StreamingLLM. Because the reindexing is present during training, the model adapts to these query-dependent positions rather than merely tolerating them. Applied to rotary position encoding, or RoPE, the rule yields ReIndexing RoPE, called RiRoPE.

There is a cost to solve. When rotations depend on the query, rotated keys can no longer simply be reused, and that would erase the efficiency gains that made sparse attention attractive. A position scheme that is better for modeling but gives back the speed would defeat its own purpose. The authors answer with two things: structure-aware rotation reuse, and fused kernels. Together these preserve tensor-core matrix multiplication, without materializing a separately rotated key for every query and key pair.

The comparison uses matched continued pretraining of OLMo-3-7B. At sixty-four thousand tokens, RiRoPE beats a sparse-attention baseline that uses RoPE with YaRN by six point one four RULER points, rising from seventy-four point one to eighty point two four. On HELMET the gain is four point four points, from forty-two point nine seven to forty-seven point three seven.

Length generalization is the second result. At five hundred and twelve thousand tokens, which is eight times the training length, RiRoPE keeps about ninety percent of its RULER score from sixty-four thousand, with no further training and no positional retuning. And the value of training natively is measured directly: at two hundred and fifty-six thousand tokens, native training beats switching to reindexing only at inference by twenty-one point two four RULER points.

Sparsity tends to be seen only as a computational constraint. This work reframes it as an opportunity for better long-context modeling, provided the positional encoding is designed together with it rather than inherited from dense attention.

More with an account

Listen to every day’s papers

Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.

Join free
KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.