When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspective
Not on the map. Why?
Abstract (arXiv)
Theoretical efforts to prove advantages of Transformers in comparison with classical architectures such as feedforward and recurrent neural networks have mostly focused on representational power. In this work, we take an alternative perspective and prove that even with infinite compute, feedforward and recurrent networks may suffer from larger sample complexity compared to Transformers, as the latter can adapt to a form of dynamic sparsity. Specifically, we consider a sequence-to-sequence data generating model on sequences of length N, in which the output at each position depends only on q relevant tokens with q ll N, and the positions of these tokens are described in the input prompt. We prove that a single-layer Transformer can learn this model if and only if its number of attention heads is at least q, in which case it achieves a sample complexity almost independent of N, while recurrent networks require NOmega(1) samples on the same problem. If we simplify this model, recurrent networks may achieve a complexity almost independent of N, while feedforward networks still require N samples. Consequently, our proposed sparse retrieval model illustrates a natural hierarchy in sample complexity across these architectures.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 55 of its 65 references that are in the map. First posted on arXiv 14 Mar 2025.
Builds on
55 of 65 references.
References · 55
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2017Spectrally-normalized margin bounds for neural networkscited by 681
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2014Breaking the Curse of Dimensionality with Convex Neural Networkscited by 329
- 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 293
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
38 more
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2020Implicit Bias of Gradient Descent for Wide Two-layer Neural Networks Trained with the Logistic Losscited by 267
- 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 256
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
- 2022Exploring Length Generalization in Large Language Modelscited by 204
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
- 2022Neural Networks can Learn Representations with Gradient Descentcited by 161
- 2022High-dimensional Asymptotics of Feature Learning: How One Gradient Step Improves the Representationcited by 146
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2023SGD learning on neural networks: leap complexity and saddle-to-saddle dynamicscited by 142
- 2018Towards Understanding the Role of Over-Parametrization in Generalization of Neural Networkscited by 140
- 2023Representational Strengths and Limitations of Transformerscited by 132
- 2018Regularization Matters: Generalization and Optimization of Neural Nets v.s. their Induced Kernelcited by 131
- 2019A Function Space View of Bounded Norm Infinite Width ReLU Nets: The Multivariate Casecited by 113
- 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
- 2022Learning Single-Index Models with Shallow Neural Networkscited by 92
- 2024Michelangelo: Long Context Evaluations Beyond Haystacks via Latent Structure Queriescited by 85
- 2024What Matters in Transformers? Not All Attention is Neededcited by 83
- 2024Transformers, parallel computation, and logarithmic depthcited by 75
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
- 2013How to Construct Deep Recurrent Neural Networkscited by 64
- 2024RNNs are not Transformers (Yet): The Key Bottleneck on In-context Retrievalcited by 62
- 2022Neural Networks Efficiently Learn Low-Dimensional Representations with SGDcited by 61
- 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 49
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 47
- 2021On the Expressive Power of Self-Attention Matricescited by 44
- 2019On Generalization Bounds of a Family of Recurrent Neural Networkscited by 42
- 2023Memorization Capacity of Multi-Head Attention in Transformerscited by 39
- 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 39
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
- 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architecturescited by 29
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2023Sequence Length Independent Norm-Based Generalization Bounds for Transformerscited by 28
- 2024Measure-to-measure interpolation using Transformerscited by 28
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
- 2024Mixture of Parrots: Experts improve memorization more than reasoningcited by 20
50 most cited of 55 All 55 (JSON)
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.