A Unified Framework for Bayesian Optimization under Contextual Uncertainty

Sebastian Shenghong Tay, Chuan-Sheng Foo, Daisuke Urano, Richalynn Leong, Bryan Kian Hsiang Low

The Challenge of Contextual Uncertainty

In standard Bayesian Optimization (BO), we typically assume full control over all inputs to a function. However, in real-world scenarios, this is rarely the case. Consider a farmer deciding how much fertilizer to apply (a decision variable) while the amount of rainfall (a context variable) remains uncertain and dictated by the weather. This paradigm is known as Bayesian Optimization under Contextual Uncertainty (BOCU).

The primary challenge in BOCU is that "managing uncertainty" is highly subjective. Depending on the application, practitioners might want to:

  • Maximize the average outcome (Stochastic Optimization).
  • Prepare for the absolute worst-case scenario (Robust Optimization).
  • Minimize volatility or balance risk and reward (Mean-Variance tradeoff).

Historically, these varied goals were treated as entirely separate problems requiring specialized algorithms. There was no "Swiss Army Knife" for risk-aware BO—until now.

The Unifying Framework: Methods and Insights

The authors introduce a unified mathematical framework that brings together these disparate "risk-aware" BO objectives under a single umbrella. Their breakthrough stems from analyzing Distributionally Robust Optimization (DRO), which evaluates the worst-case expected value if the environment's distribution shifts slightly.

The key technical insight—the "aha moment" of the paper—is that by taking the first derivative of the DRO objective with respect to its "uncertainty margin," one can mathematically recover almost every other popular risk objective. Essentially, notions of risk (like variance or Value-at-Risk) are measures of how sensitive a function is to changes in the environment, which is perfectly captured by this derivative.

Geometric relationship between various uncertainty objectives.

To formalize this, the authors propose a generalized objective function: $$g(x; \alpha, \beta, \epsilon) = \alpha v(x, \epsilon) + \beta \delta(x, \epsilon)$$

Where:

  • $v(x, \epsilon)$ is the robust value.
  • $\delta(x, \epsilon)$ is its derivative (representing worst-case sensitivity).
  • $\alpha$ and $\beta$ are user-defined weights that specify the exact risk goal (e.g., setting $\alpha=1, \beta=0$ yields standard robust BO).

To optimize this generalized objective, the authors developed TS-BOCU, a Thompson Sampling-based algorithm. While many BO researchers default to Upper Confidence Bounds (UCB), calculating UCBs for these complex, derivative-based risk objectives requires computationally nightmarish bilevel optimization. Thompson Sampling bypasses this complexity by simply sampling a function from the posterior and optimizing it directly, all while maintaining strong theoretical guarantees.

Experimental Validation and Key Results

The framework's versatility was evaluated across four distinct environments:

  1. Synthetic GP Samples: Functions drawn directly from a Gaussian Process prior to test theoretical consistency.
  2. Hartmann 3-D Function: A classic synthetic benchmark for global optimization.
  3. Plant Growth Simulator: An agricultural model optimizing pH and $NH_3$ concentration for plant leaf area.
  4. COVID-19 Epidemic Model: A simulator allocating test kits to minimize total cases despite uncertainty in transmission probabilities.
Regret performance of TS-BOCU across multiple environments and objectives.

Across these datasets, TS-BOCU demonstrated remarkable capabilities:

  • Universality: TS-BOCU successfully handled all three major classes of objectives—Distributionally Robust (DRO), Worst-Case Sensitivity (WCS), and General Mean-Risk tradeoffs (GEN)—across all test environments.
  • Sublinear Regret: The authors proved theoretically and demonstrated empirically that the algorithm's regret grows slower than the number of iterations, guaranteeing convergence to the optimal decision over time.
  • Robustness to Distance Metrics: While the formal proofs rely on the Total Variation (TV) distance to measure environmental shifts, experiments showed TS-BOCU performs excellently using Maximum Mean Discrepancy (MMD) as well, suggesting the framework is highly adaptable in practice.

Limitations and Future Directions

The primary limitation of the current work is theoretical. The proof for sublinear regret is anchored to the Total Variation (TV) distance. While mathematically convenient, other metrics like the Wasserstein distance or MMD are often preferred in high-dimensional machine learning tasks.

Future work will likely focus on extending these formal regret bounds to broader distance metrics. Additionally, the authors note that this unified derivative-based approach could potentially be expanded to adjacent fields, such as Causal Bayesian Optimization or BO with uncertain inputs, further taming the wild west of optimization under uncertainty.

Summary updated

BibTeX
@inproceedings{tay2024unified,
  author = {Sebastian Shenghong Tay and Chuan-Sheng Foo and Daisuke Urano and Richalynn Leong and Bryan Kian Hsiang Low},
  title = {{A Unified Framework for Bayesian Optimization under Contextual Uncertainty}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=oMNkj4ER7V},
}
Figure