flowchart TD
R["Regularization techniques"]
R --> P["Constrain the parameters"]
R --> D["Constrain the function via the data"]
R --> O["Constrain the output distribution"]
R --> A["Constrain the architecture during training"]
P --> P1["Weight decay"]
P --> P2["Early stopping"]
D --> D1["Data augmentation"]
D --> D2["Mixup and CutMix"]
O --> O1["Label smoothing"]
A --> A1["Stochastic depth"]
210 Other Regularization Techniques for Neural Networks
Regularization is the collection of strategies that reduce the gap between training error and test error, trading a small increase in bias for a large reduction in variance. Dropout and explicit parameter norm penalties are covered in their own chapters. This chapter treats the complementary techniques that practitioners reach for most often in modern deep learning: weight decay, early stopping, label smoothing, data augmentation viewed as a regularizer, mixup, and stochastic depth. Each method either constrains the hypothesis class or injects structured noise into the optimization, and each admits a precise mathematical characterization that explains when and why it helps.
It is useful to fix a definition before the catalog. Let \(\mathcal{H}\) be a hypothesis class, \(\hat{\mathcal{R}}(f)\) the empirical risk on the training set, and \(\mathcal{R}(f)\) the population risk. A regularizer is any modification of the training procedure, whether a change to the objective, the data distribution, the architecture, or the stopping rule, whose purpose is to reduce \(\mathcal{R}(f) - \hat{\mathcal{R}}(f)\), the generalization gap, even at the cost of raising \(\hat{\mathcal{R}}(f)\) itself. The bias variance decomposition makes the trade explicit: for squared loss the expected error of an estimator factors as \(\text{bias}^2 + \text{variance} + \text{irreducible noise}\), and every technique below moves probability mass from the variance term into the bias term.
A convenient way to organize the six techniques is by the object each one constrains.
210.1 1. Weight Decay
Weight decay shrinks parameters toward the origin at every update. In its classical form the update rule for parameter vector \(\theta\) with learning rate \(\eta\) is
\[ \theta_{t+1} = (1 - \eta \lambda)\, \theta_t - \eta\, \nabla_\theta \mathcal{L}(\theta_t), \]
where \(\lambda > 0\) is the decay coefficient. The multiplicative factor \((1 - \eta \lambda)\) pulls each weight a fixed fraction toward zero before the gradient step is applied.
210.1.1 1.1 Relationship to L2 Regularization
For plain stochastic gradient descent, weight decay is algebraically identical to adding an \(L_2\) penalty to the loss. Consider the penalized objective
\[ \tilde{\mathcal{L}}(\theta) = \mathcal{L}(\theta) + \frac{\lambda}{2} \lVert \theta \rVert_2^2 . \]
Its gradient is \(\nabla \mathcal{L}(\theta) + \lambda \theta\), so a gradient step yields \(\theta_{t+1} = \theta_t - \eta(\nabla \mathcal{L} + \lambda \theta_t) = (1 - \eta\lambda)\theta_t - \eta \nabla \mathcal{L}\), recovering the decay rule.
The equivalence breaks for adaptive optimizers such as Adam. Adam preconditions the gradient by an estimate \(\hat{v}_t\) of the per coordinate second moment, applying the step \(\eta\, \hat{m}_t / (\sqrt{\hat{v}_t} + \varepsilon)\). If the penalty \(\lambda \theta\) is folded into the loss gradient, then the shrinkage term is divided by \(\sqrt{\hat{v}_t}\) as well, so coordinates with large historical gradient magnitude are decayed less than coordinates with small magnitude. This couples the regularization strength to the optimizer state in a way that no one intends. The decoupled variant AdamW restores the intended behavior by applying the shrinkage directly to the weights, outside the adaptive preconditioner:
\[ \theta_{t+1} = (1 - \eta \lambda)\, \theta_t - \eta\, \frac{\hat{m}_t}{\sqrt{\hat{v}_t} + \varepsilon}. \]
Here the decay is a clean fraction of each weight, independent of the gradient history, which is why AdamW is the default in essentially every modern transformer training recipe. The mature open source frameworks PyTorch and the Optax library for JAX both expose AdamW directly.
210.1.2 1.2 Effect on the Loss Landscape
A quadratic approximation of the loss around a minimum \(\theta^\ast\) gives a Hessian \(H\) with eigendecomposition \(H = Q \Lambda Q^\top\). Writing the penalized objective in this basis and solving for its stationary point, the penalized minimizer \(\tilde{\theta}\) relates to the unpenalized one by
\[ \tilde{\theta}^{(i)} = \frac{\Lambda_i}{\Lambda_i + \lambda}\, \theta^{\ast (i)}, \]
so each eigendirection is rescaled by the factor \(\Lambda_i / (\Lambda_i + \lambda)\). Directions with small curvature \(\Lambda_i \ll \lambda\) are strongly contracted toward zero, while high curvature directions with \(\Lambda_i \gg \lambda\) are nearly untouched. Weight decay therefore preferentially suppresses parameter components that the data does not constrain, since flat directions of the loss are exactly the directions the data leaves undetermined. This is a soft, continuous form of dimensionality reduction: rather than discarding directions outright, it interpolates each one between full retention and full suppression according to how strongly the data pins it down.
A practical subtlety is that weight decay interacts with normalization layers. When a layer is followed by batch or layer normalization, the scale of its weights is divided out, so shrinking those weights changes only the effective learning rate and not the represented function. Many recipes therefore exclude normalization parameters and biases from the decay.
210.2 2. Early Stopping
Early stopping halts training when performance on a held out validation set stops improving. A patience parameter \(p\) specifies how many evaluations may pass without improvement before training terminates, and the parameters from the best validation checkpoint are restored.
210.2.1 2.1 Early Stopping as Implicit Regularization
For a quadratic loss optimized by gradient descent starting from \(\theta_0 = 0\), the iterate after \(t\) steps along eigendirection \(i\) is
\[ \theta_t^{(i)} = \left(1 - (1 - \eta \Lambda_i)^t\right) \theta^{\ast (i)} . \]
High curvature directions converge quickly, low curvature directions slowly. Stopping at finite \(t\) leaves the slow directions only partially fit. The shrinkage factor \(1 - (1 - \eta \Lambda_i)^t\) approximates the \(L_2\) factor \(\Lambda_i / (\Lambda_i + \lambda)\) from the previous section. To see the correspondence, expand for small step sizes: \((1 - \eta \Lambda_i)^t \approx e^{-\eta \Lambda_i t}\), and a first order expansion of \(1 - e^{-\eta \Lambda_i t}\) against \(\Lambda_i / (\Lambda_i + \lambda)\) matches when
\[ \lambda \approx \frac{1}{\eta t}. \]
Training for fewer iterations is thus quantitatively similar to imposing a stronger weight decay penalty, which is why early stopping is sometimes called a regularizer that costs nothing extra to evaluate. The result is classical and is developed in detail in Goodfellow, Bengio, and Courville, Chapter 7.
A small worked example makes the equivalence concrete. Take \(\eta = 0.1\) and a direction with curvature \(\Lambda_i = 0.01\). After \(t = 100\) steps the early stopping shrinkage factor is \(1 - (1 - 0.001)^{100} \approx 1 - 0.905 = 0.095\), so this slow direction is fit to less than ten percent of its converged value. The matched penalty is \(\lambda \approx 1 / (0.1 \times 100) = 0.1\), and the corresponding weight decay factor \(\Lambda_i / (\Lambda_i + \lambda) = 0.01 / 0.11 \approx 0.091\) agrees closely. A high curvature direction with \(\Lambda_i = 1\) reaches a factor of essentially \(1\) under both rules, confirming that both methods spare the well determined directions and shrink the poorly determined ones.
210.2.2 2.2 Practical Considerations
Early stopping consumes data because the validation split cannot also serve as training data, though a final retraining pass on the union of train and validation sets can recover that budget. The chief advantage is that a single training run sweeps the effective regularization strength along the optimization trajectory, so the practitioner obtains the entire regularization path for free rather than running a separate experiment per value of \(\lambda\). Pitfalls to watch for are a noisy validation curve, which argues for a larger patience or a smoothed criterion, and a validation set too small to estimate generalization reliably, which makes the stopping point itself high variance.
210.3 3. Label Smoothing
Hard one hot targets push the network to drive the correct logit toward \(+\infty\) relative to the others, encouraging overconfident and poorly calibrated predictions. Label smoothing softens the target distribution. For \(K\) classes and smoothing strength \(\epsilon\), the target for the true class \(y\) becomes
\[ q_k = (1 - \epsilon)\,\mathbb{1}[k = y] + \frac{\epsilon}{K}, \]
so a small probability mass \(\epsilon / K\) is assigned to every class and the true class receives \(1 - \epsilon + \epsilon/K\).
210.3.1 3.1 Why the Logits Stay Finite
The smoothed cross entropy is \(-\sum_k q_k \log p_k\), where \(p_k\) is the softmax of logit \(z_k\). Differentiating with respect to \(z_k\) gives the gradient \(p_k - q_k\), which vanishes only at the stationary point \(p_k = q_k\) for every \(k\). Because \(q_k\) is strictly positive for all classes, the network is required to assign a finite, nonzero probability to every wrong class, so the optimum is reached at finite logits. Solving \(p_k = q_k\) for the logit gap between the true class and any other class \(j\) yields
\[ z_y - z_j = \log \frac{q_y}{q_j} = \log \frac{(1 - \epsilon) + \epsilon/K}{\epsilon / K}, \]
a finite constant set entirely by \(\epsilon\) and \(K\). Contrast this with hard labels, where \(q_j = 0\) forces \(z_y - z_j \to \infty\). The bounded optimal gap is the mechanism behind the empirical observation that label smoothing improves calibration: the model’s predicted confidences align more closely with observed accuracies, and the expected calibration error, the average mismatch between confidence and accuracy across confidence bins, drops.
210.3.2 3.2 Representation Geometry
Smoothing also reshapes the penultimate layer. With hard labels, examples of a class can spread arbitrarily far along the direction of their class weight vector. Smoothing encourages examples of the same class to cluster in tight groups that sit at roughly equal distances from the templates of all other classes, producing more compact within class representations. A documented caveat is that this tighter clustering erases fine grained relational information between classes. That information is exactly what a teacher transfers in knowledge distillation, so a label smoothed network is a measurably worse teacher even when it is a more accurate classifier. Use label smoothing freely for a deployed classifier, but turn it off when training a network whose soft outputs will supervise a student.
210.4 4. Data Augmentation as Regularization
Data augmentation enlarges the effective training set by applying label preserving transformations \(g \in \mathcal{G}\) to inputs. For images these include random crops, horizontal flips, color jitter, rotations, and learned policies such as RandAugment.
210.4.1 4.1 Vicinal Risk and Invariance
Augmentation can be framed through the vicinal risk minimization principle. Rather than minimizing empirical risk over the raw points, one minimizes risk over a vicinity distribution \(\nu\) around each training example,
\[ \mathcal{R}_{\nu}(f) = \frac{1}{N} \sum_{i=1}^{N} \mathbb{E}_{\tilde{x} \sim \nu(\cdot \mid x_i)}\,\ell\big(f(\tilde{x}), y_i\big). \]
When the vicinity is generated by transformations \(g\) that humans regard as label preserving, the objective implicitly penalizes the sensitivity of \(f\) to those transformations. In the small noise limit this is equivalent to a Tikhonov penalty on the Jacobian of \(f\) in the directions spanned by \(\mathcal{G}\). Concretely, if a transformation perturbs the input by a small vector \(\delta\) drawn from a distribution with covariance \(\Sigma\), a second order expansion of the loss around \(x_i\) adds a term proportional to \(\operatorname{tr}\!\big(\Sigma\, J^\top H_\ell J\big)\), where \(J\) is the Jacobian of \(f\) at \(x_i\) and \(H_\ell\) is the loss Hessian in output space. The augmentation thus encodes the desired invariances directly into the learned function rather than into the parameters, which is what distinguishes it from a norm penalty.
210.4.2 4.2 Practical Notes
Augmentation strength must match dataset size and model capacity. Aggressive policies help large models on small datasets but can underfit when overused, and transformations must respect task semantics. A vertical flip destroys the label of a handwritten digit while preserving that of an overhead satellite scene, so the admissible group \(\mathcal{G}\) is a property of the task and not a universal default. The widely used open source library Albumentations, and the transform modules built into PyTorch and TensorFlow, implement these policies.
210.5 5. Mixup
Mixup is a vicinal method that constructs synthetic training examples from convex combinations of pairs. Given two examples \((x_i, y_i)\) and \((x_j, y_j)\) with one hot labels, it forms
\[ \tilde{x} = \lambda x_i + (1 - \lambda) x_j, \qquad \tilde{y} = \lambda y_i + (1 - \lambda) y_j, \]
with \(\lambda \sim \mathrm{Beta}(\alpha, \alpha)\) for a hyperparameter \(\alpha > 0\). As \(\alpha \to 0\) the Beta distribution concentrates at \(0\) and \(1\), recovering ordinary training on unmixed examples, while \(\alpha = 1\) gives a uniform mixing coefficient. Training proceeds on the interpolated pairs.
210.5.1 5.1 Why Mixup Regularizes
By training on points between examples, mixup enforces that the model behave approximately linearly in the space between training samples. This linear interpolation prior reduces oscillation outside the training distribution and yields smoother decision boundaries. A first order analysis shows that mixup is approximately equivalent to a data dependent regularizer that penalizes the curvature of the model output along the segments connecting training points and shrinks the model’s confidence away from the data manifold, which improves both generalization and robustness to corrupted inputs and adversarial perturbations. The practical implementation is a few lines: draw a mixing weight, blend a shuffled batch with itself, and blend the two loss terms by the same weight.
import numpy as np
def mixup_batch(x, y, alpha=0.2):
# x: (batch, ...) inputs, y: (batch, K) one-hot labels
lam = np.random.beta(alpha, alpha)
perm = np.random.permutation(len(x))
x_mix = lam * x + (1 - lam) * x[perm]
y_mix = lam * y + (1 - lam) * y[perm]
return x_mix, y_mix210.5.2 5.2 Variants and Calibration
CutMix replaces the pixel level blend with a spatial paste, cutting a rectangular patch from one image into another and mixing the labels in proportion to the patch area, which preserves local image statistics that pixel blending destroys. Manifold mixup applies the interpolation at a randomly chosen hidden layer rather than the input, smoothing representations deeper in the network. Mixup trained models are also notably better calibrated than their hard label counterparts, complementing the calibration benefits of label smoothing. A pitfall is that mixup is most natural for classification with the convex loss above; for tasks where linear interpolation of targets is not meaningful, such as some structured prediction problems, the input space variants like CutMix tend to transfer more readily than the label space blend.
210.6 6. Stochastic Depth
Stochastic depth regularizes very deep residual networks by randomly dropping entire residual blocks during training. A network with residual blocks \(f_\ell\) computes \(h_\ell = h_{\ell-1} + f_\ell(h_{\ell-1})\) in the standard case. Under stochastic depth a Bernoulli gate \(b_\ell \sim \mathrm{Bernoulli}(p_\ell)\) multiplies each block,
\[ h_\ell = h_{\ell-1} + b_\ell\, f_\ell(h_{\ell-1}), \]
so when \(b_\ell = 0\) the block is skipped and the signal passes through the identity branch unchanged.
210.6.1 6.1 Survival Schedule and Test Time Behavior
The survival probability \(p_\ell\) is typically annealed linearly with depth, \(p_\ell = 1 - \frac{\ell}{L}(1 - p_L)\), so shallow blocks survive almost always and deep blocks are dropped most often. The expected depth of the trained network is \(\sum_\ell p_\ell\), substantially less than the nominal depth \(L\), which shortens gradient paths and speeds training. At test time all blocks are retained and each output is scaled by its survival probability,
\[ h_\ell = h_{\ell-1} + p_\ell\, f_\ell(h_{\ell-1}), \]
so that the expected contribution under training, \(\mathbb{E}[b_\ell] f_\ell = p_\ell f_\ell\), matches the deterministic quantity used at inference. This is the same expectation matching device that the inverted form of dropout uses to reconcile training and test behavior.
210.6.2 6.2 Ensemble Interpretation
Because each training step samples a random subset of active blocks, stochastic depth trains an implicit ensemble of networks of varying depths that share weights, analogous to the way dropout trains an ensemble of subnetworks. A network of \(L\) blocks induces up to \(2^L\) distinct depth configurations, and the trained weights must perform well in expectation over this family. The shorter effective paths also mitigate vanishing gradients, since the identity branch provides a direct route for the error signal, which is why stochastic depth enabled the training of residual networks beyond a thousand layers. The same block dropping mechanism, applied to transformer layers and usually called drop path, remains a standard ingredient in modern vision transformers.
210.7 7. Choosing and Combining Techniques
These methods are largely complementary and are routinely stacked. A typical image classification recipe combines decoupled weight decay, RandAugment, mixup or CutMix, label smoothing, and stochastic depth simultaneously, with early stopping as a safety net. The guiding principle is the taxonomy at the start of this chapter: weight decay and early stopping constrain the parameters, augmentation and mixup constrain the function through the data, label smoothing constrains the output distribution, and stochastic depth constrains the architecture during optimization. Because each acts on a different facet of the model, their regularization effects tend to add rather than conflict.
The following table summarizes when each technique is the natural first choice and the main pitfall to anticipate.
| Technique | Constrains | Reach for it when | Main pitfall |
|---|---|---|---|
| Weight decay (AdamW) | Parameters | Almost always; a baseline regularizer | Do not route through the adaptive preconditioner; exclude norm and bias parameters |
| Early stopping | Optimization trajectory | You want the regularization path from one run | Noisy or small validation set makes the stop point high variance |
| Label smoothing | Output distribution | Calibration matters for a deployed classifier | Hurts a network used as a distillation teacher |
| Data augmentation | Function via data | You know label preserving transforms for the task | Transforms that violate task semantics flip labels |
| Mixup and CutMix | Function via data | Classification; want smoother boundaries and calibration | Label blending is not meaningful for some structured tasks |
| Stochastic depth | Architecture | Very deep residual or transformer stacks | Schedule must be tuned; remember test time scaling |
The closing caution is that strengths should be tuned jointly. Each technique individually trades variance for bias, and applying several aggressively at once can tip a model from overfitting into underfitting, where both training and test error rise together. The remedy is to introduce them incrementally and to monitor the training to validation gap rather than either curve alone.
210.8 References
- Loshchilov, I., and Hutter, F. Decoupled Weight Decay Regularization. ICLR 2019. https://arxiv.org/abs/1711.05101
- Goodfellow, I., Bengio, Y., and Courville, A. Deep Learning, Chapter 7: Regularization for Deep Learning. MIT Press, 2016. https://www.deeplearningbook.org/contents/regularization.html
- Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z. Rethinking the Inception Architecture for Computer Vision. CVPR 2016. https://doi.org/10.1109/CVPR.2016.308
- Mueller, R., Kornblith, S., and Hinton, G. When Does Label Smoothing Help? NeurIPS 2019. https://arxiv.org/abs/1906.02629
- Zhang, H., Cisse, M., Dauphin, Y., and Lopez-Paz, D. mixup: Beyond Empirical Risk Minimization. ICLR 2018. https://arxiv.org/abs/1710.09412
- Yun, S., Han, D., Oh, S., Chun, S., Choe, J., and Yoo, Y. CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features. ICCV 2019. https://doi.org/10.1109/ICCV.2019.00612
- Huang, G., Sun, Y., Liu, Z., Sedra, D., and Weinberger, K. Deep Networks with Stochastic Depth. ECCV 2016. https://doi.org/10.1007/978-3-319-46493-0_39
- Cubuk, E., Zoph, B., Shlens, J., and Le, Q. RandAugment: Practical Automated Data Augmentation with a Reduced Search Space. CVPRW 2020. https://doi.org/10.1109/CVPRW50498.2020.00359
- Verma, V., Lamb, A., Beckham, C., et al. Manifold Mixup: Better Representations by Interpolating Hidden States. ICML 2019. https://arxiv.org/abs/1806.05236
- Chapelle, O., Weston, J., Bottou, L., and Vapnik, V. Vicinal Risk Minimization. NeurIPS 2000. https://papers.nips.cc/paper/1876-vicinal-risk-minimization