Neural network generalization measured by representation quality
Escaping Parameter Space: Tight Generalization Bounds via Representation Quality
Machine Learning
Summary
It is difficult to predict how well a neural network will perform on new data just from its parameters. This paper uses the quality of the network's last hidden layer representations, measured by a simple nearest neighbor method, to estimate generalization accurately. This approach avoids complex measures tied to the network’s parameters and gives tight error bounds on standard image datasets. The authors also identify that the local structure of the data classes in representation space plays a key role in generalization. This method can help understand why some neural networks generalize well while others just memorize training data.
What this means in practice
- •For machine learning engineers: Estimate how well a neural network will generalize using representation clusters instead of parameter norms.
- •For computer vision developers: Certify image classification accuracy more reliably with frozen feature representations and k-NN evaluation.
Authors
Niclas Göring, Shuofeng Zhang, Branton DeMoss, Ard A. Louis
Abstract
We derive a tight generalization bound for deterministic neural We derive a tight generalization bound for deterministic neural networks based on their last hidden layer representations. By evaluating representation quality with a parameter-free $k$-nearest-neighbor ($k$-NN) classifier, our certificate avoids traditional parameter-space complexity measures, KL divergences to a posterior, weight norms, and compression. The bound is tight: trained from scratch, it reaches an 8.0 percentage point gap to test error on CIFAR-10 (ResNet-18) and yields the first non-vacuous certificates we are aware of on CIFAR-100; with frozen DINOv2 representations, it certifies at 1.4\% on CIFAR-10 and 23.1\% on 1,000-class ImageNet. It decomposes additively into three empirical, independently measurable quantities: local class geometry ($k$-NN decoder error), decoder-network agreement, and training stability. This allows the bound to act as a diagnostic tool: we demonstrate that actively destroying local class geometry eliminates generalization while leaving dataset memorization intact, identifying class geometry as a causally relevant mechanism for generalization. Finally, we show that learned representations are significantly less sensitive to weight noise than linear readouts, suggesting why parameter-space certificates often struggle to remain tight.