Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depth
Yihe Dong, Jean-Baptiste Cordonnier, Andreas Loukas
TL;DR
The paper investigates why attention-based transformers perform well by introducing a path decomposition that rewrites a self-attention network (SAN) as a sum over paths through the network. It proves that pure SANs, without skip connections or MLPs, exhibit a token-uniformity bias that drives the output to a rank-1 matrix at a doubly exponential rate with depth; skip connections and MLPs counteract this collapse to varying degrees. Empirical results on standard architectures (BERT, ALBERT, XLNet) confirm rank collapse in the absence of skips and illustrate the bias via toy visualizations and path-length analyses. The work provides both a theoretical framework and practical insights, highlighting the critical role of architectural components in maintaining expressive power and suggesting avenues for long-path utilization and width-depth tradeoffs in future models.
Abstract
Attention-based architectures have become ubiquitous in machine learning, yet our understanding of the reasons for their effectiveness remains limited. This work proposes a new way to understand self-attention networks: we show that their output can be decomposed into a sum of smaller terms, each involving the operation of a sequence of attention heads across layers. Using this decomposition, we prove that self-attention possesses a strong inductive bias towards "token uniformity". Specifically, without skip connections or multi-layer perceptrons (MLPs), the output converges doubly exponentially to a rank-1 matrix. On the other hand, skip connections and MLPs stop the output from degeneration. Our experiments verify the identified convergence phenomena on different variants of standard transformer architectures.
