Skip to content

Repository files navigation

An Analysis of Safety Guarantees in Multi-Task Bayesian Optimization

Research code and experiment data for “An Analysis of Safety Guarantees in Multi-Task Bayesian Optimization” by Jannis O. Lübsen and Annika Eichler. The repository implements SaMSBO and several single- and multi-task baselines on synthetic benchmarks and a laser-synchronization control problem.

Read the preprint on arXiv

Repository layout

Path Purpose
example.py Visual one-dimensional SaMSBO example
run_samsbo.py Main SaMSBO experiments
run_comparisons.py Safe/unsafe single-task and multi-task baselines
bo/, model/, cov/ Optimization loop and multi-task GP implementation
utils/ Benchmark functions, robust bounds, MCMC, and optimization helpers
data/ Initial conditions and serialized experiment results
plot_scripts/generate_plots.ipynb Recreates the paper figures from stored data
plots/ Publication figures included with the repository

Requirements

The code was developed with Python 3.12.8 on Ubuntu 24.04.2 LTS.

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

The laser-synchronization benchmark uses slycot. Building it from source may require BLAS/LAPACK libraries and a Fortran compiler.

Quick start

Run the visual example from the repository root:

python example.py

Reproducing the experiments

SaMSBO

python run_samsbo.py <function> <disturbance>

Supported functions are MTBranin, MTPowell, and LbSync. For example:

python run_samsbo.py MTBranin 0.15

Results are written below data/Final_runs_<disturbance>/. The scripts use the initial conditions stored in data/X_init_<function>.npy.

Comparison methods

python run_comparisons.py <function> <algorithm>

The algorithm choices are:

  • st_constraints — constrained single-task Bayesian optimization
  • st_no_constraints — unconstrained single-task Bayesian optimization
  • mt_no_constraints — multi-task Bayesian optimization baseline

Example:

python run_comparisons.py LbSync st_constraints

The full experiment suites run many random seeds and can take a substantial amount of time. The number of iterations and other experiment constants are defined near the top of the two runner scripts.

Figures

The repository already contains the data used for the manuscript figures. Open plot_scripts/generate_plots.ipynb from the repository root and run all cells, for example with JupyterLab:

python -m pip install jupyterlab
python -m jupyter lab plot_scripts/generate_plots.ipynb

Citation

@article{luebsen2025analysis,
  title   = {An Analysis of Safety Guarantees in Multi-Task Bayesian Optimization},
  author  = {L\"{u}bsen, Jannis O. and Eichler, Annika},
  journal = {arXiv preprint arXiv:2503.08555},
  year    = {2025},
  url     = {https://arxiv.org/abs/2503.08555}
}

License

This project is licensed under the GNU General Public License v3.0. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages