atlas

Research map / Optimization / Optimizers

Why Transformers Need Adam: A Hessian Perspective

NeurIPS 2024 · Optimization › Optimizers · approach: Adam convergence and adaptive learning rates · 7 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Explains why SGD underperforms Adam on Transformers via "block heterogeneity" in the blockwise Hessian spectrum, validated on Transformers, CNNs, MLPs and quadratic problems, with a theory that a single learning rate (GD) lags coordinate-wise Adam under heterogeneity.

Problem

Why SGD performs significantly worse than Adam on Transformers while performing on par with Adam on CNNs; the full Hessian spectrum does not reveal the difference.

Approach

Shows that Transformers exhibit block heterogeneity: the Hessian spectra of different parameter blocks (Q, K, V, MLP, embedding) differ substantially, unlike CNNs. SGD uses one learning rate for all blocks and so struggles under heterogeneity, while Adam's coordinate-wise learning rates handle it. Proposes JS^0, the average JS distance among blockwise initial Hessian spectra, as a predictor of SGD

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use SGD instead of Adam on Transformer trainingTransformer models · Transformer taskstraining performanceHurt
Use SGD instead of Adam on CNN trainingCNN models · ImageNettraining performanceNo clear effect
Increase layer-scaling heterogeneity4-layer MLP · MNISTtest accuracyHurt
Pretrain GPT2 before fine-tuningGPT2 · Alpaca Evalconverged lossHelped
Initialize ViT-base from the checkpoint at 50% training steps rather than from scratchViT-base with SGD · ImageNettraining performanceHelped
Use a single learning rate across blocks rather than coordinate-wise learning ratesGD and Adam on quadratic problems · Block-heterogeneous quadratic problemsconvergence performanceHurt
Use a single learning rate across blocks rather than coordinate-wise learning ratesGD and Adam on quadratic problems · Block-homogeneous quadratic problemsconvergence performanceNo clear effect
Set Adam β2 below 1 rather than β2 = 1 with a constant learning rateAdam on quadratic problems · Strongly convex quadraticconvergenceHurt
Reduce SQL num_v from 10 to 1 (ablation)Simplified SQL · BERT and ResNet18 initializationJS^0 estimationNo clear effect
Reduce Lanczos steps from 100 to 10 (ablation)Simplified SQL · BERT and ResNet18 initializationheterogeneity detectionNo clear effect
Sample 50% of blocks and use batch size 32 instead of batch size 1024 (ablation)Simplified SQL · BERT and ResNet18 initializationheterogeneity detectionNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: ImageNet OpenWebText Cornell Movie-Dialogs Corpus MNIST Alpaca Eval

Benchmarks: ImageNet OpenWebText Cornell Movie-Dialogs Corpus MNIST

Metrics: test accuracy training loss JS distance among blockwise Hessian spectra (JS^0)

Baselines: SGD with momentum AdamW gradient descent

Builds on: Stochastic Lanczos Quadrature Adam AdamW

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy