How Smooth Is Attention?
Not on the map. Why?
Abstract (arXiv)
Self-attention and masked self-attention are at the heart of Transformers' outstanding success. Still, our mathematical understanding of attention, in particular of its Lipschitz properties - which are key when it comes to analyzing robustness and expressive power - is incomplete. We provide a detailed study of the Lipschitz constant of self-attention in several practical scenarios, discussing the impact of the sequence length n and layer normalization on the local Lipschitz constant of both unmasked and masked self-attention. In particular, we show that for inputs of length n in any compact set, the Lipschitz constant of self-attention is bounded by √n up to a constant factor and that this bound is tight for reasonable sequence lengths. When the sequence length n is too large for the previous bound to be tight, which we refer to as the mean-field regime, we provide an upper bound and a matching lower bound which are independent of n. Our mean-field framework for masked self-attention is novel and of independent interest. Our experiments on pretrained and randomly initialized BERT and GPT-2 support our theoretical findings.
Key facts. Cited by 44 papers in the map (data through 7 Oct 2026). Builds on 55 of its 67 references that are in the map. First posted on arXiv 22 Dec 2023.
Builds on
55 of 67 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
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2014Explaining and Harnessing Adversarial Examplescited by 7,287
- 2016Layer Normalizationcited by 5,579
- 2013Intriguing properties of neural networkscited by 5,114
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2018Neural Ordinary Differential Equationscited by 3,733
- 2023Mistral 7Bcited by 3,065
- 2016Towards Evaluating the Robustness of Neural Networkscited by 2,976
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
38 more
- 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
- 2018Spectral Normalization for Generative Adversarial Networkscited by 1,618
- 2020Point Transformercited by 1,462
- 2019Root Mean Square Layer Normalizationcited by 1,425
- 2021Scaling Vision Transformerscited by 993
- 2016Adversarial Machine Learning at Scalecited by 934
- 2020On Layer Normalization in the Transformer Architecturecited by 906
- 2023Scaling Vision Transformers to 22 Billion Parameterscited by 690
- 2017Spectrally-normalized margin bounds for neural networkscited by 681
- 2015Distillation as a Defense to Adversarial Perturbations against Deep Neural Networkscited by 675
- 2017Exploring Generalization in Deep Learningcited by 595
- 2018Lipschitz regularity of deep neural networks: analysis and efficient estimationcited by 413
- 2018Invertible Residual Networkscited by 364
- 2018Generating Wikipedia by Summarizing Long Sequencescited by 333
- 2019Efficient and Accurate Estimation of Lipschitz Constants for Deep Neural Networkscited by 290
- 2017Parseval Networks: Improving Robustness to Adversarial Examplescited by 288
- 2019Residual Flows for Invertible Generative Modelingcited by 256
- 2018Sorting out Lipschitz function approximationcited by 211
- 2018Lipschitz-Margin Training: Scalable Certification of Perturbation Invariance for Deep Neural Networkscited by 193
- 2017Formal Guarantees on the Robustness of a Classifier against Adversarial Manipulationcited by 182
- 2018Evaluating the Robustness of Neural Networks: An Extreme Value Theory Approachcited by 181
- 2020The Lipschitz Constant of Self-Attentioncited by 171
- 2023A mathematical perspective on Transformerscited by 160
- 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
- 2023The emergence of clusters in self-attention dynamicscited by 133
- 2016Robust Large Margin Deep Neural Networkscited by 117
- 2019Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of Viewcited by 108
- 2021Globally-Robust Neural Networkscited by 106
- 2020Lipschitz constant estimation of Neural Networks via sparse polynomial optimizationcited by 87
- 2015Distributional Smoothing with Virtual Adversarial Trainingcited by 61
- 2021On the Expressive Power of Self-Attention Matricescited by 44
- 2020A Mathematical Theory of Attentioncited by 43
- 2020A case for new neural network smoothness constraintscited by 43
- 2021Lipschitz Normalization for Self-Attention Layers with Application to Graph Neural Networkscited by 38
- 2023Conditional Optimal Transport on Function Spacescited by 26
- 2020A Functional Perspective on Learning Symmetric Functions with Neural Networkscited by 16
- 2023Mitigating Transformer Overconfidence via Lipschitz Regularizationcited by 15
- 2023Revisiting and Exploring Efficient Fast Adversarial Training via LAW: Lipschitz Regularization and Auto Weight Averagingcited by 14
50 most cited of 55 All 55 (JSON)
Built on by
Citing papers per year: 2024: 5; 2025: 18; 2026: 21.
44 papers.
Sort:
By area:
- 2024Transformers are Universal In-context Learnerscited by 42
- 2024Clustering in Causal Attention Maskingcited by 31
- 2025The Intrinsic Dimension of Prompts in Internal Representations of Large Language Modelscited by 17
- 2025Terminal Velocity Matchingcited by 17
- 2025A Theoretical Analysis of Discrete Flow Matching Generative Modelscited by 13
- 2025Pay Attention to Attention Distribution: A New Local Lipschitz Bound for Transformerscited by 10
- 2025Approximation theory for 1-Lipschitz ResNetscited by 7
- 2025Transformers through the lens of support-preserving maps between measurescited by 5
- 2025Optimal and Diffusion Transports in Machine Learningcited by 5
- 2026Clustering in Deep Stochastic Transformerscited by 5
- 2026Approximation Theory for Lipschitz Continuous Transformerscited by 5
- 2025DDEQs: Distributional Deep Equilibrium Models through Wasserstein Gradient Flowscited by 4
32 more
- 2025Recurrent Self-Attention Dynamics: An Energy-Agnostic Perspective from Jacobianscited by 4
- 2025Memory Limitations of Prompt Tuning in Transformerscited by 4
- 2026Mixture of Sequence: Theme-Aware Mixture-of-Experts for Long-Sequence Recommendationcited by 4
- 2026Semantic Cache Distillation: Efficient State Transfer via Reuse and Selective Patchingcited by 4
- 2025Quantum latent distributions in deep generative modelscited by 3
- 2026Exact Attention Sensitivity and the Geometry of Transformer Stabilitycited by 3
- 2025Distributionally robust minimization in meta-learning for system identificationcited by 2
- 2025Sliced ReLU attention: Quasi-linear contextual expressivity via sortingcited by 2
- 2024A Mechanistic Study of Transformers Training Dynamicscited by 1
- 2025Preserve and Personalize: Personalized Text-to-Image Diffusion Models without Distributional Driftcited by 1
- 2026On the Expressive Power of Transformers for Maxout Networks and Continuous Piecewise Linear Functionscited by 1
- 2026Measure-to-measure Regression with Transformerscited by 1
- 2026MKEvolve: A Modular Multi-Agent Framework for Kernel Code Generationcited by 1
- 2024Improving Fine-Grained Control via Aggregation of Multiple Diffusion Modelscited by 0
- 2024Is Smoothness the Key to Robustness? A Comparison of Attention and Convolution Models Using a Novel Metriccited by 0
- 2025Understanding Sensitivity of Differential Attention through the Lens of Adversarial Robustnesscited by 0
- 2025Probing Geometry of Next Token Prediction Using Cumulant Expansion of the Softmax Entropycited by 0
- 2025Tight Robustness Certificates and Wasserstein Distributional Attacks for Deep Neural Networkscited by 0
- 2025ODE-ViT: Plug & Play Attention Layer from the Generalization of the ViT as an Ordinary Differential Equationcited by 0
- 2026Deep Neural Networks as Iterated Function Systems and a Generalization Boundcited by 0
- 2026CoT is Not the Chain of Truth: An Empirical Internal Analysis of Reasoning LLMs for Fake News Generationcited by 0
- 2026Better Models, Faster Training: Sigmoid Attention for single-cell Foundation Modelscited by 0
- 2026Lossless Anti-Distillation Samplingcited by 0
- 2026How Many Different Outputs Can a Transformer Generate?cited by 0
- 2026Improving Adversarial Robustness of Attribution via Implicit Regularizationcited by 0
- 2026General Quantification of Covariate and Concept Shiftscited by 0
- 2026To Solve Bilevel Optimization with Nonconvex Lower Levels, We Need Second-Order Stationaritycited by 0
- 2026Refinement Symmetry in Multimodal Transformerscited by 0
- 2026Universal Approximation of Measure-to-Measure Operators by Pushforwardscited by 0
- 2026STCFormer: Adaptive Spatio-Temporal Modeling with Dynamic Cluster Transformer for Station-based Weather Forecastingcited by 0
- 2026ATI-VLA: Action-Centric Predictive Vision-Language-Action Models via Actionable Alignment Then Adaptive Injectioncited by 0
- 2026Exploring Weaknesses of Generative Image Watermarks against Latent Frequency Maskingcited by 0
- 2026Exploring Weaknesses of Generative Image Watermarks against Latent Frequency Masking1 Oct 2026
- 2026ATI-VLA: Action-Centric Predictive Vision-Language-Action Models via Actionable Alignment Then Adaptive Injection1 Oct 2026
- 2026STCFormer: Adaptive Spatio-Temporal Modeling with Dynamic Cluster Transformer for Station-based Weather Forecasting30 Sep 2026
- 2026Universal Approximation of Measure-to-Measure Operators by Pushforwards28 Sep 2026
- 2026Refinement Symmetry in Multimodal Transformers26 Sep 2026
- 2026To Solve Bilevel Optimization with Nonconvex Lower Levels, We Need Second-Order Stationarity24 Sep 2026
- 2026General Quantification of Covariate and Concept Shifts10 Sep 2026
- 2026MKEvolve: A Modular Multi-Agent Framework for Kernel Code Generation20 Jun 2026
- 2026Semantic Cache Distillation: Efficient State Transfer via Reuse and Selective Patching5 Jun 2026
- 2026Improving Adversarial Robustness of Attribution via Implicit Regularization28 May 2026
- 2026Measure-to-measure Regression with Transformers27 May 2026
- 2026How Many Different Outputs Can a Transformer Generate?21 May 2026
32 more
- 2026Lossless Anti-Distillation Sampling12 May 2026
- 2026Better Models, Faster Training: Sigmoid Attention for single-cell Foundation Models29 Apr 2026
- 2026On the Expressive Power of Transformers for Maxout Networks and Continuous Piecewise Linear Functions3 Mar 2026
- 2026Mixture of Sequence: Theme-Aware Mixture-of-Experts for Long-Sequence Recommendation1 Mar 2026
- 2026Exact Attention Sensitivity and the Geometry of Transformer Stability21 Feb 2026
- 2026Approximation Theory for Lipschitz Continuous Transformers17 Feb 2026
- 2026CoT is Not the Chain of Truth: An Empirical Internal Analysis of Reasoning LLMs for Fake News Generation4 Feb 2026
- 2026Clustering in Deep Stochastic Transformers29 Jan 2026
- 2026Deep Neural Networks as Iterated Function Systems and a Generalization Bound27 Jan 2026
- 2025Sliced ReLU attention: Quasi-linear contextual expressivity via sorting12 Dec 2025
- 2025Optimal and Diffusion Transports in Machine Learning7 Dec 2025
- 2025Terminal Velocity Matching24 Nov 2025
- 2025ODE-ViT: Plug & Play Attention Layer from the Generalization of the ViT as an Ordinary Differential Equation20 Nov 2025
- 2025Tight Robustness Certificates and Wasserstein Distributional Attacks for Deep Neural Networks11 Oct 2025
- 2025Probing Geometry of Next Token Prediction Using Cumulant Expansion of the Softmax Entropy5 Oct 2025
- 2025Understanding Sensitivity of Differential Attention through the Lens of Adversarial Robustness1 Oct 2025
- 2025Transformers through the lens of support-preserving maps between measures30 Sep 2025
- 2025A Theoretical Analysis of Discrete Flow Matching Generative Models26 Sep 2025
- 2025Memory Limitations of Prompt Tuning in Transformers30 Aug 2025
- 2025Quantum latent distributions in deep generative models27 Aug 2025
- 2025Pay Attention to Attention Distribution: A New Local Lipschitz Bound for Transformers10 Jul 2025
- 2025Distributionally robust minimization in meta-learning for system identification22 Jun 2025
- 2025Preserve and Personalize: Personalized Text-to-Image Diffusion Models without Distributional Drift26 May 2025
- 2025Recurrent Self-Attention Dynamics: An Energy-Agnostic Perspective from Jacobians26 May 2025
- 2025Approximation theory for 1-Lipschitz ResNets17 May 2025
- 2025DDEQs: Distributional Deep Equilibrium Models through Wasserstein Gradient Flows3 Mar 2025
- 2025The Intrinsic Dimension of Prompts in Internal Representations of Large Language Models17 Jan 2025
- 2024Clustering in Causal Attention Masking7 Nov 2024
- 2024A Mechanistic Study of Transformers Training Dynamics31 Oct 2024
- 2024Is Smoothness the Key to Robustness? A Comparison of Attention and Convolution Models Using a Novel Metric23 Oct 2024
- 2024Improving Fine-Grained Control via Aggregation of Multiple Diffusion Models2 Oct 2024
- 2024Transformers are Universal In-context Learners2 Aug 2024
- 2025Terminal Velocity Matchingcited by 17
- 2025A Theoretical Analysis of Discrete Flow Matching Generative Modelscited by 13
- 2025Preserve and Personalize: Personalized Text-to-Image Diffusion Models without Distributional Driftcited by 1
- 2024Improving Fine-Grained Control via Aggregation of Multiple Diffusion Modelscited by 0
- 2025Terminal Velocity Matching24 Nov 2025
- 2025A Theoretical Analysis of Discrete Flow Matching Generative Models26 Sep 2025
- 2025Preserve and Personalize: Personalized Text-to-Image Diffusion Models without Distributional Drift26 May 2025
- 2024Improving Fine-Grained Control via Aggregation of Multiple Diffusion Models2 Oct 2024
- 2024Transformers are Universal In-context Learnerscited by 42
- 2024Clustering in Causal Attention Maskingcited by 31
- 2025The Intrinsic Dimension of Prompts in Internal Representations of Large Language Modelscited by 17
- 2025Pay Attention to Attention Distribution: A New Local Lipschitz Bound for Transformerscited by 10
- 2025Approximation theory for 1-Lipschitz ResNetscited by 7
- 2025Transformers through the lens of support-preserving maps between measurescited by 5
- 2025Optimal and Diffusion Transports in Machine Learningcited by 5
- 2026Clustering in Deep Stochastic Transformerscited by 5
- 2026Approximation Theory for Lipschitz Continuous Transformerscited by 5
- 2025DDEQs: Distributional Deep Equilibrium Models through Wasserstein Gradient Flowscited by 4
- 2025Recurrent Self-Attention Dynamics: An Energy-Agnostic Perspective from Jacobianscited by 4
- 2025Memory Limitations of Prompt Tuning in Transformerscited by 4
12 most cited of 35 All 35 (JSON)
- 2026STCFormer: Adaptive Spatio-Temporal Modeling with Dynamic Cluster Transformer for Station-based Weather Forecasting30 Sep 2026
- 2026Universal Approximation of Measure-to-Measure Operators by Pushforwards28 Sep 2026
- 2026Refinement Symmetry in Multimodal Transformers26 Sep 2026
- 2026To Solve Bilevel Optimization with Nonconvex Lower Levels, We Need Second-Order Stationarity24 Sep 2026
- 2026General Quantification of Covariate and Concept Shifts10 Sep 2026
- 2026Semantic Cache Distillation: Efficient State Transfer via Reuse and Selective Patching5 Jun 2026
- 2026Improving Adversarial Robustness of Attribution via Implicit Regularization28 May 2026
- 2026Measure-to-measure Regression with Transformers27 May 2026
- 2026How Many Different Outputs Can a Transformer Generate?21 May 2026
- 2026Lossless Anti-Distillation Sampling12 May 2026
- 2026Better Models, Faster Training: Sigmoid Attention for single-cell Foundation Models29 Apr 2026
- 2026On the Expressive Power of Transformers for Maxout Networks and Continuous Piecewise Linear Functions3 Mar 2026
12 newest of 35 All 35 (JSON)