RiRoPE: rinumerare le posizioni dei token selezionati per rendere l'attenzione sparsa utile sui contesti lunghiRiRoPE: renumbering the positions of selected tokens to make sparse attention useful on long contexts
RiRoPE assegna posizioni consecutive ai soli token scelti da ogni query nell'attenzione sparsa. Su OLMo-3-7B a 64K, guadagna 6,14 punti RULER e 4,40 HELMET. A 512K mantiene circa il 90% del punteggio.
RiRoPE gives consecutive positions to the tokens each query selects in sparse attention. On OLMo-3-7B at 64K, it gains 6.14 RULER and 4.40 HELMET points. At 512K it keeps about 90% of the score.

Nell'attenzione sparsa ogni query guarda solo una selezione di token, ma le codifiche posizionali come RoPE sono pensate per l'attenzione densa. Conservano le distanze originali, che possono arrivare a centinaia di migliaia di posizioni. Un gruppo guidato da Lei Zhu propone il reindexing nativo. I token scelti da ciascuna query ricevono posizioni consecutive, nell'ordine originale, sia in addestramento sia in inferenza. Applicato a RoPE, il metodo si chiama RiRoPE.
Le distanze relative sono così limitate al budget di attenzione e non alla lunghezza della sequenza. Il metodo non aggiunge parametri e non cambia la scelta dei token. Con un addestramento continuo di OLMo-3-7B a 64K, RiRoPE supera una base sparsa con RoPE e YaRN. Il vantaggio è di 6,14 punti su RULER (80,24 in totale) e di 4,40 su HELMET (47,37). A 512K conserva circa il 90% del punteggio RULER a 64K, senza ulteriore addestramento. I test riguardano un solo modello da 7 miliardi.
In sparse attention each query looks only at a selection of tokens, but positional encodings such as RoPE are designed for dense attention. They keep the original distances, which can reach hundreds of thousands of positions. A group led by Lei Zhu proposes native reindexing. The tokens chosen by each query receive consecutive positions, in their original order, in both training and inference. Applied to RoPE, the method is called RiRoPE.
Relative distances are thus limited to the attention budget and not to the sequence length. The method adds no parameters and does not change token selection. With continued pretraining of OLMo-3-7B at 64K, RiRoPE beats a sparse baseline with RoPE and YaRN. The gain is 6.14 RULER points (80.24 in total) and 4.40 on HELMET (47.37). At 512K it keeps about 90% of the 64K RULER score, without further training. The tests concern a single 7-billion model.
Il 27 novembre 2026, Lei Zhu e dieci coautori hanno pubblicato su arXiv (2611.37952) il paper «Native Position Reindexing for Sparse Attention». Il lavoro affronta un problema di compatibilità. L'attenzione sparsa riduce il costo dei contesti lunghi, facendo guardare a ogni query solo una parte dei token. Viene però combinata con codifiche posizionali progettate per l'attenzione densa. Secondo gli autori, questa combinazione limita i benefici della sparsità.
Per capirlo conviene ricordare come funziona RoPE. Il modello non sa in che posizione si trovi un token. La codifica rotazionale (RoPE) ruota i vettori di query e chiave di un angolo che dipende dalla posizione. Lo fa in modo che il prodotto tra i due dipenda solo dalla distanza relativa. Con l'attenzione densa, tutte le distanze fino alla lunghezza del contesto compaiono in addestramento. Con l'attenzione sparsa, invece, una query seleziona pochi token lontani. Le distanze tra questi e la query restano enormi, anche se i token scelti sono pochi.
L'idea del paper è il reindexing nativo delle posizioni. I token selezionati per ciascuna query ricevono posizioni consecutive, mantenendo il loro ordine originale, come se il testo fosse stato compattato. Questo avviene sia nell'addestramento sia nell'inferenza. Così le distanze relative sono limitate dal budget di attenzione, cioè dal numero di token consentiti, e non più dalla lunghezza dell'intera sequenza. Applicato a RoPE, il metodo prende il nome di RiRoPE (ReIndexing RoPE). Cambia l'indicizzazione e non la scelta dei token, e non aggiunge parametri.
La difficoltà è l'efficienza. Rinumerare le posizioni per ogni query rischia di moltiplicare i calcoli di rotazione. Gli autori descrivono strategie di riuso delle rotazioni e kernel dedicati. Con i vincoli strutturali comuni all'attenzione sparsa, questi riorganizzano le rotazioni sugli operandi delle singole moltiplicazioni di matrici. Così si conserva il calcolo denso sui tensor core delle GPU.
I risultati vengono da un addestramento continuo (continued pretraining) di OLMo-3-7B a parità di condizioni. A 64K di contesto, RiRoPE ottiene 80,24 punti su RULER, 6,14 in più di una base sparsa che usa RoPE con YaRN. Su HELMET ottiene 47,37, cioè 4,40 in più. RULER è una batteria di compiti sintetici di recupero di informazioni nel testo. HELMET misura prestazioni più varie su contesto lungo. Quando si estende il contesto fino a 512K senza ulteriore addestramento, il modello mantiene circa il 90% del punteggio RULER a 64K.
Un confronto riguarda il momento in cui si introduce la sparsità. A 256K, un modello addestrato con attenzione sparsa nativa supera di 21,24 punti RULER uno in cui si passa alla sparsità solo in inferenza. Gli autori ne concludono che l'attenzione sparsa può migliorare la modellazione del contesto lungo, se la codifica posizionale è progettata insieme ad essa. Non sarebbe quindi soltanto un'approssimazione che fa perdere qualità.
I limiti vanno tenuti presenti. Le misure riguardano un solo modello da 7 miliardi e una sola famiglia di baseline. Non sappiamo se il vantaggio cresca o si riduca su modelli molto più grandi o con altri schemi di sparsità. Si tratta inoltre di un preprint non ancora sottoposto a revisione. Se i risultati saranno replicati, il lavoro offre un'indicazione chiara ai progettisti di modelli a contesto lungo. Bisogna scegliere insieme il meccanismo di selezione e la codifica delle posizioni, evitando di riutilizzare quella densa.
On 27 November 2026, Lei Zhu and ten co-authors posted on arXiv (2611.37952) the paper 'Native Position Reindexing for Sparse Attention'. The work addresses a compatibility problem. Sparse attention reduces the cost of long contexts, by having each query look at only part of the tokens. It is, however, combined with positional encodings designed for dense attention. According to the authors, this combination limits the benefits of sparsity.
To see why, recall how RoPE works. The model does not know where a token sits. Rotary encoding (RoPE) rotates the query and key vectors by an angle that depends on position. It does so in such a way that their product depends only on relative distance. With dense attention, all distances up to the context length appear in training. With sparse attention, instead, a query selects few distant tokens. The distances between these and the query remain enormous, even though few tokens are chosen.
The paper's idea is native position reindexing. The tokens selected for each query receive consecutive positions, keeping their original order, as if the text had been compacted. This happens in both training and inference. Relative distances are thus limited by the attention budget, the number of tokens allowed, and no longer by the length of the whole sequence. Applied to RoPE, the method is called RiRoPE (ReIndexing RoPE). It changes the indexing and not the token selection, and adds no parameters.
The difficulty is efficiency. Renumbering positions for every query risks multiplying rotation computations. The authors describe rotation-reuse strategies and dedicated kernels. Under the structural constraints common to sparse attention, these reorganise the rotations onto the operands of individual matrix multiplications. In this way, dense computation is preserved on GPU tensor cores.
The results come from continued pretraining of OLMo-3-7B under matched conditions. At 64K context, RiRoPE scores 80.24 on RULER, 6.14 more than a sparse baseline using RoPE with YaRN. On HELMET it scores 47.37, that is 4.40 more. RULER is a battery of synthetic tasks on retrieving information from text. HELMET measures more varied long-context performance. When the context is extended to 512K without further training, the model keeps about 90% of the 64K RULER score.
One comparison concerns when sparsity is introduced. At 256K, a model trained with native sparse attention beats by 21.24 RULER points one in which sparsity is switched on only at inference. The authors conclude that sparse attention can improve long-context modelling, if the positional encoding is designed together with it. It would not, then, be merely an approximation that loses quality.
The limits must be kept in mind. The measurements concern a single 7-billion model and one family of baselines. We do not know whether the advantage grows or shrinks on much larger models or with other sparsity schemes. It is also a preprint not yet peer reviewed. If the results are replicated, the work gives a clear indication to designers of long-context models. They should choose the selection mechanism and the position encoding together, rather than reusing the dense one.
Fonti
- Testata arXiv - Native Position Reindexing for Sparse Attention (HTML) arxiv.org
- Fonte originale arXiv - Native Position Reindexing for Sparse Attention arxiv.org
Articoli rivisti con l’intelligenza artificiale. A cura di Alessandro Patassini.Articles reviewed with artificial intelligence. Edited by Alessandro Patassini.














































