Long-context inference in modern LLMs is increasingly constrained by decoding efficiency, especially in reasoning-heavy settings where models generate long intermediate chains of thought. Existing sparse attention methods often face a practical efficiency-quality trade-off. Structured block sparse methods typically provide stronger acceleration but incur noticeable quality loss, while token sparse methods are usually more accurate yet deliver limited end-to-end speedup because top-k routing over the full cache remains expensive. In this work, we propose cross-layer sparse attention (CLSA), which is built on top of KV-sharing architectures such as YOCO. The core idea is to share not only the KV cache across cross-decoder layers, but also the routing index. A single indexer computes token-level top-k selection once and reuses the resulting index across layers, thereby preserving the fine-grained selectivity of token sparse attention while amortizing the routing overhead. The resulting architecture improves all major inference bottlenecks jointly, including pre-filling, KV-cache storage, and long-context decoding. Experiments across short-context and long-context benchmarks show that CLSA is both accurate and efficient, achieving up to 7.6x decoding speedup and 17.1x overall throughput improvement at 128K context. These results suggest a more complete architectural solution for long-context LLMs that jointly advances model quality and inference efficiency.


翻译:现代大语言模型中的长上下文推理越来越受到解码效率的制约,尤其在推理密集型场景下,模型会生成长篇中间思维链。现有稀疏注意力方法通常面临实际效率与质量之间的权衡:结构化块稀疏方法虽能提供更强的加速效果,但会带来显著的质量损失;而词元稀疏方法虽通常更精确,但由于在完整缓存上进行top-k路由计算的成本高昂,端到端加速效果有限。本文提出跨层稀疏注意力(CLSA),该架构基于如YOCO等KV共享架构构建。核心思想不仅在于共享跨解码器层的KV缓存,还共享路由索引。单个索引器计算一次词元级top-k选择,并将所得索引在多个层间复用,从而在保持词元稀疏注意力细粒度选择性的同时分摊路由开销。该架构协同优化了所有主要推理瓶颈,包括预填充、KV缓存存储及长上下文解码。短上下文与长上下文基准测试结果表明,CLSA兼具准确性与高效性:在128K上下文长度下,实现最高7.6倍解码加速与17.1倍整体吞吐量提升。这些结果揭示了长上下文大语言模型更完整的架构解决方案,可同步提升模型质量与推理效率。

0
下载
关闭预览

相关内容

TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
【CVPR2023】BiFormer:基于双层路由注意力的视觉Transformer
专知会员服务
35+阅读 · 2023年3月20日
【NeurIPS 2021】流形上的注意力机制:规范等变的Transformer
专知会员服务
48+阅读 · 2020年10月20日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
跨越注意力:Cross-Attention
我爱读PAMI
172+阅读 · 2018年6月2日
基础 | 基于注意力机制的seq2seq网络
黑龙江大学自然语言处理实验室
16+阅读 · 2018年3月7日
深度学习中的注意力机制
CSDN大数据
24+阅读 · 2017年11月2日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月12日
Arxiv
0+阅读 · 6月9日
VIP会员
最新内容
驱动军事决策变革的顶尖人工智能指挥系统
专知会员服务
9+阅读 · 8月11日
非对称防御中的自组织临界性:俄乌战争
专知会员服务
10+阅读 · 8月10日
《战争中的大语言模型监管》
专知会员服务
14+阅读 · 8月10日
《边缘计算关键技术分析及美军作战实践应用》
边缘计算的军事应用
专知会员服务
12+阅读 · 8月9日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员