Safe Linear Bandits with Unknown Safety Gaps

Maoli Liu, Zhuohua Li, Zeyu Zhang, Xiangxiang Dai, John C.s. LuiNeurIPS 2026

TL;DR

Imagine tuning a robot's parameters in the dark: you want maximum performance, but stepping across an invisible line fries the hardware. Previously, algorithms could only learn at top speed if someone handed them a cheat sheet telling them exactly how close the optimal setting was to that danger zone. This paper proves you don't need the cheat sheet—introducing an algorithm that learns just as fast on the fly, while also proving that if the best action sits directly on the razor's edge of danger, learning inevitably slows down.

What Problem Does This Paper Address?

In standard stochastic linear bandits, an algorithm repeatedly picks an action $x_t$ over $T$ rounds, observes a noisy reward governed by an unknown parameter $\theta$, and tries to minimize regret—the cumulative reward lost by not picking the optimal action $x^*$ from the start.

In the real world (like power grid management or robotic tuning), exploration has hard limits. Safe linear bandits require every chosen action to satisfy a linear safety constraint ($\theta^\top B x_t \le c_{\text{safe}}$) with high probability at every single round. Crucially, the learner doesn't get separate safety sensors; it must infer the invisible safety boundary using only reward observations, because both reward and safety depend on the same unknown $\theta$.

Performance here hinges on the safety gap ($\Delta$): the slack between the optimal safe action $x^*$ and the safety boundary.

Figure 1: Geometry of the safety gap. In (a), x∗lies on the boundary of D with ∆> 0. In (b), it lies on the safety boundary.

Prior work (Safe-LUCB) left two nagging questions open:

  1. If $\Delta > 0$ and the learner knows $\Delta$ in advance, it achieves optimal $\widetilde{O}(\sqrt{T})$ regret. Without knowing $\Delta$, the best guarantee degrades to $\widetilde{O}(T^{2/3})$. Is knowing $\Delta$ actually necessary to learn fast?
  2. When $\Delta = 0$ ($x^*$ sits directly on the safety boundary), is the sluggish $\widetilde{O}(T^{2/3})$ rate an artifact of clumsy math, or a fundamental speed limit?

Methods

To answer both questions, the authors combine an information-theoretic lower-bound construction with a new multi-scale algorithm:

  • Proving the Speed Limit (Lower Bound): The authors construct two nearly identical 2D worlds ($\theta_+$ and $\theta_-$) where $\Delta = 0$. What is safe and optimal in one world is unsafe in the other. Furthermore, playing near the optimal boundary points yields zero information to tell the two worlds apart! To check which world it's in, the learner is forced to step away from the optimal action into safer, suboptimal territory, creating an inescapable trade-off between conservative regret and information-gathering regret.
Figure 2: Geometry of the lower bound instance construction.
  • Learning Without the Cheat Sheet (EPOCH-SLUCB): Standard safe bandit algorithms start with pure exploration inside a guaranteed-safe zone near the origin, then switch to Upper Confidence Bound (UCB) optimism over certified safe sets. Without knowing $\Delta$, you don't know when to stop exploring. EPOCH-SLUCB solves this by running in epochs ($k = 0, 1, \dots$) with geometrically shrinking working safety margins ($\epsilon_k = 2^{-k/2}$). Each epoch sets a balanced pure-exploration target and round budget. Early epochs cautiously grab low-hanging fruit; later epochs tighten the confidence bounds until they naturally become sharp enough to certify $x^*$—all without ever taking $\Delta$ as an input.

Datasets

Not discussed in the paper. Because this is a theoretical bandit study, the authors evaluate their algorithms using synthetic numerical simulations rather than external datasets. Specifically, they test on 2D unit-ball environments discretized by polar grids (with resolutions from $90 \times 20$ up to $720 \times 160$), randomized 2D problem realizations, and higher-dimensional synthetic environments ($d = 5, 10, 20$).

Key Insights and Ideas

  • Indirect safety feedback has a real price: When $\Delta = 0$, the $\Omega(T^{2/3})$ lower bound proves the zero-gap regime is intrinsically harder than standard bandits ($\Omega(\sqrt{T})$). You pay a mathematical penalty for having to certify a razor's-edge boundary indirectly through noisy rewards.
  • Adaptivity is (almost) free in $T$: You don't need an oracle to tell you the safety gap. By geometrically scheduling exploration budgets across epochs, EPOCH-SLUCB keeps total pure-exploration overhead bounded by $\widetilde{O}(\sqrt{T})$, matching the horizon dependence of algorithms that do know $\Delta$.
  • The $\Delta$ trade-off: While EPOCH-SLUCB matches the $\sqrt{T}$ scaling in time, not knowing $\Delta$ increases the additive, horizon-independent penalty from $\Delta^{-2}$ (when $\Delta$ is known) to $\Delta^{-3}$.

Key Results

  • Tight Zero-Gap Bound: Established an $\Omega(T^{2/3})$ regret lower bound for $\Delta = 0$ (even in dimension $d=2$), proving existing $\widetilde{O}(T^{2/3})$ upper bounds are tight in $T$.
  • Fast Gap-Agnostic Regret: Proved EPOCH-SLUCB achieves $\widetilde{O}(\sqrt{T} + \Delta^{-3})$ regret for any unknown $\Delta > 0$, while guaranteeing actions are safe across all rounds with probability at least $1 - \delta$.
  • Empirical Performance: Across synthetic experiments ($T = 50,000$ to $76,000$), EPOCH-SLUCB incurred zero safety violations. It consistently outperformed gap-agnostic Safe-LUCB, and for smaller safety gaps ($\Delta \in [0.18, 0.24]$), it even achieved lower average final regret than Safe-LUCB given the exact true value of $\Delta$ (which tends to over-explore conservatively upfront).

Limitations and Future Work

  • Strong Structural Assumptions: The setup assumes the constraint matrix $B$, threshold $c_{\text{safe}}$, and parameter norm bound are known beforehand, and that reward and safety share the exact same linear parameter $\theta$.
  • Nonconvex Optimization: Selecting the optimistic action over an ellipsoidal certified safe set is generally a nonconvex optimization problem (solved via grid discretization in their 2D experiments).
  • Open Theoretical Questions: When $\Delta$ is very small, the additive $\Delta^{-3}$ term can be large over finite horizons; tightening this to $\Delta^{-2}$ is left open. Additionally, pinning down the optimal lower-bound dependence on dimension $d$ and extending the framework to generalized linear models or contextual settings remain ripe for future work.

Summary updated

Abstract

We study stochastic linear bandits whose rewards and linear safety constraint depend on the same unknown parameter, requiring every chosen action to be safe at every round with high probability, even though the safe decision set is initially unknown. Prior work achieves $\widetilde{O}(\sqrt{T})$ regret when the safety gap, i.e., the constraint slack at the optimal action, is strictly positive and known to the learner. However, the best previously established gap-agnostic guarantee is only $\widetilde{O}(T^{2/3})$, both in the zero-gap regime, and when the gap is positive but unknown. This raises two natural questions: is the $\widetilde{O}(T^{2/3})$ bound tight in the zero-gap case, and is knowledge of the gap necessary for $\widetilde{O}(\sqrt{T})$ regret when the gap is positive? We answer both questions. First, we establish an $\Omega(T^{2/3})$ lower bound for zero-gap instances, showing that the existing upper bound is tight in its dependence on the horizon. Second, we propose Epoch-SLUCB, an algorithm that attains $\widetilde{O}(\sqrt{T})$ regret for every fixed positive safety gap, without requiring its value to be known. Numerical simulations illustrate the empirical performance of Epoch-SLUCB.
BibTeX
@inproceedings{liu2026safe,
  author = {Maoli Liu and Zhuohua Li and Zeyu Zhang and Xiangxiang Dai and John C.S. Lui},
  title = {{Safe Linear Bandits with Unknown Safety Gaps}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=1C06QNKbWx},
}
Figure