On Safety in Safe Bayesian Optimization

Christian Fiedler, Johanna Menn, Lukas Kreisköther, Sebastian Trimpe · DOI

Abstract

In high-stakes domains such as robotics and biomedical engineering, Bayesian Optimization (BO) must adhere to strict safety constraints. While "Safe BO" algorithms like SafeOpt aim to provide these guarantees, they often rely on unmeasurable mathematical properties or unsafe heuristics in practice. This paper introduces LoSBO (Lipschitz-only Safe BO) and LoS-GP-UCB, a new framework that decouples safety from statistical modeling. By utilizing Lipschitz constants rather than complex RKHS norms, LoSBO ensures rigorous safety even when the underlying Gaussian Process model is misspecified. Our results demonstrate that LoSBO maintains a 0% safety violation rate in scenarios where traditional methods fail, while scaling effectively to higher-dimensional problems.

Introduction

Bayesian Optimization is a premier tool for optimizing expensive, black-box functions. In safety-critical applications—where a single parameter set could lead to hardware failure or patient harm—the optimization process must be constrained within a "safe set." The current gold standard, SafeOpt, provides theoretical safety guarantees based on Gaussian Process (GP) uncertainty bounds. However, a significant gap exists between the theoretical requirements of these algorithms and their practical implementation.

Researchers at RWTH Aachen University have identified that many "safe" deployments are not actually safe. They often rely on heuristics that lack formal guarantees or require knowledge of the Reproducing Kernel Hilbert Space (RKHS) norm of the objective function—a value that is virtually impossible to determine for real-world physical systems. This paper presents a fundamental shift: decoupling the safety mechanism from the probabilistic learning model to achieve robust, verifiable safety.

The Three Safety Gaps

The authors identify three critical vulnerabilities in the current state of Safe BO:

  1. The Heuristic Trap: Theoretical GP uncertainty bounds are often too conservative for practical use. Consequently, practitioners frequently use fixed scaling factors (e.g., setting $\beta=2$). The authors demonstrate that these educated guesses lead to frequent safety violations when the model's assumptions are slightly off.
  2. The RKHS Norm Problem: Formal safety proofs for SafeOpt require a bound on the RKHS norm of the target function. In practice, this value is unknown, and underestimating it leads to overconfidence and potential system failure.
  3. The Curse of Dimensionality: Traditional SafeOpt requires a discrete grid to search for safe points. As the number of input variables increases, the number of grid points grows exponentially, rendering the algorithm unusable for complex, high-dimensional tasks.

Methodology: Decoupling Safety from Optimization

The core contribution of this work is LoSBO (Lipschitz-only Safe BO). Unlike traditional methods that use the GP's internal uncertainty to define safety, LoSBO uses a Lipschitz constant ($L$)—a measure of the maximum possible rate of change of the function—and a known noise bound ($E$).

LoSBO and Lipschitz Cones

By drawing "Lipschitz cones" around previously evaluated points, LoSBO can mathematically prove whether a new point is safe. If the worst-case value at a new point (based on the slope $L$ and the distance from known safe points) remains above the safety threshold, the point is deemed safe. This mechanism is deterministic and does not depend on the GP's hyperparameters, such as the length scale or the RKHS norm.

LoS-GP-UCB

To address scalability, the authors developed LoS-GP-UCB. This variant adapts the LoSBO principle for continuous search spaces. Instead of evaluating a discrete grid, it treats the safe region as a union of "safe balls." It then employs local gradient-based optimization to identify the next point to sample, allowing the algorithm to function in high-dimensional environments where grid-based methods fail.

Experimental Evaluation

The researchers evaluated the proposed algorithms against standard SafeOpt variants across several benchmarks:

  • Synthetic RKHS Functions: 100 functions sampled from Squared Exponential and Matern kernels to test performance under both well-specified and misspecified model conditions.
  • Standard Benchmarks: The 2D Camelback and 6D Hartmann functions.
  • High-Dimensional Scaling: A 10D Gaussian function designed to test the limits of safe exploration.

Key Findings

  • Safety Reliability: In tests where the GP model was intentionally misspecified (e.g., given an incorrect length scale), standard SafeOpt variants failed frequently. In contrast, LoSBO maintained a 0% failure rate because its safety mechanism remained independent of the flawed GP model.
  • Performance Efficiency: LoSBO often reached the global optimum faster than the theoretically "correct" version of SafeOpt. By not being tethered to overly conservative uncertainty bounds, the algorithm could explore the safe set more efficiently.
  • Scalability: While grid-based methods were non-functional in 10 dimensions, LoS-GP-UCB successfully optimized the 10D benchmark while strictly adhering to safety constraints.

Discussion and Limitations

The shift from probabilistic to deterministic safety via Lipschitz constants offers a more intuitive path for engineers. A Lipschitz constant often has a clear physical interpretation (e.g., the maximum possible acceleration of a motor or the maximum rate of chemical reaction), making it easier to estimate than an RKHS norm.

However, the authors note that LoSBO is still dependent on the accuracy of the Lipschitz constant $L$. If $L$ is underestimated, safety violations can still occur. Furthermore, by decoupling safety from the GP, some formal "completeness" guarantees (the mathematical certainty of finding the global optimum) are lost, though empirical results suggest this does not hinder practical performance.

Conclusion

This work highlights a critical need for rigor in Safe Bayesian Optimization. By introducing LoSBO and LoS-GP-UCB, the authors provide a framework that is both safer and more scalable than existing grid-based methods. This approach paves the way for deploying BO in real-world robotic and automotive systems where the margin for error is zero.

Summary updated

BibTeX
@article{fiedler2024safety,
  author = {Christian Fiedler and Johanna Menn and Lukas Kreisköther and Sebastian Trimpe},
  title = {{On Safety in Safe Bayesian Optimization}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=tgFHZMsl1N},
}
Figure