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

The Fast Kernel Transform

John Paul Ryan, Sebastian E. Ament, Carla P. Gomes, Anil Damle

Abstract

Kernel methods are powerful tools in machine learning, but they are often limited by the quadratic $O(N^2)$ scaling of kernel matrix computations. We present the Fast Kernel Transform (FKT), a general algorithm that achieves quasilinear $O(N \log N)$ complexity for matrix-vector multiplications (MVMs) in moderate dimensions. Unlike traditional acceleration methods that require manual mathematical derivations for specific kernels, FKT leverages auto-differentiation and automated symbolic computations. This "plug-and-play" approach allows it to be easily applied to a wide range of kernels, including Gaussian, Matérn, and Rational Quadratic functions, while maintaining high, controllable accuracy.

Introduction

From Gaussian Processes to t-SNE, kernel methods are ubiquitous. However, the "kernel trick" comes with a heavy computational price: computing interactions between $N$ data points typically requires $O(N^2)$ time. For large datasets, this bottleneck is prohibitive. While specialized algorithms like the Fast Multipole Method (FMM) can reduce this cost, they often impose a "math tax," requiring researchers to manually derive complex expansions for every new kernel. The Fast Kernel Transform (FKT) aims to eliminate this barrier by automating the derivation process.

Methodology

The FKT combines spatial data structures with modern computational tools:

  1. Tree-Based Decomposition: Data points are organized into a k-d tree. Interactions between nearby points are computed exactly, while interactions between well-separated clusters are approximated. This hierarchical partitioning allows the algorithm to focus computational resources where they are most needed.
  2. Generalized Multipole Expansion: FKT uses a new analytical expansion based on Gegenbauer polynomials and hyperspherical harmonics. This mathematical framework allows the kernel function to be separated into terms involving only the "source" points and terms involving only the "target" points.
  3. Automated Derivation: By utilizing Julia’s TaylorSeries.jl and auto-differentiation, FKT automatically computes the necessary kernel derivatives. This makes the algorithm kernel-agnostic—as long as the kernel is isotropic and analytic away from the origin, FKT can accelerate it without manual intervention.

Performance and Scaling

Empirical tests on synthetic datasets confirm that FKT achieves the promised quasilinear scaling. As shown in Figure 2, the runtime grows much more slowly than the naive $O(N^2)$ approach, becoming more efficient even for relatively small datasets ($N \approx 1,000$ in 3D). This scaling behavior is consistent across different dimensions, although the constant factor increases as the dimensionality grows.

Runtime scaling of FKT across different dimensions d, showing quasilinear growth compared to the quadratic baseline.

Accuracy and Benchmarking

A key advantage of FKT is its controllable precision. Users can adjust a truncation parameter ($p$) to achieve exponential convergence to the true value. In comparisons with other popular acceleration methods like Structured Kernel Interpolation (SKI) and Inducing Points (FITC), FKT consistently provides a superior accuracy-to-cost ratio. This is particularly evident in high-precision regimes where relative error must be below $10^{-4}$.

Comparison of FKT against other methods (SKI, FITC, etc.) across different kernels. FKT (blue) shows a significantly better error-to-time tradeoff in the high-accuracy regime.

Real-World Applications

The efficacy of FKT was demonstrated on large-scale tasks that would otherwise be computationally infeasible:

  • t-SNE: FKT-accelerated t-SNE was used to embed the MNIST dataset (60,000 points) efficiently, maintaining the structural integrity of the clusters while slashing compute time.
  • Gaussian Processes: On a Sea Surface Temperature dataset with ~146,000 observations, FKT completed a massive GP regression in just 12 minutes on a standard laptop. Crucially, it achieved four orders of magnitude better accuracy than inducing point methods with similar runtimes, making it ideal for scientific applications requiring high fidelity.

Conclusion and Future Work

The Fast Kernel Transform removes the manual derivation barrier for fast kernel methods. While currently optimized for moderate dimensions ($d < 7$) and isotropic kernels, it represents a significant step toward making high-performance kernel methods accessible for big data. Future work will focus on extending FKT to higher dimensions and incorporating FMM-style translation operators to reach true $O(N)$ scaling.

Summary updated

BibTeX
@inproceedings{ryan2022fast,
  author = {John Paul Ryan and Sebastian E. Ament and Carla P. Gomes and Anil Damle},
  title = {{The Fast Kernel Transform}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
  url = {https://openreview.net/forum?id=dJ6EXJopUcr},
}
Figure