Simple Algorithm
Deep Learning · Emergence · 30 min

What Weight Decay Really Does

Scale invariance, effective learning rates and rotational equilibrium: why decay matters when it barely regularizes.

In a network with normalization layers, multiplying a layer's weights by ten changes nothing the network computes, so a penalty on their size cannot be shaping the function directly. Yet taking weight decay away still hurts. This lesson derives what decay does instead: it sets the effective learning rate, drives normalized weights into a rotational equilibrium that turns them by about 2ηλ\sqrt{2\eta\lambda} radians per step, and in language-model training stabilizes optimization where there is nothing to overfit.

What you’ll learn

  • Contrast the classical readings of weight decay with what it does in normalized networks, and derive the effective per-coordinate penalty of AdamW versus an L2L_2 term inside Adam.
  • Prove that scale invariance L(cw)=L(w)\loss(c\mathbf w)=\loss(\mathbf w) implies ⟨∇L(w),w⟩=0\langle\nabla\loss(\mathbf w),\mathbf w\rangle=0 and ∇L(cw)=∇L(w)/c\nabla\loss(c\mathbf w)=\nabla\loss(\mathbf w)/c, and derive the norm growth and the shrinking effective learning rate η/∥w∥2\eta/\norm{\mathbf w}^2 of SGD without decay.
  • Derive the equilibrium norm and the equilibrium angular update 2ηλ\sqrt{2\eta\lambda}, and the exact equivalence of decay with an exponentially growing learning rate (Li & Arora, 2020).
  • Explain the intrinsic learning rate ηλ\eta\lambda, the timescale 1/(ηλ)1/(\eta\lambda) and AdamW's moving-average view, and what decay does in single-pass language-model training.
  • Apply the practical conventions: which parameters to decay, how decay couples to the learning-rate schedule, and its role in grokking.

Three classical readings, and a decoupling

Weight decay has three classical readings. As a penalty, it adds λ2∥θ∥2\frac\lambda2\norm{\boldsymbol\theta}^2 to the loss. As a prior, it is MAP estimation under θ∼N(0,σp2I)\boldsymbol\theta\sim\mathcal N(\mathbf 0,\sigma_p^2I) with λ=1/(nσp2)\lambda=1/(n\sigma_p^2). As capacity control, small weight norms mean a small function class, which norm-based generalization bounds turn into guarantees (Generalization Bounds for Deep Networks). For linear networks, Krogh and Hertz (1992) showed that decay suppresses the components of the weights that the target does not need and, if well tuned, reduces the effect of noise in the targets.

All three readings assume that the size of the weights shapes the function. Before showing why that is often false in modern networks, finish the story of how decay enters adaptive optimizers. The Representation lesson showed that an L2L_2 term inside Adam decays coordinate jj at the rate ηλ/vj\eta\lambda/\sqrt{v_j} per step. Fixed points tell the other half.

DerivationThe effective penalty of AdamW
  1. Adam+L2:∇jL(θ)+λθj=0\text{Adam}+L_2:\qquad\nabla_j\loss(\boldsymbol\theta)+\lambda\theta_j=0

    With the penalty inside Adam's gradient, a stationary point needs the averaged gradient of L+λ2∥θ∥2\loss+\frac\lambda2\norm{\boldsymbol\theta}^2 to vanish: the fixed points are those of plain L2L_2, even though the path decays coordinates unevenly.

  2. AdamW:∇jL(θ)=−λ(v^j+ϵ) θj\text{AdamW}:\qquad\nabla_j\loss(\boldsymbol\theta)=-\lambda\big(\sqrt{\hat v_j}+\epsilon\big)\,\theta_j

    AdamW updates θ←θ−η(m^/(v^+ϵ)+λθ)\boldsymbol\theta\leftarrow\boldsymbol\theta-\eta\big(\hat{\mathbf m}/(\sqrt{\hat{\mathbf v}}+\epsilon)+\lambda\boldsymbol\theta\big). At a stationary point m^j≈∇jL\hat m_j\approx\nabla_j\loss, so

  3. L(θ)+12∑jλ(v^j+ϵ) θj2\loss(\boldsymbol\theta)+\frac12\sum_j\lambda\big(\sqrt{\hat v_j}+\epsilon\big)\,\theta_j^2

    With v^\hat{\mathbf v} frozen, this is the stationary condition of an L2L_2 penalty whose strength differs per coordinate:

  4. So AdamW is not a uniform L2L_2 penalty either: it penalizes coordinates with a large gradient scale more. Loshchilov and Hutter (2019) proved that no L2L_2 coefficient reproduces decoupled decay when the preconditioner is not a multiple of the identity, and found the decoupled form generalized better. Why it is better is a separate question; Kosson, Messmer and Jaggi (2024) give an answer in terms of normalized layers, developed below.

Scale invariance

Batch normalization standardizes each unit's pre-activation over the batch; layer normalization and RMSNorm standardize a layer's whole pre-activation vector. Either way, scaling the weights that feed the normalization scales the pre-activations, and the normalization undoes it. For a unit followed by batch norm, its incoming weights w\mathbf w satisfy L(cw)=L(w)\loss(c\mathbf w)=\loss(\mathbf w) for every c>0c>0; for layer norm the same holds for the whole weight matrix together with its bias, up to the small constant ϵ\epsilon inside the normalization. This is scale invariance.

DerivationProof
  1. 0=ddcL(cw)∣c=1=⟨∇L(w),w⟩0=\frac{d}{dc}\loss(c\mathbf w)\Big|_{c=1}=\langle\nabla\loss(\mathbf w),\mathbf w\rangle

    (i) The function c↦L(cw)c\mapsto\loss(c\mathbf w) is constant, so its derivative vanishes; at c=1c=1 it is the radial derivative:

  2. c ∇L(cw)=∇L(w),c2 ∇2L(cw)=∇2L(w)c\,\nabla\loss(c\mathbf w)=\nabla\loss(\mathbf w),\qquad c^2\,\nabla^2\loss(c\mathbf w)=\nabla^2\loss(\mathbf w)

    (ii) Differentiate the identity L(cw)=L(w)\loss(c\mathbf w)=\loss(\mathbf w) with respect to w\mathbf w by the chain rule, and (iii) once more:

  3. So the gradient is always tangent to the sphere through w\mathbf w, and the further w\mathbf w is from the origin, the flatter the loss looks: the same function, seen at a larger radius, has gradients scaled by 1/c1/c and curvature by 1/c21/c^2.

DerivationWithout decay: the norm grows and the step shrinks
  1. ∥wt+1∥2=∥wt∥2+η2∥gt∥2\norm{\mathbf w_{t+1}}^2=\norm{\mathbf w_t}^2+\eta^2\norm{\mathbf g_t}^2

    Take an SGD step wt+1=wt−ηgt\mathbf w_{t+1}=\mathbf w_t-\eta\mathbf g_t. Since gt⊥wt\mathbf g_t\perp\mathbf w_t, Pythagoras gives a norm that can only grow:

  2. ηeff=η∥wt∥2\eta_{\text{eff}}=\frac{\eta}{\norm{\mathbf w_t}^2}

    Write gt=g~t/∥wt∥\mathbf g_t=\tilde{\mathbf g}_t/\norm{\mathbf w_t}, where g~t\tilde{\mathbf g}_t is the gradient at the unit vector ut=wt/∥wt∥\mathbf u_t=\mathbf w_t/\norm{\mathbf w_t} (property ii). The direction turns by an angle of about η∥gt∥/∥wt∥\eta\norm{\mathbf g_t}/\norm{\mathbf w_t}, so on the sphere SGD runs with an effective learning rate

  3. Nt2≈N02+2η2G t⟹ηeff=ηNt≈12Gt  for large tN_t^2\approx N_0^2+2\eta^2G\,t\qquad\Longrightarrow\qquad\eta_{\text{eff}}=\frac{\eta}{N_t}\approx\frac{1}{\sqrt{2Gt}}\ \ \text{for large }t

    Feed this back into the norm. With Nt=∥wt∥2N_t=\norm{\mathbf w_t}^2 and a roughly constant G=∥g~∥2G=\norm{\tilde{\mathbf g}}^2, the increments are η2G/Nt\eta^2G/N_t, so Nt dNt≈η2G dtN_t\,dN_t\approx\eta^2G\,dt:

  4. Without decay, normalized weights grow like t1/4t^{1/4} and their effective learning rate decays like 1/t1/\sqrt t, a hidden schedule that in the long run does not even depend on η\eta. In normalized networks the weight norm matters only through the effective learning rate (van Laarhoven, 2017; Hoffer et al., 2018).

Check your understanding

Two copies of a batch-normalized network compute the same function, but in copy B every weight vector that feeds a batch-norm layer is 10 times longer. Both are trained with SGD at the same learning rate. How do their steps compare?

  1. Identical, since the networks compute the same function
  2. B's gradients are 10 times smaller and its directions turn about 100 times more slowly
  3. B's gradients are 10 times larger, so it trains faster
  4. B's gradients are 100 times smaller but its directions turn at the same rate
Show the answer

B. B's gradients are 10 times smaller and its directions turn about 100 times more slowly

By ∇L(cw)=∇L(w)/c\nabla\loss(c\mathbf w)=\nabla\loss(\mathbf w)/c, B's gradients are 10 times smaller, and the angle turned per step, η∥g∥/∥w∥\eta\norm{\mathbf g}/\norm{\mathbf w}, is 10×10=10010\times10=100 times smaller: B trains as if its learning rate were η/100\eta/100.

Rotational equilibrium

Now add decay, wt+1=(1−ηλ)wt−ηgt\mathbf w_{t+1}=(1-\eta\lambda)\mathbf w_t-\eta\mathbf g_t. Decay pulls the norm in, and the orthogonal gradient steps push it out. The two must balance:

DerivationEquilibrium norm and angular update (SGD)
  1. ∥wt+1∥2=(1−ηλ)2∥wt∥2+η2G∥wt∥2\norm{\mathbf w_{t+1}}^2=(1-\eta\lambda)^2\norm{\mathbf w_t}^2+\frac{\eta^2G}{\norm{\mathbf w_t}^2}

    The cross term vanishes because gt⊥wt\mathbf g_t\perp\mathbf w_t, so with G=∥g~∥2G=\norm{\tilde{\mathbf g}}^2 as before:

  2. (2ηλ−η2λ2)∥w∗∥4=η2G⟹∥w∗∥4=ηG2λ−ηλ2≈ηG2λ(2\eta\lambda-\eta^2\lambda^2)\norm{\mathbf w^*}^4=\eta^2G\quad\Longrightarrow\quad\norm{\mathbf w^*}^4=\frac{\eta G}{2\lambda-\eta\lambda^2}\approx\frac{\eta G}{2\lambda}

    At a fixed point ∥wt+1∥=∥wt∥=∥w∗∥\norm{\mathbf w_{t+1}}=\norm{\mathbf w_t}=\norm{\mathbf w^*}:

  3. Δ∠  ≈  ηG⋅2ληG  =  2ηλ\Delta\angle\;\approx\;\eta\sqrt G\cdot\sqrt{\frac{2\lambda}{\eta G}}\;=\;\sqrt{2\eta\lambda}

    The angle turned per step is the step length over the radius, η∥g∥/∥w∗∥=ηG/∥w∗∥2\eta\norm{\mathbf g}/\norm{\mathbf w^*}=\eta\sqrt G/\norm{\mathbf w^*}^2:

  4. The gradient size GG has cancelled. In equilibrium, every normalized weight group, whatever its gradients, turns by about 2ηλ\sqrt{2\eta\lambda} radians per step: decay sets the speed of learning on the sphere. Linearizing the norm recursion around ∥w∗∥\norm{\mathbf w^*} shows deviations shrinking by a factor of about 1−4ηλ1-4\eta\lambda per step, so the norm settles within a few multiples of 1/(4ηλ)1/(4\eta\lambda) steps.

Predict before you look

A normalized network is trained with plain SGD at η=0.1\eta=0.1 and weight decay λ=5×10−4\lambda=5\times10^{-4}. In equilibrium, by roughly how many radians does each normalized weight vector turn per step?

Show the answer

0.01 rad

2×0.1×5×10−4=10−4=0.01\sqrt{2\times0.1\times5\times10^{-4}}=\sqrt{10^{-4}}=0.01 rad, about 0.57°0.57° per step. A simulation of the norm recursion with random orthogonal gradients lands on 0.0100. With heavy-ball momentum α=0.9\alpha=0.9 the prediction becomes 2ηλ/(1+α)≈0.0073\sqrt{2\eta\lambda/(1+\alpha)}\approx0.0073 rad.

OptimizerEquilibrium angle per stepEquilibrium norm
SGD2ηλ\sqrt{2\eta\lambda}(ηG/(2λ))1/4\big(\eta G/(2\lambda)\big)^{1/4}
SGD, momentum α\alpha (decay added to the gradient)2ηλ/(1+α)\sqrt{2\eta\lambda/(1+\alpha)}(ηG/(2λ(1−α)))1/4\big(\eta G/(2\lambda(1-\alpha))\big)^{1/4}
AdamW, first-moment decay β1\beta_12ηλ (1−β1)/(1+β1)\sqrt{2\eta\lambda\,(1-\beta_1)/(1+\beta_1)}ηC/(2λ)\sqrt{\eta C/(2\lambda)} for a group of CC weights
Adam with an L2L_2 termdepends on each neuron's gradient sizedepends on each neuron's gradient size
Steady-state predictions for scale-invariant weights, assuming successive gradients are uncorrelated, from Kosson, Messmer and Jaggi (2024); Wan, Zhu, Zhang and Sun (2021) derived the equilibrium angular update of SGD with momentum. Under AdamW every neuron rotates at the same rate; with an L2L_2 term inside Adam, neurons with larger gradients settle at larger norms and rotate more slowly. Kosson et al. argue that this imbalanced rotation is a key reason decoupled decay works better, a hypothesis backed by experiments rather than a proof.
DerivationDecay is an exponentially growing learning rate (Li & Arora, 2020)
  1. w~t+1=w~t−η (1−ηλ)−(t+1) ∇L(wt)\tilde{\mathbf w}_{t+1}=\tilde{\mathbf w}_t-\eta\,(1-\eta\lambda)^{-(t+1)}\,\nabla\loss(\mathbf w_t)

    Divide the decayed update by (1−ηλ)t+1(1-\eta\lambda)^{t+1} and set w~t=wt/(1−ηλ)t\tilde{\mathbf w}_t=\mathbf w_t/(1-\eta\lambda)^t:

  2. ∇L(wt)=(1−ηλ)−t ∇L(w~t)⟹w~t+1=w~t−η (1−ηλ)−(2t+1) ∇L(w~t)\nabla\loss(\mathbf w_t)=(1-\eta\lambda)^{-t}\,\nabla\loss(\tilde{\mathbf w}_t)\quad\Longrightarrow\quad\tilde{\mathbf w}_{t+1}=\tilde{\mathbf w}_t-\eta\,(1-\eta\lambda)^{-(2t+1)}\,\nabla\loss(\tilde{\mathbf w}_t)

    Scale invariance converts the gradient at wt=(1−ηλ)tw~t\mathbf w_t=(1-\eta\lambda)^t\tilde{\mathbf w}_t into one at w~t\tilde{\mathbf w}_t:

  3. So SGD with decay visits exactly the same directions, and hence computes exactly the same functions, as SGD without decay whose learning rate grows by a factor (1−ηλ)−2≈e2ηλ(1-\eta\lambda)^{-2}\approx e^{2\eta\lambda} every step. For η=0.1\eta=0.1, λ=5×10−4\lambda=5\times10^{-4} and 391 steps per epoch, a classic CIFAR-10 recipe, that is about 4% per epoch, a factor of about 50 over 100 epochs. Li and Arora proved the equivalence also with momentum, for networks in which every trained layer is scale-invariant.

Decay where nothing overfits

Large language models are pretrained for roughly one pass over their data, so training and validation losses nearly coincide and there is no generalization gap for decay to close. Yet decoupled weight decay is standard: GPT-3 used AdamW with λ=0.1\lambda=0.1 (Brown et al., 2020), and PaLM, trained with Adafactor, used a decay equal to the square of the current learning rate (Chowdhery et al., 2023). D'Angelo, Andriushchenko, Varre and Flammarion (2024) studied why, training GPT-2-style models of 124 million parameters:

  • Not a regularizer here. Decay lowered the training loss at the end of training. Early on, its larger effective learning rate keeps the loss higher, because the noise term dominates; as the learning rate is decayed, the faster contraction of the remaining error wins and the run ends lower.
  • A different effective learning rate. Adam's steps have roughly fixed size per coordinate, ∥Δw∥≈ηC\norm{\Delta\mathbf w}\approx\eta\sqrt C, whatever the radius, so the angle turned per step is about ηC/∥w∥\eta\sqrt C/\norm{\mathbf w}: the effective rate scales as ηt/∥wt∥\eta_t/\norm{\mathbf w_t}, not ηt/∥wt∥2\eta_t/\norm{\mathbf w_t}^2 as for SGD. A schedule matching it reproduced AdamW's loss curve without decay, in float32.
  • Stability in low precision. Without decay, runs at a higher learning rate diverged late in training in bfloat16 precision but not in float32, and matching the effective learning rate did not prevent it; decay made the higher learning rate stable in bfloat16.
DerivationAdamW weights are a moving average of updates
  1. θt=(1−ηλ)tθ0+1λ∑s=1tηλ(1−ηλ)t−s (−us)\boldsymbol\theta_t=(1-\eta\lambda)^t\boldsymbol\theta_0+\frac1\lambda\sum_{s=1}^t\eta\lambda(1-\eta\lambda)^{t-s}\,(-\mathbf u_s)

    Write AdamW as θt=(1−ηλ)θt−1−ηut\boldsymbol\theta_t=(1-\eta\lambda)\boldsymbol\theta_{t-1}-\eta\mathbf u_t, with ut\mathbf u_t Adam's normalized update, and unroll:

  2. θt≈1λ EMAτ(−u),τ=1ηλ steps\boldsymbol\theta_t\approx\frac1\lambda\,\mathrm{EMA}_{\tau}(-\mathbf u),\qquad\tau=\frac{1}{\eta\lambda}\ \text{steps}

    The coefficients ηλ(1−ηλ)t−s\eta\lambda(1-\eta\lambda)^{t-s} sum to 1−(1−ηλ)t→11-(1-\eta\lambda)^t\to1. After a few multiples of τ=1/(ηλ)\tau=1/(\eta\lambda) steps the initialization is forgotten and the weights are 1/λ1/\lambda times an exponential moving average of the negated updates, with timescale τ\tau:

  3. Wang and Aitchison (2025) took this view seriously: they found the best timescale, measured in epochs, roughly constant as model and dataset size change, which implies that at fixed learning rate and batch size the best λ\lambda should shrink as the dataset grows.

Check your understanding

AdamW runs with η=3×10−4\eta=3\times10^{-4} and λ=0.1\lambda=0.1. Over roughly how many recent steps do the weights average their updates?

  1. About 10
  2. About 3,300
  3. About 33,000
  4. About 3.3 million
Show the answer

C. About 33,000

τ=1/(ηλ)=1/(3×10−5)≈33,000\tau=1/(\eta\lambda)=1/(3\times10^{-5})\approx33{,}000 steps; an update's influence halves after ln⁡2⋅τ≈23,000\ln2\cdot\tau\approx23{,}000 steps. A run much shorter than τ\tau never forgets its initialization, while one much longer forgets everything older than a few τ\tau.

Practice and open questions

What to decay. Common practice decays weight matrices and leaves biases and normalization gains alone ("no bias decay" is one of the tricks collected in He et al.'s "Bag of tricks for image classification with convolutional neural networks", 2019). The theory explains why the distinction matters: for scale-invariant matrices decay works through the effective learning rate, while for parameters that are not scale-invariant, such as gains, biases or an unnormalized output layer, decay pulls on the function itself, and shrinking a gain toward zero simply switches its units off.

Coupling to the schedule. In PyTorch's AdamW the decay per step is ηtλ\eta_t\lambda, so it fades with the learning rate during a cooldown. And since normalized weights in equilibrium depend on ηλ\eta\lambda, learning-rate and weight-decay sweeps should be read together rather than tuned one at a time.

Grokking. Decay is central to grokking on small algorithmic tasks: a network that has memorized its training set later moves, under decay, to a lower-norm solution that generalizes (Grokking).

Key takeaways

  • Classically, weight decay is a penalty, a Gaussian prior and capacity control. AdamW is not a uniform L2L_2 penalty either: at its fixed points it acts like a per-coordinate penalty 12λ(v^j+ϵ)θj2\frac12\lambda(\sqrt{\hat v_j}+\epsilon)\theta_j^2.
  • Normalization makes the loss scale-invariant in the weights that feed it: ⟨∇L(w),w⟩=0\langle\nabla\loss(\mathbf w),\mathbf w\rangle=0 and ∇L(cw)=∇L(w)/c\nabla\loss(c\mathbf w)=\nabla\loss(\mathbf w)/c. Without decay, SGD makes ∥w∥\norm{\mathbf w} grow like t1/4t^{1/4} and the effective learning rate η/∥w∥2\eta/\norm{\mathbf w}^2 decay like 1/t1/\sqrt t.
  • With decay, gradient push and decay pull balance at ∥w∗∥4≈ηG/(2λ)\norm{\mathbf w^*}^4\approx\eta G/(2\lambda), where every normalized weight group turns by about 2ηλ\sqrt{2\eta\lambda} per step; exactly, decay equals a learning rate growing by (1−ηλ)−2(1-\eta\lambda)^{-2} per step (Li & Arora, 2020), and ηλ\eta\lambda is the intrinsic learning rate.
  • AdamW's weights are 1/λ1/\lambda times a moving average of its updates over 1/(ηλ)1/(\eta\lambda) steps. In single-pass language-model training decay is an optimization and stability tool, not a regularizer (D'Angelo et al., 2024).
  • Decay matrices, not biases or gains; tune η\eta and λ\lambda jointly; and expect decay to matter in grokking.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

A loss satisfies L(cw)=L(w)\loss(c\mathbf w)=\loss(\mathbf w) for all c>0c>0. Which statement is true?

  1. ∇L(2w)=2∇L(w)\nabla\loss(2\mathbf w)=2\nabla\loss(\mathbf w), and the gradient points along w\mathbf w
  2. The gradient is zero everywhere, since the loss does not change along rays
  3. ∇L(2w)=∇L(w)\nabla\loss(2\mathbf w)=\nabla\loss(\mathbf w), since the function is the same
  4. ∇L(2w)=∇L(w)/2\nabla\loss(2\mathbf w)=\nabla\loss(\mathbf w)/2, and the gradient is orthogonal to w\mathbf w
Show the answer

D. ∇L(2w)=∇L(w)/2\nabla\loss(2\mathbf w)=\nabla\loss(\mathbf w)/2, and the gradient is orthogonal to w\mathbf w

Differentiating L(cw)=L(w)\loss(c\mathbf w)=\loss(\mathbf w) in cc gives ⟨∇L,w⟩=0\langle\nabla\loss,\mathbf w\rangle=0, and in w\mathbf w gives c∇L(cw)=∇L(w)c\nabla\loss(c\mathbf w)=\nabla\loss(\mathbf w). Gradient steps are tangent to spheres, and they shrink as the radius grows.

Question 2

In rotational equilibrium under SGD with weight decay, what sets the angle a normalized weight vector turns per step?

  1. The product ηλ\eta\lambda alone, giving about 2ηλ\sqrt{2\eta\lambda} for every such vector
  2. Its gradient norm: neurons with larger gradients turn faster
  3. Nothing: the norm is constant in equilibrium, so the vector stops moving
  4. The learning rate alone, giving about η\eta radians
Show the answer

A. The product ηλ\eta\lambda alone, giving about 2ηλ\sqrt{2\eta\lambda} for every such vector

The equilibrium norm satisfies ∥w∗∥4≈ηG/(2λ)\norm{\mathbf w^*}^4\approx\eta G/(2\lambda), and the angle ηG/∥w∗∥2\eta\sqrt G/\norm{\mathbf w^*}^2 then equals 2ηλ\sqrt{2\eta\lambda}: the gradient scale GG cancels.

Question 3

For a loss that is scale-invariant in all trained weights, SGD with weight decay λ\lambda is exactly equivalent to which procedure?

  1. SGD without decay and a learning rate that decays like 1/t1/t
  2. SGD on the loss plus λ2∥w∥2\frac\lambda2\norm{\mathbf w}^2 with learning rate η/(1+λ)\eta/(1+\lambda)
  3. SGD without decay and a learning rate multiplied by about e2ηλe^{2\eta\lambda} every step
  4. Projected SGD on the unit sphere with a constant learning rate
Show the answer

C. SGD without decay and a learning rate multiplied by about e2ηλe^{2\eta\lambda} every step

Rescaling w~t=wt/(1−ηλ)t\tilde{\mathbf w}_t=\mathbf w_t/(1-\eta\lambda)^t and using ∇L(cw)=∇L(w)/c\nabla\loss(c\mathbf w)=\nabla\loss(\mathbf w)/c gives SGD without decay at learning rate η(1−ηλ)−(2t+1)\eta(1-\eta\lambda)^{-(2t+1)}, growing by (1−ηλ)−2≈e2ηλ(1-\eta\lambda)^{-2}\approx e^{2\eta\lambda} per step; both runs pass through the same directions (Li & Arora, 2020).

Question 4

In single-pass language-model pretraining, what did D'Angelo et al. (2024) find weight decay mainly does?

  1. It closes a large gap between training and validation loss
  2. It lowers the final training loss when combined with a decaying learning rate, and keeps bfloat16 training stable at higher learning rates
  3. It makes the model sparser, so inference is cheaper
  4. Nothing measurable; it is kept only for historical reasons
Show the answer

B. It lowers the final training loss when combined with a decaying learning rate, and keeps bfloat16 training stable at higher learning rates

With one pass there is little generalization gap. Decay changes the optimization instead: a higher effective learning rate that pays off once the learning rate decays, and protection against late loss divergences in bfloat16.

Further reading

  • I. Loshchilov & F. Hutter, "Decoupled weight decay regularization," ICLR (2019).
  • T. van Laarhoven, "L2 regularization versus batch and weight normalization," arXiv:1706.05350 (2017).
  • Z. Li & S. Arora, "An exponential learning rate schedule for deep learning," ICLR (2020).
  • A. Kosson, B. Messmer & M. Jaggi, "Rotational equilibrium: how weight decay balances learning across neural networks," ICML (2024).
  • F. D'Angelo, M. Andriushchenko, A. Varre & N. Flammarion, "Why do we need weight decay in modern deep learning?," NeurIPS (2024).
  • G. Zhang, C. Wang, B. Xu & R. Grosse, "Three mechanisms of weight decay regularization," ICLR (2019).