mlsanityData to 7 Oct 2026

Vision Transformers provably learn spatial structure

arXiv 2210.09221 ↗First posted 13 Oct 2022cs.CV cs.LGcited by 92

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2014Very Deep Convolutional Networks for Large-Scale Image Recognitioncited by 15,267
  6. 2020End-to-End Object Detection with Transformerscited by 7,384
  7. 2015Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shiftcited by 6,979
  8. 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
  9. 2015Rethinking the Inception Architecture for Computer Visioncited by 5,451
  10. 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
  11. 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
  12. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
38 more
  1. 2021Program Synthesis with Large Language Modelscited by 3,509
  2. 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
  3. 2016Identity Mappings in Deep Residual Networkscited by 1,960
  4. 2021An Empirical Study of Training Self-Supervised Vision Transformerscited by 1,610
  5. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
  6. 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,479
  7. 2016On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minimacited by 1,337
  8. 2017Random Erasing Data Augmentationcited by 1,235
  9. 2016Deep Networks with Stochastic Depthcited by 973
  10. 2018AutoAugment: Learning Augmentation Policies from Datacited by 728
  11. 2021Do Vision Transformers See Like Convolutional Neural Networks?cited by 671
  12. 2017The Implicit Bias of Gradient Descent on Separable Datacited by 649
  13. 2021Offline Reinforcement Learning as One Big Sequence Modeling Problemcited by 636
  14. 2021CoAtNet: Marrying Convolution and Attention for All Data Sizescited by 566
  15. 2019Stand-Alone Self-Attention in Vision Modelscited by 542
  16. 2021ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biasescited by 484
  17. 2021Intriguing Properties of Vision Transformerscited by 446
  18. 2019Implicit Regularization in Deep Matrix Factorizationcited by 402
  19. 2019Attention Augmented Convolutional Networkscited by 363
  20. 2017Don't Decay the Learning Rate, Increase the Batch Sizecited by 313
  21. 2021CMT: Convolutional Neural Networks Meet Vision Transformerscited by 310
  22. 2019Gradient Descent Maximizes the Margin of Homogeneous Neural Networkscited by 308
  23. 2020Kernel and Rich Regimes in Overparametrized Modelscited by 302
  24. 2019On the Relationship between Self-Attention and Convolutional Layerscited by 299
  25. 2020Towards Understanding Ensemble, Knowledge Distillation and Self-Distillation in Deep Learningcited by 292
  26. 2017Train longer, generalize better: closing the generalization gap in large batch training of neural networkscited by 278
  27. 2020Implicit Bias of Gradient Descent for Wide Two-layer Neural Networks Trained with the Logistic Losscited by 267
  28. 2019Deep Learning for Symbolic Mathematicscited by 266
  29. 2018Implicit Bias of Gradient Descent on Linear Convolutional Networkscited by 251
  30. 2021Understanding Robustness of Transformers for Image Classificationcited by 250
  31. 2017The Marginal Value of Adaptive Gradient Methods in Machine Learningcited by 248
  32. 2021Vision Transformers are Robust Learnerscited by 208
  33. 2022Patches Are All You Need?cited by 201
  34. 2019Towards Explaining the Regularization Effect of Initial Large Learning Rate in Training Neural Networkscited by 162
  35. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  36. 2021Toward Understanding the Feature Learning Process of Self-supervised Contrastive Learningcited by 119
  37. 2015Path-SGD: Path-Normalized Optimization in Deep Neural Networkscited by 117
  38. 2020Infinite attention: NNGP and NTK for deep attention networkscited by 117

50 most cited of 66 All 66 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 26; 2024: 38; 2025: 21; 2026: 7.

92 papers.

Sort:

By area:

  1. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  2. 2023TinyStories: How Small Can Language Models Be and Still Speak Coherent English?cited by 425
  3. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  4. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  5. 2023Birth of a Transformer: A Memory Viewpointcited by 154
  6. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
  7. 2023In-Context Convergence of Transformerscited by 112
  8. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
  9. 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
  10. 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
  11. 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
  12. 2023Transformers as Support Vector Machinescited by 67
38 more
  1. 2023Max-Margin Token Selection in Attention Mechanismcited by 57
  2. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  3. 2023On the Role of Attention in Prompt-tuningcited by 49
  4. 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
  5. 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
  6. 2023Memorization Capacity of Multi-Head Attention in Transformerscited by 39
  7. 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 39
  8. 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
  9. 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformerscited by 38
  10. 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
  11. 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
  12. 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
  13. 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
  14. 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Inputcited by 32
  15. 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
  16. 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
  17. 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
  18. 2024Understanding Scaling Laws with Statistical and Approximation Theory for Transformer Neural Networks on Intrinsically Low-dimensional Datacited by 30
  19. 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
  20. 2024Provably learning a multi-head attention layercited by 21
  21. 2024Federated Learning from Vision-Language Foundation Models: Theoretical Analysis and Methodcited by 21
  22. 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
  23. 2024Self-attention Networks Localize When QK-eigenspectrum Concentratescited by 19
  24. 2023ViP: A Differentially Private Foundation Model for Computer Visioncited by 17
  25. 2023Enhancing Graph Transformers with Hierarchical Distance Structural Encodingcited by 16
  26. 2024How do Transformers perform In-Context Autoregressive Learning?cited by 16
  27. 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 16
  28. 2024On the Surprising Effectiveness of Attention Transfer for Vision Transformerscited by 16
  29. 2024Attention layers provably solve single-location regressioncited by 15
  30. 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
  31. 2024What Improves the Generalization of Graph Transformers? A Theoretical Dive into the Self-attention and Positional Encodingcited by 14
  32. 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
  33. 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Contextcited by 14
  34. 2023On the Convergence of Encoder-only Shallow Transformerscited by 13
  35. 2024Locality Alignment Improves Vision-Language Modelscited by 13
  36. 2023Quantifying the Optimization and Generalization Advantages of Graph Neural Networks Over Multilayer Perceptronscited by 12
  37. 2024Adversarial Training Can Provably Improve Robustness: Theoretical Analysis of Feature Learning Process Under Structured Datacited by 12
  38. 2024Attention Meets Post-hoc Interpretability: A Mathematical Perspectivecited by 11

50 most cited of 92 All 92 (JSON)