Hybrid Random Features
Krzysztof Choromanski, Haoxian Chen, Han Lin, Yuanzhe Ma, Arijit Sehanobish, Deepali Jain, Michael S Ryoo, Jake Varley, Andy Zeng, Valerii Likhosherstov, Dmitry Kalashnikov, Vikas Sindhwani, Adrian Weller
TL;DR
This work introduces Hybrid Random Features (HRFs) to adaptively approximate softmax and Gaussian kernels with unbiased estimators and reduced worst-case relative error. By unifying trig-based, positive random features, and complex exponential representations under Bochner-like theory, HRFs offer flexible constructions (including bipolar, lambda-angular, and Gaussian-mixtures variants) that trade accuracy for computational efficiency. The authors derive general MSE and variance expressions for many hybrids and provide concrete estimator designs with explicit constructions (A-matrices, angular λs, cluster-based schemes). They validate HRFs across kernel estimation tasks and language-modeling benchmarks, showing improved accuracy and efficiency in linear-attention-like settings and related applications, including robotics-relevant tasks. Overall, HRFs offer a principled, scalable framework to tailor kernel estimations to regions of interest while maintaining unbiasedness and favorable error properties.
Abstract
We propose a new class of random feature methods for linearizing softmax and Gaussian kernels called hybrid random features (HRFs) that automatically adapt the quality of kernel estimation to provide most accurate approximation in the defined regions of interest. Special instantiations of HRFs lead to well-known methods such as trigonometric (Rahimi and Recht, 2007) or (recently introduced in the context of linear-attention Transformers) positive random features (Choromanski et al., 2021). By generalizing Bochner's Theorem for softmax/Gaussian kernels and leveraging random features for compositional kernels, the HRF-mechanism provides strong theoretical guarantees - unbiased approximation and strictly smaller worst-case relative errors than its counterparts. We conduct exhaustive empirical evaluation of HRF ranging from pointwise kernel estimation experiments, through tests on data admitting clustering structure to benchmarking implicit-attention Transformers (also for downstream Robotics applications), demonstrating its quality in a wide spectrum of machine learning problems.
