跳到正文
arXiv cs.AI· Lei Zhu, Zexuan Qiu, Zhiwei Li, Zhongwei Wan, Tong Che, Huayang Li, Tian Liang, Hao Gu, Zhijiang Guo, Irwin King, Leo Liang·· 2 小时前AI 评分52

RiRoPE 论文提出稀疏注意力原生的位置重索引训练方法

Native Position Reindexing for Sparse Attention

AI 导读

论文提出把位置重索引作为稀疏注意力训练的原生环节,使每个 query 选中 token 获得连续位置,得到 ReIndexing RoPE(RiRoPE),并用结构感知旋转复用和融合算子保持效率。

正文 · 原文

Authors:Lei Zhu, Zexuan Qiu, Zhiwei Li, Zhongwei Wan, Tong Che, Huayang Li, Tian Liang, Hao Gu, Zhijiang Guo, Irwin King, Leo Liang

View PDF HTML (experimental)

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.
Comments: Work in progress
Subjects: Artificial Intelligence (cs.AI); Computation and Language (cs.CL)
Cite as: arXiv:2611.37952 [cs.AI]
  (or arXiv:2611.37952v1 [cs.AI] for this version)
  https://doi.org/10.48550/arXiv.2611.37952

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Lei Zhu [view email]
[v1] Fri, 27 Nov 2026 18:59:26 UTC (1,323 KB)

来源:arXiv cs.AI · arxiv.org