A Simple Weight Decay Can Improve Generalization

Anders Krogh, John A. HertzNeurIPS 1991

TL;DR

This classic paper provides a theoretical foundation for why weight decay (L2 regularization) improves a neural network's ability to generalize to new data. The authors demonstrate that weight decay acts as a filter that suppresses noise and forces the model to choose the "simplest" possible solution among many mathematically valid options.

What Problem Does This Paper Address?

In the early 90s, researchers knew that neural networks often suffered from overfitting: they could memorize training data perfectly but fail miserably on new, unseen examples. This usually happened when a network was too "complex" (had too many weights) relative to the amount of information in the training set.

While "weight decay"—adding a penalty for large weights to the cost function—was a known heuristic to combat this, the underlying mechanics weren't fully understood. Krogh and Hertz set out to explain why this simple trick works, moving beyond trial-and-error to a formal mathematical proof for both linear and non-linear networks.

Methods

The authors approach the problem through the lens of the Linear Perceptron. By analyzing the learning equations in a linear setting, they decompose the weight vector into two parts:

  1. The Pattern Subspace: Components of the weights that actually respond to the training data.
  2. The Orthogonal Subspace: Components that have no effect on the training error (essentially "dead weight" or "noise-fitters").
Theoretical generalization error curves for a linear perceptron.

They introduce a standard weight decay term to the cost function: $$E(w) = E_0(w) + \frac{1}{2}\lambda \sum w_i^2$$ Where $\lambda$ (lambda) controls the strength of the penalty.

The authors then extend this logic to non-linear networks using local linearization. They argue that near a solution, a complex network behaves enough like a linear one that the same principles of weight suppression apply.

Datasets

To move from theory to practice, the authors used the NetTalk dataset.

  • Task: Mapping English text to phonemes (speech sounds).
  • Setup: A network with roughly 8,400 weights (7x26 input units, 40 hidden units, and 26 output units).
  • Training/Testing: They trained on subsets of 400 to 5,000 words and tested on a separate set of 1,000 words to measure generalization.

Key Insights and Ideas

  • Choosing the "Smallest" Solution: In many learning problems, there isn't just one "right" set of weights; there is a "valley" of many different weight configurations that all result in zero training error. Without weight decay, the network might end up anywhere in that valley. Weight decay acts as a tie-breaker, pulling the network toward the solution with the smallest norm—the simplest model.
  • Noise Filtering: When training data is "noisy" (the "unreliable teacher" scenario), a network without weight decay will try to fit that noise. The authors prove that weight decay suppresses the components of the weights that would otherwise be dedicated to mimicking random fluctuations in the targets.
  • The Optimal Lambda: One of the most striking findings is the derivation of an optimal decay constant: $\lambda_{optimal} = \sigma^2 / u^2$. This suggests that the best amount of weight decay depends strictly on the ratio of the noise variance ($\sigma^2$) to the average magnitude of the "true" weights ($u^2$), regardless of the input distribution.

Key Results

  • Theoretical Proof: The paper successfully shows that weight decay improves generalization by suppressing irrelevant weight components and mitigating static noise.
  • Empirical Success: In the NetTalk experiments, the network using weight decay ($\lambda = 0.00008$) showed a "dramatic improvement" in generalization error compared to the network without it.
Generalization error and mistake rate (inset) on the NetTalk dataset.
  • Error Rates: Beyond just reducing squared error, weight decay also improved the actual phoneme mistake rate. As shown in the empirical data, the improvement in "raw error" (main plot) was more pronounced than the improvement in "classification accuracy" or mistake rate (inset plot).

Limitations and Future Work

  • Local Linearization: The analysis for non-linear networks (like those with hidden layers) relies on the assumption that the network is operating in a "little neighborhood" where it behaves linearly. This might not hold true during the early, chaotic phases of training.
  • Realizability: The theory assumes a "teacher" exists—meaning there is a perfect set of weights $u$ that can solve the problem. In the real world, the underlying function might be more complex than the network can ever represent (an "unrealizable" function).
  • Simple Weight Decay: The paper focuses on a uniform penalty for all weights. The authors acknowledge there are infinitely many ways to penalize weights, leaving the door open for more complex regularization schemes.

Summary updated

BibTeX
@inproceedings{krogh1991simple,
  author = {Anders Krogh and John A. Hertz},
  title = {{A Simple Weight Decay Can Improve Generalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {1991},
}
Figure