Regularization

Regularization constrains a model or training process to reduce overfitting and improve generalization.

A common regularized objective is:

Here is a penalty term and controls its strength.

Common Forms

  • L1 or L2 penalties on parameters.
  • Early stopping based on validation performance.
  • Data augmentation.
  • Dropout or noise injection.
  • Architectural constraints such as locality or equivariance.

L2 regularization uses:

L1 regularization uses:

In gradient descent, an L2 penalty adds a shrinkage term:

where is the learning rate.

Why It Matters

More capacity is not automatically better. Regularization makes the learned function less dependent on accidental patterns in the training data.

Regularization as Inductive Bias

Regularization is not only a penalty term. It encodes a preference over solutions.

RegularizerPreference
L2 penalty / weight decaysmaller parameter norms
L1 penaltysparse parameters
dropoutrobustness to missing activations
data augmentationinvariance to transformations
early stoppingsimpler solution reached earlier in training
architecture constraintlocality, permutation symmetry, equivariance, bottleneck

This means the regularizer should match what you believe about the task. A mismatched regularizer can improve validation loss by exploiting dataset artifacts rather than the intended structure.

Explicit and Implicit Regularization

TypeExampleNote
explicitpenalty term, dropout, augmentationvisible in objective or data pipeline
implicitoptimizer, batch size, initialization, early stoppingaffects solution even without explicit penalty
architecturalconvolution, parameter sharing, equivarianceconstrains function class
evaluation-drivenmodel selection by validationcontrols complexity through selection

For example, stochastic gradient methods can prefer some solutions over others even when the written objective is unchanged.

Regularization Path

Varying gives a regularization path:

Useful plots compare training and validation performance as changes. If both are poor, the issue may be underfitting or feature/objective mismatch rather than insufficient regularization.

Model Selection

Regularization strength is a hyperparameter. It should be selected on validation data:

The test set should only be used after this choice is fixed.

Checks

  • Is regularization reducing validation error, not only training loss?
  • Was the regularization strength selected without using test labels?
  • Does the regularizer match the intended inductive bias?
  • Is the method preventing overfit, or hiding leakage in the evaluation protocol?
  • Is the regularizer explicit, implicit, architectural, or selection-based?
  • Does stronger regularization improve calibration or only one target metric?