ソフトマックス注意機構の表現力について:リカレントニューラルネットワークの視点から
On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspective
July 31, 2025
著者: Gabriel Mongaras, Eric C. Larson
cs.AI
要旨
ソフトマックスアテンションは、その表現力と幅広いタスクにわたるスケーラビリティから、導入以来、現代のトランスフォーマーアーキテクチャの基盤となってきました。しかし、ソフトマックスアテンションの主な欠点は、シーケンス長に対して二次的なメモリ要件と計算複雑性です。ソフトマックスの非線形性を置き換えることで、線形アテンションや類似の手法が導入され、ソフトマックスアテンションの二次的なボトルネックを回避する試みがなされてきました。これらの線形形式のアテンションは、元のソフトマックス定式化から派生しているにもかかわらず、下流の精度において通常は劣っています。クエリとキーの内積に対するソフトマックス非線形性の強い直感は、他の非線形性と比べて望ましい特性を持っていることを示唆していますが、なぜこのような差異が存在するのかという疑問は未だに解明されていません。本研究では、ソフトマックスアテンションの再帰形式を導出することで、線形アテンションがソフトマックスアテンションの近似であることを示します。この形式を用いることで、ソフトマックスアテンションの各部分を再帰型ニューラルネットワーク(RNN)の言語で記述することができます。ソフトマックスアテンションをRNNとして記述することで、その構成要素を除去し、各部分の重要性とそれらがどのように相互作用するかを理解することが可能になります。このようにして、本研究はソフトマックスアテンションが他の手法よりも表現力が高い理由を説明するのに役立ちます。
English
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.