On the Optimization and Generalization of Two-layer Transformers with Sign Gradient Descent
Not on the map. Why?
Abstract (arXiv)
The Adam optimizer is widely used for transformer optimization in practice, which makes understanding the underlying optimization mechanisms an important problem. However, due to the Adam's complexity, theoretical analysis of how it optimizes transformers remains a challenging task. Fortunately, Sign Gradient Descent (SignGD) serves as an effective surrogate for Adam. Despite its simplicity, theoretical understanding of how SignGD optimizes transformers still lags behind. In this work, we study how SignGD optimizes a two-layer transformer -- consisting of a softmax attention layer with trainable query-key parameterization followed by a linear layer -- on a linearly separable noisy dataset. We identify four stages in the training dynamics, each exhibiting intriguing behaviors. Based on the training dynamics, we prove the fast convergence but poor generalization of the learned transformer on the noisy dataset. We also show that Adam behaves similarly to SignGD in terms of both optimization and generalization in this setting. Additionally, we find that the poor generalization of SignGD is not solely due to data noise, suggesting that both SignGD and Adam requires high-quality data for real-world tasks. Finally, experiments on synthetic and real-world datasets empirically support our theoretical results.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). First posted on arXiv 7 Oct 2024.
Builds on
0 of 0 references.
No references here yet.
Built on by
Citing papers per year: 2025: 6; 2026: 2.
8 papers.
- 2025Asymptotics of SGD in Sequence-Single Index Models and Single-Layer Attention Networkscited by 9
- 2025NIRVANA: Structured Pruning Reimagined for Large Language Model Compressioncited by 6
- 2025How Does Label Noise Gradient Descent Improve Generalization in the Low SNR Regime?cited by 4
- 2025LoTA-QAF: Lossless Ternary Adaptation for Quantization-Aware Fine-Tuningcited by 3
- 2025Understanding Generalization in Transformers: Error Bounds and Training Dynamics Under Benign and Harmful Overfittingcited by 2
- 2025Unveiling m-Sharpness Through the Structure of Stochastic Gradient Noisecited by 2
- 2026Never Saddle for Reparameterized Steepest Descent as Mirror Flowcited by 2
- 2026Adaptive Methods Are Preferable in High Privacy Settings: An SDE Perspectivecited by 1
- 2026Adaptive Methods Are Preferable in High Privacy Settings: An SDE Perspective3 Mar 2026
- 2026Never Saddle for Reparameterized Steepest Descent as Mirror Flow2 Mar 2026
- 2025How Does Label Noise Gradient Descent Improve Generalization in the Low SNR Regime?20 Oct 2025
- 2025Unveiling m-Sharpness Through the Structure of Stochastic Gradient Noise22 Sep 2025
- 2025NIRVANA: Structured Pruning Reimagined for Large Language Model Compression17 Sep 2025
- 2025Asymptotics of SGD in Sequence-Single Index Models and Single-Layer Attention Networks3 Jun 2025
- 2025LoTA-QAF: Lossless Ternary Adaptation for Quantization-Aware Fine-Tuning24 May 2025
- 2025Understanding Generalization in Transformers: Error Bounds and Training Dynamics Under Benign and Harmful Overfitting18 Feb 2025