arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.17196cs.CLcs.AIcs.LG
收藏

理解并改进层次稀疏注意力模型中的长度泛化

Understanding and Improving Length Generalization in Hierarchical Sparse Attention Models

Fudan University(复旦大学);Tencent AI Lab(腾讯AI实验室);Cornell University(康奈尔大学);Ant Group(蚂蚁集团);Ant International(蚂蚁国际);NYU Shanghai(纽约大学上海分校)

Jiaqi Leng, Xiang Hu, Junxiong Wang, Jianguo Li, Wei Wu, Yucheng Lu

AI总结:

本文通过系统分析揭示了层次稀疏注意力模型中长度泛化的核心设计原则,提出三种关键组件:非线性Chunk编码器、旁路残差路径和预训练中的稀疏选择,从而在RULER和BABILong数据集上实现了免训练的长度外推。

摘要:

有效处理长上下文是语言模型的关键挑战。尽管标准Transformer受限于二次复杂度和较差的长度外推能力,替代架构如滑动窗口注意力和状态空间模型由于固定大小的内存,无法有效利用完整上下文。基于分块的稀疏注意力已成为极端长度泛化的重要范式,但其成功背后的架构原理尚未完全理解。本文系统分析了这些模型,通过统一框架和全面的消融研究,证明了三个关键设计原则:(1)具有专用CLS标记的表达性非线性Chunk编码器,用于生成检索表示;(2)旁路残差路径,用于稳定整合检索到的全局信息,而不被局部残差流覆盖;(3)预训练中强制选择稀疏性,以弥合训练-测试分布差距。我们提供了对块内信息处理和地标生成的理论动机。通过结合这些原则,我们建立了新的免训练长度外推状态,成功将训练于4K上下文的模型泛化到RULER和BABILong上的3200万token。我们的发现为开发未来高性能长上下文语言模型提供了清晰且经验支持的设计原则。

英文摘要:

Effectively processing long contexts is a critical challenge for language models. While standard Transformers are limited by quadratic complexity and poor length extrapolation, alternative architectures like sliding window attention and state space models sacrifice the ability to effectively utilize the full context due to their fixed-size memory. Chunk-based sparse attention has emerged as a promising paradigm for extreme length generalization, yet the key architectural principles underpinning its success are not yet fully understood. In this work, we present a systematic dissection of these models to identify the core components driving their performance. Through a unified framework and comprehensive ablation studies, we demonstrate that a combination of three design principles is critical: (1) an expressive, non-linear Chunk Encoder with a dedicated CLS token to produce representations for retrieval; (2) a Bypassing Residual Path to stably integrate retrieved global information without it being overridden by the local residual stream; and (3) enforced selection sparsity during pre-training to bridge the train-test distribution gap. We provide a theoretical motivation for intra-chunk information processing and landmark generation. By combining these principles, we establish a new state-of-the-art for training-free length extrapolation, successfully generalizing models trained on a 4K context to 32 million tokens on RULER and BABILong. Our findings provide a clear and empirically-grounded set of design principles for developing future, highly-capable long-context language models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑