Max-Margin Token Selection in Attention Mechanism
Davoud Ataee Tarzanagh, Yingcong Li, Xuechen Zhang, Samet Oymak
摘要
Attention mechanism is a central component of the transformer architecture which led to the phenomenal success of large language models. However, the theoretical principles underlying the attention mechanism are poorly understood, especially its nonconvex optimization dynamics. In this work, we explore the seminal softmax-attention model , where is the token sequence and are trainable parameters. We prove that running gradient descent on , or equivalently , converges in direction to a max-margin solution that separates tokens from non-optimal ones. This clearly formalizes attention as an optimal token selection mechanism. Remarkably, our results are applicable to general data and precisely characterize of tokens in terms of the value embeddings and problem geometry. We also provide a broader regularization path analysis that establishes the margin maximizing nature of attention even for nonlinear prediction heads. When optimizing and simultaneously with logistic loss, we identify conditions under which the regularization paths directionally converge to their respective hard-margin SVM solutions where separates the input features based on their labels. Interestingly, the SVM formulation of is influenced by the support vector geometry of . Finally, we verify our theoretical findings via numerical experiments and provide insights.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 52 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 How Transformers Learn Causal Structure with Gradient Descent
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 JoMA: Demystifying Multilayer Transformers via Joint Dynamics of MLP and Attention
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 Language Models are Few-Shot Learners
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- How Transformers Learn Causal Structure with Gradient Descent 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- How Transformers Learn Causal Structure with Gradient Descent 引用了 JoMA: Demystifying Multilayer Transformers via Joint Dynamics of MLP and Attention
- How Transformers Learn Causal Structure with Gradient Descent 引用了 Language Models are Few-Shot Learners
- How Transformers Learn Causal Structure with Gradient Descent 引用了 Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer
- JoMA: Demystifying Multilayer Transformers via Joint Dynamics of MLP and Attention 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- JoMA: Demystifying Multilayer Transformers via Joint Dynamics of MLP and Attention 引用了 Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer
- Learning Transferable Visual Models From Natural Language Supervision 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Learning Transferable Visual Models From Natural Language Supervision 引用了 Language Models are Few-Shot Learners
- Training data-efficient image transformers & distillation through attention 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression 引用了 Language Models are Few-Shot Learners
- Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer 引用了 Language Models are Few-Shot Learners
- Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer 引用了 Learning Transferable Visual Models From Natural Language Supervision
引用它的顶会 Paper52
- Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer TransformerYuandong Tian, Yiping Wang, Beidi Chen, Simon S. DuNeurIPS 2023 · 125 次引用
- How Transformers Learn Causal Structure with Gradient DescentEshaan Nichani, Alex Damian, Jason D. LeeICML 2024 · 117 次引用
- Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear RegressionDeqing Fu, Tianqi Chen, Robin Jia, Vatsal SharanNeurIPS 2024 · 54 次引用
- JoMA: Demystifying Multilayer Transformers via Joint Dynamics of MLP and AttentionYuandong Tian, Yiping Wang, Zhenyu Zhang, Beidi Chen 等ICLR 2024 · 49 次引用
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in TransformersSiyu Chen, Heejune Sheen, Tianhao Wang, Zhuoran YangNeurIPS 2024 · 48 次引用
它引用的 Paper41
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh 等ICML 2021 · 47,906 次引用
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa 等ICML 2021 · 8,974 次引用
相关 Paper
- Attention with Trained Embeddings Provably Selects Important TokensDiyuan Wu, Aleksandr Shevchenko, Samet Oymak, Marco MondelliNeurIPS 2025
- Unraveling the Gradient Descent Dynamics of TransformersBingqing Song, Boran Han, Shuai Zhang, Jie Ding 等NeurIPS 2024 · 13 次引用
- Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based PerspectiveEtienne Boursier, Claire BoyerICML 2026 · 4 次引用
- Understanding Softmax Attention Layers: Exact Mean-Field Analysis on a Toy ProblemElvis DohmatobNeurIPS 2025 · 3 次引用
- Limitations of Normalization in AttentionTimur Mudarisov, Mikhail Burtsev, Tatiana Petrova, Radu StateNeurIPS 2025
