Class-wise Generalization Error: an Information-Theoretic Analysis

Firas Laakom, Yuheng Bu, Moncef Gabbouj · DOI

TL;DR

Most machine learning theories tell us how well a model generalizes on average, but they ignore the fact that a model might master "trucks" while failing miserably on "cats." This paper introduces the first rigorous information-theoretic framework to quantify class-wise generalization error, providing practical, easy-to-estimate bounds that reveal why some classes are harder for neural networks to learn than others.

The Challenge of Class-Specific Generalization

In machine learning, "generalization error" is the gap between how a model performs on its training data versus how it performs on new, unseen data. Traditionally, researchers look at this as a single number—a holistic average across the entire dataset.

However, neural networks do not generalize equally for all classes. For example, on the CIFAR10 dataset, a ResNet50 might have a generalization gap for "cats" that is four times larger than the gap for "trucks." When even a tiny amount of label noise (5%) is introduced, these disparities explode, with some classes generalizing eight times worse than others.

Existing theories, such as VC dimension or standard mutual information bounds, are "class-blind." They cannot explain why a model overfits on one category while generalizing perfectly on another. This research fills that gap by developing a mathematical toolkit to analyze generalization at the individual class level.

Figure 1: Observed class-wise generalization error disparities on CIFAR10, showing how "cats" generalize significantly worse than "trucks" or "airplanes," and how existing bounds (Harutyunyan et al.) fail to capture this granularity.

An Information-Theoretic Framework

The authors leverage Information Theory to build their bounds, linking generalization error to how much information a model "memorizes" about specific training samples.

  1. KL Divergence Bounds: The theory begins with Kullback–Leibler (KL) divergence between the joint distribution of weights and data. While theoretically sound, this is difficult to calculate for modern networks with millions of weights ($W$).
  2. Conditional Mutual Information (CMI): To make the theory practical, they adopt a "super-sample" framework. Instead of weights, they analyze Conditional Mutual Information, measuring how much the model's output reveals about whether a specific sample was used for training or testing.
  3. The $\Delta_y L$-CMI Bound: This is the paper's primary contribution. It is a bound based on the difference in loss values between pairs of samples. It is computationally efficient, requires no access to model weights, and is significantly tighter (more accurate) than previous methods.

Empirical Validation and Key Results

The researchers validated their theoretical bounds using CIFAR10 (standard and noisy) and Binary MNIST. The proposed $\Delta_y L$-CMI bound demonstrates a remarkably strong linear correlation with the actual observed class-wise generalization error. If the bound increases, the error increases proportionally.

Figure 6: The strong linear correlation between the proposed Class-ΔLy-CMI bound and the actual class-generalization error across different training set sizes (n).

Beyond simple correlation, the bounds successfully predicted complex, counter-intuitive behaviors. For instance, in the presence of noise, the "trucks" class actually generalized worse as more training data was added—a result that standard average-case theories would miss entirely.

Broader Implications: Noise and Fairness

  • The Memorization Connection: High class-wise generalization error is a direct symptom of the model memorizing training samples of a specific class rather than learning underlying patterns.
  • Noise Sensitivity: Even low levels of noise radically change which classes a model finds "easy" or "hard," rather than just lowering average accuracy.
  • Algorithmic Fairness: The authors demonstrated that their "class-wise" math can be adapted to handle fairness. By replacing "class" with a "sensitive attribute" (like gender or skin tone), they derived new bounds for attribute-generalization error, providing a mathematical way to certify if a model is biased in its ability to generalize across different populations.

Future Directions

While this paper provides a robust foundation for standard supervised learning, the authors suggest extending these class-wise analyses to transfer learning and self-supervised learning. A promising next step is using these bounds to develop new regularization techniques or targeted data augmentation strategies that specifically help "hard" classes generalize better, moving beyond the limitations of average-case optimization.

Summary updated

BibTeX
@misc{laakom2024class,
  author = {Firas Laakom and Yuheng Bu and Moncef Gabbouj},
  title = {{Class-wise Generalization Error: an Information-Theoretic Analysis}},
  year = {2024},
  eprint = {2401.02904},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.02904},
}
Figure