Bayesian Optimization With Formal Safety Guarantees via Online Conformal Prediction

Yunchuan Zhang, Sangwoo Park, Osvaldo Simeone

TL;DR

The paper introduces SAFE-BOCP, a novel safe Bayesian Optimization framework that provides assumption-free formal safety guarantees by leveraging online conformal prediction. Unlike traditional safe optimization methods that require strict, often unrealistic assumptions about the safety constraint to ensure zero violations, SAFE-BOCP allows users to specify a tolerable, non-zero violation rate and guarantees this bound is respected regardless of the constraint function's underlying properties.

What Problem Does This Paper Address?

Bayesian Optimization (BO) is a powerful tool for optimizing expensive, black-box functions. However, in many real-world applications—like clinical trials or chemical engineering—we must explore the parameter space safely, ensuring we don't violate critical thresholds (e.g., causing severe side effects or damaging equipment).

Existing "Safe-BO" algorithms, most notably SAFEOPT, try to guarantee absolute safety (zero violations). The catch? These guarantees rely on massive assumptions: the optimizer must perfectly know the smoothness properties of the safety constraint function (specifically, its Reproducing Kernel Hilbert Space (RKHS) norm bound).

In practice, if your surrogate model (like a Gaussian Process) is even slightly misspecified, these safety guarantees completely fall apart, leading to catastrophic real-world failures. This paper addresses a crucial question: How can we provide rigorous safety guarantees without making restrictive assumptions about the unknown safety constraint?

Overview of safe black-box optimization with safety constraints.

Methods

The core innovation of this paper is the integration of Online Conformal Prediction (CP) into the Safe-BO loop. Instead of chasing an impossible goal of absolute zero violations under model uncertainty, the authors relax the target to a controllable, user-defined safety violation rate ($\alpha > 0$).

The resulting algorithm, SAFE-BOCP, dynamically adjusts its level of exploration caution based on real-time feedback:

  1. Error Tracking: The algorithm tracks an "excess violation rate" ($\Delta \alpha_t$), which measures how much the actual rate of unsafe decisions deviates from the target threshold $\alpha$.
  2. Adaptive Pessimism: It uses this excess rate to dynamically scale the confidence intervals of its Gaussian Process surrogate model via a parameter $\beta_t$. If the algorithm experiences more violations than allowed, $\beta_t$ shoots up (as shown in Figure 3), forcing the safe set to shrink and making the acquisition function highly conservative.

The authors propose two variants:

  • D-SAFE-BOCP: Designed for deterministic (noiseless) safety feedback.
  • P-SAFE-BOCP: Designed for noisy safety feedback, incorporating a "caution-increasing" back-off mechanism to handle observation noise.
Block diagram of the Safe-BO loop, showing how the safe set and acquisition steps interact.

Datasets

The authors evaluated SAFE-BOCP using three distinct benchmarks:

  • Synthetic Dataset: A synthetic 1D optimization problem generated via a Gaussian Process, explicitly designed to test the algorithm under severe kernel misspecification (incorrect bandwidth parameters).
  • MovieLens-100k: A real-world dataset used to simulate a safe movie recommendation system, where recommending a movie rated below 4 stars is treated as an unsafe action.
  • Plug Flow Reactor (PFR) Simulator: A real-world chemical reaction optimization problem aimed at maximizing product yield while keeping chemical selectivity within safe bounds.

Key Insights and Ideas

  • The Power of Closed-Loop Safety: Traditional Safe-BO is open-loop regarding uncertainty quantification; it sets a safety threshold upfront and hopes the model assumptions hold. SAFE-BOCP introduces a closed-loop feedback mechanism via online CP, correcting the model's pessimism level dynamically based on actual performance.
  • Embracing Controlled Risk: By shifting the goalpost from zero violations to a controlled violation rate, the authors unlock a mathematically rigorous way to provide safety guarantees that are completely independent of the constraint function's properties.
  • Robustness to Misspecification: Even when the underlying Gaussian Process kernel is completely wrong, SAFE-BOCP's safety guarantees remain intact because the online conformal prediction layer acts as an automated guardrail.

Key Results

  • Assumption-Free Safety Upheld: In synthetic experiments with a misspecified kernel, SAFEOPT failed spectacularly, yielding violation rates well above 30% despite targeting 0%. In contrast, D-SAFE-BOCP strictly adhered to the user-defined target violation rates (e.g., keeping violations below the 10%, 20%, or 30% thresholds).
  • Better Performance Trade-offs: In the MovieLens recommendation task, SAFEOPT failed to meet its safety requirements due to model mismatch. D-SAFE-BOCP successfully controlled the fraction of unsafe recommendations while maintaining high recommendation quality.
  • Noisy Safety Control: In the chemical reactor simulation, P-SAFE-BOCP consistently kept the probability of excessive safety violations below the target reliability level ($1 - \delta = 0.9$), outperforming SAFEOPT under noisy constraint conditions.

Limitations and Future Work

While SAFE-BOCP provides a massive leap forward in safety reliability, a few areas remain open for improvement:

  • Acquisition Dependency: The current implementation builds directly on top of the SAFEOPT acquisition mechanism. While the authors note it can be generalized to other safe exploration algorithms (like GOOSE), this paper only explicitly tests the SAFEOPT variant.
  • Scalability to Multiple Constraints: The current formulation focuses primarily on a single safety constraint function. Extending this assumption-free framework to handle multiple, competing safety constraints simultaneously is a vital direction for future work.

Summary updated

BibTeX
@article{zhang2025bayesian,
  author = {Yunchuan Zhang and Sangwoo Park and Osvaldo Simeone},
  title = {{Bayesian Optimization With Formal Safety Guarantees via Online Conformal Prediction}},
  journal = {IEEE J. Sel. Top. Signal Process.},
  year = {2025},
  doi = {10.1109/jstsp.2024.3422825},
}
Figure