Weight Decay

Weight decay penalizes large parameters during optimization. It is commonly used as a form of regularization in neural network training.

Classical regularization adds a penalty to the objective:

The gradient becomes:

For plain SGD, this gives:

is the learning rate, is the data gradient, and is the decay coefficient.

Decoupled Weight Decay

Adaptive optimizers often use decoupled weight decay:

is the optimizer update direction. This separates parameter shrinkage from adaptive gradient normalization.

Coupled vs Decoupled

The same coefficient can mean different things depending on the optimizer.

SetupFormula ShapeInterpretation
objective penaltychanges the optimized objective
SGD with equivalent to multiplicative shrinkage
Adam with Adam receives decay is scaled by adaptive denominator
AdamWdirect decoupled shrinkage

For plain SGD, coupled and weight decay are closely related. For adaptive optimizers, they should be treated as different training recipes.

Effective Decay Over Training

With decoupled decay, a parameter is repeatedly multiplied by:

Ignoring gradient updates, after optimizer steps:

So effective decay depends on learning-rate schedule and optimizer step count, not only on .

Parameter Group Contract

Weight decay should be documented as a parameter-group rule:

GroupTypical ChoiceCheck
matrix weightsdecaylinear, convolution, attention projections
bias termsno decayotherwise shifts may be over-regularized
normalization parametersno decayscale/shift parameters control activation statistics
embeddingsdependscan dominate parameter count; tune separately
task headsdependssmall heads may need different decay

The public note should state the rule, not private run identifiers or internal file paths.

Interaction With Generalization

Weight decay can reduce overfitting, but it is not proof of better generalization:

The selected value depends on validation metric, split, schedule, batch size, optimizer, augmentation, and training length. If those change, the best may change too.

Checks

  • Is weight decay coupled to the loss or decoupled in the optimizer?
  • Are bias, normalization, and embedding parameters excluded when appropriate?
  • Is the decay coefficient reported separately from learning rate?
  • Does stronger decay improve validation performance or only reduce training loss?
  • Is weight decay being confused with dropout or early stopping?
  • Is the effective decay affected by schedule length or number of optimizer steps?
  • Are parameter groups logged in the run record?