Adam: A Method for Stochastic Optimization

Jimmy Ba and Diederik Kingma · OpenReview

TL;DR

Adam (Adaptive Moment Estimation) is a first-order optimization algorithm that computes individual adaptive learning rates for different parameters. By combining the advantages of AdaGrad and RMSProp—and adding a clever bias-correction mechanism—Adam provides a robust, computationally efficient tool that has become the "gold standard" for training deep neural networks.

Introduction: The Optimization Problem

In the world of machine learning, Stochastic Gradient Descent (SGD) is the traditional workhorse, but it has significant limitations. Standard SGD uses a single learning rate for all parameters, which is often inefficient. Some parameters might need large updates (because they are associated with rare features), while others need small, precise updates.

Previous attempts to solve this had mixed results:

  • AdaGrad worked well for sparse gradients but struggled with non-stationary objectives (where the "target" moves over time).
  • RMSProp addressed non-stationarity but lacked a theoretical foundation and could be unstable at the start of training.

The authors of Adam sought to create a method that is computationally efficient, requires little memory, and works well even when gradients are very noisy or sparse, all while requiring minimal hyperparameter tuning.

The Adam Algorithm

Adam works by keeping track of two moving averages of the gradients:

  1. The First Moment ($m_t$): An exponential moving average of the gradients (essentially "momentum").
  2. The Second Moment ($v_t$): An exponential moving average of the squared gradients (an estimate of the uncentered variance).

The novel component of Adam is its initialization bias correction. Because these moving averages are initialized at zero, they are biased toward zero, especially during the initial steps of training or when the decay rates ($\beta_1$ and $\beta_2$) are small. Adam counteracts this by dividing the estimates by $(1 - \beta^t)$, where $t$ is the current timestep. This ensures that the early updates are not artificially suppressed.

The final update rule scales the gradient by the square root of the second moment, effectively performing a form of diagonal rescaling. This makes the step size invariant to the scale of the gradients.

Key Insights

  • The Signal-to-Noise Ratio (SNR): The authors describe the ratio of the first moment to the square root of the second moment as a "signal-to-noise ratio." If the SNR is low (high uncertainty in the gradient direction), the effective step size becomes smaller—a form of automatic annealing.
  • Approximate Trust Regions: Because the effective step size is roughly bounded by the hyperparameter $\alpha$, Adam naturally establishes a "trust region" around the current parameter value. This makes it much easier for practitioners to choose a reasonable initial learning rate.

Experimental Results

The authors evaluated Adam across several standard benchmarks to prove its versatility, including MNIST (logistic regression and multi-layer networks), IMDB Movie Reviews (sparse bag-of-words features), and CIFAR-10 (deep Convolutional Neural Networks).

Training cost for MNIST Logistic Regression and IMDB BoW Logistic Regression

Faster Convergence and Robustness to Sparsity: In almost all experiments, Adam converged faster than SGD with Nesterov momentum, AdaGrad, and RMSProp. On the IMDB dataset, Adam matched the performance of AdaGrad—which is specifically designed for sparse data—while outperforming standard SGD.

Training cost for CIFAR-10 ConvNet over the first 3 epochs and full training

CNN Performance: On CIFAR-10, while Adam and AdaGrad both started fast, Adam eventually converged significantly faster and to a lower cost than AdaGrad.

Hyperparameter Stability: The paper suggests "good default settings" ($\alpha=0.001, \beta_1=0.9, \beta_2=0.999$) that the authors found worked well across a wide variety of problems, reducing the need for expensive grid searches.

Limitations and Future Work

  • Convex vs. Non-Convex: While the authors provide a theoretical convergence proof (regret bound) for convex functions, most deep learning problems are non-convex. The empirical success in non-convex settings is well-documented, but the theoretical guarantees are more complex.
  • AdaMax: The authors introduce a variant called AdaMax, which uses the $L^\infty$ norm instead of the $L^2$ norm for the second moment. They suggest this might be even more stable in some cases.
  • Temporal Averaging: The paper briefly mentions that averaging the parameters over time (temporal averaging) could further improve generalization, a technique often used in conjunction with Adam today.

Summary updated

BibTeX
@inproceedings{kingma2015adam,
  author = {Jimmy Ba and Diederik Kingma},
  title = {{Adam: A Method for Stochastic Optimization}},
  booktitle = {International Conference on Learning Representations},
  year = {2015},
  url = {http://arxiv.org/abs/1412.6980},
}
Figure