NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Stochastic Bayesian Optimization with Unknown Continuous Context Distribution via Kernel Density Estimation

Xiaobin Huang, Lei Song, Ke Xue, Chao Qian

Abstract

This paper introduces SBO-KDE and DRBO-KDE, two novel algorithms for Bayesian Optimization (BO) in environments where the objective function is influenced by uncontrollable, continuous context variables with unknown distributions. By integrating online Kernel Density Estimation (KDE), these methods learn the context distribution dynamically, achieving sub-linear regret. DRBO-KDE further enhances performance in complex environments by optimizing for the worst-case expectation within a distributionally robust framework.

Introduction

In many real-world optimization tasks, outcomes depend not only on the decision variable $x$ but also on an environmental context $c$. Examples include inventory management (demand context) and agricultural optimization (weather context). Traditional Stochastic Bayesian Optimization (SBO) assumes the context distribution $p(c)$ is known, while Distributionally Robust BO (DRBO) often relies on discrete context spaces. Discretizing continuous contexts leads to a trade-off between accuracy and computational complexity. This work addresses these challenges by proposing a continuous-context approach that learns $p(c)$ on-the-fly using KDE.

Methodology

The proposed framework integrates KDE directly into the BO loop. As samples of the context are observed, the algorithm builds a non-parametric estimate of the probability density function.

  1. SBO-KDE (Stochastic BO via KDE): This approach uses the KDE estimate to maximize the expected value of the acquisition function (specifically, the Upper Confidence Bound).
  2. DRBO-KDE (Distributionally Robust BO via KDE): To account for KDE estimation errors, this version optimizes for the worst-case expectation within a "ball" of distributions defined by the Total Variation (TV) distance from the KDE estimate.

A key technical contribution is the use of duality to transform the infinite-dimensional DRBO-KDE problem into a computationally efficient two-dimensional convex optimization problem, making it feasible for real-time applications.

Experimental Evaluation

The algorithms were evaluated on a mix of synthetic benchmarks and real-world simulations:

  • Synthetic Functions: Ackley, Modified Branin, and Hartmann.
  • Complicated Hartmann: A custom variant featuring a complex mixture of Normal and Cauchy distributions to test robustness against estimation errors.
  • Real-World Problems: A Newsvendor inventory task and a financial Portfolio Optimization task.

Results and Discussion

The experimental results demonstrate that SBO-KDE and DRBO-KDE consistently outperform traditional baselines like StableOpt and GP-UCB across various tasks.

Comprehensive performance comparison across synthetic and real-world benchmarks.

As shown in Figure 6, the KDE-based methods achieve significantly lower cumulative regret in most scenarios. SBO-KDE performs exceptionally well when the context distribution is relatively simple (e.g., Gaussian). However, in more challenging environments, the robust approach becomes essential.

Cumulative reward on the Complicated Hartmann task, highlighting the advantage of DRBO-KDE.

In the "Complicated Hartmann" task (Figure 4), DRBO-KDE (blue dashed line) significantly outperforms SBO-KDE (yellow dotted line) in terms of cumulative reward. This confirms that the distributionally robust objective effectively mitigates the impact of estimation errors when the underlying PDF is complex or heavy-tailed, preventing overconfident, sub-optimal decisions.

Conclusion

SBO-KDE and DRBO-KDE provide a powerful framework for optimization under unknown continuous context distributions. By avoiding discretization and learning the environment online, they offer a scalable and robust alternative to existing methods. Theoretical analysis confirms that both algorithms achieve sub-linear Bayesian cumulative regret. Future work includes adapting these methods for non-stationary distributions and high-dimensional context spaces where KDE naturally faces challenges.

Summary updated

BibTeX
@inproceedings{huang2024stochastic,
  author = {Xiaobin Huang and Lei Song and Ke Xue and Chao Qian},
  title = {{Stochastic Bayesian Optimization with Unknown Continuous Context Distribution via Kernel Density Estimation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i11.29158},
}
Figure