Luke Sernau, Silvano Bonacina, and Rif A. Saurous
Google DeepMind & Google Research
Abstract
For years, researchers have sought the "perfect" random feature mapping to approximate kernels with minimal error. This paper proves that under an optimal importance sampling strategy, every random feature representation achieves the exact same minimum variance. This finding suggests that the specific choice of feature mapping is secondary to the sampling policy, as the theoretical error floor is determined solely by the kernel and the data distribution.
1. Introduction
Kernel methods are a cornerstone of machine learning, yet their linear scaling with dataset size makes them prohibitively expensive for large-scale applications. Random Features (RF), introduced by Rahimi and Recht in 2007, solved this by approximating kernels as an expectation of random functions, transforming quadratic problems into linear ones.
Since then, a "sampling arms race" has emerged, with researchers proposing increasingly complex mappings—such as Positive Random Features or Orthogonal Random Features—to reduce variance. This work addresses a fundamental question: Is there a limit to how low this variance can go, and does the choice of mapping actually matter?
2. Methodology: Optimal Importance Sampling
We shift the focus from the mathematical form of the features ($\phi$) to the strategy used to sample them. By employing Importance Sampling, we can sample from a distribution $\Psi$ instead of the original prior $\Omega$, reweighting the results to maintain an unbiased estimate.
Using Lagrange optimization, we derive an optimal sampling policy ($p_\Psi$) that minimizes expected sample variance. While standard methods sample features according to the prior defined by the kernel, the optimal approach accounts for both that prior and the expected magnitude of the features over the specific data distribution being processed.
3. Key Theoretical Results
The core contribution of this work is the proof that the choice of feature mapping $\phi$ becomes irrelevant under an optimal sampling policy.
Theorem 1 provides the analytical form for the optimal importance sampling distribution and the resulting minimum variance.
Corollary 2 demonstrates that when input data distributions are identical ($X_1 = X_2$), the optimal variance is defined as: $$\hat{V}_\Psi = \left( \mathbb{E}_{x \sim X} [K(x, x)] \right)^2 - \mathbb{E}_{x_1, x_2 \sim X} [K(x_1, x_2)^2]$$
Crucially, the feature mapping $\phi$ does not appear in this equation. This confirms that the minimum achievable variance is a property of the kernel $K$ and the data distribution $X$, not the specific representation used.
4. Discussion and Limitations
While this theoretical equivalence is striking, practical implementation faces hurdles:
- Computational Overhead: Calculating and sampling from the optimal distribution $\Psi$ may be more expensive than the savings gained from using fewer samples.
- Data Knowledge: The optimal policy requires an understanding of the input data distribution, which may be difficult to estimate in non-stationary or streaming environments.
5. Conclusion
The "arms race" for superior random feature mappings is theoretically moot. Future research should pivot from designing new mappings to developing efficient, data-driven algorithms that can approximate the optimal sampling distribution in real-world architectures, such as modern Transformers.
Summary updated