Bayesian Optimization with Conformal Coverage Guarantees
October 25, 2022 · View on GitHub
Abstract
Bayesian optimization is a coherent, ubiquitous approach to decision-making under uncertainty, with applications including multi-arm bandits, active learning, and black-box optimization. Bayesian optimization selects decisions (i.e. objective function queries) with maximal expected utility with respect to the posterior distribution of a Bayesian model, which quantifies reducible, epistemic uncertainty about query outcomes. In practice, subjectively implausible outcomes can occur regularly for two reasons: 1) model misspecification and 2) covariate shift. Conformal prediction is an uncertainty quantification method with coverage guarantees even for misspecified models and a simple mechanism to correct for covariate shift. We propose conformal Bayesian optimization, which directs queries towards regions of search space where the model predictions have guaranteed validity, and investigate its behavior on a suite of black-box optimization tasks and tabular ranking tasks. In many cases we find that query coverage can be significantly improved without harming sample-efficiency.
Main Idea

We want which maximizes the Branin objective (left panel), starting from $8\alpha = 1 / \sqrt{8}(1 - \alpha)\mathbf xw(\mathbf x) \propto p_{\mathrm{query}}(\mathbf x) / p_{\mathrm{train}}(\mathbf x)\alpha$.
Installation
git clone https://github.com/samuelstanton/conformal-bayesopt && cd conformal-bayesopt
conda create --name conf-bo-env python=3.8 -y && conda activate conf-bo-env
conda install -c conda-forge rdkit -y
conda install -c pytorch cudatoolkit=11.3
pip install -r requirements.txt --upgrade
pip install -e .
Running the code
Single-objective, continuous
python scripts/black_box_opt.py task=ackley acq_fn=cucb
Multi-objective, continuous
python scripts/black_box_opt.py task=branin_currin acq_fn=cehvi
Single-objective, tabular
python scripts/tab_bandits.py task=poas_stability acq_fn=cucb
Configuration options
See the config files in ./hydra_config for all configurable parameters.
Note that any config field can be overridden from the command line, and some configurations are not supported.
Task options
Single-objective, continuous
ackleybraninlevymichal
Multi-objective, continuous
branin_currincarsidepeniciliinzdt2
Single-objective, tabular
poas_hydrophobicitypoas_stabilityzinc_penalized_logpzinc_qedzinc_3pbl_docking
Acquisition options
Single-objective
ceicneicucbeineiucb
Multi-objective
cehvicnehviehvinehvi
Tests
pytest tests
This project currently has very limited test coverage.
Citation
If you use any part of this code for your own work, please cite (update citation once ArXiv link is available)
@misc{stanton2022bayesian,
title={Bayesian Optimization with Conformal Coverage Guarantees},
author={Samuel Stanton and Wesley Maddox and Andrew Gordon Wilson},
year={2022},
eprint={2210.12496},
archivePrefix={arXiv},
primaryClass={cs.LG}
}