ChatPaper.aiChatPaper

Zur Ausdruckskraft von Softmax-Attention: Eine Perspektive aus rekurrenten neuronalen Netzen

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

July 31, 2025
papers.authors: Gabriel Mongaras, Eric C. Larson
cs.AI

papers.abstract

Seit seiner Einführung hat die Softmax-Attention aufgrund ihrer Ausdrucksstärke und Skalierbarkeit über eine Vielzahl von Aufgaben hinweg das Rückgrat moderner Transformer-Architekturen gebildet. Der Hauptnachteil der Softmax-Attention besteht jedoch in dem quadratischen Speicherbedarf und der Rechenkomplexität in Bezug auf die Sequenzlänge. Durch den Ersatz der Softmax-Nichtlinearität wurden lineare Attention und ähnliche Methoden eingeführt, um den quadratischen Engpass der Softmax-Attention zu vermeiden. Obwohl diese linearen Formen der Attention aus der ursprünglichen Softmax-Formulierung abgeleitet wurden, liegen sie typischerweise in Bezug auf die nachgelagerte Genauigkeit zurück. Während die starke Intuition der Softmax-Nichtlinearität auf dem inneren Produkt von Query und Key darauf hindeutet, dass sie im Vergleich zu anderen Nichtlinearitäten wünschenswerte Eigenschaften besitzt, bleibt die Frage, warum diese Diskrepanz besteht, weiterhin unbeantwortet. Diese Arbeit zeigt, dass lineare Attention eine Approximation der Softmax-Attention darstellt, indem die rekurrente Form der Softmax-Attention hergeleitet wird. Mit dieser Form kann jeder Teil der Softmax-Attention in der Sprache rekurrenter neuronaler Netze (RNNs) beschrieben werden. Die Beschreibung der Softmax-Attention als RNN ermöglicht die Ablation der Komponenten der Softmax-Attention, um die Bedeutung jedes Teils und ihre Interaktion zu verstehen. Auf diese Weise trägt unsere Arbeit dazu bei, zu erklären, warum Softmax-Attention ausdrucksstärker ist als ihre Gegenstücke.
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.
PDF22August 1, 2025