arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.23319cs.CLcs.AI
收藏

每个token都重要:在大语言模型中推广1600万超长上下文

Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models

Ant Group(蚂蚁集团);Westlake University(西湖大学)

Xiang Hu, Zhanchao Zhou, Ruiqi Liang, Zehuan Li, Wei Wu, Jianguo Li

AI总结:

本文提出了一种新型的分层稀疏注意力机制,用于在大语言模型中实现对超长上下文的有效建模,并在多个任务中展示了其处理1600万长度上下文的能力。

摘要:

本文探讨了构建"能够记忆的机器"所面临的挑战,将长期记忆视为高效超长上下文建模的问题。我们主张这需要三个关键特性:稀疏性、随机访问灵活性和长度泛化。为解决超长上下文建模问题,我们利用了分层稀疏注意力(HSA),这是一种新型的注意力机制,满足了这三个特性。我们将HSA整合到Transformer中,构建了HSA-UltraLong,这是一个80亿参数的MoE模型,训练数据超过8万亿个token,并在不同任务上进行了严格评估,以展示其处理超长上下文的能力。结果表明,我们的模型在域内长度上与全注意力基线相当,而在上下文长度达到1600万时,在大多数上下文检索任务中实现了超过90%的准确率。本报告概述了我们的实验见解和开放问题,为未来超长上下文建模的研究奠定了基础。

英文摘要:

This work explores the challenge of building ``Machines that Can Remember'', framing long-term memory as the problem of efficient ultra-long context modeling. We argue that this requires three key properties: \textbf{sparsity}, \textbf{random-access flexibility}, and \textbf{length generalization}. To address ultra-long-context modeling, we leverage Hierarchical Sparse Attention (HSA), a novel attention mechanism that satisfies all three properties. We integrate HSA into Transformers to build HSA-UltraLong, which is an 8B-parameter MoE model trained on over 8 trillion tokens and is rigorously evaluated on different tasks with in-domain and out-of-domain context lengths to demonstrate its capability in handling ultra-long contexts. Results show that our model performs comparably to full-attention baselines on in-domain lengths while achieving over 90\% accuracy on most in-context retrieval tasks with contexts up to 16M. This report outlines our experimental insights and open problems, contributing a foundation for future research in ultra-long context modeling.

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

↑