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]
AdamW in the PyTorch documentation. PyTorch2.15, algorithm: separate parameter-decay line before the adaptive update
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]
Decoupled Weight Decay Regularization by Ilya Loshchilov and Frank Hutter. Version3, section2 and Algorithm2
An original limiting case isolates the shrinkage. Suppose the processed direction is zero at every step and are constant. Repeated substitution givesWith , and , one update gives 0.98 and 50 updates give approximately 0.36417. For varying learning rates, the corresponding factor isThus 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.
Articles by others on the same topic
There are currently no matching articles.