Generalization Through the Lens of Leave-One-Out Error

Gregor Bachmann, Thomas Hofmann, Aurelien Lucchi

The Generalization Mystery in Deep Learning

Why do deep neural networks generalize so well to unseen data despite having millions of parameters? This remains one of the biggest open questions in artificial intelligence. Traditional theoretical tools, such as VC dimension or Rademacher complexity, often fail in the deep learning context. They frequently produce "vacuous" bounds, essentially telling us the error is somewhere between 0% and 500%, which offers little practical value.

The Leave-One-Out (LOO) error is a gold standard in statistics for estimating generalization. To calculate it, you train a model $n$ times, each time leaving out exactly one data point to use as a "test" set. While highly accurate, this is computationally impossible for deep learning—training a ResNet-152 on ImageNet 1.2 million times is simply not feasible. This paper addresses the critical need for a tractable, non-vacuous way to estimate and understand generalization in deep models by breathing new life into the LOO error.

Bridging the Gap: The Kernel Regime

The authors bridge the gap between expensive LOO calculations and deep learning by operating in the kernel regime. Recent theoretical advancements have shown that very wide neural networks behave like kernel machines, specifically governed by the Neural Tangent Kernel (NTK).

The key breakthrough leveraged here is a closed-form mathematical expression (originally from Stone, 1974) that allows one to calculate the LOO error using only the results of a single training run on the full dataset. The authors make several crucial technical contributions to adapt this method for modern deep learning:

  1. Multi-class Extension: They extend the traditional LOO formula to handle multi-class classification tasks.
  2. Zero-Regularization Analysis: They derive the behavior of LOO as regularization approaches zero, matching the standard setting for most deep learning training.
  3. LOO Accuracy: While previous work focused primarily on LOO loss, this paper derives a formula for LOO accuracy, providing a metric that is far more relevant to practitioners.

Key Insights and Empirical Results

The authors validated their theoretical findings using standard computer vision benchmarks, including MNIST, CIFAR-10, and ImageNet (for transfer learning).

1. LOO as a Precise Proxy

Unlike loose theoretical bounds, the LOO error tracks the actual test error almost perfectly across different sample sizes and noise levels. In experiments on MNIST and CIFAR-10, the LOO loss and accuracy curves were nearly indistinguishable from the actual test curves.

Comparison of Test and LOO Loss/Accuracy on MNIST and CIFAR-10.

2. Explaining the "Double Descent" Spike

One of the most famous quirks of deep learning is Double Descent, where error suddenly spikes when the number of parameters roughly equals the number of data points (the interpolation threshold). The authors mathematically prove that at the interpolation point, the LOO error diverges (goes to infinity). This matches the empirical "spike" observed in real-world training, providing a rigorous new lens to study why this phenomenon occurs.

3. Predicting Transferability

The LOO formula can accurately predict how well a pre-trained model will perform on a new task without needing a separate validation set. For example, for a ResNet-18 pre-trained on ImageNet and transferred to CIFAR-10, the actual test accuracy was $67.2\% \pm 0.1$, while the LOO estimate was $67.5\% \pm 0.4$. This level of precision is virtually unheard of in traditional generalization theory and has immediate practical utility for model selection.

4. Robustness to Label Noise

The paper demonstrates that LOO correctly reflects the drop in generalization when training labels are randomized. This is a notorious scenario where many other theoretical bounds fail to capture the degradation in model performance.

Limitations and Future Work

The primary limitation of this approach is its reliance on the kernel regime. While the NTK is a powerful theoretical tool, it describes networks that are infinitely wide and do not undergo significant "feature learning" (where internal representations change drastically during training). Standard, finite-width networks used in production may deviate from this behavior.

Future research directions could include:

  • Extending these LOO formulas to models that move beyond the kernel regime to account for active feature learning.
  • Developing more computationally efficient ways to handle the $O(n^2)$ cost of the kernel matrix, making the method viable for truly massive datasets.
  • Using the LOO formula directly as a training objective to explicitly optimize for generalization.

Summary updated

BibTeX
@inproceedings{bachmann2022generalization,
  author = {Gregor Bachmann and Thomas Hofmann and Aurelien Lucchi},
  title = {{Generalization Through the Lens of Leave-One-Out Error}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=7grkzyj89A_},
}
Figure