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.
| 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 |
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.txtThe laser-synchronization benchmark uses slycot. Building it from source may require BLAS/LAPACK libraries and a Fortran compiler.
Run the visual example from the repository root:
python example.pypython run_samsbo.py <function> <disturbance>Supported functions are MTBranin, MTPowell, and LbSync. For example:
python run_samsbo.py MTBranin 0.15Results are written below data/Final_runs_<disturbance>/. The scripts use the initial conditions stored in data/X_init_<function>.npy.
python run_comparisons.py <function> <algorithm>The algorithm choices are:
st_constraints— constrained single-task Bayesian optimizationst_no_constraints— unconstrained single-task Bayesian optimizationmt_no_constraints— multi-task Bayesian optimization baseline
Example:
python run_comparisons.py LbSync st_constraintsThe 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.
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@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}
}This project is licensed under the GNU General Public License v3.0. See LICENSE.