arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.02328cs.CL
收藏

高效稀疏注意力需要自适应 Token 释放

Efficient Sparse Attention needs Adaptive Token Release

Wuhan University(武汉大学);Lehigh University(里海大学);Monash University(莫纳什大学)

Chaoran Zhang, Lixin Zou, Dan Luo, Min Tang, Xiangyang Luo, Zihao Li, Chenliang Li

AI总结:

针对 LLM 键值缓存开销问题,提出轻量级控制器自适应释放并重建 token,以近似 top-$K$ 稀疏注意力,性能接近全注意力且吞吐量最高提升 221.8%。

摘要:

近年来,大语言模型(LLM)在大量以文本为中心的任务中展现出卓越能力。然而,其“大”规模带来了显著的计算与存储挑战,尤其是在管理 transformer 的键值状态方面,这限制了它们更广泛的适用性。因此,我们提出自适应地从缓存中释放资源,并重建必要的键值状态。具体而言,我们通过一个轻量级控制器模块来实现这一点,以近似理想的 top-$K$ 稀疏注意力。该模块保留具有最高 top-$K$ 注意力权重的 token,同时重建那些被丢弃但必要的 token,这些 token 可能对未来解码变得至关重要。在自然语言生成和建模中的综合实验表明,我们的方法不仅在性能上可与全注意力竞争,还实现了最高达 221.8% 的显著吞吐量提升。用于复现的代码可在 https://github.com/WHUIR/ADORE 获取。

英文摘要:

In recent years, Large Language Models (LLMs) have demonstrated remarkable capabilities across a wide array of text-centric tasks. However, their `large' scale introduces significant computational and storage challenges, particularly in managing the key-value states of the transformer, which limits their wider applicability. Therefore, we propose to adaptively release resources from caches and rebuild the necessary key-value states. Particularly, we accomplish this by a lightweight controller module to approximate an ideal top-$K$ sparse attention. This module retains the tokens with the highest top-$K$ attention weights and simultaneously rebuilds the discarded but necessary tokens, which may become essential for future decoding. Comprehensive experiments in natural language generation and modeling reveal that our method is not only competitive with full attention in terms of performance but also achieves a significant throughput improvement of up to 221.8%. The code for replication is available on the https://github.com/WHUIR/ADORE.

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

↑