Papers · arXiv 1412.6980
Adam: A Method for Stochastic Optimization
Summary in three lines
- 🎯 Stochastic gradient descent struggles with noisy gradients, non-stationary objectives, and ill-conditioned curvature across parameters.
- 🔧 Computes individual adaptive learning rates using exponentially decaying moving averages of past gradients and past squared gradients, with essential initialization bias corrections.
- 📈 Proves an regret bound for convex online settings and outperforms SGD with momentum, AdaGrad, and RMSProp across deep learning benchmarks.
Abstract
We introduce Adam, an algorithm for first-order gradient-based optimization of stochastic objective functions, based on adaptive estimates of lower-order moments. The method is straightforward to implement, is computationally efficient, has little memory requirements, is invariant to diagonal rescaling of the gradients, and is well suited for problems that are large in terms of data and/or parameters. The method is also appropriate for non-stationary objectives and problems with very noisy and/or sparse gradients. The hyper-parameters have intuitive interpretations and typically require little tuning. Some connections to related algorithms, on which Adam was inspired, are discussed. We also analyze the theoretical convergence properties of the algorithm and provide a regret bound on the convergence rate that is comparable to the best known results under the online convex optimization framework. Empirical results demonstrate that Adam works well in practice and compares favorably to other stochastic optimization methods. Finally, we discuss AdaMax, a variant of Adam based on the infinity norm.
Reading guide
Problem and motivation
Stochastic first-order optimization is the backbone of modern machine learning. However, standard Stochastic Gradient Descent (SGD) applies a uniform step size to all coordinates, making it sensitive to gradient scaling, ill-conditioned curvature, and stochastic noise. While AdaGrad adapts coordinate step sizes using historical squared gradients, its learning rate rapidly decays to zero in deep architectures. RMSProp and AdaDelta address this decay with exponential moving averages, but RMSProp lacks theoretical guarantees in non-stationary settings and neither accounts for initialization bias when moving averages start at zero.
The authors aim to combine the benefits of two paradigms: AdaGrad/RMSProp (adapting to sparse and differently scaled gradients) and classical Momentum (accelerating convergence across flat directions and smoothing noise).
Key ideas
- First and Second Moment Estimation: Adam maintains running exponential moving averages of both the gradient (first raw moment ) and the squared gradient (second uncentered moment ).
- Bias Correction: Because and are initialized to vectors of zeros, their standard running averages are biased toward zero—especially in early iterations or when decay rates (eta_1, \beta_2) are near 1. Adam analytically corrects this bias by dividing by and .
- Invariant to Gradient Rescaling: The effective update direction approximately scales with the signal-to-noise ratio , providing natural step-size bounding and invariance to diagonal scaling of the gradients.
- AdaMax: Generalizing the norm tracking of gradients in to the norm yields AdaMax, a numerically stable variant that dispenses with second-moment bias correction.
Method (with the key equations)
At time step , given objective function , gradient , step size , exponential decay rates , and small constant :
Update biased first moment estimate:
Update biased second raw moment estimate:
Compute bias-corrected moment estimates:
Update parameters:
Default hyperparameters recommended by the paper are , , , and .
Results (with the most important numbers)
- Theoretical Convergence: In an online convex optimization framework with bounded gradients and bounded parameter domain , Adam achieves a theoretical regret bound , yielding an average regret rate of .
- Logistic Regression & Multi-layer Perceptrons: On MNIST classification, Adam converged faster than AdaGrad, RMSProp, and SGD with Nesterov momentum across various architectures, displaying minimal sensitivity to hyperparameter perturbations.
- Convolutional Neural Networks: Evaluated on CIFAR-10 with a multi-layer CNN (with dropout and pooling), Adam exhibited faster training loss reduction and reached lower final loss than RMSProp and AdaDelta.
Limitations and open questions
- Convex vs. Non-Convex Theory: The theoretical regret bounds assume convex functions; theoretical convergence behavior on non-convex deep learning objectives was not formally guaranteed.
- Subsequent Theoretical Flaws: Later work (such as Reddi et al., 2018) proved that Adam's convergence proof had an issue where is not necessarily positive semi-definite, occasionally leading to empirical divergence (which spurred variants like AMSGrad).
- Generalization Gap: Empirical studies following this paper noted that while Adam trains faster initially, carefully tuned SGD with momentum often finds solutions that generalize slightly better on certain image classification tasks.
Key terms
- Adam
- An algorithm for first-order gradient-based stochastic optimization derived from 'adaptive moment estimation'.
- First Moment Vector
- The exponentially decaying moving average of past stochastic gradients, representing the estimated mean direction.
- Second Raw Moment Vector
- The exponentially decaying moving average of past element-wise squared stochastic gradients, tracking uncentered variance.
- Bias Correction
- Rescaling the moving averages by to counteract the initialization bias toward zero during early optimization steps.
- Signal-to-Noise Ratio (SNR)
- The ratio , which shrinks step sizes along dimensions with high uncertainty and expands them along confident dimensions.
- AdaMax
- A variant of Adam where the -norm-based second moment estimation is generalized to the norm.
- Regret Bound
- A theoretical metric measuring the difference between the algorithm's cumulative loss and that of the best fixed parameter in hindsight.
Questions
Why is bias correction necessary in Adam?
Because and are initialized as zero vectors, the moving averages are heavily biased toward zero in initial iterations (especially when and are close to 1). The division by and corrects the expected value of the estimator to match the true moment.
What are the recommended default hyperparameters for Adam?
The authors recommend a learning rate , first-moment decay , second-moment decay , and numerical stability constant .
How does Adam differ from RMSProp?
RMSProp uses an exponential moving average of squared gradients but omits the moving average of first moments (momentum) and does not perform initialization bias correction.
What is AdaMax?
AdaMax generalizes Adam's norm second moment tracking to the norm, replacing the running sum of squared gradients with a running maximum of absolute gradients, eliminating the need for second-moment bias correction.
The overview on this page was written by AI from the paper and may contain mistakes. Read the paper for the details.