L2 Regularization

L2 regularization adds a penalty based on squared model weights and discourages overly large parameter values.
Also known as
weight decay, ridge regularization

Intuition

L2 makes the model spread influence more smoothly instead of relying on extreme weights.

Technical definition

L2 regularization adds a term proportional to the squared Euclidean norm of parameters to the objective.

Example

Weight decay in neural network training is a common L2-style constraint.

Common misunderstandings

  • Weight decay and L2 regularization are closely related but can differ depending on the optimizer.
  • L2 usually shrinks weights rather than making many of them exactly zero.

Need this inside a product?

The studio builds the systems these terms describe. Tell us what you are working on.