TL;DR
Adam is a first-order optimizer for training models on noisy objectives. It keeps a running average of each parameter's gradient and of its squared gradient, corrects both averages for their start-up bias, and takes a step whose size adapts to each parameter separately. The paper shows it works well across several model types with little tuning, and gives a convergence guarantee for convex problems.
Where you'll see it: the default optimizer for training most neural networks, including transformers, image models and fine-tuning runs, usually in the variant AdamW that adds decoupled weight decay.
The problem
Training a model means minimizing a loss over its parameters. The loss is usually an average over a minibatch of data, so each gradient is a noisy estimate of the true gradient. Plain stochastic gradient descent uses one global learning rate. That rate has to suit every parameter at once, and it has to be tuned by hand and often decayed on a schedule.
Two other families existed in 2014. Methods such as AdaGrad adapt the rate per parameter, but accumulate squared gradients forever, so the effective rate shrinks toward zero on long runs. RMSProp uses a decaying average of squared gradients, which suits non-stationary settings, and methods with Momentum smooth the gradient direction without scaling steps per parameter. The paper aims to combine AdaGrad's strength on sparse gradients with RMSProp's strength online, works on non-stationary and sparse gradients, and needs little memory and little tuning.
Key idea
Keep two exponential moving averages per parameter, both updated from the current minibatch gradient:
- the first moment, a smoothed gradient that gives the direction, and
- the second moment, a smoothed squared gradient that estimates how large the gradient typically is.
Step in the direction of the first moment, divided elementwise by the square root of the second. A parameter whose gradients are consistently large takes smaller steps. A parameter that rarely receives a gradient takes larger ones when it does. Because the averages decay, the method forgets old gradients, unlike AdaGrad, which keeps adding them.
The averages start at zero, so early estimates are too small. The paper's bias correction divides each average by , which removes the bias exactly in the case of stationary gradients.
The method
Let be the gradient of the minibatch objective at step . The algorithm uses a step size , decay rates , and a small constant . The paper's default values are , , and .
Initialise , and . At each step:
where is the elementwise square. Then correct the bias:
Finally update the parameters:
Every operation is elementwise, so the cost per step is a few vector operations on memory the size of the parameters, two extra copies of the parameter vector in total. The paper highlights this as one reason it suits large models.
The bias-correction argument
Suppose the gradients are drawn from a fixed distribution with mean . Unrolling the recursion shows that . The average is pulled toward the zero it started from, by the factor . Dividing by that factor gives an unbiased estimate of the mean gradient. The same argument applies to with . The correction matters for much longer there, because is close to 1 and the second moment fills up slowly.
The effective step
The ratio is roughly a signal-to-noise ratio. If the gradient has the same sign every step, and are of similar size, and the step is close to in magnitude. If the gradient flips sign and averages out, is small compared with , and the step shrinks. The step size in any coordinate is therefore approximately bounded by regardless of the gradient scale. (With the defaults, the exact worst case, a gradient that is zero at every step but the current one, allows a step up to about .) The paper notes this makes the method invariant to diagonal rescaling of the gradients: multiplying one parameter's gradient by a constant leaves its step unchanged.
Convergence
For convex online problems the paper proves a regret bound. Regret compares the total loss of the algorithm with the loss of the best fixed parameter in hindsight. Under a step size that decays as and a first-moment coefficient that decays exponentially, the regret after steps grows like in the paper's framework, which matches the best known rate for this setting. The bound is stated under assumptions such as bounded gradients and a bounded feasible set. It is a guarantee about the average performance over a sequence, not a claim about deep networks, which are not convex.
AdaMax
The paper also derives a variant that replaces the second moment's square root with the infinity norm, . This removes the need for the term and the second bias correction, and the step becomes . The authors present it as a stable alternative with a simpler form.
Results
The paper's experiments all report training cost against passes over the data, with minibatches of 128.
- Logistic regression on MNIST (convex, -regularised, step size decayed as ). Adam converges about as fast as SGD with Nesterov momentum, and both beat AdaGrad.
- Logistic regression on IMDB reviews, using sparse 10,000-word bag-of-words features with 50% dropout noise. Here AdaGrad beats SGD with Nesterov momentum by a large margin, and Adam converges as fast as AdaGrad. This is the sparse-gradient case the method was designed for.
- Multilayer networks on MNIST (two hidden layers of 1,000 ReLU units). Adam beats the other first-order methods with dropout. Against the quasi-Newton method SFO it makes faster progress per iteration and per second; SFO is 5 to 10 times slower per iteration and failed to converge with dropout.
- A convolutional network on CIFAR-10. AdaGrad and Adam both fall quickly at first, but Adam and SGD with momentum then converge considerably faster than AdaGrad. The authors observe that the second-moment estimate shrinks to near zero after a few epochs and is dominated by , so the gain here comes mostly from the first moment reducing minibatch variance. Adam shows only marginal improvement over SGD with momentum, though it sets per-layer scales without hand tuning.
- Bias correction, on a variational autoencoder (one hidden layer of 500 units, 50-dimensional latent). Without correction, eta_2 close to 1 causes unstable training, especially in the first epochs. The best results used bias correction with small, and Adam did equal or better than the uncorrected, RMSProp-with-momentum version at every hyperparameter setting tried.
The figures are curves of training cost, not final test accuracies, so the paper supports claims about optimisation speed rather than about generalisation.
Why it mattered
Adam became the default choice in deep learning within a few years of publication. Frameworks ship it as a one-line option, and most published training recipes for transformers and vision models use it or a close relative. The method also made per-parameter adaptive learning rates routine, which shaped how practitioners think about the learning rate as a hyperparameter.
Later work changed the details. Loshchilov and Hutter showed that adding weight decay to the gradient interacts badly with the adaptive scaling, and proposed AdamW, which decouples the decay. Researchers have also reported cases where Adam generalises worse than SGD, and a later paper gave a simple convex counterexample showing that the convergence argument fails for some choices of the second-moment averaging. The paper's core ideas, moment estimates with bias correction, remain in nearly every successor.
Reading guide
Read the paper in this order, with these prerequisites in hand.
- Abstract and introduction. Needs stochastic gradient descent and Gradient Descent. The problem is minimizing a noisy objective with a first-order method.
- The algorithm section. Needs Exponential Moving Average for the two moment updates, and Momentum for the first moment's role. The update rule is the one in The method section of this review.
- The bias-correction part. Needs Mean and Variance for the second moment as an average of squares, and the geometric series for the factor .
- The convergence analysis. Needs Convex Function and the idea of regret from online learning. Skip on a first read if the rest is clear.
- The experiments. Needs the loss and model descriptions from the earlier sections, and Adam Optimizer for a gentler walkthrough of the update.
- The AdaMax variant. Needs the infinity norm and the main algorithm.
Check yourself
QuestionIn one or two sentences, what does Adam store for each parameter, and what does it do with those stored values?Show answer
Adam stores two running averages per parameter: a smoothed gradient and a smoothed squared gradient. It steps in the direction of the smoothed gradient, divided elementwise by the square root of the smoothed squared gradient, so each parameter gets its own effective step size.
QuestionWith and gradients that are constantly equal to 2, what is the bias-corrected first moment at step 1?Show answer
Start with . Then . The correction divides by , so . Without correction the estimate would have been 0.2, a tenth of the true gradient.
QuestionWhy does Adam take smaller steps for a parameter whose gradients oscillate in sign than for one whose gradients always point the same way?Show answer
For an oscillating gradient, the first moment averages positive and negative values toward zero, so its magnitude is small compared with the square root of the second moment, which measures typical gradient size regardless of sign. The ratio, and therefore the step, is small. For a consistent gradient the first moment stays close to the typical size, so the ratio is close to 1 and the step is close to .
QuestionA parameter's gradient was 100 for a long time and then drops to 0.01 for many steps. Compare how AdaGrad and Adam would respond, in terms of the effective step size.Show answer
AdaGrad accumulates every squared gradient, so the early large values stay in its denominator. Its effective step remains small for the rest of training. Adam forgets old squared gradients at rate . With the old values decay slowly, but the old contribution falls below the new level of after roughly 18,000 steps (), and then the step grows again. Adam's effective step recovers eventually, while AdaGrad's does not.