Long-context ability, has become one of the most important iteration direction of next-generation Large Language Models, particularly in semantic understanding/reasoning, code agentic intelligence and recommendation system. However, the standard softmax attention exhibits quadratic time complexity with respect to sequence length. As the sequence length increases, this incurs substantial overhead in long-context settings, leading the training and inference costs of extremely long sequences deteriorate rapidly. Existing solutions mitigate this issue through two technique routings: i) Reducing the KV cache per layer, such as from the head-level compression GQA, and the embedding dimension-level compression MLA, but the KV cache remains linearly dependent on the sequence length at a 1:1 ratio. ii) Interleaving with KV Cache friendly architecture, such as local attention SWA, linear kernel GDN, but often involve trade-offs among KV Cache and long-context modeling effectiveness. Besides the two technique routings, we argue that there exists an intermediate path not well explored: {Maintaining a linear relationship between the KV cache and sequence length, but performing semantic-level compression through a specific ratio $k$}. This $O(n/k)$ path does not pursue a ``minimum KV cache'', but rather trades acceptable memory costs for complete, referential, and interpretable retention of long distant dependency. Motivated by this, we propose Kwai Summary Attention (KSA), a novel attention mechanism that reduces sequence modeling cost by compressing historical contexts into learnable summary tokens.


翻译:长上下文能力已成为下一代大语言模型最重要的迭代方向之一,尤其在语义理解/推理、代码智能体和推荐系统中。然而,标准 softmax 注意力机制在序列长度上呈现二次复杂度。随着序列长度增加,长上下文场景中的计算开销急剧增长,导致超长序列的训练和推理成本迅速恶化。现有解决方案通过两条技术路径缓解该问题:i) 降低每层的 KV 缓存,例如通过头级压缩 GQA 和嵌入维度级压缩 MLA,但 KV 缓存与序列长度仍保持1:1的线性依赖关系;ii) 采用与 KV 缓存友好的架构交替,例如局部注意力 SWA、线性核 GDN,但通常需要在 KV 缓存与长上下文建模效果之间进行权衡。除上述两条技术路径外,我们认为存在一条尚未充分探索的中间路径:{维持 KV 缓存与序列长度的线性关系,但通过特定比率 $k$ 执行语义级压缩}。该 $O(n/k)$ 路径并不追求"最小 KV 缓存",而是以可接受的内存代价换取对长距离依赖的完整、可参考且可解释的保留。受此启发,我们提出 Kwai Summary Attention (KSA),一种通过将历史上下文压缩为可学习的摘要标记来降低序列建模成本的新型注意力机制。

0
下载
关闭预览

相关内容

数学上,序列是被排成一列的对象(或事件);这样每个元素不是在其他元素之前,就是在其他元素之后。这里,元素之间的顺序非常重要。
2024年中国AI基础数据服务研究报告
专知会员服务
40+阅读 · 2024年7月12日
AI+汽车智能化系列之五:大模型技术综述,54页pdf
专知会员服务
67+阅读 · 2024年6月1日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
语音识别的前沿论文,看我们推荐的这4篇
人工智能前沿讲习班
26+阅读 · 2019年1月14日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
《pyramid Attention Network for Semantic Segmentation》
统计学习与视觉计算组
44+阅读 · 2018年8月30日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
11+阅读 · 2016年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 4月27日
Arxiv
0+阅读 · 3月26日
Arxiv
0+阅读 · 3月20日
VIP会员
最新内容
ECCV 2026 | MIMFlow:MIM与归一化流统一图像生成
专知会员服务
1+阅读 · 35分钟前
网状网络及其在军事领域的运用
专知会员服务
4+阅读 · 今天6:18
无美国参与的欧洲战争方式(万字长文)
专知会员服务
5+阅读 · 今天5:54
《国防领域敏感性分析白皮书》
专知会员服务
6+阅读 · 今天3:42
综述 | 从问答到任务完成:Agent系统与Harness设计
Agentic RL:框架、实践与长程智能体训练
专知会员服务
5+阅读 · 6月24日
重新思考无人机时代的生存能力
专知会员服务
9+阅读 · 6月24日
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
6+阅读 · 6月24日
在人工智能加速决策环境中拓展OODA循环
专知会员服务
8+阅读 · 6月24日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
11+阅读 · 2016年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员