Over de Expressiviteit van Softmax Attention: Een Perspectief vanuit Recurrente Neurale Netwerken
On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspective
July 31, 2025
Auteurs: Gabriel Mongaras, Eric C. Larson
cs.AI
Samenvatting
Sinds de introductie ervan is softmax-attentie de ruggengraat geworden van moderne transformer-architecturen vanwege de expressiviteit en schaalbaarheid ervan over een breed scala aan taken. Het belangrijkste nadeel van softmax-attentie is echter het kwadratische geheugenvereiste en de rekenkundige complexiteit ten opzichte van de sequentielengte. Door de softmax-non-lineariteit te vervangen, zijn lineaire aandacht en soortgelijke methoden geïntroduceerd om het kwadratische knelpunt van softmax-attentie te vermijden. Hoewel deze lineaire vormen van aandacht zijn afgeleid van de oorspronkelijke softmax-formulering, blijven ze doorgaans achter in termen van downstream-nauwkeurigheid. Hoewel een sterke intuïtie van de softmax-non-lineariteit op het inwendige product van query en key suggereert dat het wenselijke eigenschappen heeft in vergelijking met andere non-lineariteiten, blijft de vraag waarom deze discrepantie bestaat nog steeds onbeantwoord. Dit werk toont aan dat lineaire aandacht een benadering is van softmax-attentie door de recurrente vorm van softmax-attentie af te leiden. Met behulp van deze vorm kan elk onderdeel van softmax-attentie worden beschreven in de taal van recurrente neurale netwerken (RNN's). Het beschrijven van softmax-attentie als een RNN maakt het mogelijk om de componenten van softmax-attentie te isoleren om het belang van elk onderdeel en hoe ze interageren te begrijpen. Op deze manier helpt ons werk te verklaren waarom softmax-attentie expressiever is dan zijn tegenhangers.
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.