Predicting Neural Network Accuracy from Weights

Thomas Unterthiner, Daniel Keysers, Sylvain Gelly, Olivier Bousquet, Ilya O. TolstikhinarXiv 2020

Abstract: We show experimentally that the accuracy of a trained neural network can be predicted surprisingly well by looking only at its weights, without evaluating it on input data. We motivate this task and introduce a formal setting for it. Even when using simple statistics of the weights, the predictors are able to rank neural networks by their performance with very high accuracy ($R^2$ score more than 0.98). Furthermore, the predictors are able to rank networks trained on different, unobserved datasets and with different architectures. We release a collection of 120k convolutional neural networks trained on four different datasets to encourage further research in this area, with the goal of understanding network training and performance better.

Introduction

In standard machine learning, evaluating a model's performance requires a "hold-out" test set. While effective, this method doesn't explain why a model generalizes; it simply confirms that it does. Researchers from Google Research (Brain Team) have investigated a more fundamental question: Is the signal of a model's generalization ability baked into the geometry of its weights? If accuracy can be predicted from weights alone, it suggests universal structural properties of "good" weights that transcend specific datasets.

Methods and Feature Engineering

The authors frame accuracy prediction as a supervised learning problem where the input is the weight vector of a trained CNN and the target is its test accuracy. They tested three types of "meta-predictors":

  • Logit-linear models: A simple baseline.
  • Gradient Boosting Machines (GBM): Specifically LightGBM.
  • Deep Neural Networks (DNNs): Meta-networks trained to evaluate other networks.

Surprisingly, simple layer-wise statistics (mean, variance, and quantiles) were more effective features for the meta-predictor than raw weight values. This suggests that the global distribution of weights is a key indicator of performance. The study also found that the weights of the final fully connected layer are disproportionately informative, often yielding nearly the same predictive power as the entire network.

The Small CNN Zoo

To facilitate this research, the authors introduced the Small CNN Zoo, a dataset containing 120,000 Convolutional Neural Networks. These models share a fixed architecture (3 conv layers + 1 dense layer) but were trained with varying hyperparameters, including different learning rates, optimizers, and dropout rates.

Distributions of test accuracy and correlations between train and test accuracy across the four datasets in the Small CNN Zoo.

The models were trained on four base datasets: MNIST, Fashion-MNIST, CIFAR-10 (grayscale), and SVHN (grayscale). As shown in the figure above, the zoo captures a wide range of performance outcomes, providing a rich landscape for training meta-predictors.

Key Results

The meta-predictors achieved remarkable precision. Within the same dataset, GBM and DNN predictors reached an $R^2$ score of over 0.98, capturing almost all variance in model accuracy.

Universal Ranking and Transferability

One of the most significant findings is the ability of these predictors to generalize across domains. A meta-predictor trained solely on MNIST-trained weights can successfully rank the performance of models trained on CIFAR-10. This implies that the characteristics of "good" weights are consistent across different image classification tasks.

Generalization of meta-predictors across datasets, showing high rank correlation (Kendall’s $\tau$) even when trained on one dataset and tested on another.

Using Kendall’s $\tau$ as a ranking metric, the predictors achieved scores between 0.60 and 0.93 when transferring across datasets. Furthermore, predictors trained on the Small CNN Zoo were able to rank the accuracy of much larger, over-parameterized Wide-ResNet32 models from the DEMOGEN dataset, demonstrating that these weight-based signals scale with model size.

Conclusion

This research demonstrates that neural network weights contain a clear, interpretable signal of their own performance. While the study focused on CNNs for image classification, it opens the door for future work on architecture-agnostic predictors (perhaps using Deep Sets) and a deeper theoretical understanding of why specific weight distributions lead to better generalization. The release of the 120k model "Zoo" provides a benchmark for the community to further explore the internal geometry of deep learning.

Summary updated

BibTeX
@misc{unterthiner2020predicting,
  author = {Thomas Unterthiner and Daniel Keysers and Sylvain Gelly and Olivier Bousquet and Ilya O. Tolstikhin},
  title = {{Predicting Neural Network Accuracy from Weights}},
  year = {2020},
  eprint = {2002.11448},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.11448},
}
Figure