A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexity
Not on the map. Why?
Abstract (arXiv)
Vision Transformers (ViTs) with self-attention modules have recently achieved great empirical success in many vision tasks. Due to non-convex interactions across layers, however, theoretical learning and generalization analysis is mostly elusive. Based on a data model characterizing both label-relevant and label-irrelevant tokens, this paper provides the first theoretical analysis of training a shallow ViT, i.e., one self-attention layer followed by a two-layer perceptron, for a classification task. We characterize the sample complexity to achieve a zero generalization error. Our sample complexity bound is positively correlated with the inverse of the fraction of label-relevant tokens, the token noise level, and the initial model error. We also prove that a training process using stochastic gradient descent (SGD) leads to a sparse attention map, which is a formal verification of the general intuition about the success of attention. Moreover, this paper indicates that a proper token sparsification can improve the test performance by removing label-irrelevant and/or noisy tokens, including spurious correlations. Empirical experiments on synthetic data and CIFAR-10 dataset justify our theoretical results and generalize to deeper ViTs.
Key facts. Cited by 77 papers in the map (data through 7 Oct 2026). Builds on 66 of its 84 references that are in the map. First posted on arXiv 12 Feb 2023.
Builds on
66 of 84 references.
References · 66
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2018Neural Tangent Kernel: Convergence and Generalization in Neural Networkscited by 2,597
- 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,960
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
- 2019BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformercited by 952
- 2021DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsificationcited by 849
38 more
- 2018A Convergence Theory for Deep Learning via Over-Parameterizationcited by 784
- 2018Gradient Descent Provably Optimizes Over-parameterized Neural Networkscited by 655
- 2018Universal Transformerscited by 613
- 2021Twins: Revisiting the Design of Spatial Attention in Vision Transformerscited by 565
- 2019Fine-Grained Analysis of Optimization and Generalization for Overparameterized Two-Layer Neural Networkscited by 562
- 2017Deep Interest Network for Click-Through Rate Predictioncited by 541
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 411
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
- 2021AdaViT: Adaptive Tokens for Efficient Vision Transformercited by 360
- 2022Not All Patches are What You Need: Expediting Vision Transformers via Token Reorganizationscited by 359
- 2018Learning and Generalization in Overparameterized Neural Networks, Going Beyond Two Layerscited by 340
- 2020An Investigation of Why Overparameterization Exacerbates Spurious Correlationscited by 310
- 2019On the Relationship between Self-Attention and Convolutional Layerscited by 299
- 2020Towards Understanding Ensemble, Knowledge Distillation and Self-Distillation in Deep Learningcited by 292
- 2021Post-Training Quantization for Vision Transformercited by 274
- 2018Learning Overparameterized Neural Networks via Stochastic Gradient Descent on Structured Datacited by 260
- 2019Generalization Bounds of Stochastic Gradient Descent for Wide and Deep Neural Networkscited by 221
- 2022Online Decision Transformercited by 194
- 2020The Lipschitz Constant of Self-Attentioncited by 171
- 2021FQ-ViT: Post-Training Quantization for Fully Quantized Vision Transformercited by 148
- 2021All Tokens Matter: Token Labeling for Training Better Vision Transformerscited by 144
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2020Tensor Programs II: Neural Tangent Kernel for Any Architecturecited by 139
- 2021Patch Slimming for Efficient Vision Transformerscited by 131
- 2019Behavior Sequence Transformer for E-commerce Recommendation in Alibabacited by 128
- 2019An Improved Analysis of Training Over-parameterized Deep Neural Networkscited by 120
- 2021Toward Understanding the Feature Learning Process of Self-supervised Contrastive Learningcited by 119
- 2020Infinite attention: NNGP and NTK for deep attention networkscited by 117
- 2020Feature Purification: How Adversarial Training Performs Robust Deep Learningcited by 107
- 2021Long-Short Transformer: Efficient Transformers for Language and Visioncited by 102
- 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
- 2017Recovery Guarantees for One-hidden-layer Neural Networkscited by 94
- 2022Vision Transformers provably learn spatial structurecited by 92
- 2019What Can ResNet Learn Efficiently, Going Beyond Kernels?cited by 91
- 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
- 2021Scalable Vision Transformers with Hierarchical Poolingcited by 84
- 2020Learning Parities with Neural Networkscited by 77
- 2021Vision Transformer Pruningcited by 77
50 most cited of 66 All 66 (JSON)
Built on by
Citing papers per year: 2023: 17; 2024: 34; 2025: 20; 2026: 6.
77 papers.
Sort:
By area:
- 2023In-Context Convergence of Transformerscited by 112
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 97
- 2023White-Box Transformers via Sparse Rate Reductioncited by 77
- 2023Transformers as Support Vector Machinescited by 67
- 2023Max-Margin Token Selection in Attention Mechanismcited by 57
- 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
- 2023On the Role of Attention in Prompt-tuningcited by 49
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 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
- 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 39
38 more
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformerscited by 38
- 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
- 2023Patch-level Routing in Mixture-of-Experts is Provably Sample-efficient for Convolutional Neural Networkscited by 35
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
- 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Graph Transformers: A Surveycited by 32
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
- 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 26
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2024Provably learning a multi-head attention layercited by 21
- 2024A Provably Effective Method for Pruning Experts in Fine-tuned Sparse Mixture-of-Expertscited by 21
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
- 2024Federated Learning from Vision-Language Foundation Models: Theoretical Analysis and Methodcited by 21
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
- 2023Dissecting Chain-of-Thought: Compositionality through In-Context Filtering and Learningcited by 19
- 2023On the Convergence and Sample Complexity Analysis of Deep Q-Networks with ε-Greedy Explorationcited by 17
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2023Enhancing Graph Transformers with Hierarchical Distance Structural Encodingcited by 16
- 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 16
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2024What Improves the Generalization of Graph Transformers? A Theoretical Dive into the Self-attention and Positional Encodingcited by 14
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2023On the Convergence of Encoder-only Shallow Transformerscited by 13
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
- 2023Quantifying the Optimization and Generalization Advantages of Graph Neural Networks Over Multilayer Perceptronscited by 12
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
- 2024Dissecting the Interplay of Attention Paths in a Statistical Mechanics Theory of Transformerscited by 9
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
- 2025Asymptotics of SGD in Sequence-Single Index Models and Single-Layer Attention Networkscited by 9
- 2024Interpretable Lightweight Transformer via Unrolling of Learned Graph Smoothness Priorscited by 8
- 2024Learning on Transformers is Provable Low-Rank and Sparse: A One-layer Analysiscited by 8
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
- 2024How does promoting the minority fraction affect generalization? A theoretical study of the one-hidden-layer neural network on group imbalancecited by 6
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
50 most cited of 77 All 77 (JSON)
- 2026Transformers Learn the Optimal DDPM Denoiser for Multi-Token GMMs11 Apr 2026
- 2026Kuramoto Oscillatory Phase Encoding: Neuro-inspired Synchronization for Improved Learning Efficiency9 Apr 2026
- 2026Efficient Quantization of Mixture-of-Experts with Theoretical Generalization Guarantees7 Apr 2026
- 2026Visual prompting reimagined: The power of the Activation Prompts7 Apr 2026
- 2026Provable Effects of Data Replay in Continual Learning: A Feature Learning Perspective2 Feb 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Rethinking Vision Transformer Depth via Structural Reparameterization24 Nov 2025
- 2025Understanding Private Learning From Feature Perspective22 Nov 2025
- 2025SCALE: Upscaled Continual Learning of Large Language Models5 Nov 2025
- 2025Sparse Model Inversion: Efficient Inversion of Vision Transformers for Data-Free Applications31 Oct 2025
- 2025Mixture-of-Transformers Learn Faster: A Theoretical Study on Classification Problems30 Oct 2025
- 2025Transformers Provably Learn Directed Acyclic Graphs via Kernel-Guided Mutual Information29 Oct 2025
38 more
- 2025How Does Label Noise Gradient Descent Improve Generalization in the Low SNR Regime?20 Oct 2025
- 2025Minimax Rates for Learning Pairwise Interactions in Attention-Style Models13 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2025Learning the Wrong Lessons: Syntactic-Domain Spurious Correlations in Language Models25 Sep 2025
- 2025Theoretical Learning Performance of Graph Neural Networks: The Impact of Jumping Connections and Layer-wise Sparsification7 Jul 2025
- 2025Merging Smarter, Generalizing Better: Enhancing Model Merging on OOD Data10 Jun 2025
- 2025Unlocking Pretrained Vision Transformers for Time Series Classification10 Jun 2025
- 2025Asymptotics of SGD in Sequence-Single Index Models and Single-Layer Attention Networks3 Jun 2025
- 2025On the Role of Label Noise in the Feature Learning Process25 May 2025
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Bias2 May 2025
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformers15 Apr 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought28 Feb 2025
- 2025Disentangling Feature Structure: A Mathematically Provable Two-Stage Training Dynamics in Transformers28 Feb 2025
- 2024Theory of Mixture-of-Experts for Mobile Edge Computing20 Dec 2024
- 2024Generalizability of Memorization Neural Networks1 Nov 2024
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selection18 Oct 2024
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recovery17 Oct 2024
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixtures15 Oct 2024
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descent15 Oct 2024
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysis12 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024Federated Learning from Vision-Language Foundation Models: Theoretical Analysis and Method29 Sep 2024
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Prediction25 Sep 2024
- 2024Differentially Private Kernel Density Estimation3 Sep 2024
- 2024Transformers on Markov Data: Constant Depth Suffices25 Jul 2024
- 2024Graph Transformers: A Survey13 Jul 2024
- 2024Learning on Transformers is Provable Low-Rank and Sparse: A One-layer Analysis24 Jun 2024
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannot11 Jun 2024
- 2024Interpretable Lightweight Transformer via Unrolling of Learned Graph Smoothness Priors6 Jun 2024
- 2024Provably Neural Active Learning Succeeds via Prioritizing Perplexing Samples6 Jun 2024
- 2024What Improves the Generalization of Graph Transformers? A Theoretical Dive into the Self-attention and Positional Encoding4 Jun 2024
- 2024Why Larger Language Models Do In-context Learning Differently?30 May 2024
- 2024A Provably Effective Method for Pruning Experts in Fine-tuned Sparse Mixture-of-Experts26 May 2024
- 2024Dissecting the Interplay of Attention Paths in a Statistical Mechanics Theory of Transformers24 May 2024
- 2024SF-DQN: Provable Knowledge Transfer using Successor Feature for Deep Reinforcement Learning24 May 2024
- 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attention13 Mar 2024
- 2024Mechanics of Next Token Prediction with Self-Attention12 Mar 2024
50 newest of 77 All 77 (JSON)
- 2023Patch-level Routing in Mixture-of-Experts is Provably Sample-efficient for Convolutional Neural Networkscited by 35
- 2024A Provably Effective Method for Pruning Experts in Fine-tuned Sparse Mixture-of-Expertscited by 21
- 2024Theory of Mixture-of-Experts for Mobile Edge Computingcited by 5
- 2026Efficient Quantization of Mixture-of-Experts with Theoretical Generalization Guaranteescited by 1
- 2025Mixture-of-Transformers Learn Faster: A Theoretical Study on Classification Problemscited by 0
- 2026Efficient Quantization of Mixture-of-Experts with Theoretical Generalization Guarantees7 Apr 2026
- 2025Mixture-of-Transformers Learn Faster: A Theoretical Study on Classification Problems30 Oct 2025
- 2024Theory of Mixture-of-Experts for Mobile Edge Computing20 Dec 2024
- 2024A Provably Effective Method for Pruning Experts in Fine-tuned Sparse Mixture-of-Experts26 May 2024
- 2023Patch-level Routing in Mixture-of-Experts is Provably Sample-efficient for Convolutional Neural Networks7 Jun 2023
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2023Dissecting Chain-of-Thought: Compositionality through In-Context Filtering and Learningcited by 19
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought28 Feb 2025
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2023Dissecting Chain-of-Thought: Compositionality through In-Context Filtering and Learning30 May 2023
- 2023In-Context Convergence of Transformerscited by 112
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 97
- 2023White-Box Transformers via Sparse Rate Reductioncited by 77
- 2023Transformers as Support Vector Machinescited by 67
- 2023Max-Margin Token Selection in Attention Mechanismcited by 57
- 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
- 2023On the Role of Attention in Prompt-tuningcited by 49
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 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
- 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 39
12 most cited of 64 All 64 (JSON)
- 2026Kuramoto Oscillatory Phase Encoding: Neuro-inspired Synchronization for Improved Learning Efficiency9 Apr 2026
- 2026Visual prompting reimagined: The power of the Activation Prompts7 Apr 2026
- 2026Provable Effects of Data Replay in Continual Learning: A Feature Learning Perspective2 Feb 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Understanding Private Learning From Feature Perspective22 Nov 2025
- 2025SCALE: Upscaled Continual Learning of Large Language Models5 Nov 2025
- 2025Sparse Model Inversion: Efficient Inversion of Vision Transformers for Data-Free Applications31 Oct 2025
- 2025Transformers Provably Learn Directed Acyclic Graphs via Kernel-Guided Mutual Information29 Oct 2025
- 2025How Does Label Noise Gradient Descent Improve Generalization in the Low SNR Regime?20 Oct 2025
- 2025Minimax Rates for Learning Pairwise Interactions in Attention-Style Models13 Oct 2025
- 2025Learning the Wrong Lessons: Syntactic-Domain Spurious Correlations in Language Models25 Sep 2025
- 2025Theoretical Learning Performance of Graph Neural Networks: The Impact of Jumping Connections and Layer-wise Sparsification7 Jul 2025
12 newest of 64 All 64 (JSON)