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

Quantum algorithm for training nonlinear SVMs in almost linear time

Jonathan Allcock, Chang-Yu HsieharXiv 2020

Abstract

Support Vector Machines (SVMs) are powerful tools for supervised learning, but their nonlinear variants suffer from a quadratic scaling bottleneck $O(m^2)$ relative to the number of training examples $m$. We present a quantum algorithm that leverages structural SVM formulations and quantum inner product estimation to achieve "almost linear" $\tilde{O}(m)$ training time. By encoding data into quantum feature maps and utilizing a hybrid classical-quantum loop, this approach sidesteps the need to compute full kernel matrices, offering a path toward scalable nonlinear classification on future fault-tolerant quantum hardware.

Introduction: The Scalability Wall of Kernel Methods

Support Vector Machines are prized for their interpretability and guaranteed global optima. While linear SVMs can be trained efficiently, nonlinear SVMs—which use the "kernel trick" to find complex boundaries—typically scale quadratically with the dataset size. This $O(m^2)$ complexity arises because the algorithm must compute and often store a massive matrix of similarities between every pair of data points. While classical approximations like Nyström sampling exist, they are often restricted to specific kernel types. This paper introduces a quantum method to achieve linear-time training for arbitrary nonlinear kernels.

Methodology

The proposed algorithm is a quantum extension of SVM-perf, a classical method for training linear structural SVMs. The hybrid approach relies on four pillars:

  1. Structural SVM Formulation: Instead of the standard $m$-constraint problem, the authors use a structural version with $2^m$ constraints but a highly sparse solution. This allows the algorithm to focus on a small "working set" of constraints that does not grow with $m$.
  2. Quantum Feature Maps: Classical data is encoded into quantum state amplitudes, allowing the algorithm to operate in a high-dimensional Hilbert space where nonlinear patterns become linearly separable.
  3. qRAM and Inner Product Estimation: Using Quantum Random Access Memory (qRAM), the algorithm queries data in superposition and estimates inner products (similarities) in $O(\text{polylog } m)$ time.
  4. Hybrid Optimization Loop: A quantum computer identifies the most violated constraints, while a classical computer solves a restricted optimization problem. A classical projection step ensures the resulting kernel matrix remains positive semi-definite (PSD) despite quantum noise.
Figure 1: Visualization of the synthetic Ising Hamiltonian dataset in the J-Delta parameter space, showing a nonlinear decision boundary.

Experimental Validation

To verify the algorithm's scaling, the authors performed classical simulations using a Synthetic Ising Hamiltonian Dataset. Data points were generated based on parameters ($J, \Delta$) of a generalized Ising Hamiltonian, with labels assigned based on the ground state's magnetic properties.

Figure 2: Another instance of the synthetic dataset demonstrating more complex, XOR-like nonlinear class distributions.

The simulations covered datasets from $m = 10^2$ to $m = 10^5$ examples. Key results include:

  • Classification Accuracy: The algorithm achieved 93% to 99% accuracy, matching or exceeding classical SVMs using Gaussian RBF kernels.
  • Iteration Stability: The number of iterations required for convergence remained nearly constant (36–39) as the dataset size increased 1000-fold, confirming the $\tilde{O}(m)$ scaling claim.
  • Robustness: The classical PSD projection step successfully mitigated the impact of noisy quantum inner product estimates.

Discussion and Future Work

The primary bottleneck for this algorithm is the requirement for fault-tolerant quantum hardware and functional qRAM. Additionally, while the algorithm can utilize any quantum feature map, selecting the optimal map for a given classical dataset remains an open challenge. Future research will focus on tightening the theoretical upper bounds for convergence and exploring the risk of "de-quantization" by classical algorithms.

Summary updated

BibTeX
@misc{allcock2020quantum,
  author = {Jonathan Allcock and Chang-Yu Hsieh},
  title = {{Quantum algorithm for training nonlinear SVMs in almost linear time}},
  year = {2020},
  eprint = {2006.10299},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.10299},
}
Figure