Skip to content
Quantum.world

Research

Training quantum neural networks one job at a time

Treats cloud QNN training as job-budget allocation and releases code showing batched optimizers fail as parameters grow, guiding execution-efficient hybrid training.

Training quantum neural networks one job at a time
arXiv
2611.16365
Published
2026-11-12
Authors
Muhammad Faryad, Rabab Alomairy

AI summary

Overview

Research area: Quantum machine learning — specifically optimizer design for variational quantum algorithms (VQAs) and quantum neural networks (QNNs) executed on cloud-queued quantum processors, framed through a high-performance computing (HPC) lens of overhead amortization.

Technical level: Intermediate. The paper is readable without deep mathematics, but it assumes familiarity with parameterized quantum circuits, the parameter-shift rule, and gradient-based optimization.

Scope: A controlled comparison of four optimizers — SPSA, batched parameter-shift with Adam, compass pattern search, and a new sinusoid stencil search — given identical job budgets and shots per job, validated in simulation and on IBM's ibm_fez processor.

What This Paper Is About

When a variational quantum algorithm runs on cloud hardware, every submission to the quantum processor pays a queue wait, a load overhead, and metered execution time, regardless of how many circuits the submission contains. Standard optimizer comparisons count circuit evaluations or shots, which misses this cost entirely. This paper asks a different question: given a fixed number of jobs and a fixed number of shots per job, how should each optimizer fill a job so that training makes the most progress per costly round trip? The authors answer it for a data re-uploading QNN classifier built from Pauli rotations.

Key Contributions

  1. A job-aware framing of hybrid training. The paper defines a job as one Qiskit primitives PUB — a circuit plus an array of R parameter rows plus s shots, for S = Rs total shots — and defines an optimizer as "job-aware" when its k-th query set depends only on the results of jobs 1 through k−1. It fits a measured cost model, T_job ≃ t₀ + τ_s S + τ_r R, to all 306 jobs of the study (three runs of 102 jobs each), with t₀ ≈ 2.0 s, τ_s ≈ 0.27 ms per shot and τ_r ≈ 0.5 ms per row.

  2. Demonstration that the QAOA batched-optimizer port fails but its principle transfers. The compass pattern search of the authors' earlier QAOA work (Ref. 8) stalls at a few dozen parameters because it accepts at most one coordinate move per job. What transfers is filling each job with a batch fixed before submission — and for Pauli-rotation circuits the natural batch is the parameter-shift stencil of 2P+1 parameter vectors, which yields exact derivatives in one round trip.

  3. A new sinusoid stencil search. Because each angle enters once as a Pauli rotation, every model output is a first-order trigonometric polynomial in that angle, so three rows (t = 0, ±π/2) determine the full one-dimensional loss curve. The optimizer probes k = 10 coordinates per job, moves all of them at once using dampings of 0.25 and 0.5 plus the best single-coordinate step, and tests those moves on a fresh minibatch in the next job, so the line search costs no extra round trip.

  4. A per-job error analysis with two testable signatures. Under fixed shots per job, the batched parameter-shift gradient error falls as 1/S, while SPSA's error has a shot-independent floor of order P‖g‖².

Main Findings

  • Batched parameter shift wins in simulation. The ordering at both noise levels (η = 0.03 and η = 0.2) is: batched parameter shift, then the sinusoid search, SPSA with 18 directions per job, plain SPSA, and compass search. Batched parameter shift reached SPSA's 50-job loss in about 20 jobs and its 100-job loss in 30 to 40, and was ahead of SPSA at job 50 from 19 or 20 of the 20 initial points.

  • Job savings scale from P = 24 to P = 48. The batched optimizer needed between a fifth and a half of SPSA's jobs across that range, for both n = 6 and n = 8.

  • Compass pattern search stalls. Its best loss after 100 jobs stayed near 0.14 across all tolerance settings tried, a level batched parameter shift reached in about 17 jobs. The paper attributes this to at most one coordinate move per job combined with an acceptance test that is hard to set under minibatch noise.

  • The error laws are confirmed by direct sampling. Parameter-shift error follows 1/S over nearly two decades of S. At the lowest shot counts the sampled error lies above the prediction by up to about 50% partway through training, because Eq. (8) drops the noise of the incumbent row. SPSA sits on its floor, somewhat below the linear prediction because at c = 0.2 the perturbation c√P ≈ 1.2 rad is not small.

  • SPSA cannot convert extra shots into progress. When shots per job were varied from 5.6 × 10³ to 4.5 × 10⁴, SPSA gained from the first doubling but flattened above about 10⁴ shots, while batched parameter shift kept improving.

  • Hardware training matches the simulation. On ibm_fez, in three interleaved runs (n = 6 from two initial points and n = 8 from one, 50 jobs per arm), arm A (batched parameter shift) ended with a lower training loss than arm B (SPSA) in all three runs and reached B's final loss after 4, 20 and 8 of its jobs.

  • Test accuracy is clear only at eight qubits. At n = 8, arm A reached 0.79 against arm B's 0.71 (p = 0.003, McNemar test), and arm A after only 16 jobs already beat arm B after 50 (p = 0.01). At n = 6, arm A was ahead in run 1 (0.78 against 0.74) and level in run 2. The two n = 6 runs alone gave 80 correct against 69 (p = 0.41); the pooled three-run comparison of 130 against 93 (p = 0.016) is reported with an explicit caveat that the 900 comparisons are not independent and that the result is carried by run 3.

  • Controls behave as intended. The encoding-off control sat at the majority-class rate in every run; hardware and noiseless accuracies agreed to within 0.02; the fitted contraction of measured against ideal output was 0.92 to 0.97, close to the Aer model and far from the pessimistic surrogate.

  • The advantage survives in wall-clock and metered time. A batched job with 2,336 or 3,104 rows was metered at 9 s and an SPSA job with 128 rows at 8 s. Per run, arm A needed 1.8 to 10 times fewer jobs, 1.6 to 9 times less metered time, and 2.2 to 11 times less round-trip time than arm B.

Methodology in Plain English

The authors build a small quantum classifier that re-uploads classical data into a chain of physical qubits, with one trainable rotation per angle per layer (P = 2nL angles) and CZ gates between neighbors. They use the hidden-manifold benchmark with 300 training and 300 test points drawn with a fixed seed, where logistic regression and an RBF support-vector machine reach about 0.8 test accuracy at n = 6 — a deliberately easy task, chosen so that the study measures training cost rather than model capability.

The central experimental discipline is matching: every optimizer gets the same number of jobs and the same shots per job, so the only difference is which circuits go into each job. SPSA sends two points along one random direction. Batched parameter shift sends the current point plus 2P shifted copies. Compass search sends ±ρ probes along ten coordinates plus a momentum probe. The new sinusoid search sends the same three-row geometry as parameter shift but reconstructs the full loss curve per coordinate and moves all ten probed angles at once, checking those moves in the next job.

For the hardware experiment, the two arms were interleaved job by job (A1, B1, A2, …), so slow device drift could not favor either one. Each run used 102 jobs: 100 training jobs, one read-out job measuring the test set at five parameter sets, and one repeat of arm A's first job to bound drift. Each run took 964 metered seconds; the three runs together used about 48 minutes of processor time on ibm_fez under IBM's Open Plan in job mode, with dynamical decoupling on and Pauli twirling off.

Why This Matters

Impact on research. Optimizer comparisons for variational algorithms conventionally report circuit evaluations or shots. This paper argues that on cloud hardware the number of round trips is the quantity a user can convert directly into time and money, and it provides an error analysis that predicts which optimizers benefit from a larger job payload. It also gives a concrete, reproducible demonstration that the same stencil geometry can be read differently — as a slope (parameter shift) or as a whole sinusoid (the new search) — which is a transferable design idea for structure-aware optimizers.

Real-world applications:

  • Training quantum classifiers through cloud queues, where the per-job cost dominates the per-shot cost.
  • QAOA workloads, such as the portfolio-selection problem with six to twelve assets used in the authors' earlier work, where the compass stencil fits comfortably because the parameter count is small.
  • Any variational algorithm whose generators are Pauli rotations, since the per-job error analysis applies to that class directly.
  • Scheduling and resource management of accelerator-backed hybrid workflows, where the HPC analogy of amortizing launch and communication overhead carries over.

Industry relevance. The results give cloud quantum users a practical rule for filling a job, and a measured cost model (roughly 2.0 s fixed, 0.27 ms per shot, 0.5 ms per row) that converts job counts into metered seconds. The finding that rows are cheap relative to shots and fixed overhead is directly actionable for anyone paying for processor time.

Future Directions

  • Uneven shot allocation within a job. The authors note that shots could be split unevenly between rows inside a single job, in the spirit of shot-frugal methods that allocate unevenly between steps.

  • Exploiting second-order information from the same stencil. The coefficients a_d of Eq. (4) are diagonal curvatures that the batched job already measures, so curvature information is available at no extra round trip.

  • Scaling beyond P = 48. The paper suggests GPU statevector or tensor-network simulators to test how the job-level advantage grows with P beyond the range where an exact oracle is affordable.

  • Re-measuring under different access modes and calibrations. All runs used job mode on one device; with sessions or batches the queue component shrinks but the metered overhead of Eq. (1) does not. A short hardware calibration of SPSA's gain sequences would also settle whether its larger gap to simulation in the two n = 6 runs reflects fragility or mis-tuning. The sinusoid search has not yet been run on hardware.

Target Audience

Quantum machine learning researchers and practitioners who train variational circuits on cloud-accessed hardware; developers of optimizer and compiler tooling for quantum SDKs; HPC and scientific-computing specialists interested in algorithm–system co-design for accelerators; and readers who want a rigorous, reproducible case study in measuring the true cost of hybrid training rather than counting shots.

Authors’ abstract

When a quantum processor is reached through a cloud queue, a variational algorithm pays for every round trip, and a single round trip can carry many circuits. The classical optimizer therefore decides how much is learned per job, not only per shot. We study this for a quantum neural network classifier. We compare optimizers that are given the same number of jobs and the same shots per job, and that differ only in how they fill each job. This comparison treats hybrid…

The full abstract on arXiv
Read the original paper