arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2602.03681cs.CLcs.LG
收藏

神经注意力搜索线性:迈向自适应令牌级混合注意力模型

Neural Attention Search Linear: Towards Adaptive Token-Level Hybrid Attention Models

University of Copenhagen(哥本哈根大学)

Difan Deng, Andreas Bentzen Winje, Lukas Fehring, Marius Lindauer

AI总结:

提出NAtS-L框架,在同一层内对不同令牌自适应选择线性注意力或softmax注意力,以平衡效率与表达能力。

摘要:

softmax变换器的二次计算复杂度已成为长上下文场景的瓶颈。相比之下,线性注意力模型系列为更高效的序列模型提供了有希望的方向。这些线性注意力模型将过去的KV值压缩成单个隐藏状态,从而在训练和推理期间有效降低复杂度。然而,它们的表达能力仍然受限于隐藏状态的大小。先前的工作提出交错使用softmax和线性注意力层,以在保持表达能力的同时降低计算复杂度。然而,这些模型的效率仍然受限于其softmax注意力层。在本文中,我们提出神经注意力搜索线性(NAtS-L)框架,该框架在同一层内对不同令牌同时应用线性注意力和softmax注意力操作。NAtS-L自动判断一个令牌是否可以由线性注意力模型处理(即仅具有短期影响且可编码为固定大小隐藏状态的令牌),或者是否需要softmax注意力(即包含与长期检索相关信息且需要为未来查询保留的令牌)。通过跨令牌搜索最优的门控DeltaNet和softmax注意力组合,我们展示了NAtS-L提供了一种强大而高效的令牌级混合架构。

英文摘要:

The quadratic computational complexity of softmax transformers has become a bottleneck in long-context scenarios. In contrast, linear attention model families provide a promising direction towards a more efficient sequential model. These linear attention models compress past KV values into a single hidden state, thereby efficiently reducing complexity during both training and inference. However, their expressivity remains limited by the size of their hidden state. Previous work proposed interleaving softmax and linear attention layers to reduce computational complexity while preserving expressivity. Nevertheless, the efficiency of these models remains bottlenecked by their softmax attention layers. In this paper, we propose Neural Attention Search Linear (NAtS-L), a framework that applies both linear attention and softmax attention operations within the same layer on different tokens. NAtS-L automatically determines whether a token can be handled by a linear attention model, i.e., tokens that have only short-term impact and can be encoded into fixed-size hidden states, or require softmax attention, i.e., tokens that contain information related to long-term retrieval and need to be preserved for future queries. By searching for optimal Gated DeltaNet and softmax attention combinations across tokens, we show that NAtS-L provides a strong yet efficient token-level hybrid architecture.

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

↑