Second Order Derivatives for Network Pruning: Optimal Brain Surgeon

Babak Hassibi, David G. StorkNeurIPS 1992

TL;DR

Optimal Brain Surgeon (OBS) is a sophisticated pruning technique that uses the full Hessian matrix to identify and remove redundant weights while simultaneously adjusting the remaining ones. By accounting for weight correlations that simpler methods ignore, OBS achieves massive reductions in network size (up to 90%) and improves generalization without requiring the typical "prune-and-retrain" cycle.

What Problem Does This Paper Address?

In the early 90s, neural networks faced a "Goldilocks" problem: too many weights led to overfitting (learning noise instead of signal), while too few prevented the network from learning at all. To improve generalization and efficiency, researchers used "pruning" to remove unnecessary connections.

However, existing methods were flawed. Magnitude-based pruning naively assumed small weights were unimportant, but even small weights can be critical for maintaining low error. Optimal Brain Damage (OBD), the state-of-the-art at the time, used second-order information (the Hessian matrix) but assumed the matrix was diagonal to save on computation. Hassibi and Stork argue that this "diagonal assumption" is almost always wrong in practice—weights are highly correlated—leading OBD to "amputate" the wrong parts of the network.

Error surface comparing Magnitude, OBD, and OBS pruning trajectories.

Methods

The authors introduce Optimal Brain Surgeon (OBS), which utilizes the full, non-diagonal Hessian matrix ($H$) of the error function to make smarter pruning decisions.

  1. The Math: They model the change in error using a Taylor series expansion. Since a trained network is at a local minimum, the first-order (gradient) term is zero. OBS then solves a constrained optimization problem: find the weight change that sets one weight to zero while minimizing the increase in total error.
  2. The "Surgeon" Adjustment: Unlike other methods that just delete a weight and leave the rest alone, OBS uses the inverse Hessian ($H^{-1}$) to calculate how all other weights should be adjusted to compensate for the missing connection.
  3. Computational Efficiency: Inverting a massive Hessian is usually computationally intractable. The authors solve this by using a recursive formula (based on the Matrix Inversion Lemma) to compute $H^{-1}$ directly from training data in a single pass, making the process feasible for larger networks.

Datasets

The paper evaluates OBS on three distinct types of problems:

  • XOR: A classic non-linear toy problem used to demonstrate that OBS picks the logically "correct" weights to delete where other methods fail.
  • MONK’s Problems: Three benchmark problems from a 1991 machine learning competition. These are used to show how OBS can simplify a network enough to extract human-readable logical rules.
  • NETtalk: A real-world scale speech synthesis task. The authors compare their results against the famous 18,000-weight network developed by Sejnowski and Rosenberg.

Key Insights and Ideas

  • The Diagonal Myth: The most striking insight is that the Hessian matrix for neural networks is "strongly non-diagonal." This means weights don't act in isolation; their effects are intertwined. Ignoring these correlations (as OBD does) leads to poor pruning decisions.
Visualization of a non-diagonal Hessian matrix.
  • Pruning as Regularization: By aggressively removing weights, OBS forces the network to keep only the most essential features, which significantly boosts performance on unseen test data (generalization).
  • No Retraining Required: Because OBS "reconstructs" the remaining weights optimally after each cut, the network often maintains zero or near-zero error immediately. This eliminates the slow, iterative retraining process required by magnitude-based methods.
  • Interpretability: The authors show that a pruned network is an "intelligible" network. By reducing the MONK's problem networks to just a handful of weights, the underlying logic of the data becomes visible.

Key Results

  • Massive Compression: On the MONK’s problems, OBS achieved weight reductions of 90%, 76%, and 62% compared to standard backpropagation with weight decay, while maintaining or improving accuracy.
  • Superior Logic: In the XOR task, OBS was the only method that consistently deleted the correct weights to solve the problem in every test case.
  • NETtalk Efficiency: The authors pruned a NETtalk network down to just 1,560 weights (from an initial 5,546). This pruned version actually achieved a lower test error than the original, much larger complex networks, proving that "less is more" for generalization.

Limitations and Future Work

  • Stopping Criteria: The paper notes that OBS itself doesn't provide a definitive rule for when to stop pruning; users must rely on cross-validation or other heuristics to decide when the network has reached its optimal size.
  • Scaling: While the recursive $H^{-1}$ calculation is efficient ($O(n^2)$), it may still be demanding for the gargantuan models of the modern era (though it was a breakthrough for 1993).
  • Generalizations: The authors suggest that the method could be extended to other error measures (like cross-entropy) or used to project weights onto arbitrary planes rather than just setting them to zero.

Summary updated

BibTeX
@inproceedings{hassibi1992second,
  author = {Babak Hassibi and David G. Stork},
  title = {{Second Order Derivatives for Network Pruning: Optimal Brain Surgeon}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {1992},
}
Figure