Token Sparse Attention: Efficient Long-Context Inference with Interleaved Token Selection
提出了一种名为Token Sparse Attention的轻量级、动态的token级稀疏化机制,以有效加速长上下文推理。
更新于 2026-06-09。作者:Dongwon Jo、Beomseok Kang、Jiwon Song、Jae-Joon Kim。
中文摘要
注意力的二次复杂度仍然是大型语言模型进行长上下文推理的中心瓶颈。之前加速方法要么通过结构化模式稀疏化注意力图,要么在特定层永久移除标记,这可能导致保留无关标记或依赖于不可逆的早期决策,尽管标记的重要性具有层/头部的动态性。在这篇论文中,我们提出了Token Sparse Attention,这是一种轻量级且动态的标记级稀疏化机制,在注意力过程中将每个头的Q、K、V压缩到缩减的标记集,然后解压缩输出回到原始序列,使得标记信息可以在后续层重新考虑。此外,Token Sparse Attention在标记选择和稀疏注意力交汇处提出了一种新的设计点。我们的方法与密集注意力实现完全兼容,包括Flash Attention,并且可以无缝与现有的稀疏注意力内核组合。实验结果表明,Token Sparse Attention在准确率-延迟权衡方面持续改进,在128K上下文中实现了高达3.23倍的关注速度提升,同时准确率下降不到1%。这些结果证明了动态和交错式的标记级稀疏化是可扩展长上下文推理的一种补充和有效策略。
英文摘要
The quadratic complexity of attention remains the central bottleneck in long-context inference for large language models. Prior acceleration methods either sparsify the attention map with structured patterns or permanently evict tokens at specific layers, which can retain irrelevant tokens or rely on irreversible early decisions despite the layer-/head-wise dynamics of token importance. In this paper, we propose Token Sparse Attention, a lightweight and dynamic token-level sparsification mechanism that compresses per-head Q, K, V to a reduced token set during attention and then decompresses the output back to the original sequence, enabling token information to be reconsidered in subsequent layers. Furthermore, Token Sparse Attention exposes a new design point at the intersection of token selection and sparse attention. Our approach is fully compatible with dense attention implementations, including Flash Attention, and can be seamlessly composed with existing sparse attention kernels. Experimental results show that Token Sparse Attention consistently improves accuracy-latency trade-off, achieving up to times3.23 attention speedup at 128K context with less than 1% accuracy degradation. These results demonstrate that dynamic and interleaved token-level sparsification is a complementary and effective strategy for scalable long-context inference.
解读
一句话总结
提出了一种名为Token Sparse Attention的轻量级、动态的token级稀疏化机制,以有效加速长上下文推理。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:大型语言模型在长上下文推理中面临注意力机制的二次复杂性瓶颈。
- 现有方案不足:先前加速方法要么使用结构化模式稀疏化注意力图,要么在特定层永久排除token,这可能导致保留无关token或依赖于不可逆的早期决策。
- 研究目标:提出Token Sparse Attention,一种轻量级和动态的token级稀疏化机制,以实现长上下文推理的高效性。
问题2:论文的核心创新点是什么?
- 技术创新:引入了Token Sparse Attention,通过压缩和分解Q、K、V来降低注意力计算成本。
- 方法改进:实现了一种动态的token级稀疏化,允许后续层重新考虑token信息。
- 优势:与现有方法相比,Token Sparse Attention在保持准确性的同时显著提高了推理速度。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在RULER和InfiniteBench等基准测试中评估Token Sparse Attention的性能。
- 性能提升:在128K上下文中,Token Sparse Attention实现了高达×3.23的注意力加速,同时准确性降低不到1%。
- 对比结果:与基线方法相比,Token Sparse Attention在保持类似准确性的同时,显著提高了速度。
问题4:这个研究的实际应用价值是什么?
- 应用场景:适用于需要处理长上下文的大型语言模型,如文本摘要、多轮推理和代码生成。
- 实施建议:将Token Sparse Attention与现有稀疏注意力核结合使用,以实现高效的推理速度。
- 局限与展望:在短上下文中效率增益较小,未来可以扩展到解码阶段和多模态设置。
来源
机器可读索引:llms.txt