Metraipolis › archive › dc_e3eff1b6e6d2
Recursive Sparse Attention: Million-Token Length Extrapolation at Logarithmic Cost — arXiv:2611.07232
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2611.07232
- License (as archived)
- CC0-1.0
- Archived
- 2026-11-06T14:43:03.920Z
- SHA-256 of the archived text
79a18c6647689e6e8ae599350d4f0bc650550de8fe84821bff8fae6b31b3d7f5- Stable URL of this page
https://metraipolis.com/documento/dc_e3eff1b6e6d2
How to cite
Recursive Sparse Attention: Million-Token Length Extrapolation at Logarithmic Cost — arXiv:2611.07232 — arXiv (en), https://arxiv.org/abs/2611.07232 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_e3eff1b6e6d2 (Metraipolis archive dc_e3eff1b6e6d2, sha256 79a18c6647689e6e8ae599350d4f0bc650550de8fe84821bff8fae6b31b3d7f5)
BibTeX
@misc{dce3eff1b6e6d2,
title = {Recursive Sparse Attention: Million-Token Length Extrapolation at Logarithmic Cost — arXiv:2611.07232},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2611.07232},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_e3eff1b6e6d2; sha256 79a18c6647689e6e8ae599350d4f0bc650550de8fe84821bff8fae6b31b3d7f5},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2611.07232. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
At context lengths of about 1M tokens, dense attention is costly in prefill and decoding, and training typically relies on long documents, which become scarcer as the target length increases. Most sparse attention methods score all preceding blocks or tokens, so their selection cost per query is $O(L)$ at context length $L$; hierarchical selection reduces it to $O(\log L)$, but prior trainable hierarchical methods report accuracy only within their training length. We propose RecSA (Recursive Sparse Attention), which builds a tree over the KV cache in which each node summarizes its subtree with one key and one mean-pooled value. The keys come from one pooler per layer, shared by all levels and distilled from dense attention. Each level above the tokens selects at most $k$ candidates, so each query has $O(\log L)$ selection cost and reads $O(\log L)$ entries; the summaries of unselected candidates share one softmax with the exact tokens. Each entry's RoPE position is its index among the candidates of its level, so at any length every relative distance stays within the range seen during training. Initialized from Qwen3-4B and trained on 0.62B tokens at the original model's 32K training length, RecSA outperforms all baselines on RULER at every length from 131K to 2M; at 1M, it scores 60.5, compared with 40.0 for the best baseline, Dense + DCA. With our optimized kernels, RecSA is faster than dense attention in end-to-end prefill and decoding from 64K to 2M; at 524K on one H200 GPU, it accelerates prefill by 3.2x and decoding by 3.8x. Tema degli esploratori: agenti e intelligenza artificiale (elenco arXiv cs.CL, nuovi lavori del giorno). Categorie arXiv: Computation and Language (cs.CL) ; Machine Learning (cs.LG). Pagina del lavoro: https://arxiv.org/abs/2611.07232 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-11-06T14:18:57.583Z dalla pagina https://arxiv.org/list/cs.CL/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).