通过混合稀疏注意力与上下文可学习令牌驱逐缓解线性注意力的遗忘问题
Alleviating Forgetfulness of Linear Attention by Hybrid Sparse Attention and Contextualized Learnable Token Eviction
AI总结:
针对线性注意力模型因有限内存导致的遗忘问题,本文提出结合稀疏注意力与可学习令牌驱逐的混合方法,在保持线性复杂度下提升检索性能。
摘要:
线性注意力模型将整个输入序列压缩为固定大小的循环状态,为Transformer提供了一种高效替代方案,但其有限的内存会导致遗忘,从而损害检索密集型任务。为缓解该问题,我们探索了一系列混合模型,以恢复对过去令牌的直接访问。我们交替使用时间与空间复杂度介于线性和完全注意力之间的令牌混合器,包括带令牌驱逐的稀疏注意力以及查询感知的原生稀疏注意力。特别地,我们提出了一种新颖的可学习令牌驱逐方法。结合滑动窗口注意力,一个端到端可训练的轻量级CNN聚合过去和未来相邻令牌的信息,以自适应地保留每个头有限的关键KV对,同时维持线性注意力的恒定时间和空间复杂度。我们为稀疏注意力机制提供了高效的Triton内核。在检索密集型基准上的实证评估支持了我们方法的有效性。
英文摘要:
Linear-attention models that compress the entire input sequence into a fixed-size recurrent state offer an efficient alternative to Transformers, but their finite memory induces forgetfulness that harms retrieval-intensive tasks. To mitigate the issue, we explore a series of hybrid models that restore direct access to past tokens. We interleave token mixers with intermediate time and space complexity between linear and full attention, including sparse attention with token eviction, and the query-aware native sparse attention. Particularly, we propose a novel learnable token eviction approach. Combined with sliding-window attention, an end-to-end trainable lightweight CNN aggregates information from both past and future adjacent tokens to adaptively retain a limited set of critical KV-pairs per head, maintaining linear attention's constant time and space complexity. Efficient Triton kernels for the sparse attention mechanisms are provided. Empirical evaluations on retrieval-intensive benchmarks support the effectiveness of our approaches.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。