Variance-Reducing Couplings for Random Features: Perspectives from Optimal Transport

Isaac Reid, Stratis Markou, Krzysztof Choromanski, Richard E. Turner, Adrian WellerarXiv 2024 · DOI

Abstract

Kernel methods are fundamental to non-linear machine learning but face significant scalability challenges due to their $O(N^3)$ computational complexity. Random Features (RFs) provide a popular Monte Carlo-based approximation to kernels, yet their performance is often limited by high variance in the estimator. This work reinterprets the problem of variance reduction in RFs through the lens of Optimal Transport (OT). By treating the selection of random frequencies as a multi-marginal OT problem, the authors derive "Pairwise Norm-Coupling" (PNC) for Euclidean spaces and "$σ$-coupling" for graphs. Their findings demonstrate significant improvements in kernel estimation and graph inference, while revealing a counterintuitive result: in normalized attention mechanisms like those in Transformers, increasing variance can actually enhance performance.

Introduction

The "curse of dimensionality" in kernel methods stems from the scaling of exact kernel computations relative to the number of data points $N$. Random Features (RFs) mitigate this by using a small number of random samples to construct a low-rank approximation of the kernel. However, the accuracy of this approximation depends heavily on the variance of the Monte Carlo estimator. While techniques like Quasi-Monte Carlo and Orthogonal Random Features exist, they are generally static and do not adapt to specific data distributions or kernel types.

This paper addresses a fundamental question: what is the mathematically optimal way to couple random samples to minimize approximation error? By framing this as an Optimal Transport problem, the authors provide a rigorous framework for variance reduction.

Methods: The Optimal Transport Framework

The authors frame variance reduction as a multi-marginal Optimal Transport problem. The objective is to find a joint distribution (coupling) of random frequencies that minimizes the expected squared error of the kernel estimate. This connection allows the application of Kantorovich's formulation of OT to the domain of kernel approximations.

Pairwise Norm-Coupling (PNC)

For standard Euclidean kernels, such as the Gaussian kernel, the authors demonstrate that for pairs of orthogonal frequencies, the optimal strategy is negative monotone coupling. In this scheme, if one random frequency has a large norm, its paired frequency should have a small norm, thereby maximizing sample diversity.

The Optimal Transport framework allows for transforming standard distributions into coupled frequencies that minimize kernel approximation error.

For more complex scenarios where analytical solutions are elusive, the authors employ numerical OT solvers. They parameterize dependencies using a Gaussian Copula and optimize the correlation matrix via gradient descent.

σ-coupled Graph Random Features (GRFs)

In the context of graphs, kernels are typically estimated via random walks. The authors propose a data-driven approach that maps random walk lengths to a bipartite matching problem. By solving this matching using the Hungarian algorithm, they ensure that the lengths of random walks are coupled to minimize approximation error for the specific graph topology.

The σ-coupling approach for Graph Random Features utilizes bipartite matching between quantiles to optimize random walk lengths.

The Transformer Paradox

A significant finding of this research concerns the "Performer," an efficient Transformer architecture. While PNC successfully reduces the variance of pointwise kernel estimates, it does not necessarily translate to better attention mechanism performance. Surprisingly, the authors found that maximizing variance (using positive monotone coupling) improved ImageNet accuracy by 0.8%.

This occurs because the attention mechanism is normalized via softmax. Increasing the variance of individual scores while also increasing their covariance allows errors to cancel out during the normalization step. This insight suggests that the machine learning community may need to rethink variance reduction objectives for normalized architectures.

Key Results

The proposed methods were evaluated across diverse benchmarks, showing superior performance in several areas:

  • UCI Regression: PNC achieved significantly lower RMSE compared to standard i.i.d. or orthogonal features across multiple datasets, including Concrete, Abalone, and Power.
  • Graph Gaussian Processes: σ-coupled features provided superior uncertainty quantification on mesh graphs and real-world networks, often improving KL divergence to the true posterior by more than a factor of two.
  • PageRank Efficiency: The OT-based coupling consistently matched or exceeded the state-of-the-art for estimating PageRank vectors on large-scale graphs.

Conclusion and Future Work

By establishing a rigorous link between variance reduction and Optimal Transport, this work provides a powerful new toolkit for scalable kernel methods. While analytical solutions for large numbers of marginals remain a challenge, the empirical success of pairwise couplings is evident. Future research will focus on developing OT cost functions that optimize directly for downstream tasks, such as classification accuracy, rather than intermediate kernel fidelity.

Summary updated

BibTeX
@misc{reid2024variance,
  author = {Isaac Reid and Stratis Markou and Krzysztof Choromanski and Richard E. Turner and Adrian Weller},
  title = {{Variance-Reducing Couplings for Random Features: Perspectives from Optimal Transport}},
  year = {2024},
  eprint = {2405.16541},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.16541},
}
Figure