Provable optimal transport with transformers: The essence of depth and prompt engineering
Not on the map. Why?
Abstract (arXiv)
Despite their empirical success, the internal mechanism by which transformer models align tokens during language processing remains poorly understood. This paper provides a mechanistic and theoretical explanation of token alignment in LLMs. We first present empirical evidences showing that, in machine translation, attention weights progressively align translated word pairs across layers, closely approximating Optimal Transport (OT) between word embeddings. Building on this observation, we prove that softmax self-attention layers can simulate gradient descent on the dual of the entropy-regularized OT problem, providing a theoretical foundation for the alignment. Our analysis yields a constructive convergence bound showing that transformer depth controls OT approximation accuracy. A direct implication is that standard transformers can sort lists of varying lengths without any parameter adjustment, up to an error term vanishing with transformers depth.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 31 of its 50 references that are in the map. First posted on arXiv 25 Oct 2024.
Builds on
31 of 50 references.
References · 31
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2013Sinkhorn Distances: Lightspeed Computation of Optimal Transportation Distancescited by 2,277
- 2016Understanding intermediate layers using linear classifier probescited by 1,279
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
19 more
- 2014Neural Turing Machinescited by 630
- 2017Word Translation Without Parallel Datacited by 480
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 411
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2017Unsupervised Machine Translation Using Monolingual Corpora Onlycited by 272
- 2020Sparse Sinkhorn Attentioncited by 250
- 2018Marian: Fast Neural Machine Translation in C++cited by 202
- 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
- 2023The emergence of clusters in self-attention dynamicscited by 133
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 82
- 2019Jointly Learning to Align and Translate with Transformer Modelscited by 75
- 2017Residual Connections Encourage Iterative Inferencecited by 74
- 2023Transformers as Support Vector Machinescited by 67
- 2024Can Looped Transformers Learn to Implement Multi-step Gradient Descent for In-context Learning?cited by 60
- 2024On the Role of Attention Masks and LayerNorm in Transformerscited by 45
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
- 2021Batch Normalization Orthogonalizes Representations in Deep Random Networkscited by 28
- 2023On the impact of activation and normalization in obtaining isometric embeddings at initializationcited by 13
- 2023Towards Training Without Depth Limits: Batch Normalization Without Gradient Explosioncited by 8
Built on by
Citing papers per year: 2026: 1.
1 paper.