Representational Strengths and Limitations of Transformers
Clayton Sanford, Daniel J. Hsu, Matus Telgarsky
摘要
Attention layers, as commonly used in transformers, form the backbone of modern deep learning, yet there is no mathematical description of their benefits and deficiencies as compared with other architectures. In this work we establish both positive and negative results on the representation power of attention layers, with a focus on intrinsic complexity parameters such as width, depth, and embedding dimension. On the positive side, we present a sparse averaging task, where recurrent networks and feedforward networks all have complexity scaling polynomially in the input size, whereas transformers scale merely logarithmically in the input size; furthermore, we use the same construction to show the necessity and role of a large embedding dimension in a transformer. On the negative side, we present a triple detection task, where attention layers in turn have complexity scaling linearly in the input size; as this scenario seems rare in practice, we also present natural variants that can be efficiently solved by attention layers. The proof techniques emphasize the value of communication complexity in the analysis of transformers and related models, and the role of sparse averaging as a prototypical attention task, which even finds use in the analysis of triple detection.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 69 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers, parallel computation, and logarithmic depth 引用了 What graph neural networks cannot learn: depth vs width
- Transformers, parallel computation, and logarithmic depth 引用了 Birth of a Transformer: A Memory Viewpoint
- Inductive Biases and Variable Creation in Self-Attention Mechanisms 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Inductive Biases and Variable Creation in Self-Attention Mechanisms 引用了 Language Models are Few-Shot Learners
- Inductive Biases and Variable Creation in Self-Attention Mechanisms 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 Language Models are Few-Shot Learners
- Repeat After Me: Transformers are Better than State Space Models at Copying 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- Repeat After Me: Transformers are Better than State Space Models at Copying 引用了 Language Models are Few-Shot Learners
- Understanding Transformer Reasoning Capabilities via Graph Algorithms 引用了 Transformers, parallel computation, and logarithmic depth
- Understanding Transformer Reasoning Capabilities via Graph Algorithms 引用了 What graph neural networks cannot learn: depth vs width
- Understanding Transformer Reasoning Capabilities via Graph Algorithms 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Understanding Transformer Reasoning Capabilities via Graph Algorithms 引用了 Language Models are Few-Shot Learners
- Understanding Transformer Reasoning Capabilities via Graph Algorithms 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
- Birth of a Transformer: A Memory Viewpoint 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- Birth of a Transformer: A Memory Viewpoint 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper69
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen 等NeurIPS 2023 · 1,003 次引用
- Birth of a Transformer: A Memory ViewpointAlberto Bietti, Vivien Cabannes, Diane Bouchacourt, Hervé Jégou 等NeurIPS 2023 · 182 次引用
- Repeat After Me: Transformers are Better than State Space Models at CopyingSamy Jelassi, David Brandfonbrener, Sham M. Kakade, Eran MalachICML 2024 · 176 次引用
- Understanding Transformer Reasoning Capabilities via Graph AlgorithmsClayton Sanford, Bahare Fatemi, Ethan Hall, Anton Tsitsulin 等NeurIPS 2024 · 84 次引用
- Transformers, parallel computation, and logarithmic depthClayton Sanford, Daniel Hsu, Matus TelgarskyICML 2024 · 64 次引用
它引用的 Paper13
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 481 次引用
- What graph neural networks cannot learn: depth vs widthAndreas LoukasICLR 2020 · 336 次引用
- Inductive Biases and Variable Creation in Self-Attention MechanismsBenjamin L. Edelman, Surbhi Goel, Sham M. Kakade, Cyril ZhangICML 2022 · 154 次引用
相关 Paper
- When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical PerspectiveAlireza Mousavi-Hosseini, Clayton Sanford, Denny Wu, Murat A. ErdogduNeurIPS 2025 · 6 次引用
- Quality over Quantity in Attention Layers: When Adding More Heads HurtsNoah Amsel, Gilad Yehudai, Joan BrunaICLR 2025
- Low-Rank Bottleneck in Multi-head Attention ModelsSrinadh Bhojanapalli, Chulhee Yun, Ankit Singh Rawat, Sashank J. Reddi 等ICML 2020 · 130 次引用
- Separations in the Representational Capabilities of Transformers and Recurrent ArchitecturesSatwik Bhattamishra, Michael Hahn, Phil Blunsom, Varun KanadeNeurIPS 2024 · 36 次引用
- Theoretical limitations of multi-layer TransformerLijie Chen, Binghui Peng, Hongxun WuFOCS 2025 · 2 次引用
