Nyström Kernel Mean Embeddings

Antoine Chatalic, Nicolas Schreuder, Lorenzo Rosasco, Alessandro Rudi

Introduction

Kernel Mean Embeddings (KMEs) are a cornerstone of modern non-parametric statistics. They allow us to represent an entire probability distribution as a single point in a high-dimensional (often infinite-dimensional) Hilbert space. This representation is incredibly useful for tasks like two-sample testing, anomaly detection, and training generative models like MMD-GANs.

However, KMEs suffer from a significant "big data" problem. The standard empirical estimator requires storing and manipulating all $n$ points in a dataset. Consequently, computing the distance between two distributions—the Maximum Mean Discrepancy (MMD)—scales at $O(n^2)$. For modern datasets with millions of samples, this computational cost is prohibitive. While previous work has suggested using random features or greedy approximations, these methods often fail to capture the specific complexity of the data distribution or lack strong theoretical guarantees.

This paper introduces a Nyström-based estimator for KMEs that drastically reduces computational and storage costs. By subsampling just a fraction of the data, the authors prove it is possible to achieve the same statistical accuracy as the full empirical estimator.

The Nyström Estimator

Instead of utilizing all $n$ points, the proposed method selects a small random subset of $m$ "landmark" points. The key technical contribution is the construction of the estimator $\hat{\mu}_m$. Rather than simply averaging the $m$ points, the method projects the full empirical mean onto the subspace spanned by these landmarks.

This results in a weighted sum of the landmark features: $$ \hat{\mu}_m = \sum_{j=1}^m \alpha_j \phi(\tilde{X}_j) $$ where the weights $\alpha$ are calculated using the pseudo-inverse of the landmark kernel matrix.

What sets this approach apart is its rigorous theoretical analysis. The authors provide an upper bound on the approximation error and relate the required number of landmarks ($m$) to the effective dimension of the data—a measure of how much information the kernel actually "sees" in the distribution.

Key Theoretical Insights

  • The $\sqrt{n}$ Sweet Spot: For many common kernels (like the Gaussian kernel), the authors demonstrate that only $m \approx \sqrt{n} \log \sqrt{n}$ landmarks are needed to match the accuracy of the full $n$-point estimator. This represents a massive gain in efficiency.
  • Spectral Decay Matters: The efficiency of the Nyström approximation is tied to the eigenvalues of the covariance operator. If the eigenvalues decay exponentially (common in smooth kernels), the number of landmarks needed is remarkably small.
  • The "Empirical Floor": There is a threshold beyond which adding more landmarks yields no benefit. This occurs because the Nyström estimator becomes limited by the inherent statistical error of the original $n$ samples. The objective is to reach this "floor" with as few landmarks as possible.

Experimental Validation

The authors validated their theory using both synthetic (Gaussian mixture models) and real-world datasets (Fasttext, FMA, Intel Lab, and Gowalla).

The experimental results strongly support the theoretical bounds. As shown in Figure 1, for synthetic data, the Nyström estimator quickly converges to the performance of the full empirical estimator. The vertical dashed line represents the predicted $\sqrt{n} \log \sqrt{n}$ threshold, which accurately marks where the Nyström estimator hits the "empirical floor."

Estimation errors for synthetic Gaussian data. The Nyström estimator matches the full empirical estimator's accuracy once $m$ reaches the predicted threshold.

This behavior is consistent across real-world data as well. Figure 2 illustrates that for datasets like Intel Lab, the error decays incredibly fast, requiring only about 20 landmarks to match the full dataset's performance. Conversely, the Fasttext dataset shows a slower decay, likely due to the higher intrinsic complexity and slower spectral decay of the text features.

Estimation errors for real datasets. The behavior is consistent across different types of data, though the "hardness" varies by dataset.

Limitations and Future Work

While the theoretical bounds are strong, the current framework relies on uniform random sampling of landmarks. In practice, "leverage score sampling"—picking points that are more unique or informative—often performs better, though proving similar bounds for that setting remains an open challenge. Additionally, results are sensitive to the choice of kernel and its hyperparameters. Finally, while the paper proves bounds for the MMD distance itself, future work will need to explore how these approximations affect the statistical power of downstream tasks, such as two-sample testing.

Summary updated

BibTeX
@inproceedings{chatalic2022nystrom,
  author = {Antoine Chatalic and Nicolas Schreuder and Lorenzo Rosasco and Alessandro Rudi},
  title = {{Nyström Kernel Mean Embeddings}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=UUOIfUvaHIi},
}
Figure