arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2502.13251cs.CLcs.AI
收藏

神经注意力搜索

Neural Attention Search

Leibniz University Hannover(汉诺威莱布尼茨大学)

Difan Deng, Marius Lindauer

AI总结:

本文提出神经注意力搜索(NAtS)框架,通过可学习掩码自动评估令牌重要性并丢弃冗余令牌,在保持模型性能的同时减少KV缓存,降低推理成本。

摘要:

我们提出了神经注意力搜索(NAtS),这是一个自动评估序列中每个令牌重要性并决定相应令牌是否可以在若干步后被丢弃的框架。该方法能有效减少基于Transformer的模型在推理过程中所需的KV缓存大小,从而降低推理成本。在本文中,我们设计了一个包含三种令牌类型的搜索空间:(i)全局令牌将被保留并被所有后续令牌查询。(ii)局部令牌在下一个全局令牌出现之前存活。(iii)滑动窗口令牌对固定数量的后续令牌的推理产生影响。类似于一次性神经架构搜索方法,这种令牌类型信息可以通过可学习的注意力掩码与架构权重联合学习。在从头训练新Transformer和微调现有大型语言模型的实验中,NAtS均能有效减少模型所需的KV缓存大小,同时保持模型性能。

英文摘要:

We present Neural Attention Search (NAtS), a framework that automatically evaluates the importance of each token within a sequence and determines if the corresponding token can be dropped after several steps. This approach can efficiently reduce the KV cache sizes required by transformer-based models during inference and thus reduce inference costs. In this paper, we design a search space that contains three token types: (i) Global Tokens will be preserved and queried by all the following tokens. (ii) Local Tokens survive until the next global token appears. (iii) Sliding Window Tokens have an impact on the inference of a fixed size of the next following tokens. Similar to the One-Shot Neural Architecture Search approach, this token-type information can be learned jointly with the architecture weights via a learnable attention mask. Experiments on both training a new transformer from scratch and fine-tuning existing large language models show that NAtS can efficiently reduce the KV cache size required for the models while maintaining the models' performance.

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

↑