Overfitting: low training loss but high validation loss; the model fits noise (the high-variance side of bias-variance).

Remedies: more data, early stopping, dropout, and a penalty on the weights:

From a Bayesian view (bayes-theorem), L2 equals a Gaussian prior on the weights and L1 a Laplace prior; the penalised solution is the MAP estimate.

The penalty is added to the loss before gradient-descent.