Vision Transformers provably learn spatial structure
Not on the map. Why?
Abstract (arXiv)
Vision Transformers (ViTs) have achieved comparable or superior performance than Convolutional Neural Networks (CNNs) in computer vision. This empirical breakthrough is even more remarkable since, in contrast to CNNs, ViTs do not embed any visual inductive bias of spatial locality. Yet, recent works have shown that while minimizing their training loss, ViTs specifically learn spatially localized patterns. This raises a central question: how do ViTs learn these patterns by solely minimizing their training loss using gradient-based methods from random initialization? In this paper, we provide some theoretical justification of this phenomenon. We propose a spatially structured dataset and a simplified ViT model. In this model, the attention matrix solely depends on the positional encodings. We call this mechanism the positional attention mechanism. On the theoretical side, we consider a binary classification task and show that while the learning problem admits multiple solutions that generalize, our model implicitly learns the spatial structure of the dataset while generalizing: we call this phenomenon patch association. We prove that patch association helps to sample-efficiently transfer to downstream datasets that share the same structure as the pre-training one but differ in the features. Lastly, we empirically verify that a ViT with positional attention performs similarly to the original one on CIFAR-10/100, SVHN and ImageNet.
Key facts. Cited by 92 papers in the map (data through 7 Oct 2026). Builds on 66 of its 77 references that are in the map. First posted on arXiv 13 Oct 2022.
Builds on
66 of 77 references.
References · 66
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2014Very Deep Convolutional Networks for Large-Scale Image Recognitioncited by 15,267
- 2020End-to-End Object Detection with Transformerscited by 7,384
- 2015Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shiftcited by 6,979
- 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
- 2015Rethinking the Inception Architecture for Computer Visioncited by 5,451
- 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
38 more
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
- 2016Identity Mappings in Deep Residual Networkscited by 1,960
- 2021An Empirical Study of Training Self-Supervised Vision Transformerscited by 1,610
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
- 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,479
- 2016On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minimacited by 1,337
- 2017Random Erasing Data Augmentationcited by 1,235
- 2016Deep Networks with Stochastic Depthcited by 973
- 2018AutoAugment: Learning Augmentation Policies from Datacited by 728
- 2021Do Vision Transformers See Like Convolutional Neural Networks?cited by 671
- 2017The Implicit Bias of Gradient Descent on Separable Datacited by 649
- 2021Offline Reinforcement Learning as One Big Sequence Modeling Problemcited by 636
- 2021CoAtNet: Marrying Convolution and Attention for All Data Sizescited by 566
- 2019Stand-Alone Self-Attention in Vision Modelscited by 542
- 2021ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biasescited by 484
- 2021Intriguing Properties of Vision Transformerscited by 446
- 2019Implicit Regularization in Deep Matrix Factorizationcited by 402
- 2019Attention Augmented Convolutional Networkscited by 363
- 2017Don't Decay the Learning Rate, Increase the Batch Sizecited by 313
- 2021CMT: Convolutional Neural Networks Meet Vision Transformerscited by 310
- 2019Gradient Descent Maximizes the Margin of Homogeneous Neural Networkscited by 308
- 2020Kernel and Rich Regimes in Overparametrized Modelscited by 302
- 2019On the Relationship between Self-Attention and Convolutional Layerscited by 299
- 2020Towards Understanding Ensemble, Knowledge Distillation and Self-Distillation in Deep Learningcited by 292
- 2017Train longer, generalize better: closing the generalization gap in large batch training of neural networkscited by 278
- 2020Implicit Bias of Gradient Descent for Wide Two-layer Neural Networks Trained with the Logistic Losscited by 267
- 2019Deep Learning for Symbolic Mathematicscited by 266
- 2018Implicit Bias of Gradient Descent on Linear Convolutional Networkscited by 251
- 2021Understanding Robustness of Transformers for Image Classificationcited by 250
- 2017The Marginal Value of Adaptive Gradient Methods in Machine Learningcited by 248
- 2021Vision Transformers are Robust Learnerscited by 208
- 2022Patches Are All You Need?cited by 201
- 2019Towards Explaining the Regularization Effect of Initial Large Learning Rate in Training Neural Networkscited by 162
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2021Toward Understanding the Feature Learning Process of Self-supervised Contrastive Learningcited by 119
- 2015Path-SGD: Path-Normalized Optimization in Deep Neural Networkscited by 117
- 2020Infinite attention: NNGP and NTK for deep attention networkscited by 117
50 most cited of 66 All 66 (JSON)
Built on by
Citing papers per year: 2023: 26; 2024: 38; 2025: 21; 2026: 7.
92 papers.
Sort:
By area:
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2023TinyStories: How Small Can Language Models Be and Still Speak Coherent English?cited by 425
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Birth of a Transformer: A Memory Viewpointcited by 154
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023In-Context Convergence of Transformerscited by 112
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
- 2023Transformers as Support Vector Machinescited by 67
38 more
- 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
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited 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
- 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
- 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
- 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
- 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Inputcited by 32
- 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
- 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
- 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
- 2024Understanding Scaling Laws with Statistical and Approximation Theory for Transformer Neural Networks on Intrinsically Low-dimensional Datacited by 30
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
- 2024Provably learning a multi-head attention layercited 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
- 2024Self-attention Networks Localize When QK-eigenspectrum Concentratescited by 19
- 2023ViP: A Differentially Private Foundation Model for Computer Visioncited by 17
- 2023Enhancing Graph Transformers with Hierarchical Distance Structural Encodingcited by 16
- 2024How do Transformers perform In-Context Autoregressive Learning?cited by 16
- 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 16
- 2024On the Surprising Effectiveness of Attention Transfer for Vision Transformerscited by 16
- 2024Attention layers provably solve single-location regressioncited by 15
- 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
- 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Contextcited by 14
- 2023On the Convergence of Encoder-only Shallow Transformerscited by 13
- 2024Locality Alignment Improves Vision-Language Modelscited by 13
- 2023Quantifying the Optimization and Generalization Advantages of Graph Neural Networks Over Multilayer Perceptronscited by 12
- 2024Adversarial Training Can Provably Improve Robustness: Theoretical Analysis of Feature Learning Process Under Structured Datacited by 12
- 2024Attention Meets Post-hoc Interpretability: A Mathematical Perspectivecited by 11
50 most cited of 92 All 92 (JSON)
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2026Accelerating Vision Foundation Models with Drop-in Depthwise Convolution21 May 2026
- 2026Transformers Learn the Optimal DDPM Denoiser for Multi-Token GMMs11 Apr 2026
- 2026Do VLMs Need Vision Transformers? Evaluating State Space Models as Vision Encoders19 Mar 2026
- 2026Differential Privacy in Two-Layer Networks: How DP-SGD Harms Fairness and Robustness5 Mar 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Provable Effects of Data Replay in Continual Learning: A Feature Learning Perspective2 Feb 2026
- 2025Towards Understanding Transformers in Learning Random Walks28 Nov 2025
- 2025Understanding Private Learning From Feature Perspective22 Nov 2025
- 2025Transformers Provably Learn Directed Acyclic Graphs via Kernel-Guided Mutual Information29 Oct 2025
- 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions21 Oct 2025
- 2025How Does Label Noise Gradient Descent Improve Generalization in the Low SNR Regime?20 Oct 2025
38 more
- 2025A Mathematical Explanation of Transformers5 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2025Unveiling m-Sharpness Through the Structure of Stochastic Gradient Noise22 Sep 2025
- 2025Boosting Generative Adversarial Transferability with Self-supervised Vision Transformer Features26 Jun 2025
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2025On the Role of Label Noise in the Feature Learning Process25 May 2025
- 2025Learning to Adapt to Position Bias in Vision Transformer Classifiers19 May 2025
- 2025Transformers for Learning on Noisy and Task-Level Manifolds: Approximation and Generalization Insights6 May 2025
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformers15 Apr 2025
- 2025Gradient Descent Robustly Learns the Intrinsic Dimension of Data in Training Convolutional Neural Networks11 Apr 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025On the Robustness of Transformers against Context Hijacking for Linear Classification21 Feb 2025
- 2025Understanding Generalization in Transformers: Error Bounds and Training Dynamics Under Benign and Harmful Overfitting18 Feb 2025
- 2025On the Query Complexity of Verifier-Assisted Language Generation17 Feb 2025
- 2025Transformers versus the EM Algorithm in Multi-class Clustering9 Feb 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025
- 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Context16 Nov 2024
- 2024On the Surprising Effectiveness of Attention Transfer for Vision Transformers14 Nov 2024
- 2024Understanding Scaling Laws with Statistical and Approximation Theory for Transformer Neural Networks on Intrinsically Low-dimensional Data11 Nov 2024
- 2024A Mechanistic Study of Transformers Training Dynamics31 Oct 2024
- 2024Global Convergence in Training Large-Scale Transformers31 Oct 2024
- 2024PViT: Prior-augmented Vision Transformer for Out-of-distribution Detection27 Oct 2024
- 2024Simplicity Bias via Global Convergence of Sharpness Minimization21 Oct 2024
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selection18 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
- 2024Locality Alignment Improves Vision-Language Models14 Oct 2024
- 2024Learning Linear Attention in Polynomial Time14 Oct 2024
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysis12 Oct 2024
- 2024Adversarial Training Can Provably Improve Robustness: Theoretical Analysis of Feature Learning Process Under Structured Data11 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024Attention layers provably solve single-location regression2 Oct 2024
- 2024Federated Learning from Vision-Language Foundation Models: Theoretical Analysis and Method29 Sep 2024
- 2024Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelines22 Jul 2024
- 2024Learning on Transformers is Provable Low-Rank and Sparse: A One-layer Analysis24 Jun 2024
- 2024What Improves the Generalization of Graph Transformers? A Theoretical Dive into the Self-attention and Positional Encoding4 Jun 2024
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Tasks4 Jun 2024
- 2024Why Larger Language Models Do In-context Learning Differently?30 May 2024
50 newest of 92 All 92 (JSON)
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2024Locality Alignment Improves Vision-Language Modelscited by 13
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Taskscited by 10
- 2025On the Query Complexity of Verifier-Assisted Language Generationcited by 10
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2026Transformers Provably Learn to Internalize Chain-of-Thoughtcited by 1
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2025On the Query Complexity of Verifier-Assisted Language Generation17 Feb 2025
- 2024Locality Alignment Improves Vision-Language Models14 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Tasks4 Jun 2024
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamics7 May 2024
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2023TinyStories: How Small Can Language Models Be and Still Speak Coherent English?cited by 425
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Birth of a Transformer: A Memory Viewpointcited by 154
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023In-Context Convergence of Transformerscited by 112
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
- 2023Transformers as Support Vector Machinescited by 67
12 most cited of 80 All 80 (JSON)
- 2026Accelerating Vision Foundation Models with Drop-in Depthwise Convolution21 May 2026
- 2026Do VLMs Need Vision Transformers? Evaluating State Space Models as Vision Encoders19 Mar 2026
- 2026Differential Privacy in Two-Layer Networks: How DP-SGD Harms Fairness and Robustness5 Mar 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Provable Effects of Data Replay in Continual Learning: A Feature Learning Perspective2 Feb 2026
- 2025Towards Understanding Transformers in Learning Random Walks28 Nov 2025
- 2025Understanding Private Learning From Feature Perspective22 Nov 2025
- 2025Transformers Provably Learn Directed Acyclic Graphs via Kernel-Guided Mutual Information29 Oct 2025
- 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions21 Oct 2025
- 2025How Does Label Noise Gradient Descent Improve Generalization in the Low SNR Regime?20 Oct 2025
- 2025A Mathematical Explanation of Transformers5 Oct 2025
- 2025Unveiling m-Sharpness Through the Structure of Stochastic Gradient Noise22 Sep 2025
12 newest of 80 All 80 (JSON)