Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depth
Open accessAbstract
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.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Transformer feature maps undergo rank collapse when going deeper.
“Dong et al. (2021) mathematically reveals the rank collapse phenomenon when Transformer goes deeper.”
From Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice (2022) · cites this paper as Dong et al. (2021)
Dong et al. (2021) is the sole work in the literature that systematically and rigorously analyzes the depth scalability issue with deep ViT.
“However, to our best knowledge, Dong et al. (2021) is the sole work in the literature that systematically and rigorously analyzes this issue with deep ViT.”
From Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice (2022) · cites this paper as Dong et al. (2021)
ViT have been witnessed performance saturation when going deeper.
“Likewise, ViT have been witnessed performance saturation when going deeper.”
From Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice (2022) · cites this paper as Dong et al. (2021)
In Dong et al. (2021), the proof of Lemma A.3 implicitly assumes E_ij - E_ij' is bounded around zero; the authors confirmed a missed assumption is max_{i,j}(E_ij - E_ij') ≤ 1.
“In the proof of Lemma A.3, Taylor expansion was used to approximate and upper bound an exponentiation. However, to let the right-hand side upper bound satisfied, we conjectured that the authors implicitly assumed E ij -E ij ′ is bounded around zero. After directly communicating with the authors, they confirmed that a missed assumption here is max i,j ( E ij -E ij ′ ) ≤ 1 .”
From Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice (2022) · cites this paper as Dong et al. (2021)
In Dong et al. (2021), the proof of Lemma A.1 may assume R, W_V ≥ 0 entry-wise to let Eqn. (8)-(9) hold.
“In the proof of Lemma A.1, to let Eqn. (8)-(9) hold, the authors may have assumed R , W V ≥ 0 , where ≥ denotes entry-wise inequality.”
From Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice (2022) · cites this paper as Dong et al. (2021)
In Dong et al. (2021), Eqn. (12) may not be satisfied in general; a counterexample gives ||D1 softmax(r)^T R W_V||_1 = 4 while ||D1||_∞ ||R||_1 ||W_V||_1 = 3, disproving the claim.
“In the proof of Lemma A.1, we find Eqn. (12) may not be satisfied in general. We can raise the following counterexample: Since E , r , R , W V can be any matrices, we simply let D = diag(2 , 3) , softmax( r ) = [0 . 8 0 . 2] T , R = W V = I . Then ‖ D 1 softmax( r ) T RW V ‖ 1 = 4 while ‖ D 1 ‖ ∞ ‖ R ‖ 1 ‖ W V ‖ 1 = 3 , which disproves the claim.”
From Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice (2022) · cites this paper as Dong et al. (2021)
Cites
Deep Residual Learning for Image Recognition
He, K., Zhang, X., Ren, S., & Sun, J. (2016) · 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) · doi:10.1109/cvpr.2016.90 · Cited by 235,474 · see citing works
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019) · Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) · doi:10.18653/v1/n19-1423 · Cited by 48,293 · see citing works
DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
Sanh, V., Debut, L., Chaumond, J., & Wolf, T. (2019) · arXiv · doi:10.48550/arxiv.1910.01108 · Cited by 4,653 · see citing works
Linformer: Self-Attention with Linear Complexity
Wang, S., Li, B. Z., Khabsa, M., Fang, H., & Ma, H. (2020) · arXiv · doi:10.48550/arxiv.2006.04768 · Cited by 867 · see citing works
Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
Katharopoulos, A., Vyas, A., Pappas, N., & Fleuret, F. (2020) · arXiv · doi:10.48550/arxiv.2006.16236 · Cited by 827 · see citing works
MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices
Sun, Z., Yu, H., Song, X., Liu, R., Yang, Y., & Zhou, D. (2020) · Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2020.acl-main.195 · Cited by 757 · see citing works
Flagged first, then by citations
Cited by
Sorted by citations
Lin, T., Wang, Y., Liu, X., & Qiu, X. (2022) · AI Open · doi:10.1016/j.aiopen.2022.10.001 · Cited by 1,422 · see citing works
Understanding Robustness of Transformers for Image Classification
Bhojanapalli, S., Chakrabarti, A., Glasner, D., Li, D., Unterthiner, T., & Veit, A. (2021) · 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · doi:10.1109/iccv48922.2021.01007 · Cited by 440 · see citing works
“We then turn our attention to the action of the ViT models themselves, analyzing the evolution of information through the cascade of Transformer layers and the redundancies in their internal representations via correlation analysis and lesion studiesÐas has been done in the past for Transformers for language tasks [51…”
MethodKnowledge Neurons in Pretrained Transformers
Dai, D., Dong, L., Hao, Y., Sui, Z., Chang, B., & Wei, F. (2022) · Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) · doi:10.18653/v1/2022.acl-long.581 · Cited by 187 · see citing works
Wang, P., Zheng, W., Chen, T., & Wang, Z. (2022) · arXiv · doi:10.48550/arxiv.2203.05962 · Cited by 80 · see citing works
“Here we respectfully elaborate on the hidden assumptions in the proof of the current preprint of Dong et al. (2021).”
BackgroundMethodInfluential
- Authors
- Dong, Y., Cordonnier, J.-B., & Loukas, A.
- Affiliations
- Google (United States) (US)
- École Polytechnique Fédérale de Lausanne (CH)
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2021
- ISSN
- 2331-8422 (ISSN-L)
- arXiv
- 2103.03404
- OpenAlex
- W3135593154
- Cited by
- 195
- References
- 6
- Citations by year
- 2026: 1 · 2025: 35 · 2024: 44 · 2023: 52 · 2022: 33 · 2021: 28 · 2020: 2
- Type
- posted content
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- arXiv (Cornell University) (submittedVersion)
- Infoscience (Ecole Polytechnique Fédérale de Lausanne) (submittedVersion, cc-by-nc-nd)
- arXiv (Cornell University)
- Funders
- National Science Foundation
- San Diego Supercomputer Center
- Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung (PZ00P2, 179981)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
- Physical Sciences › Computer Science › Artificial Intelligence › Neural Networks and Applications
- Keywords
- self-attention, attention heads, inductive bias, transformer models, skip connections, multilayer perceptron
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review