Random Fourier Features in Near-Linear Time

Sepideh Mahabadi, Sandeep Silwal, Tal WagnerarXiv 2026

This paper provides a theoretical breakthrough in the efficiency of kernel methods, a staple of machine learning. The authors prove that a well-known algorithm called "Fastfood" is significantly more powerful than previously thought, offering near-optimal statistical guarantees while running in near-linear time.

TL;DR

The authors provide a new, tighter analysis of the Fastfood feature map, proving it achieves near-subgaussian concentration for Gaussian and radial kernels in $O((d+m) \log d)$ time. This closes a long-standing gap between the computational speed of structured random features and the strong statistical guarantees of traditional Random Fourier Features.

What Problem Does This Paper Address?

Kernel methods allow algorithms to operate in high-dimensional feature spaces by using a "kernel trick," but they often suffer from a computational bottleneck: for a dataset of $n$ points, they typically require $O(n^2)$ time and space to handle the Gram matrix.

Random Fourier Features (RFF) were introduced to solve this by approximating the kernel as an inner product of $m$-dimensional randomized feature vectors. This reduces the complexity to $O(nm)$. However, even computing these $m$ features for a $d$-dimensional input takes $O(md)$ time. When both $d$ and $m$ are large, this becomes a major bottleneck.

Previous "fast" variants of RFF used structured matrices (like the Hadamard transform) to speed up computation to $O(d \log d)$. However, these faster methods came with a catch: their error bounds were much weaker than standard RFF, often depending on the diameter of the data ($\Delta$). This paper asks: Can we get the speed of structured transforms without sacrificing the statistical "concentration" (accuracy) of standard RFF?

Methods

The authors focus on the Fastfood feature map, which uses a sequence of randomized Hadamard transforms (RHTs) to simulate a random rotation. The map is defined as $V = \sqrt{d}HGHB$, where $H$ is a Hadamard matrix, $B$ is a random sign matrix, and $G$ is a random Gaussian diagonal matrix.

The core contribution is a novel mathematical analysis using two advanced tools:

  1. Brascamp-Lieb Inequalities: Standard RFF analysis assumes features are independent. In Fastfood, the features are dependent because they share the same random matrices. The authors use Brascamp-Lieb inequalities to prove that these dependent features still concentrate "as if" they were nearly independent.
  2. Schoenberg Representation: To extend the results beyond the Gaussian kernel to all radial kernels (like the Matérn or Exponential kernels), the authors utilize Schoenberg’s theorem, which represents radial kernels as mixtures of spherical shell kernels.

Datasets

This is a purely theoretical paper. It does not use empirical datasets for evaluation; instead, it provides rigorous mathematical proofs and complexity analyses.

Key Insights and Ideas

  • The "Flattening" Effect: The first stage of the Fastfood map ($HB$) acts to "flatten" the input vector, spreading its mass across all coordinates. The authors show that this flattening is exactly what allows the subsequent Gaussian stage to behave like a collection of well-spread, nearly independent directions.
  • Closing the Gap: For over a decade, researchers believed Fastfood's analysis was inherently pessimistic. By applying the Brascamp-Lieb framework, the authors proved that the error does not need to depend on the data diameter $\Delta$.
  • Optimality: The authors don't just provide an upper bound on speed; they provide a lower bound (Theorem 1.3) showing that their evaluation time is nearly optimal for the level of accuracy achieved.

Key Results

The paper's primary result is summarized in the comparison table below, which shows how this new analysis outperforms previous bounds for the Gaussian kernel.

Table 1: Comparison of random feature maps for the Gaussian kernel. "This work" achieves the best of both worlds: the small output dimension of standard RFF and the fast computation time of structured methods.
  • Near-Linear Time: The feature map can be computed in $O((d+m) \log d)$ time.
  • Strong Concentration: The approximation error decays exponentially with the number of features $m$, matching the "subgaussian" behavior of much slower methods.
  • KDE Breakthrough: The authors provide the first Kernel Density Estimation (KDE) solution with a query time of $\tilde{O}(d + 1/\epsilon^2)$ for a fixed additive error $\epsilon$, solving an open problem in the field.
  • Differential Privacy: The results lead to improved utility-privacy trade-offs for differentially private kernel density release.

Limitations and Future Work

  • Radial Restriction: While the paper covers a wide range of popular kernels (Gaussian, Matérn, Exponential, Cauchy), the analysis is specifically tailored to radial kernels (those depending only on Euclidean distance). Extending this near-linear time analysis to non-radial shift-invariant kernels remains an open challenge.
  • "For-Each" vs. "For-All": The current bounds provide a "for-each" guarantee (high probability for any fixed pair of points). While sufficient for many applications like KDE, some tasks require a "for-all" guarantee (uniform convergence over an entire domain), which typically requires more features.

Summary updated

Abstract

Random Fourier features approximate a shift-invariant kernel in $\mathbb{R}^d$, such as the Gaussian kernel $\exp(-\tfrac12\|x-y\|_2^2)$, using independent samples from its spectral measure to construct an unbiased estimator for the kernel value with subgaussian concentration. However, generating $m$ such features requires $O(md)$ time. A long line of work on structured random features has accelerated this computation for the Gaussian kernel and other radial kernels, albeit with weaker concentration guarantees. We close this gap by showing a random feature map that can be computed in near-linear time $O((d+m)\log d)$ and yields near-subgaussian concentration. We obtain it through a new and tighter analysis of the Fastfood feature map of Le, Sarlós and Smola (ICML 2013), using Brascamp-Lieb inequalities and the Schoenberg representation of radial kernels.
BibTeX
@misc{mahabadi2026random,
  author = {Sepideh Mahabadi and Sandeep Silwal and Tal Wagner},
  title = {{Random Fourier Features in Near-Linear Time}},
  year = {2026},
  eprint = {2610.14751},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.14751},
}

Loading related content...

Figure