Adam 2026-11-05
Adam, named for adaptive moment estimation, is an adaptive gradient method that scales a running gradient estimate by a running squared-gradient estimate. Diederik P. Kingma and Jimmy Lei Ba presented it as a first-order method for stochastic optimization. Its state makes the next optimizer update depend on gradient history as well as the current parameters.[ref]
Starting from , the basic minimization rule is
Here is the supplied gradient, is the learning rate, , and . The Hadamard product, square root and division act coordinatewise. Adam bias correction supplies the two normalization factors. The accumulator concerns a raw second moment, rather than a centered variance.[ref]
For an original scalar calculation, choose , , and , and supply , . The first step has
The second has
Equal and opposite supplied gradients have not undone one another: the running histories give the second step a different magnitude. Plain gradient descent with the same constant learning rate would return to zero for this sequence.
The calculation specifies the recurrence, rather than a convergence guarantee for an unspecified objective function. An optimization checkpoint needs these histories and the step count to reproduce subsequent steps. AdamW adds decoupled weight decay; feeding a penalty gradient into Adam instead implements coupled L2 regularization and changes the histories.
AdamW 2026-11-05
AdamW combines the adaptive update of Adam with decoupled weight decay. It maintains exponentially weighted histories of the supplied data gradient and its componentwise square, while applying parameter shrinkage separately. Ilya Loshchilov and Frank Hutter presented the method in their work on decoupling decay from gradient-based regularization.[ref]
For minimization without optional algorithm variants, initialize . In the convention documented by PyTorch, step uses
The product is a Hadamard product; square roots and division are also coordinatewise. Assume , and the stated learning rate . The decay coefficient is . This explicitly fixes epsilon placement and the decay convention.[ref]
The denominators and perform Adam bias correction for zero-initialized histories. For a constant supplied scalar gradient , the corresponding geometric sums give and . Their corrected values are therefore and . The squared-gradient quantity concerns a raw second moment, rather than a centered variance: a constant gradient of 2 has square 4 even though its variance is zero.
For an original first-step example, choose , , , , , and . Then
and
The constants are chosen for transparent arithmetic. Feeding into the same adaptive formulas instead, with no separate shrinkage, would give approximately . That coupled L2 regularization also changes the stored histories. Resuming AdamW therefore requires the relevant optimizer state and step count as well as the parameter values and settings.
Decoupled weight decay 2026-11-05
Decoupled weight decay applies a parameter-shrinkage contribution separately from the optimizer's processing of the data gradient. Write for the processed data-gradient direction, including any algorithm-specific optimizer state. Using the coefficient convention documented for PyTorch AdamW,
The shrinkage term uses the pre-update parameter and is not inserted into the gradient moments.[ref]
This differs from coupled L2 regularization, which processes as a single gradient input. Decoupled weight decay was introduced for adaptive optimization in the AdamW work; the original paper also writes decay coefficients with the learning-rate factor absorbed differently, so its coefficient must be translated before comparing equations.[ref]
An original limiting case isolates the shrinkage. Suppose the processed direction is zero at every step and are constant. Repeated substitution gives
With , and , one update gives 0.98 and 50 updates give approximately 0.36417. For varying learning rates, the corresponding factor is
Thus the same numerical decay coefficient can have a different accumulated effect under a different learning rate schedule. In this zero-direction model, gives sign-preserving shrinkage; other factors have different behaviour.
The update order is also part of the definition. For , , and , the stated formula gives . Applying shrinkage after first taking the gradient step would instead give . Both operations may be described informally as decay plus a step, but they are different recurrences. An optimization checkpoint must retain the relevant state and settings to reproduce the chosen one.
Frank Hutter 2026-11-05
Frank Hutter researches automated design and configuration of algorithms and machine learning systems. His work asks how experimental measurements of an algorithm's performance can guide the search for better settings, replacing some manual trial and error with an explicit computational procedure.[ref]
Hutter and colleagues developed ParamILS, an algorithm configuration framework described in 2009. It searches settings of a target algorithm and limits unpromising evaluation runs to use the experimental budget more effectively.[ref] A useful example is a solver with several search settings: choosing a setting changes the procedure used on the next problem instance, rather than changing that instance's answer. Performance measured on the tuning instances should therefore be checked on separate instances before claiming a general improvement.
With Ilya Loshchilov, Hutter also introduced the decoupled weight decay mechanism underlying AdamW. Their analysis showed why using coupled L2 regularization and directly shrinking parameters cease to be equivalent under general adaptive gradient scaling.[ref] This contribution connects algorithm design to a precise update equation: an option called weight decay can describe different mathematical operations in different optimizers.
Figure 1.
Frank Hutter, portrait linked from his Freiburg Machine Learning Lab profile
.
Weight decay 2026-11-05
Weight decay supplies a parameter-shrinkage contribution to an optimizer update, with a coefficient commonly denoted . Two implementations must be distinguished. Coupled L2 regularization adds the penalty to the objective function, replacing its data gradient by . Decoupled weight decay applies parameter shrinkage separately from the optimizer's processing of the data gradient. These operations are equivalent for plain gradient descent with matched coefficients, but not in general for an adaptive gradient method.[ref]
Use the PyTorch convention here: a decoupled update shrinks parameters by , where is the learning rate. A source writing instead has absorbed the step-size factor into its decay coefficient. For an unmodified gradient step,
In AdamW, the decay contribution does not enter the stored first- or second-moment estimates of the gradient.[ref]
An original fixed-scaling example exposes the difference. Let , , , and diagonal matrix . Applying the same scaling to the entire coupled gradient gives
Separating uniform parameter shrinkage gives
The second coordinate receives different shrinkage. This is an illustrative fixed matrix, not a full AdamW simulation. With history-dependent scaling, coupling the penalty into the gradient can also alter the optimizer state. State the update equation and coefficient convention when reporting a decay setting; the label alone does not specify either.