# Adam (2014)

> The optimizer that trains most neural networks, with defaults that work without tuning.

Page: https://mralbu.github.io/ai-datasets/p/adam

## Key facts

- Title: Adam: A Method for Stochastic Optimization
- Authors: Diederik P. Kingma, Jimmy Ba
- Venue: ICLR 2015
- Category: Foundations
- Paper: https://www.alphaxiv.org/abs/1412.6980

## Why it matters

Before Adam, each model needed its learning rate and schedule tuned by hand. Adam's defaults (learning rate 0.001, β₁ 0.9, β₂ 0.999) worked well across very different problems, and it became the default choice. Its convergence proof later turned out to be flawed, and the variant AdamW, with decoupled weight decay, is what trains most large language models today.

## The idea

Keep two running averages for every weight: of its gradients (momentum) and of its squared gradients (how large they usually are). Step in the direction of the first, divided by the square root of the second, so each weight gets its own step size. A correction keeps the averages from being too small in the first steps.

## The result

With little hyperparameter tuning, it trained logistic regression on MNIST and IMDB, a multilayer network on MNIST and a convolutional network on CIFAR-10 as fast as or faster than SGD with momentum, AdaGrad and RMSProp.

## The data

- [MNIST (1998)](https://mralbu.github.io/ai-datasets/d/mnist.md): 70,000 handwritten digits, 28×28 grayscale, 10 classes.
- [IMDB Large Movie Review (2011)](https://mralbu.github.io/ai-datasets/d/imdb.md): 50,000 movie reviews from IMDb, labeled positive or negative.
- [CIFAR-10 (2009)](https://mralbu.github.io/ai-datasets/d/cifar10.md): 60,000 tiny 32×32 color images in 10 classes.

## Builds on

- [AdaGrad (2010)](https://mralbu.github.io/ai-datasets/p/adagrad.md)

## Led to

- [DCGAN (2015)](https://mralbu.github.io/ai-datasets/p/dcgan.md)
- [AdamW (2017)](https://mralbu.github.io/ai-datasets/p/adamw.md)

## Part of

- [Making deep networks trainable](https://mralbu.github.io/ai-datasets/t/deep-nets-trainable.md) (step 5 of 7)
- [Optimizers](https://mralbu.github.io/ai-datasets/t/optimizers.md) (step 3 of 7)
