NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Fast Statistical Leverage Score Approximation in Kernel Ridge Regression

Yifan Chen, Yun Yang

Abstract

Kernel Ridge Regression (KRR) is a cornerstone of non-parametric learning but suffers from $O(n^3)$ complexity. While Nyström methods reduce this cost via subsampling, optimal sampling requires statistical leverage scores, which are themselves expensive to compute. This paper proposes a novel $O(n)$ analytical approach to approximate these scores using spectral density and local input distribution. By shifting from algebraic matrix approximations to equivalent kernel theory, the method achieves significant speedups—processing 500,000 samples in under 36 seconds—while maintaining or improving predictive accuracy compared to state-of-the-art matrix-based approximations.

Introduction

Kernel Ridge Regression (KRR) is a powerful tool for non-parametric learning, but it faces a significant scalability challenge: it requires inverting an $n \times n$ matrix, leading to a computational cost of $O(n^3)$. To address this, the Nyström method is commonly used to approximate the large matrix by subsampling $m$ representative points.

However, the effectiveness of the Nyström method depends heavily on the sampling strategy. For optimal performance, points must be sampled based on their statistical leverage scores, which measure the influence of individual data points on the model. The "catch-22" is that calculating these scores exactly also costs $O(n^3)$, and existing approximations often scale at $O(n^2)$ or $O(nd_{stat}^2)$, remaining a bottleneck for massive datasets.

Methods: An Analytical Approach

The authors depart from standard "algebraic" methods that approximate the matrix directly, proposing instead an analytical approach based on Equivalent Kernel Theory. They posit that as the sample size $n$ grows, the weight function of KRR behaves like a limiting "equivalent kernel."

By analyzing the first-order conditions of the KRR objective in the frequency domain using Fourier transforms, they derive an explicit formula for the leverage score at a point $x_i$: $$\tilde{K}_\lambda(x_i, x_i) = \int_{\mathbb{R}^d} \frac{1}{p(x_i) + \lambda/m(s)} ds$$ where $p(x_i)$ is the local density of the input data and $m(s)$ is the spectral density of the kernel (e.g., a Matérn kernel).

Figure 2: Comparison of the proposed Spectral Analysis (SA) approximation against true leverage scores across different data distributions (Uniform, Beta, Bimodal) and sample sizes.

Their practical algorithm involves two main steps: estimating the local density $p(x_i)$ for each sample using fast Kernel Density Estimation and performing a simple numerical integration. Because these steps can be completed in roughly linear time relative to $n$, the entire process is significantly faster than previous iterative or recursive matrix-based methods.

Key Insights

  • Density and Leverage: The leverage score of a point is inversely related to the data density around it. In "crowded" regions, individual points have low leverage; in "sparse" regions, points are more unique and thus have higher leverage.
  • Spectral Connection: The importance of a point is dictated by the kernel's smoothness. For Matérn kernels, leverage scores scale roughly as $(\lambda/p(x))^{1-d/(2\alpha)}$.
  • Error Tolerance: A crucial finding is that perfect leverage scores are not required for an optimal Nyström approximation. As long as the approximation error is within a certain bound, the final KRR model remains statistically optimal, justifying the use of fast, approximate density estimation.

Experimental Results

The authors evaluated their method using synthetic 1D and 3D distributions, as well as real-world benchmarks from the UCI Machine Learning Repository (RQC, HTRU2, and CCPP datasets).

Figure 5: Performance benchmarks showing (left) linear runtime scaling of SA compared to RC and BLESS, (middle) competitive error rates across sample sizes, and (right) the superior error-to-runtime trade-off of the SA method.

Key results include:

  • Speed: On a dataset with $n = 500,000$ samples, the proposed Spectral Analysis (SA) method took 35.8 seconds to approximate leverage scores. In comparison, Recursive-RLS took 94.3 seconds and BLESS took 167 seconds.
  • Accuracy: Despite its speed, the SA method achieved the highest accuracy (lowest mean R-ACC) across all three UCI datasets compared to Vanilla (uniform) sampling, Recursive-RLS, and BLESS.
  • Theoretical Tightness: The authors proved that their approximation has a vanishing relative error as the sample size $n \to \infty$, providing a solid theoretical foundation for the heuristic.

Conclusion and Future Work

While the current derivation relies on stationary kernels (like Matérn or Gaussian) to utilize Fourier transforms, it represents a major step forward in scaling KRR. Future work may involve extending this theory to non-stationary kernels or other kernel-based methods such as Kernel $k$-means and Kernel PCA. The "curse of dimensionality" remains a challenge for the density estimation step, though the authors note that in very high dimensions, leverage scores tend to become more uniform, potentially making simpler sampling strategies competitive again.

Summary updated

BibTeX
@inproceedings{chen2021fast,
  author = {Yifan Chen and Yun Yang},
  title = {{Fast Statistical Leverage Score Approximation in Kernel Ridge Regression}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=rYgecoLrKk},
}
Figure