Optimal algorithmic complexity of inference in quantum kernel methods

Elies Gil-Fuster, Seongwook Shin, Sofiene Jerbi, Jens Eisert, Maximilian J. KramerNeurIPS 2026

TL;DR

Quantum kernel methods are a leading candidate for achieving quantum advantage in machine learning, but making a single prediction on new data has historically required a slow, brute-force slog through every training datapoint. By bundling the entire dataset evaluation into one coherent quantum operation and applying smarter estimation subroutines, the authors slash the query complexity to its theoretical limit—completely removing the dataset size from the query count. Surprisingly, however, the absolute fastest method in theory isn't always the cheapest to actually build out of quantum logic gates, making this paper an essential, practical roadmap for real-world quantum hardware.

What Problem Does This Paper Address?

Imagine you’ve trained a machine learning model using a quantum kernel. Kernel methods work by mapping data into a high-dimensional space (here, quantum states) where patterns become easier to separate. Once trained on a dataset of $N$ points, making a prediction (inference) on a new input $x$ means calculating a weighted sum of how similar $x$ is to each of the $N$ training points: $f_\alpha(x) = \sum_{i=1}^N \alpha_i k(x, x_i)$, to some target precision $\varepsilon$.

The standard, naive way to compute this is painfully literal: measure the similarity between $x$ and the first training point via repeated quantum circuit sampling, write it down, move to the second point, and repeat $N$ times. This brute-force approach requires $\mathcal{O}(N\|\alpha\|_2^2/\varepsilon^2)$ oracle queries, creating a severe scalability bottleneck as datasets grow or high precision is needed. The authors ask: how fast can we fundamentally make quantum kernel inference, and what is the best way to run it on actual hardware?

Methods

The authors break the inference problem down along two independent algorithmic axes, mapping out a complete landscape of strategies:

Figure 1: Schematic overview of the four algorithmic strategies for inference in quantum kernel methods. The two axes correspond to the two independent design choices: how the sum over training points is approximated (list-and-sum versus all-at-once, vertical axis), and how expectation values are estimated (sampling versus quantum amplitude estimation, horizontal axis). In list-and-sum, each kernel value k(x, xi) is estimated independently and results are combined classically. In the all-at-once approach, the full inference sum is encoded as a single observable. Moving from sampling to quantum amplitude estimation yields a quadratic improvement in precision within each row.
  1. How to approximate the sum: Instead of the standard list-and-sum approach (evaluating each of the $N$ terms one by one, either with a fixed query budget or an adaptive budget weighted by coefficient size), the authors formalize an all-at-once strategy. By encoding the trained weights $\alpha$ into the amplitudes of a quantum state and compiling the training points into a single "training-set oracle," they group the entire weighted sum under one observable—measuring the whole dataset's contribution coherently in one go.
  2. How to estimate expectation values: Instead of standard sampling (repeatedly running and measuring a circuit, where precision scales poorly with shots $M$ as $\mathcal{O}(1/\sqrt{M})$), one can use Quantum Amplitude Estimation (QAE). QAE bounces quantum states back and forth coherently to extract probabilities with a quadratic speedup, reaching $\mathcal{O}(1/M)$ precision.

Datasets

Not discussed in the paper. Because this is a theoretical algorithmic complexity study, the authors prove worst-case mathematical bounds within a formal black-box oracle model rather than benchmarking on empirical datasets.

Key Insights and Ideas

  • No QRAM required: Quantum algorithms often hide massive hardware assumptions inside "Quantum Random-Access Memory" (QRAM). Here, because the training set is classically known and fixed after training, the all-at-once circuit can be compiled offline using standard controlled gates—no exotic QRAM needed.
  • Query-optimal does not mean gate-optimal: In theoretical computer science, we usually count black-box queries. Under that metric, combining all-at-once with QAE wins hands-down. However, a single query to the all-at-once oracle has to touch all $N$ training points, making each query $N$ times deeper in terms of elementary quantum logic gates. When you count total gates, evaluating terms individually with an adaptive budget (spending more effort on larger $\alpha_i$ weights) and QAE actually beats the query-optimal method!
  • Near-term devices get a free lunch via adaptivity: If you are stuck on noisy, near-term hardware where QAE is out of reach and you must rely on standard sampling, you don't need the complex all-at-once circuit. Simply switching from a fixed shot budget to an adaptive budget in list-and-sum achieves the exact same query scaling with $N$-times fewer gates.

Key Results

The authors establish rigorous upper bounds across all algorithmic combinations for both query count and gate complexity:

Query complexity across the six algorithmic strategies
  • Query Optimality: Combining all-at-once with QAE improves query complexity from the naive $\mathcal{O}(N\|\alpha\|_2^2/\varepsilon^2)$ down to $\mathcal{O}(\|\alpha\|_1/\varepsilon)$. This strips $N$ out of the query count entirely and provides a quadratic speedup in precision $\varepsilon$. The authors also prove a matching $\Omega(\|\alpha\|_1/\varepsilon)$ lower bound, confirming no future algorithm in this access model can beat it.
  • Gate Optimality: When accounting for circuit size (assuming an $n$-qubit feature map takes $G$ gates), all-at-once + QAE costs $\tilde{\mathcal{O}}((NG+n)\|\alpha\|_1/\varepsilon)$ gates. Meanwhile, list-and-sum (adaptive) + QAE achieves $\tilde{\mathcal{O}}(G\|\alpha\|_{2/3}/\varepsilon)$ gates (where $\|\alpha\|_{2/3} = (\sum |\alpha_i|^{2/3})^{3/2}$), winning the title of lowest gate-count upper bound by up to a factor of $\sim N$.

Limitations and Future Work

  • Pure states only: The circuit constructions assume unitary feature maps that prepare pure quantum states; extending these speedups to noisy or mixed-state feature maps $\rho(x)$ remains an open problem.
  • No gate-complexity lower bound: While query optimality is mathematically locked in, there is no matching lower bound for gate complexity—meaning a clever future algorithm with sublinear-in-$N$ gate cost isn't strictly ruled out.
  • Kernel concentration: If a quantum kernel suffers from exponential concentration (where similarity values vanish exponentially with qubit count), these bounds still hold mathematically, though the underlying ML model loses predictive power.
  • Speeding up training: Training a kernel model still typically requires $\mathcal{O}(N^3)$ classical work to invert a kernel matrix. Future work could embed these fast inference subroutines directly inside gradient-based quantum optimization loops to accelerate training itself.

Summary updated

Abstract

Quantum kernel methods are among the leading candidates for achieving quantum advantage in supervised learning. A key bottleneck is the cost of inference: evaluating a weighted sum of $N$ kernel values to additive precision $\varepsilon$, where $\alpha$ is the vector of trained coefficients. The standard approach estimates each term independently via sampling, yielding a query complexity of $\mathcal{O}(N\lVert\alpha\rVert_2^2/\varepsilon^2)$. In this work, we combine two independent improvements: estimating the kernel values via quantum amplitude estimation and collecting the sum under a single observable. We show that the improved approach achieves a query complexity of $\mathcal{O}(\lVert\alpha\rVert_1/\varepsilon)$, removing the dependence on $N$ from the query count and yielding a quadratic improvement in both $\lVert\alpha\rVert_1$ and $\varepsilon$. We prove a matching lower bound of $\Omega(\lVert\alpha\rVert_1/\varepsilon)$, establishing query-optimality. Beyond query complexity, we also analyze how these improvements translate into gate costs and show that the query-optimal strategy is not always optimal in practice from the perspective of gate complexity. We identify a different strategy based on importance sampling, which yields a lower total gate count. We thus provide both a query-optimal algorithm and a practically-optimal choice of strategy depending on hardware capabilities, along with a complete landscape of intermediate methods to guide practitioners. All algorithms require only amplitude estimation as a subroutine and are thus natural candidates for early-fault-tolerant implementations.
BibTeX
@inproceedings{gilfuster2026optimal,
  author = {Elies Gil-Fuster and Seongwook Shin and Sofiene Jerbi and Jens Eisert and Maximilian J. Kramer},
  title = {{Optimal algorithmic complexity of inference in quantum kernel methods}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=dMzQUanLcb},
}
Figure