More Than a Toy: Random Matrix Models Predict How Real-World Neural Representations Generalize

Alexander Wei, Wei Hu, Jacob Steinhardt

Deep learning models are vastly overparameterized—often possessing many more parameters than training examples—yet they generalize remarkably well to unseen data. This phenomenon contradicts classical statistical wisdom, which dictates that such models should severely overfit. To understand this, theorists often study high-dimensional linear models, like kernel ridge regression, as a proxy.

However, there is a massive gap between these theoretical models and reality. When standard theoretical bounds are applied to realistic settings—such as regression on neural network representations of actual image data—they fail completely. This paper demonstrates that classical theories of generalization, particularly norm-based bounds, fundamentally mischaracterize how real-world neural network representations perform. Instead, the authors show that the Generalized Cross-Validation (GCV) estimator, grounded in Random Matrix Theory (RMT), can accurately predict generalization risk, scaling laws, and the empirical benefits of pretraining using only training data.

The Failure of Classical Bounds

Standard learning theory bounds rely heavily on the norm of the learned weights, predicting that error will increase as the norm grows. The authors set out to test this by evaluating predictors of generalization risk on empirical Neural Tangent Kernels (eNTKs) and last-layer activations extracted from large-scale ResNets on standard vision benchmarks (CIFAR-10/100, Fashion-MNIST, Flowers-102, Food-101).

They observed a striking contradiction: the norm of the learned weights actually grows as the dataset size increases, even while the actual test error drops.

Norm growth vs. risk in ridgeless regression.

Because the "ground truth" function in real datasets has an effectively infinite norm, norm-based generalization bounds become vacuous. They predict error will increase as you add data, which is empirically false. Furthermore, empirical covariance matrices converge too slowly in high dimensions for spectrum-only bounds to work. A new theoretical framework is needed to predict real-world generalization.

A Random Matrix Theory Approach

To predict generalization without relying on a test set, the authors revisit the Generalized Cross-Validation (GCV) estimator, a classical statistical tool. They built a highly optimized GPU library to compute massive eNTK matrices (up to 75,000 x 75,000) to test GCV against norm-based and spectrum-based baselines across various dataset sizes and regularization strengths.

Theoretically, they prove a non-asymptotic bound showing that GCV converges to the true generalization risk whenever a local random matrix law (the Marchenko-Pastur law) holds. Unlike previous work, their proof does not assume Gaussian data, does not require a fixed feature-to-sample ratio, and holds even when the ground truth has a massive norm.

Key Insights: Why Pretraining Works and Scaling Laws

Using this RMT lens, the authors uncover several surprising insights about neural network behavior:

  • The real reason pretraining works: It is a common intuition that pretraining helps by creating simple, "low-dimensional" representations of complex data, effectively compressing it. The authors found the exact opposite: pretrained eNTKs actually have slower eigenvalue decay (meaning a higher effective dimension) than randomly initialized ones. Pretraining works because of alignment—it reshapes the feature space so that the target function is much easier to represent in the network's top eigenvectors.
  • Scaling laws are predictable: By estimating the power-law decay of the eigenvalues and the alignment coefficients from the training data, we can accurately predict the neural scaling laws (how fast test error drops as data increases) of the model. For example, on CIFAR-10 with a pretrained ResNet-18, their RMT framework predicted a scaling rate of $\alpha \approx 0.162$, perfectly matching the true observed rate.

Key Results: GCV Accurately Predicts Risk

The empirical results strongly validate the RMT approach. The GCV predictions achieved a >0.97 Pearson correlation with the actual generalization risk across almost all tested datasets and models. It accurately predicted the test risk across a wide range of dataset sizes and regularization strengths.

GCV predictions vs. true generalization risk on CIFAR-100.

In contrast, baselines failed entirely. Norm-based predictors had negative correlations with true risk (e.g., -0.64 on CIFAR-10), and spectrum-only predictors failed to capture scaling accurately (predicting a 0.008 scaling exponent on Fashion-MNIST versus the true 0.166).

Limitations and Future Work

While Random Matrix Theory is often viewed as a mathematically convenient but unrealistic toy model, this paper shows that accounting for random matrix effects is actually necessary and sufficient to model the qualitative phenomena of deep learning in kernel regression.

Currently, the theoretical analysis is restricted to ridge regression (mean squared error), and the RMT assumptions require the regularization parameter $\lambda$ to be bounded away from 0. Extending the proofs to cover the natural scaling regime where $\lambda \asymp N^{-1}$ remains an open mathematical problem. Future directions include extending this approach to classification tasks (like logistic regression), handling natural covariate shift, and using eNTKs to untangle the mysteries of feature learning during the actual training process.

Summary updated

Abstract

Of theories for why large-scale machine learning models generalize despite being vastly overparameterized, which of their assumptions are needed to capture the qualitative phenomena of generalizati...
BibTeX
@inproceedings{wei2022more,
  author = {Alexander Wei and Wei Hu and Jacob Steinhardt},
  title = {{More Than a Toy: Random Matrix Models Predict How Real-World Neural Representations Generalize}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=cCdrvWnm4X},
}
Figure