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

精确线性注意力

Exact Linear Attention

Weinuo Ou

AI总结:

本文提出精确线性注意力(ELA),通过利用核函数的精确分解性质,实现Transformer注意力的线性计算复杂度,消除近似误差。针对先前线性注意力的两个关键限制——梯度爆炸和token注意力稀释,提出核约束以确保非负性、判别性和几何可解释性。此外,本文还提出了三种工程创新,包括Hyper-Link结构、Memory Lobe模块和基于路由分数的MoE偏置机制,实验结果表明ELA在解码速度和KV缓存内存使用上分别达到全注意力的6倍和75%的减少,同时保持或优于训练性能。

摘要:

本文介绍精确线性注意力(ELA),一种通过利用核函数的精确分解性质,实现Transformer注意力线性计算复杂度的机制,从而消除近似误差。我们识别并解决了先前线性注意力的两个关键限制——梯度爆炸和token注意力稀释——通过施加核约束,确保非负性、判别性和几何可解释性。提出了几种核函数,包括Hadamard Exp核、求和平方欧几里得距离核和减法平方欧几里得距离核,每种都针对特定的注意力行为进行了优化。除了核心注意力公式之外,本文还提出了三种工程创新:(1)Hyper-Link结构,用以替代传统残差连接以缓解梯度退化;(2)基于双向线性注意力的Memory Lobe模块,捕捉跨层的“转换流”以实现定性记忆和隐式强化学习范式;(3)基于路由分数的MoE偏置机制,以提高可解释性和语义对齐。实验结果表明,ELA在解码速度和KV缓存内存使用上分别达到全注意力的6倍和75%的减少,同时保持或优于训练性能。所提出的记忆模块加速了收敛并增强了泛化能力。此外,我们还将线性注意力原理扩展到视觉模型,得到YOLO-LAT,其在GPU推理速度和参数减少方面分别达到4.3倍和7.9倍,同时保持竞争性的检测精度。这些结果表明,精确线性注意力在扩展Transformer模型以处理超长序列和高效视觉任务方面具有广泛的应用前景。

英文摘要:

This paper introduces Exact Linear Attention (ELA), a mechanism that achieves linear computational complexity for Transformer attention by exploiting the exact decomposition property of kernel functions, thereby eliminating approximation error. We identify and address two key limitations of prior linear attention -- gradient explosion and token attention dilution -- by imposing kernel constraints that ensure non-negativity, discriminability, and geometric interpretability. Several kernel functions are proposed, including the Hadamard Exp Kernel, Summation Squared Euclidean Distance Kernel, and Subtraction Squared Euclidean Distance Kernel, each tailored for specific attention behaviors. Beyond the core attention formulation, the paper presents three engineering innovations: (1) a Hyper-Link structure that replaces traditional residual connections to mitigate gradient degradation; (2) a Memory Lobe module based on bidirectional linear attention, which captures "transformation flow" across layers to implement qualitative memory and an implicit reinforcement learning paradigm; and (3) a routing-score-based bias mechanism for Mixture-of-Experts (MoE) to improve interpretability and semantic alignment. Experimental results demonstrate that ELA achieves up to 6x faster decoding speed and 75% reduction in KV cache memory usage compared to full attention, while maintaining comparable or superior training performance. The proposed memory module accelerates convergence and enhances generalization. Furthermore, we extend the linear attention principle to vision models, yielding YOLO-LAT, which attains up to 4.3x GPU inference speedup and 7.9x parameter reduction with competitive detection accuracy. These results underline the broad applicability of exact linear attention for scaling Transformer models to ultra-long sequences and efficient visual tasks.

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

↑