arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.03216cs.CLcs.LG

Token Sparse Attention: 交错令牌选择的高效长上下文推理

Token Sparse Attention: Efficient Long-Context Inference with Interleaved Token Selection

Department of Electrical and Computer Engineering, Seoul National University, Seoul, South Korea(电气电子工程系,首尔国立大学,首尔,韩国)

Dongwon Jo, Beomseok Kang, Jiwon Song, Jae-Joon Kim

AI总结:

提出Token Sparse Attention,一种轻量级动态令牌级稀疏化机制,通过交错选择令牌并在注意力前后压缩/解压缩,实现高效长上下文推理,在128K上下文中获得高达3.23倍加速且精度损失小于1%。

摘要:

注意力的二次复杂度仍然是大语言模型长上下文推理的核心瓶颈。先前的加速方法要么使用结构化模式稀疏化注意力图,要么在特定层永久驱逐令牌,这可能会保留不相关的令牌或依赖不可逆的早期决策,尽管令牌重要性具有层/头动态性。在本文中,我们提出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 $\times$3.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.

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

↑