Weight Decay in Neural Network Training
A neural network can keep reducing its training loss while learning parameter values that generalize poorly. Weight decay is one way to regularize training: it applies a small pressure that shrinks selected parameters as optimization proceeds. The idea sounds similar to adding an L2 penalty to the loss, and for plain stochastic gradient descent the two can be made equivalent by matching their scaling. With adaptive optimizers such as Adam, however, adding an L2 penalty to the gradient and directly decaying the weights are not generally the same operation. That distinction is why optimizers such as AdamW use decoupled weight decay.