层级稀疏注意力:迈向无限上下文建模的正确方式
Authors:Xiang Hu (https://arxiv.org/search/cs?searchtype=author&query=Hu,+X), Xinyu Wei (https://arxiv.org/search/cs?searchtype=author&query=Wei,+X), Hao Gu (https://arxiv.org/search/cs?searchtype=author&query=Gu,+H), Minshen Zhang (https://arxiv.org/search/cs?searchtype=author&query=Zhang,+M), Tian Liang (https://arxiv.org/search/cs?searchtype=author&query=Liang,+T), Huayang Li (https://arxiv.org/search/cs?searchtype=author&query=Li,+H), Lei Zhu (https://arxiv.org/search/cs?searchtype=author&query=Zhu,+L), Yan Wang (https://arxiv.org/search/cs?searchtype=author&query=Wang,+Y), Sirui Han (https://arxiv.org/search/cs?searchtype=author&query=Han,+S), Yushi Bai (https://arxiv.org/search/cs?searchtype=author&query=Bai,+Y), Kewei Tu (https://arxiv.org/search/cs?searchtype=author&query=Tu,+K), Haitao Mi (https://arxiv.org/search/cs?searchtype=author&query=Mi,+H), Leo Liang (https://arxiv.org/search/cs?searchtype=author&query=Liang,+L)
View PDF (https://arxiv.org/pdf/2607.02980)HTML (experimental) (https://arxiv.org/html/2607.02980v1)
Abstract:Scaling modern large language models (LLMs) to long contexts is limited by the quadratic computation cost, and poor length extrapolation of dense attention. Chunk-wise sparse attention offers a promising alternative, but all existing methods fall short of full attention because of their inaccurate chunk selection. We propose Hierarchical Landmark Sparse (HiLS) Attention, a chunk-wise sparse attention mechanism that learns chunk selection end-to-end under the language-modeling (LM) loss. HiLS factorizes attention hierarchically: each query performs attention independently with each retrieved chunk to extract chunk-specific information, and the resulting outputs are fused according to chunk retrieval scores. By incorporating retrieval scores into the forward attention computation, HiLS optimizes them directly with the LM loss, enabling end-to-end retrieval learning and native sparse training. Experimental results show that HiLS-Attention achieves performance comparable to, and in some cases better than, full attention at in-domain context lengths. Meanwhile, HiLS-Attention extrapolates more than 64×the training context length with 90% retrieval accuracy, far beyond full attention. Moreover, existing full-attention models can be converted to HiLS-Attention with lightweight continued pretraining, preserving in-domain performance while acquiring ultra-long-context extrapolation. Together with its sparse KV access and computation, HiLS-Attention breaks the usual efficiency-performance trade-off, enabling long-context LLMs that are both more efficient and more effective on general long-context tasks than their full-attention counterparts.
Comments:preprint
Subjects:Computation and Language (cs.CL); Artificial Intelligence (cs.AI)
Cite as:arXiv:2607.02980 (https://arxiv.org/abs/2607.02980) [cs.CL]
(or arXiv:2607.02980v1 (https://arxiv.org/abs/2607.02980v1) [cs.CL] for this version)
https://doi.org/10.48550/arXiv.2607.02980
arXiv-issued DOI via DataCite (pending registration)
Submission history
From: Xiang Hu [view email (https://arxiv.org/show-email/803759ca/2607.02980)]
• *[v1]** Fri, 3 Jul 2026 05:39:00 UTC (798 KB)