Abstract
Deep learning models are known to overfit and memorize spurious features in the training dataset. While numerous empirical studies have aimed at understanding this phenomenon, a rigorous theoretical framework to quantify it is still missing. In this paper, we consider spurious features that are uncorrelated with the learning task, and we provide a precise characterization of how they are memorized via two separate terms: (i) the stability of the model with respect to individual training samples, and (ii) the feature alignment between the spurious feature and the full sample. While the first term is well established in learning theory and it is connected to the generalization error in classical work, the second one is, to the best of our knowledge, novel. Our key technical result gives a precise characterization of the feature alignment for the two prototypical settings of random features (RF) and neural tangent kernel (NTK) regression. We prove that the memorization of spurious features weakens as the generalization capability increases and, through the analysis of the feature alignment, we unveil the role of the model and of its activation function. Numerical experiments show the predictive power of our theory on standard datasets (MNIST, CIFAR-10).
Introduction
Deep learning models often act as "lazy" students, passing tests by memorizing shortcuts—spurious features—rather than learning the underlying core concepts. A classic example is a model identifying a cow based on the presence of green grass in the background. While this "simplicity bias" has been observed empirically for years, providing a rigorous mathematical framework to quantify it has remained a challenge.
In the work "Stability, Generalization and Privacy: Precise Analysis for Random and NTK Features," Simone Bombari and Marco Mondelli bridge the gap between empirical observations and formal learning theory. They demonstrate that the memorization of irrelevant features is driven by two distinct factors: the model's stability and a novel metric termed feature alignment.
Problem Formulation: Core vs. Spurious Features
In real-world datasets, a training sample $z$ is typically composed of "core" features $x$ (the object of interest, such as a cat) and "spurious" features $y$ (the background or noise). Over-parameterized models, which possess significantly more parameters than data points, often achieve zero training error by memorizing both $x$ and $y$. This paper specifically investigates "input noise"—features completely uncorrelated with the task—and asks why models pick them up.
Theoretical Framework: Stability and Alignment
The authors analyze this phenomenon using generalized linear regression within two theoretical frameworks: Random Features (RF) and the Neural Tangent Kernel (NTK). Their primary contribution is a mathematical decomposition showing that a model's output on a spurious sample is determined by:
- Stability ($S_z$): A measure of how much a model's prediction changes when a specific training sample is removed. This is a well-established concept in learning theory connected to generalization.
- Feature Alignment ($\mathcal{F}$): A novel concept measuring the similarity in the model's internal feature space between the full training sample (core + spurious) and the spurious component alone.
By applying Hermite polynomials to analyze activation functions, the researchers derived closed-form expressions that predict memorization levels based on model architecture and the "smoothness" of the activation function.
Experimental Validation
To validate their theory, the authors used synthetic data, MNIST (digits 1 vs. 7), and CIFAR-10 (cats vs. ships). They created controlled spurious features by adding noise backgrounds to images. "Spurious accuracy"—the model's tendency to predict the original label when presented with only the noise background—served as the primary metric for memorization.
Key Insights and Results
The study reveals several critical insights:
- Generalization as a Safeguard: Memorization is mathematically shown to be proportional to the square root of the generalization error. Improving a model's ability to generalize inherently reduces its reliance on spurious features.
- Activation Functions as Filters: The choice of activation function (e.g., ReLU) dictates how much a model aligns with noise. This is determined by the function's Hermite coefficients.
- The Power of Data: As the number of training samples ($N$) increases, test accuracy improves while spurious accuracy declines, confirming that more data helps models distinguish core features from noise.
- Architectural Robustness: While the theory was developed for RF and NTK, empirical tests on CNNs and ResNets suggest that the interplay between stability and alignment remains the dominant driver of memorization even in models capable of active feature learning.
Conclusion and Future Work
This research provides a precise toolset for quantifying spurious memorization in "lazy training" regimes. However, it primarily addresses spurious features that are uncorrelated with labels. Future work is needed to extend this framework to cases where spurious features are correlated with labels (e.g., demographic biases). Additionally, moving beyond the lazy training regime to fully "active" feature learning remains a significant open challenge for the community.
Summary updated