TL;DR
Weight decay is usually viewed as a static Bayesian Gaussian prior, but its practical benefits actually stem from how it changes training dynamics: it speeds up convergence in flat directions while introducing an asymptotic bias. By analyzing these dynamics, the authors introduce a weight-decay linear scaling rule for large-batch training and Stable Weight Decay (SWD), an adaptive, learning-rate-aware scheduler that closes the generalization gap between Adam and SGD on standard vision benchmarks.
What Problem Does This Paper Address?
Despite its ubiquity, weight decay behaves in ways the traditional Bayesian perspective cannot explain. For instance, if networks are trained for long enough, the optimal weight decay approaches zero—contradicting the idea that weight decay reflects a fixed prior belief about network weights.
Furthermore, existing implementations have subtle dynamical flaws:
- Instability in AdamW: While AdamW decouples weight decay from gradients, it applies decay using the base learning rate rather than the effective adaptive step size ($\eta / \sqrt{v_t}$). This causes the effective regularized loss landscape to shift over time, rendering stationary points unstable.
- Pitfalls in Large-Batch Training: When scaling batch size $B$ with fixed epochs, the total number of update iterations drops by $k^{-1}$. The classic linear scaling rule (multiplying learning rate by $k$) frequently causes divergence or optimization instability when convergence speed—rather than gradient noise—is the bottleneck.
Methods
The authors analyze gradient descent dynamics under a local quadratic approximation ($L(\theta) \approx L(\theta^*) + \frac{1}{2}(\theta - \theta^*)^T H (\theta - \theta^*)$) and propose two major solutions:
- Weight-Decay Linear Scaling Rule (Rule 2): When batch size is multiplied by $k$ under fixed epoch budgets, multiply the weight decay by $k$ rather than the learning rate. Because the convergence time along flat Hessian directions scales as $\mathcal{O}(\lambda^{-1}\eta^{-1})$, increasing $\lambda$ accelerates convergence without triggering the divergence risks of large learning rates.
-
Stable Weight Decay (SWD / AdamS): To stabilize stationary points while avoiding anisotropic distortion across parameter dimensions, the authors couple weight decay with the mean of the second-moment accumulator $\bar{v}_t = \text{mean}(\hat{v}_t)$: $$\theta_t = \theta_{t-1} - \frac{\eta}{\sqrt{\hat{v}_t} + \epsilon} \hat{m}_t - \frac{\eta}{\bar{v}_t^p} \lambda \theta_{t-1}$$ Setting $p = 0.5$ dynamically tracks the overall magnitude of the adaptive step size isotropically. (Decoupled weight decay in AdamW is the special case where $p = 0$).
-
Momentum SGD with SWD (SGDS): For Stochastic Heavy Ball momentum, SWD applies a scaling factor of $\frac{\beta_3}{1-\beta_1}$ to weight decay to reflect the true effective step size of the momentum buffer.
Datasets
The authors evaluate their methods on standard image classification and language modeling benchmarks:
- CIFAR-10 & CIFAR-100: Evaluated on ResNet18/34, VGG16, DenseNet121, and GoogLeNet.
- ImageNet (ILSVRC): Evaluated on ResNet50.
- Penn TreeBank (PTB): Word-level language modeling using a 2-layer LSTM.
No new datasets or benchmarks were introduced.
Key Insights and Ideas
- The Dual Nature of Weight Decay:
- Stationary point bias: Weight decay displaces the long-term solution away from the true local minimum $\theta^*$ along the $i$-th Hessian eigenvector by $\mu_i = -\lambda(H_i + \lambda)^{-1}\theta^*$. This bias is strictly harmful if convergence is already achieved.
- Convergence acceleration: Because neural network Hessians have many near-zero eigenvalues ($H_i \approx 0$), the convergence time is dominated by $t_{\text{convergence}} \approx \mathcal{O}(\lambda^{-1}\eta^{-1})$. Weight decay acts primarily as an accelerator for flat dimensions.
- Why Element-Wise Decay Fails: Dividing weight decay coordinate-wise by $\sqrt{v_t}$ stabilizes stationary points in theory, but creates severe anisotropic convergence rates across parameters. Using the scalar mean $\bar{v}_t$ preserves stability while preventing dimension-wise divergence.
Key Results
- Closing the Adam–SGD Generalization Gap: On CIFAR-10 and CIFAR-100, AdamS consistently matches or outperforms SGD and state-of-the-art Adam variants:
- ResNet18 on CIFAR-10: AdamS achieves 4.91% test error (and an optimal 4.52%), beating vanilla Adam (6.96%), AdamW (5.08%), and standard SGD (5.01%).
- VGG16 on CIFAR-10: AdamS reaches 6.09% error vs. 6.42% for SGD and 6.59% for AdamW.
- Large-Batch Scaling ($B = 16,384$): On CIFAR-10 with ResNet18 ($128\times$ baseline batch size), scaling the learning rate via Rule 1 caused training failure. Scaling weight decay by $128$ via Rule 2 produced the lowest test error.
- Hyperparameter Robustness: Grid searches across learning rates and decay rates show AdamS exhibits a significantly deeper, wider basin of low test error than Adam and AdamW.
Limitations and Future Work
- Complex Landscapes & Non-Vision Tasks: On ImageNet (ResNet50), AdamS showed only marginal gains over AdamW (24.19% vs. 24.29% Top-1 error). On Penn TreeBank (LSTM), standard $L_2$ regularization outperformed both AdamW and AdamS.
- Time-Varying Scheduling: Because weight decay helps early convergence but harms the final asymptotic minimum via parameter bias, the authors note that ideal future schedulers should decay $\lambda$ dynamically (high in early epochs, low or zero in late training).
Summary updated