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

Fast sketching of polynomial kernels of polynomial degree

Zhao Song, David Woodruff, Zheng Yu, Lichen Zhang

Overview

Kernel methods, such as Support Vector Machines (SVMs) and Gaussian Processes, are foundational to machine learning. However, they suffer from a notorious scalability bottleneck: computing a kernel matrix for $n$ data points in $d$ dimensions typically requires $O(n^2 d)$ time. As datasets grow, this quadratic dependence on $n$ becomes computationally prohibitive.

This paper introduces a breakthrough algorithm for "sketching" polynomial kernels, significantly accelerating kernel-based machine learning. By employing a novel "limited randomness" approach combined with repeated powering, the authors achieve a runtime that is nearly linear in the input size ($nd$). Crucially, their method removes the polynomial degree from the leading order term of the runtime, outperforming previous state-of-the-art techniques—especially for high-degree and slow-growing kernels like the Neural Tangent Kernel (NTK).

The Sketching Dilemma for Polynomial Kernels

"Sketching" is a standard technique to bypass the $O(n^2 d)$ bottleneck. It compresses data into a lower-dimensional space while preserving essential geometric properties. Polynomial kernels are particularly important because they serve as the building blocks for many other complex kernels via Taylor expansion.

Historically, sketching polynomial kernels presented a dilemma. Previous techniques either suffered from a runtime that grew exponentially with the polynomial degree ($p$) or exhibited a high-order polynomial dependence on the number of data points (e.g., $n^3$). This made them impractical for "slow-growing" kernels, such as the NTK or arc-cosine kernels, which require very high-degree polynomial approximations to be accurate.

A Novel Approach: Limited Randomness and Repeated Powering

To overcome these limitations, the authors propose a new oblivious sketching algorithm called TENSORSKETCHVIALIMRAND. Its core innovation lies in its highly efficient management of randomness:

  1. Limited Randomness: Standard sketching techniques typically require $O(p)$ independent sketching matrices. The authors mathematically prove that only two distinct base sketches ($T$ and $S$) are necessary. By carefully balancing the complexity of applying these base sketches, they can be reused without losing approximation guarantees.
  2. Repeated Powering: Instead of applying a massive, one-shot transformation, the algorithm "squares" the vector by computing a tensor product with itself, applies a sketch, and repeats this process recursively in a binary tree-like structure.
  3. Preserving the Column Span: Although reusing randomness makes the sketch theoretically "weaker" than a full Oblivious Subspace Embedding (OSE), the authors demonstrate it is still powerful enough to preserve the column span of the polynomial kernel matrix. This preservation is the only strict requirement for most downstream machine learning tasks.

Key Results and Complexity Improvements

This is a theoretical paper focused on algorithmic complexity; thus, its primary contributions are rigorous big-O complexity bounds rather than empirical benchmarks. The algorithm treats the polynomial kernel as a "universal donor"—optimizing the polynomial sketch provides a cascading speedup for any kernel that can be expressed as a Taylor series.

The most significant achievement is the decoupling of the polynomial degree $p$ from the input size $nd$. Even for highly complex models requiring a large $p$, the initial data pass remains highly efficient.

Comparison of Sketch Dimension and Running Time

As shown in the comparison above, the improvements over the previous state-of-the-art (Ahle et al., 2020) are substantial:

  • Leading Term Reduction: The leading runtime term is reduced from $O(pnd)$ to $\tilde{O}(nd)$.
  • Second Term Reduction: The dependence on the number of data points in the second term drops from $n^3$ to $n^2$ (specifically, $\tilde{O}(\epsilon^{-2} n^2 p^2)$), which is a massive computational win for large datasets.

These theoretical improvements translate into the fastest known algorithms for approximating both the Gaussian Kernel and the Neural Tangent Kernel (NTK). For the NTK, the authors achieve a runtime of $\tilde{O}(\epsilon^{-3} n^{11/3} + nd)$, providing a powerful new tool for analyzing over-parametrized neural networks.

Limitations and Future Directions

While the theoretical complexity bounds are vastly superior, the paper relies on big-$\tilde{O}$ notation, which hides constant factors that can impact practical, real-world performance. Future empirical studies will be necessary to benchmark these constants.

Additionally, the authors note that their sketch does not naturally produce a dimension bound based on "statistical dimension" (a measure of the effective rank of the kernel matrix) without further composition with other sketches. Finally, while the approach is highly optimized for "slow-growing" kernels requiring many Taylor expansion terms, future work could explore tailored sampling schemes to further optimize specific kernel families.

Summary updated

BibTeX
@misc{song2021fast,
  author = {Zhao Song and David Woodruff and Zheng Yu and Lichen Zhang},
  title = {{Fast sketching of polynomial kernels of polynomial degree}},
  year = {2021},
  eprint = {2108.09420},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.09420},
}
Figure