mlsanityData to 7 Oct 2026

Transformers as Support Vector Machines

arXiv 2308.16898 ↗First posted 31 Aug 2023cs.LG cs.AI cs.CLcited by 67

Not on the map. Why?

Abstract (arXiv)

Since its inception in "Attention Is All You Need", transformer architecture has led to revolutionary advancements in NLP. The attention layer within the transformer admits a sequence of input tokens X and makes them interact through pairwise similarities computed as softmax(XQK^top X^top), where (K,Q) are the trainable key-query parameters. In this work, we establish a formal equivalence between the optimization geometry of self-attention and a hard-margin SVM problem that separates optimal input tokens from non-optimal tokens using linear constraints on the outer-products of token pairs. This formalism allows us to characterize the implicit bias of 1-layer transformers optimized with gradient descent: (1) Optimizing the attention layer with vanishing regularization, parameterized by (K,Q), converges in direction to an SVM solution minimizing the nuclear norm of the combined parameter W=KQ^top. Instead, directly parameterizing by W minimizes a Frobenius norm objective. We characterize this convergence, highlighting that it can occur toward locally-optimal directions rather than global ones. (2) Complementing this, we prove the local/global directional convergence of gradient descent under suitable geometric conditions. Importantly, we show that over-parameterization catalyzes global convergence by ensuring the feasibility of the SVM problem and by guaranteeing a benign optimization landscape devoid of stationary points. (3) While our theory applies primarily to linear prediction heads, we propose a more general SVM equivalence that predicts the implicit bias with nonlinear heads. Our findings are applicable to arbitrary datasets and their validity is verified via experiments. We also introduce several open problems and research directions. We believe these findings inspire the interpretation of transformers as a hierarchy of SVMs that separates and selects optimal tokens.

Key facts. Cited by 67 papers in the map (data through 7 Oct 2026). Builds on 77 of its 102 references that are in the map. First posted on arXiv 31 Aug 2023.

Builds on

77 of 102 references.

References · 77

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2023GPT-4 Technical Reportcited by 18,132
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  7. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
  8. 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
  9. 2018Neural Tangent Kernel: Convergence and Generalization in Neural Networkscited by 2,597
  10. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
  11. 2021Multiscale Vision Transformerscited by 896
  12. 2018A Convergence Theory for Deep Learning via Over-Parameterizationcited by 784
38 more
  1. 2020Prevalence of Neural Collapse during the terminal phase of deep learning trainingcited by 713
  2. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  3. 2018Gradient Descent Provably Optimizes Over-parameterized Neural Networkscited by 655
  4. 2017The Implicit Bias of Gradient Descent on Separable Datacited by 649
  5. 2021Offline Reinforcement Learning as One Big Sequence Modeling Problemcited by 636
  6. 2019Benign Overfitting in Linear Regressioncited by 544
  7. 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 411
  8. 2019Implicit Regularization in Deep Matrix Factorizationcited by 402
  9. 2017A Deep Reinforced Model for Abstractive Summarizationcited by 364
  10. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  11. 2017A Structured Self-attentive Sentence Embeddingcited by 318
  12. 2017Implicit Regularization in Matrix Factorizationcited by 318
  13. 2019Gradient Descent Maximizes the Margin of Homogeneous Neural Networkscited by 308
  14. 2020Kernel and Rich Regimes in Overparametrized Modelscited by 302
  15. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  16. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
  17. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  18. 2018Learning Overparameterized Neural Networks via Stochastic Gradient Descent on Structured Datacited by 260
  19. 2018Characterizing Implicit Bias in Terms of Optimization Geometrycited by 259
  20. 2023Looped Transformers as Programmable Computerscited by 224
  21. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  22. 2016A Decomposable Attention Model for Natural Language Inferencecited by 214
  23. 2018Just Interpolate: Kernel "Ridgeless" Regression Can Generalizecited by 190
  24. 2020Directional convergence and alignment in deep learningcited by 172
  25. 2019Towards Explaining the Regularization Effect of Initial Large Learning Rate in Training Neural Networkscited by 162
  26. 2016Long Short-Term Memory-Networks for Machine Readingcited by 161
  27. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  28. 2019Implicit regularization for deep neural networks driven by an Ornstein-Uhlenbeck like processcited by 123
  29. 2021Label Noise SGD Provably Prefers Flat Global Minimizerscited by 121
  30. 2018Convergence of Gradient Descent on Separable Datacited by 108
  31. 2021What Happens after SGD Reaches Zero Loss? --A Mathematical Frameworkcited by 106
  32. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
  33. 2015Low-rank Solutions of Linear Matrix Equations via Procrustes Flowcited by 97
  34. 2020Classification vs regression in overparameterized regimes: Does the loss function matter?cited by 97
  35. 2022Vision Transformers provably learn spatial structurecited by 92
  36. 2020Shape Matters: Understanding the Implicit Bias of the Noise Covariancecited by 88
  37. 2018Overparameterized Nonlinear Learning: Gradient Descent Takes the Shortest Path?cited by 87
  38. 2018Risk and parameter convergence of logistic regressioncited by 81

50 most cited of 77 All 77 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 11; 2024: 30; 2025: 17; 2026: 9.

67 papers.

Sort:

By area:

  1. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
  2. 2023In-Context Convergence of Transformerscited by 112
  3. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  4. 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
  5. 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
  6. 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
  7. 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 39
  8. 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
  9. 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
  10. 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
  11. 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
  12. 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
38 more
  1. 2023A Fast Optimization View: Reformulating Single Layer Attention in LLM Based on Tensor and SVM Trick, and Solving It in Matrix Multiplication Timecited by 30
  2. 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
  3. 2024Compressible Dynamics in Deep Overparameterized Low-Rank Learning & Adaptationcited by 26
  4. 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
  5. 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
  6. 2024Self-attention Networks Localize When QK-eigenspectrum Concentratescited by 19
  7. 2023Towards Causal Foundation Model: on Duality between Causal Inference and Attentioncited by 17
  8. 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 16
  9. 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
  10. 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 14
  11. 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
  12. 2024Transformers Learn Low Sensitivity Functions: Investigations and Implicationscited by 13
  13. 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 13
  14. 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
  15. 2023Learning to (Learn at Test Time)cited by 12
  16. 2023Unmasking Transformers: A Theoretical Approach to Data Recovery via Attention Weightscited by 11
  17. 2024Attention Meets Post-hoc Interpretability: A Mathematical Perspectivecited by 11
  18. 2024Next-token prediction capacity: general upper bounds and a lower bound for transformerscited by 11
  19. 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
  20. 2025Mirror, Mirror of the Flow: How Does Regularization Shape Implicit Bias?cited by 10
  21. 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
  22. 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
  23. 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
  24. 2024Learning on Transformers is Provable Low-Rank and Sparse: A One-layer Analysiscited by 8
  25. 2024Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysiscited by 7
  26. 2024How Transformers Get Rich: Approximation and Dynamics Analysiscited by 7
  27. 2023A Theoretical Insight into Attack and Defense of Gradient Leakage in Transformercited by 6
  28. 2023One Pass Streaming Algorithm for Super Long Token Attention Approximation in Sublinear Spacecited by 6
  29. 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
  30. 2025Structured Initialization for Vision Transformerscited by 6
  31. 2024Learning Linear Attention in Polynomial Timecited by 5
  32. 2025On the Convergence of Gradient Descent on Learning Transformers with Residual Connectionscited by 5
  33. 2025Position: We Need An Algorithmic Understanding of Generative AIcited by 5
  34. 2024Structured Initialization for Attention in Vision Transformerscited by 4
  35. 2025Transformer Meets Twicing: Harnessing Unattended Residual Informationcited by 3
  36. 2024Differentially Private Kernel Density Estimationcited by 2
  37. 2025Diagonalizing the Softmax: Hadamard Initialization for Tractable Cross-Entropy Dynamicscited by 2
  38. 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformerscited by 2

50 most cited of 67 All 67 (JSON)