Generalization error of random features and kernel methods: hypercontractivity and kernel matrix concentration

Mei Song, Theodor Misiakiewicz, Andrea Montanari · DOI

In the landscape of supervised learning, Kernel Ridge Regression (KRR) stands as a cornerstone of non-parametric modeling. However, its computational complexity—scaling cubically with the number of data points ($O(n^3)$)—presents a significant barrier for large-scale applications. Random Features (RF) methods emerged as a powerful alternative, approximating the kernel by mapping data into a finite $N$-dimensional space. While empirically successful, the precise relationship between the number of features $N$, the number of samples $n$, and the resulting generalization error has long remained a subject of theoretical debate.

This research provides a sharp mathematical characterization of the generalization error for Random Features Ridge Regression (RFRR) and its convergence to KRR. By leveraging tools from high-dimensional probability, the authors establish exactly how many features are required to match the performance of full kernel methods and reveal the underlying spectral mechanics of these models.

The Theoretical Engine: Hypercontractivity and Concentration

The analysis centers on a high-dimensional asymptotic framework where both the number of samples $n$ and the feature dimension $N$ grow. To achieve "sharp" bounds, the study introduces two critical technical components:

  1. Hypercontractivity: The authors assume the eigenfunctions of the kernel are "delocalized." In practical terms, this means the eigenfunctions do not concentrate their mass in small, isolated regions of the input space. This property allows for the application of powerful concentration of measure inequalities, ensuring that empirical estimates of the kernel matrix behave predictably.
  2. Kernel Matrix Concentration: The paper develops new techniques to bound the behavior of the random feature matrix $Z$. Specifically, it analyzes how the empirical kernel matrix $(Z^T Z / N)$ converges to the population kernel, providing a rigorous foundation for comparing finite-dimensional RF models to their infinite-dimensional kernel counterparts.

KRR as a Spectral Projection

A central insight of this work is the characterization of KRR as a "hard-threshold" projection. The researchers prove that KRR effectively learns the components of the target function associated with the top $\ell$ eigenfunctions of the kernel, where the cutoff $\ell$ is determined by the sample size $n$. Any components of the target function residing in the "tail" of the spectrum (beyond the top $\ell$ eigenvalues) are essentially treated as noise.

This perspective simplifies the understanding of the learning process: the model's success depends on whether the target function's energy is concentrated within the spectral range that the sample size $n$ allows the model to "see."

The $N$ vs. $n$ Bottleneck

The paper identifies a clear phase transition in the performance of random features based on the relationship between $N$ and $n$:

  • The Overparametrized Regime ($N \ge n^{1+\delta}$): When the number of features slightly exceeds the number of samples, random features achieve the same test error as the full KRR. In this regime, adding more features (increasing $N$) yields diminishing returns; the bottleneck is the statistical limit imposed by the sample size $n$, not the approximation limit of the features.
  • The Underparametrized Regime ($N \le n^{1-\delta}$): When features are scarce, the error is dominated by the approximation gap. The model performs strictly worse than KRR because the finite feature set cannot adequately represent the kernel's spectral properties.
  • Effective Regularization: The authors further characterize an "effective" regularization parameter, $\gamma_{eff}$, which KRR implicitly applies. This parameter is the sum of the explicit ridge penalty $\lambda$ and the "tail" of the kernel's eigenvalues, explaining how KRR maintains stability even in the absence of explicit regularization.

Implications for "Lazy Training" and Neural Networks

These results have significant implications for deep learning theory, particularly the "lazy training" or Neural Tangent Kernel (NTK) regime. In this regime, overparametrized neural networks behave like linearized models with random features. The findings suggest that for such networks, the "minimum norm interpolator" (where regularization $\lambda \to 0$) is often optimal. Furthermore, the study provides a theoretical justification for why increasing the width of a network beyond a certain threshold (relative to the dataset size) stops improving generalization error.

Conclusion

By providing a sharp characterization of the generalization error, this work bridges the gap between finite-dimensional random features and infinite-dimensional kernel methods. While the analysis is currently focused on fixed features (precluding "feature learning" where the basis functions evolve), it establishes a rigorous benchmark for high-dimensional statistics and offers a clear roadmap for understanding the limits of approximation in scalable machine learning.

Summary updated

Abstract

Consider the classical supervised learning problem: we are given data $(y_i,{\boldsymbol x}_i)$, $i\le n$, with $y_i$ a response and ${\boldsymbol x}_i\in {\mathcal X}$ a covariates vector, and try to learn a model $f:{\mathcal X}\to{\mathbb R}$ to predict future responses. Random features methods map the covariates vector ${\boldsymbol x}_i$ to a point ${\boldsymbol ϕ}({\boldsymbol x}_i)$ in a higher dimensional space ${\mathbb R}^N$, via a random featurization map ${\boldsymbol ϕ}$. We study the use of random features methods in conjunction with ridge regression in the feature space ${\mathbb R}^N$. This can be viewed as a finite-dimensional approximation of kernel ridge regression (KRR), or as a stylized model for neural networks in the so called lazy training regime. We define a class of problems satisfying certain spectral conditions on the underlying kernels, and a hypercontractivity assumption on the associated eigenfunctions. These conditions are verified by classical high-dimensional examples. Under these conditions, we prove a sharp characterization of the error of random features ridge regression. In particular, we address two fundamental questions: $(1)$~What is the generalization error of KRR? $(2)$~How big $N$ should be for the random features approximation to achieve the same error as KRR? In this setting, we prove that KRR is well approximated by a projection onto the top $\ell$ eigenfunctions of the kernel, where $\ell$ depends on the sample size $n$. We show that the test error of random features ridge regression is dominated by its approximation error and is larger than the error of KRR as long as $N\le n^{1-δ}$ for some $δ>0$. We characterize this gap. For $N\ge n^{1+δ}$, random features achieve the same error as the corresponding KRR, and further increasing $N$ does not lead to a significant change in test error.
BibTeX
@inproceedings{song2021generalization,
  author = {Mei Song and Theodor Misiakiewicz and Andrea Montanari},
  title = {{Generalization error of random features and kernel methods: hypercontractivity and kernel matrix concentration}},
  booktitle = {Applied and Computational Harmonic Analysis},
  year = {2021},
  doi = {10.1016/j.acha.2021.12.003},
}
Figure