Lune

NeurIPS2024顶会

Why Transformers Need Adam: A Hessian Perspective

Yushun Zhang, Congliang Chen, Tian Ding, Ziniu Li, Ruoyu Sun, Zhi-Quan Luo

摘要

SGD performs worse than Adam by a significant margin on Transformers, but the reason remains unclear. In this work, we provide an explanation through the lens of Hessian: (i) Transformers are"heterogeneous": the Hessian spectrum across parameter blocks vary dramatically, a phenomenon we call"block heterogeneity"; (ii) Heterogeneity hampers SGD: SGD performs worse than Adam on problems with block heterogeneity. To validate (i) and (ii), we check various Transformers, CNNs, MLPs, and quadratic problems, and find that SGD can perform on par with Adam on problems without block heterogeneity, but performs worse than Adam when the heterogeneity exists. Our initial theoretical analysis indicates that SGD performs worse because it applies one single learning rate to all blocks, which cannot handle the heterogeneity among blocks. This limitation could be ameliorated if we use coordinate-wise learning rates, as designed in Adam.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 59 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • MLP-Mixer: An all-MLP Architecture for Vision 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • In Search of Adam's Secret Sauce 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • In Search of Adam's Secret Sauce 引用了 On Layer Normalization in the Transformer Architecture
  • Muon Outperforms Adam in Tail-End Associative Memory Learning 引用了 ASGO: Adaptive Structured Gradient Optimization
  • On Layer Normalization in the Transformer Architecture 引用了 On the Variance of the Adaptive Learning Rate and Beyond
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper59

  1. ASGO: Adaptive Structured Gradient OptimizationKang An, Yuxing Liu, Rui Pan, Yi Ren 等NeurIPS 2025 · 58 次引用
  2. Small Batch Size Training for Language Models: When Vanilla SGD Works, and Why Gradient Accumulation is WastefulMartin Marek, Sanae Lotfi, Aditya Somasundaram, Andrew Gordon Wilson 等NeurIPS 2025 · 46 次引用
  3. In Search of Adam's Secret SauceAntonio Orvieto, Robert GowerNeurIPS 2025 · 43 次引用
  4. Muon Outperforms Adam in Tail-End Associative Memory LearningShuche Wang, Fengzhuo Zhang, Jiaxiang Li, Cunxiao Du 等ICLR 2026 · 40 次引用
  5. Adam with model exponential moving average is effective for nonconvex optimizationKwangjun Ahn, Ashok CutkoskyNeurIPS 2024 · 36 次引用

它引用的 Paper30

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
  2. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
  3. MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer 等NeurIPS 2021 · 3,862 次引用
  4. On the Variance of the Adaptive Learning Rate and BeyondLiyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen 等ICLR 2020 · 2,210 次引用
  5. On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng 等ICML 2020 · 1,388 次引用

相关 Paper

  1. What Does It Mean to Be a Transformer? Insights from a Theoretical Hessian AnalysisWeronika Ormaniec, Felix Dangel, Sidak Pal SinghICLR 2025
  2. Understanding Adam Requires Better Rotation Dependent AssumptionsTianyue H. Zhang, Lucas Maes, Alan Milligan, Alexia Jolicoeur-Martineau 等NeurIPS 2025 · 11 次引用
  3. Heavy-Tailed Class Imbalance and Why Adam Outperforms Gradient Descent on Language ModelsFrederik Kunstner, Alan Milligan, Robin Yadav, Mark Schmidt 等NeurIPS 2024 · 100 次引用
  4. On the Optimization and Generalization of Two-layer Transformers with Sign Gradient DescentBingrui Li, Wei Huang, Andi Han, Zhanpeng Zhou 等ICLR 2025
  5. Adam Exploits ℓ∞-geometry of Loss Landscape via Coordinate-wise AdaptivityShuo Xie, Mohamad Amin Mohamadi, Zhiyuan LiICLR 2025
黄昏的海面,两侧是细线勾勒的悬崖