Optimizer
The algorithm that decides how to apply the gradient — where Adam is the default, AdamW is what you should actually use, and SGD still wins sometimes.
When not to use it
- (You need one. The question is which.)*
- Plain Adam, when AdamW exists. The weight decay is being distorted and there's no reason to accept it.
- Adam when memory is the constraint. Two extra numbers per parameter is a real cost at scale.
- Adam reflexively on CNNs. SGD with momentum sometimes generalises better there, and uses a third of the memory.
- A new optimiser from a recent paper. The replication record is poor and the baselines are often under-tuned.
Reach for something else instead
- AdamW — the answer for nearly everything.
- SGD + momentum — memory-light, sometimes better generalisation, more tuning.
- 8-bit Adam / Adafactor — when optimiser state doesn't fit.
- Lion — less state, competitive, newer and less proven.
Sources & further reading
- Kingma & Ba (2014), Adam: A Method for Stochastic Optimization — the paper; momentum plus per-parameter scaling.
- Loshchilov & Hutter (2017), Decoupled Weight Decay Regularization — AdamW; the correction you should be using.
- Wilson et al. (2017), The Marginal Value of Adaptive Gradient Methods in Machine Learning — adaptive methods can generalise worse than SGD despite lower training loss.
Primary sources, listed so you can check the claims on this page rather than take them on trust.
Where people go wrong
- Using Adam instead of AdamW out of habit. The weight decay is wrong and the fix is free.
- Tuning betas. 0.9/0.999 is near-universal; 0.95 for β₂ on LLMs is the one real exception.
- Forgetting optimiser state in your memory budget. It's roughly 2× the model.
- Believing "beats Adam" claims without checking whether their Adam was tuned.
- Assuming adaptive means better. Wilson et al. found it can converge faster to a worse solution.