Safe Quantum Stochastic Linear Bandits

Ruizhe Zhang, Junyi Wu, Guang Lin

TL;DR

Learning by trial and error is tricky when a bad choice breaks your system—like frying a power grid or scrambling a quantum computer's qubits. Classical "safe" bandit algorithms play it safe, but their performance hits a fundamental $\sqrt{T}$ bottleneck because they only get one noisy data point per try. By querying environments coherently on a quantum computer, this paper shatters that barrier, achieving exponentially better (polylogarithmic) regret while keeping every chosen action strictly within safety limits.

What Problem Does This Paper Address?

Imagine tuning a microwave pulse to read out a superconducting qubit. A stronger pulse makes it easier to read the logical bit, maximizing your reward. Push it too far, though, and the qubit leaks into a higher energy state, ruining future operations.

This is the domain of safe stochastic linear bandits: an agent repeatedly picks an action $a_t$ from a $d$-dimensional space to maximize an unknown linear reward while keeping $m$ unknown linear safety metrics below strict thresholds at every single step (starting from a known, conservative baseline action).

Classically, Monte Carlo estimation creates a hard statistical wall: cumulative regret—the gap between what you earned and what the optimal safe action would have earned over $T$ rounds—cannot beat $\Omega(\sqrt{T})$. Recently, quantum algorithms broke this $\sqrt{T}$ barrier for unconstrained bandits using coherent quantum oracles (reversible circuits that output quantum superpositions of rewards). However, unconstrained optimism is reckless when constraints are unknown. Here, you have to be simultaneously optimistic about rewards to explore effectively, and conservative about constraints so you don't cross the line. Can quantum access still give an exponential speedup without violating safety?

Methods

The authors formalize three quantum feedback models and build novel algorithms for the two where coherent quantum access is available:

Figure 1: Safe quantum bandit models. In Figure 1a, each action a has a corresponding unitary oracle Oa that prepares a coherent qsample of the stochastic feedback. In Figure 1b, each query applies a quantum channel Ea followed by measurement, yielding classical feedback. In Figure 1c, the learner queries actions in superposition (first register) while the oracle attaches a safety flag (second register) and prepares the reward qsample (third register); measuring 1 on the flag register triggers a bomb explosion and terminates the algorithm.
  1. QRS-COLTS (Classical actions, coherent feedback): Here, the learner picks a single classical action, and a quantum oracle returns a coherent superposition ("qsample") of the noisy reward and $m$ safety measurements. QRS-COLTS adapts a classical constrained Thompson Sampling architecture into stages. Instead of updating after single noisy samples, it repeatedly queries the chosen action within a stage using bounded multivariate quantum mean estimation. To balance exploration and safety, it draws $K_s$ coupled random perturbations to find an optimistic candidate action, then conservatively scales that action back toward the known safe baseline before playing it.
  2. BCO-QLinTS (Coherent actions with a "safe-action bomb"): What if the learner queries a superposition of actions at once? Drawing inspiration from the Elitzur–Vaidman bomb-testing problem, the oracle attaches an exact unsafe-action flag—a "bomb"—that is measured after every query. If it reads 1, the bomb explodes and terminates the algorithm. BCO-QLinTS treats this bomb as an exact membership oracle for the true safe set. Using bomb-safe quantum convex optimization, it keeps quantum amplitude on unsafe actions tiny (bounding total explosion probability by $\varepsilon$) and optimizes perturbed linear rewards directly over the safe set—never bothering to estimate the $m$ constraint equations at all.

(A third model—classical actions with immediate measurement—collapses the quantum state and reduces to the classical $\Omega(d\sqrt{T})$ bottleneck, serving as a baseline).

Datasets

Not discussed in the paper. (This is a purely theoretical work proving mathematical guarantees on safety and query complexity).

Key Insights and Ideas

  • Multivariate estimation tames constraint scaling: If you estimated the reward and $m$ constraints separately using scalar quantum mean estimation, your query cost would multiply by $(m+1)$. By rescaling vector feedback and using multivariate quantum mean estimation, QRS-COLTS estimates all coordinates simultaneously, shrinking the penalty to just $\sqrt{m+1}$.
  • Bypassing constraint learning via interaction-free measurement: In the bomb model, testing feasibility across $m$ constraints gets compressed into a single dangerous bit. By carefully simulating membership queries without setting off the bomb, BCO-QLinTS completely decouples regret from the number of constraints $m$—constraints only show up logarithmically through the geometric shape of the safe region.
  • Resampling fixes stage-wise commitment: Standard Thompson sampling only achieves optimism with a constant probability (~16%) per round, which is fine over $T$ classical rounds, but fatal when you only have $\widetilde{O}(d \log T)$ quantum stages. Resampling $O(\log(s/\delta))$ perturbations per stage guarantees high-probability optimism at every single stage.

Key Results

Both algorithms break the classical $\sqrt{T}$ regret barrier, achieving polylogarithmic scaling in the query horizon $T$:

Comparison of linear bandit algorithms selecting one classical action per query.
  • QRS-COLTS: Guarantees round-wise expected safety ($\Phi^\star a_t \le \alpha$ for all $t \le T$) with probability at least $1 - 3\delta$, while achieving a cumulative regret of $\widetilde{O}\left(\sqrt{m+1}\, d^2 \log^{3/2}(T/\delta)\left(1 + \frac{\Delta(a_{\text{safe}})}{\Gamma_0}\right)\right)$, where $\Delta(a_{\text{safe}})$ and $\Gamma_0$ are the reward gap and safety margin of the baseline action. Compared to its classical cousin S-COLTS ($\widetilde{O}(\sqrt{d^3 T})$), it trades an exponential improvement in $T$ for a slightly higher dimension factor ($d^2$ vs. $d^{3/2}$).
  • BCO-QLinTS: Keeps cumulative bomb-explosion probability at most $\varepsilon$ over all $T$ queries and achieves a query-weighted regret of $\widetilde{O}\left(d^2 \log^{3/2}(2T/\delta) + \frac{d^4 \log^2(2T)}{\varepsilon}\right)$—entirely independent of $m$.

Limitations and Future Work

  • Query complexity vs. wall-clock time: The speedups count quantum oracle queries. Because QRS-COLTS still solves classical linear optimization subproblems and matrix updates between stages, real-world wall-clock speedups only materialize when running the quantum simulator dominates classical compute.
  • Safety in expectation, not per-shot: QRS-COLTS enforces safety on the expected constraint values. Individual noisy realizations on a single run can still spike above the threshold $\alpha_i$.
  • Open theoretical gaps: The authors ask whether the $d^2$ dependence can be tightened to match the $d^{3/2}$ rate of unconstrained quantum linear bandits, whether the $\widetilde{O}(d^4 \log^2 T / \varepsilon)$ bomb-simulation overhead can be lowered, and how these ideas extend to hybrid quantum-classical feedback, contextual bandits, and reinforcement learning.

Summary updated

Abstract

We initiate the study of safe quantum stochastic linear bandits, in which a learner maximizes an unknown linear reward while satisfying unknown linear mean constraints at every interaction. Under coherent unitary access to the joint reward-and-constraint distribution, we develop QRS-COLTS, a staged quantum resampled-scaling analog of constrained linear Thompson sampling (COLTS). With high probability, QRS-COLTS plays only feasible actions and achieves regret that is polylogarithmic in the query horizon and scales only with the square root of the number of constraints. We also study a model in which the learner queries superpositions of actions while an unsafe-action flag, a "bomb" that terminates the interaction upon violation, is measured after every query. In this setting, the bomb provides exact membership access to the safe set, and query regret is evaluated over the action superposition. For this model, we propose BCO-QLinTS, which selects feasible actions via bomb-certified quantum convex optimization without estimating the constraint matrix. Its query-weighted regret remains polylogarithmic in the horizon, with the constraints entering the bound only through the geometry of the safe set.
BibTeX
@inproceedings{zhang2026safe,
  author = {Ruizhe Zhang and Junyi Wu and Guang Lin},
  title = {{Safe Quantum Stochastic Linear Bandits}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=w0Ou0Qeg5H},
}
Figure