Command Palette
Search for a command to run...
ADAM : une méthode d'optimisation stochastique
ADAM : une méthode d'optimisation stochastique
Diederik P. Kingma Jimmy Lei Ba
Résumé
Nous introduisons Adam, un algorithme d'optimisation stochastique d'objectifs basé sur le gradient du premier ordre, fondé sur des estimations adaptatives de moments d'ordre inférieur. La méthode est simple à implémenter, computationnellement efficace, peu gourmande en mémoire, invariante aux recalibrages diagonaux des gradients et bien adaptée aux problèmes de grande taille en données et/ou en paramètres. Elle convient également aux objectifs non stationnaires et aux problèmes présentant des gradients très bruités et/ou épars. Les hyperparamètres possèdent des interprétations intuitives et ne requièrent généralement que peu de réglage. Certaines connexions avec les algorithmes connexes ayant inspiré Adam sont abordées. Nous analysons également les propriétés théoriques de convergence de l'algorithme et fournissons une borne de regret sur le taux de convergence comparable aux meilleurs résultats connus dans le cadre de l'optimisation convexe en ligne. Les résultats empiriques montrent qu'Adam fonctionne bien en pratique et se compare favorablement aux autres méthodes d'optimisation stochastique. Enfin, nous discutons d'AdaMax, une variante d'Adam basée sur la norme infinie.
One-sentence Summary
Researchers at the University of Amsterdam, OpenAI, and the University of Toronto propose Adam, a first-order stochastic optimization method based on adaptive estimates of lower-order moments that is computationally efficient, memory-light, requires minimal hyperparameter tuning, and performs well on large-scale problems with noisy or sparse gradients.
Key Contributions
- The paper introduces Adam, a computationally efficient first-order optimizer for stochastic objective functions that uses adaptive estimates of first and second gradient moments and is suited to large datasets, high-dimensional parameters, non-stationary objectives, noisy gradients, and sparse gradients.
- The paper analyzes convergence and derives a regret bound under the online convex optimization framework, and explains Adam's relation to RMSProp and AdaGrad, including how bias correction prevents excessively large parameter updates when beta_2 is near 1.
- Experimental results show Adam compares favorably with other stochastic optimization methods on non-convex machine-learning optimization problems, and the paper introduces AdaMax, a variant based on the infinity norm.
Introduction
Stochastic first-order optimization is central to machine learning and scientific computing because many objectives are defined over large, noisy datasets or regularizers such as dropout. In high-dimensional parameter spaces, second-order methods are often impractical, while earlier first-order optimizers have tradeoffs: AdaGrad handles sparse gradients well, and RMSProp suits online or non-stationary settings, but RMSProp without bias correction can produce unstable updates when sparse-gradient behavior is needed. The authors introduce Adam, which uses running estimates of the first and second moments of gradients, with bias correction, to compute per-parameter adaptive learning rates. Adam combines sparse-gradient robustness with non-stationary adaptivity, requires little memory, and provides convergence analysis and strong empirical results on large-scale machine learning problems.
Method
The authors design the method as an adaptive stochastic optimization algorithm for minimizing an expected objective function. Let f(θ) be a noisy scalar objective that is differentiable with respect to parameters θ, and suppose the algorithm observes a sequence of stochastic realizations f1(θ),…,fT(θ), for example through minibatches or through inherently noisy gradient estimates. At timestep t, the gradient is
gt=∇θft(θ).The central idea is to maintain running estimates of both the first and second moments of the gradient. Instead of using the raw gradient alone, the optimizer normalizes a smoothed gradient direction by an estimate of gradient variance. This produces parameter updates that are adaptive in scale and robust to noisy or sparse gradients.
The core update can be written as a repeated module. The optimizer begins with θ0, m0=0, and v0=0, where mt tracks the gradient and vt tracks the squared gradient. At each step,
gtmtvtmtvtθt=∇θft(θt−1),=β1mt−1+(1−β1)gt,=β2vt−1+(1−β2)gt2,=1−β1tmt,=1−β2tvt,=θt−1−αvt+ϵmt.Here, β1 and β2 control the exponential decay rates of the first and second moment estimates. The hyperparameter α controls the base stepsize, and ϵ provides numerical stability in the denominator.
The term mt is an exponential moving average of the gradient and serves as an estimate of the first moment. The term vt is an exponential moving average of the elementwise squared gradient and serves as an estimate of the second raw moment. Because both averages are initialized at zero, their early values are biased toward zero. This bias is especially pronounced when β1 or β2 is close to 1, since old values are heavily discounted and the initial zeros persist for many steps.
To counteract this, the method divides the moving averages by the terms 1−β1t and 1−β2t. The bias correction for the second moment can be understood by writing the recursive average as
vt=(1−β2)i=1∑tβ2t−igi2.Taking expectations gives
E[vt]≈E[gt2](1−β2t),with additional discrepancy that can remain small when the decay rate gives little weight to very old gradients. Dividing by 1−β2t removes the initialization bias and yields a scale correct estimate vt. The same logic applies to the first moment.
The resulting update uses the bias corrected first moment and the square root of the bias corrected second moment. The effective parameter change can be viewed as
Δt=αvtmt.The ratio
vtmtacts like a signal to noise ratio. When the smoothed gradient estimate is consistent across recent steps, the magnitude of this ratio can be close to one, allowing larger effective moves. When the gradient direction is noisy or uncertain, the ratio shrinks, reducing the effective step. Near an optimum, the signal to noise ratio often becomes small, which naturally reduces the update magnitude. This behavior gives the optimizer a form of automatic annealing without requiring an external stepsize schedule in many practical settings.
The update also has a bounded effect. For the common case where (1−β1)≤1−β2, the effective step is bounded by approximately α. In more severe sparse cases, a looser bound is
∣Δt∣≤α1−β21−β1.This bounded step behavior creates a trust region around the current parameters: the optimizer does not allow a single noisy gradient estimate to produce arbitrarily large movements. Because α controls the upper scale of parameter changes, it is often possible to choose its magnitude based on prior knowledge of the parameter geometry, such as expected distance from initialization to good solutions.
Another important property is scale invariance. If gradients are rescaled by a constant factor c, then mt scales by c and vt scales by c2. The ratio
c2vtcmt=vtmtremains unchanged. Therefore, multiplying all gradients by a constant does not change the optimizer direction or step magnitude, except for the numerical stabilizer.
The computational flow can be simplified by folding the bias correction terms into the stepsize. Instead of computing mt and vt separately, one can use
αt=α1−β1t1−β2tand then update
θt=θt−1−αtvt+ϵmt.This formulation is mathematically equivalent to the bias corrected update while avoiding an extra division in the main loop.
The method is also analyzed through an online learning framework. Given an arbitrary sequence of convex cost functions f1(θ),…,fT(θ), the algorithm chooses parameters θt before observing the current cost. The performance is measured by regret relative to the best fixed parameter θ∗:
R(T)=t=1∑T[ft(θt)−ft(θ∗)].Under bounded gradient and bounded parameter movement assumptions, the update rule achieves an O(T) regret bound. Consequently, the average regret satisfies
TR(T)=O(T1),which implies that the average regret converges to zero as T grows. For sparse data, the adaptive normalization can improve over non adaptive methods because dimensions that are rarely updated should not receive the same scaling treatment as frequently updated dimensions.
An important variant arises by generalizing the second moment normalization from an L2 based quantity to an Lp based quantity. If the stepsize is made inversely proportional to an Lp norm surrogate, the second moment estimator can be written as
vt=β2pvt−1+(1−β2p)∣gt∣p.Taking the limit as p approaches infinity yields a simpler recursive quantity:
ut=max(β2ut−1,∣gt∣).This quantity behaves like a decayed running maximum of gradient magnitudes. Using this in place of vt leads to a more stable variant for settings where large norm generalizations become numerically difficult. In this formulation, initialization bias correction is not required, and the effective parameter update has the simpler bound
∣Δt∣≤α.The core training module can also be augmented with temporal averaging. Since stochastic optimization produces noisy iterates, averaging recent parameters often improves generalization. A simple extension is to maintain an exponential moving average of the parameter vector:
θˉt=β2θˉt−1+(1−β2)θt,with θˉ0=0. Bias correction can again be applied using
θˉt=1−β2tθˉt.Alternatively, a uniform average over iterates can be used, but the exponential form places more weight on more recent parameters and fits naturally into the streaming gradient optimization loop.
Experiment
The experiments evaluate Adam across logistic regression, multilayer neural networks, convolutional neural networks, and a variational autoencoder, comparing it with momentum SGD, Adagrad, SFO, and RMSProp under consistently tuned settings. Logistic regression experiments confirm that Adam converges comparably to momentum SGD and handles sparse features effectively, matching Adagrad. On non-convex deep models, Adam generally trains efficiently, often outperforming or matching competing optimizers, while in convolutional networks it benefits from adaptive layer-wise scaling and variance reduction through momentum. The bias-correction study shows that this term improves stability when slow-decay estimates are used, making Adam at least as strong as RMSProp across the tested configurations.