2025-08-01 · 专家 · 机器学习 · 自然语言处理

On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspective

本文通过将softmax注意力机制重新表述为循环神经网络的形式,揭示了其相较于线性注意力机制在表达力上的优势。

更新于 2025-09-11。作者:Gabriel Mongaras、Eric C. Larson。

中文摘要

自从引入以来,softmax注意力因其表达能力和广泛的任务可扩展性,已成为现代Transformer架构的核心。然而,softmax注意力的主要缺点是与序列长度相关的二次内存需求和计算复杂度。通过替换softmax非线性函数,引入了线性注意力以及类似方法,以避免softmax注意力的二次瓶颈。尽管这些线性形式的注意力源于原始的softmax公式,但它们在下游准确性方面通常落后。虽然对softmax非线性函数在查询和键内积上的强大直觉表明,它与其他非线性函数相比具有可取的性质,但为什么存在这种差异的问题仍未得到解答。这项工作通过推导softmax注意力的递归形式,证明了线性注意力是softmax注意力的近似。使用这种形式,softmax注意力的每个部分都可以用递归神经网络(RNN)的语言来描述。将softmax注意力描述为RNN允许我们消除softmax注意力的组成部分,以了解每个部分的重要性以及它们如何相互作用。通过这种方式,我们的工作有助于解释为什么softmax注意力比其对应物更具表现力。

英文摘要

Since its introduction, softmax attention has become the backbone of modern transformer architectures due to its expressiveness and scalability across a wide range of tasks. However, the main drawback of softmax attention is the quadratic memory requirement and computational complexity with respect to the sequence length. By replacing the softmax nonlinearity, linear attention and similar methods have been introduced to avoid the quadratic bottleneck of softmax attention. Despite these linear forms of attention being derived from the original softmax formulation, they typically lag in terms of downstream accuracy. While strong intuition of the softmax nonlinearity on the query and key inner product suggests that it has desirable properties compared to other nonlinearities, the question of why this discrepancy exists still remains unanswered. This work demonstrates that linear attention is an approximation of softmax attention by deriving the recurrent form of softmax attention. Using this form, each part of softmax attention can be described in the language of recurrent neural networks (RNNs). Describing softmax attention as an RNN allows for the ablation of the components of softmax attention to understand the importance of each part and how they interact. In this way, our work helps explain why softmax attention is more expressive than its counterparts.

解读

一句话总结

本文通过将softmax注意力机制重新表述为循环神经网络的形式,揭示了其相较于线性注意力机制在表达力上的优势。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源