On Predicting Generalization using GANs

Yi Zhang, Arushi Gupta, Nikunj Saunshi, Sanjeev Arora

Generalization—the ability of massive neural networks to perform well on unseen data despite having the capacity to simply memorize their training sets—remains one of the most profound mysteries in deep learning. While theorists have attempted to formulate mathematical "generalization bounds" to predict test error, these bounds are often too loose to be practically useful. Consequently, the research community has pivoted toward finding empirical "complexity measures" that correlate with test performance without peeking at the held-out test set.

A recent paper introduces a surprisingly effective and counter-intuitive approach to this problem: predicting a deep learning model's test performance by evaluating it on synthetic images generated by a Generative Adversarial Network (GAN). Despite well-known flaws like "mode collapse," GANs trained on a training set produce synthetic data that mimics the test set closely enough to serve as a high-fidelity proxy for predicting generalization.

The Synthetic Data Proxy Method

The researchers propose a remarkably straightforward procedure to estimate test accuracy:

  1. Train a GAN: Train a conditional GAN (such as BigGAN with Differentiable Augmentation) on the original training dataset.
  2. Generate Synthetic Data: Use the trained GAN to create a large, labeled synthetic dataset.
  3. Evaluate: Run the target classifier on this synthetic data.
  4. Predict: Use the classifier’s accuracy on the synthetic data as the direct prediction for its accuracy on the real, unseen test set.

The core novelty lies not in the GAN architecture itself, but in repurposing GAN-generated data as a direct, drop-in substitute for a test set.

Key Insights: Why Does This Work?

The study evaluates this method across standard computer vision benchmarks (CIFAR-10, CIFAR-100, Tiny ImageNet) and specialized generalization competitions (PGDL, DEMOGEN). The findings reveal several fascinating properties of GANs and generalization:

  • The "Closer than Training" Phenomenon: The most startling finding is that synthetic GAN data is often "closer" to the unseen test set than the training data is, at least from the perspective of a trained classifier.
  • A Universal Proxy: Even though a GAN is trained exclusively on the training set, it does not merely memorize it. Instead, it learns a smoothed version of the data distribution. Using a "Class-conditional Fréchet Distance," the authors demonstrate that synthetic samples occupy a feature space overlapping more significantly with the test set than the original training samples do.
  • Robustness Across Architectures: A single GAN trained on a dataset like CIFAR-10 can accurately predict the performance of a wide variety of architectures (VGG, ResNet, DenseNet, MobileNet, etc.) without needing to be retrained for each specific model.
Synthetic accuracy vs. test accuracy across various classifiers on CIFAR-10 and Tiny ImageNet.

Interestingly, this success highlights an irony regarding GAN limitations. GANs are frequently criticized for "mode collapse"—failing to represent the entire diversity of a dataset. However, this paper suggests that for the specific task of predicting generalization, these generative limitations do not hinder the GAN from being a highly useful evaluation tool.

Benchmark-Beating Results

The synthetic data approach yields remarkably strong empirical results, often requiring zero hyperparameter tuning. By using "off-the-shelf" GANs from public libraries, the method proves both robust and easy to implement.

  • DEMOGEN Benchmark: The GAN-based method achieved near-perfect correlation with actual test accuracy. On CIFAR-10, it reached an adjusted $R^2$ score of 0.995, significantly outperforming previous state-of-the-art complexity measures (which typically scored around 0.94).
  • PGDL Competition: The method outperformed the top three winning teams from the NeurIPS 2020 Predicting Generalization in Deep Learning (PGDL) competition on several tasks, often by a large margin. For instance, on VGG models trained on CIFAR-10, the GAN method achieved a score of 62.62, easily beating the winning team's 52.59.
Linear fit of synthetic accuracy versus test accuracy for NiN and ResNet classifiers on CIFAR-10 and CIFAR-100.

Limitations and Future Directions

While highly effective, the method is not without its limitations:

  • Low-Data Regimes: The approach struggles with tasks involving very small datasets or highly uneven class sizes (e.g., Oxford Flowers or Oxford Pets). Standard GANs often fail to converge or produce meaningful samples under these conditions.
  • Computational Cost: Training a high-quality GAN like BigGAN is computationally expensive, making this method slower upfront than calculating simple weight-based complexity measures.
  • Theoretical Gaps: While the empirical results are undeniably strong, there is currently no mathematical theory that fully explains why GANs excel at this task.

The authors suggest that unraveling this counter-intuitive phenomenon is a vital direction for future research, potentially leading to a deeper, unified understanding of both generative modeling and generalization theory.

Summary updated

BibTeX
@inproceedings{zhang2022predicting,
  author = {Yi Zhang and Arushi Gupta and Nikunj Saunshi and Sanjeev Arora},
  title = {{On Predicting Generalization using GANs}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=eW5R4Cek6y6},
}
Figure