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

Orthogonal Random Features

Felix X. Yu, Ananda Theertha Suresh, Krzysztof Marcin Choromanski, Daniel N. Holtmann-Rice, Sanjiv Kumar

Kernel methods, such as Support Vector Machines (SVMs) with Gaussian kernels, are foundational tools in nonlinear machine learning. However, they scale poorly with large datasets because they typically require computing an $N \times N$ kernel matrix, which becomes computationally prohibitive as the number of data points $N$ grows.

To address this scaling issue, researchers often turn to Random Fourier Features (RFF). RFF maps high-dimensional data into a lower-dimensional space where a simple dot product approximates the complex kernel. Traditionally, this mapping uses a projection matrix $W$ filled with independent, identically distributed (i.i.d.) Gaussian values. While effective, RFF has two main drawbacks: it often requires a very large number of features to achieve a low approximation error, and computing the transformation for high-dimensional data is computationally expensive, scaling at $\mathcal{O}(d^2)$ time.

This paper introduces Orthogonal Random Features (ORF), a simple yet powerful tweak to the classic RFF algorithm. By replacing standard independent Gaussian projections with orthogonal ones, the authors significantly reduce kernel approximation error. Furthermore, they propose a structured version (SORF) that is both faster and more memory-efficient.

The Methods: ORF and SORF

The paper proposes two main innovations to improve upon standard RFF:

  1. Orthogonal Random Features (ORF): Instead of sampling the rows of the projection matrix $W$ independently, the authors enforce orthogonality. They decompose the matrix as $W = \frac{1}{\sigma} SQ$, where $Q$ is a random orthogonal matrix and $S$ is a diagonal matrix that scales the rows to match the required Gaussian distribution. This ensures the estimator remains unbiased while significantly reducing its variance.
  2. Structured Orthogonal Random Features (SORF): Generating a truly random orthogonal matrix is slow, requiring $\mathcal{O}(d^3)$ time. To fix this, the authors use a "structured" approach: $W = \frac{\sqrt{d}}{\sigma} HD_1HD_2HD_3$. Here, $H$ is a normalized Walsh-Hadamard matrix, and $D_i$ are random diagonal matrices (essentially random sign flips). This structure mimics the properties of a random orthogonal matrix but can be computed in $\mathcal{O}(d \log d)$ time using the Fast Walsh-Hadamard Transform.

Key Insights: Why Orthogonality Works

The "aha moment" of this research is the realization that i.i.d. sampling in RFF is suboptimal. In the variance calculation for the kernel estimator, orthogonality introduces negative correlation between the random features. These negative terms subtract from the total variance, leading to a much more stable and accurate approximation than independent sampling.

Variance ratio and empirical distribution showing how ORF reduces variance compared to RFF.

Furthermore, the authors found that using three blocks of Hadamard-Diagonal transformations ($HDHDHD$) is the "sweet spot." It provides enough randomness to behave like a truly orthogonal matrix while remaining computationally cheap. Unlike other methods (like Nyström) that look at the data to build an approximation, ORF and SORF are entirely data-independent. This makes them robust and easy to implement as a pre-processing step for any dataset.

Key Results

The authors evaluated their methods on six diverse datasets, including USPS, MNIST, CIFAR-10, LETTER, FOREST, and the high-dimensional GISETTE dataset ($d=4096$).

  • Lower Error: Across all datasets, ORF and SORF consistently achieved lower Mean Squared Error (MSE) in kernel approximation compared to standard RFF.
Mean Squared Error (MSE) comparison between RFF and ORF across USPS, MNIST, and CIFAR datasets.
  • Significant Speedup: On the high-dimensional GISETTE dataset, SORF provided a 10x speedup over standard RFF and ORF while maintaining comparable or better classification accuracy.
  • Efficiency: SORF reduces the memory footprint from $\mathcal{O}(d^2)$ to $\mathcal{O}(d)$ (or even $\mathcal{O}(1)$ if using fixed random seeds), which is crucial for deploying models on resource-constrained hardware.
  • Better Accuracy: When used with a linear SVM, SORF often reached the "exact" kernel accuracy with significantly fewer features than standard RFF.

Limitations and Future Work

While highly effective, the methods have a few limitations. The theoretical proofs and most experiments focus primarily on the Gaussian (RBF) kernel. While the authors suggest the method can be generalized to other shift-invariant kernels, the performance gains might vary. Additionally, the SORF method relies on the Walsh-Hadamard Transform, which typically requires the input dimension $d$ to be a power of 2. While padding with zeros is a standard workaround, it adds a small amount of overhead.

Looking forward, the authors suggest that the $HDHDHD$ structure could serve as a general-purpose replacement for random Gaussian matrices in other areas, such as dimensionality reduction or fast locality-sensitive hashing (LSH), opening the door for broader algorithmic improvements.

Summary updated

BibTeX
@inproceedings{yu2016orthogonal,
  author = {Felix X. Yu and Ananda Theertha Suresh and Krzysztof Marcin Choromanski and Daniel N. Holtmann-Rice and Sanjiv Kumar},
  title = {{Orthogonal Random Features}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2016},
  url = {https://openreview.net/forum?id=BJNWqDWdWS},
}
Figure