Constrained Bayesian Optimization with Noisy Experiments

Benjamin Letham, Brian Karrer, Guilherme Ottoni, Eytan Bakshy

Abstract

Randomized experiments are the gold standard for evaluating the effects of changes to real-world systems. However, data in these tests are often difficult to collect and outcomes may exhibit high variance, resulting in significant measurement error. While Bayesian optimization (BO) is a promising technique for efficiently optimizing multiple continuous parameters, existing approaches often degrade in performance when noise levels are high. We introduce Noisy Expected Improvement (NEI), a robust framework designed for real-world A/B testing where both the objective and the constraints are subject to noise. By replacing common "plug-in" heuristics with a rigorous integration over the model's posterior and leveraging Quasi-Monte Carlo (QMC) methods for efficiency, we demonstrate superior performance in tuning complex systems, including Facebook’s ranking algorithms and server compiler flags.

Introduction

Bayesian Optimization (BO) has become a standard strategy for optimizing "black-box" functions that are expensive to evaluate. The core of BO is the acquisition function, which determines the next point to sample by balancing exploration and exploitation. The most popular acquisition function, Expected Improvement (EI), was originally designed for noiseless environments, such as deterministic computer simulations.

In practical applications like Internet-scale A/B tests or physical experiments, observations are inherently noisy. When noise is high, standard EI struggles because it cannot definitively identify which previously tested point is the "best" one to improve upon. Most practitioners rely on heuristics—such as using the predicted mean of the best point—but these often lead to "clumping," where the algorithm repeatedly samples the same area to reduce local uncertainty rather than exploring the broader space. Furthermore, real-world problems frequently involve noisy constraints (e.g., maximizing user engagement without increasing latency), which standard methods handle poorly.

The Noisy Expected Improvement (NEI) Framework

To address these challenges, we propose the Noisy Expected Improvement (NEI) acquisition function. NEI moves beyond simple heuristics through three primary innovations:

1. Full Posterior Integration

Instead of selecting a single "best" point as a baseline for improvement, NEI integrates over the entire posterior distribution of the objective and constraints at all previously sampled locations. This approach explicitly accounts for the uncertainty regarding the true "best" feasible value, making the optimization process significantly more robust to measurement error.

2. Probabilistic Constraint Handling

NEI naturally incorporates constraints by weighting the improvement by the probability of feasibility. This is integrated directly into the noisy observation framework, ensuring that the algorithm favors regions that are likely to satisfy all requirements even when the constraint measurements themselves are unreliable.

3. Efficient Approximation via Quasi-Monte Carlo

The resulting integral for NEI is high-dimensional and lacks a closed-form solution. We utilize Quasi-Monte Carlo (QMC) with Sobol sequences to approximate this integral. This method is significantly more efficient than standard Monte Carlo; our results show that 16 QMC samples provide the same optimization accuracy as 50 standard samples. Crucially, this approximation allows for the calculation of gradients, enabling NEI to be optimized using standard nonlinear solvers.

Experimental Results

Synthetic Benchmarks

We evaluated NEI against standard optimization problems modified with noise and constraints, including the Gramacy, Hartmann6, Branin, and Gardner functions. In these simulations, NEI consistently found better solutions with fewer iterations than existing methods such as Spearmint and Predictive Entropy Search (PESC).

Real-World Applications at Facebook

We further demonstrated the effectiveness of NEI through two large-scale experiments:

  • Ranking System Optimization: We tuned six continuous parameters of a content indexer to maximize an objective metric while maintaining a quality constraint. After a 31-point initialization, NEI proposed just three candidates and successfully identified a configuration that significantly outperformed the baseline while respecting all constraints.
  • HHVM Compiler Flags: We optimized seven numeric flags for the HipHop Virtual Machine (HHVM) to reduce CPU time without increasing peak memory usage. NEI successfully reduced CPU time and increased the probability of finding a feasible (low-memory) configuration from 0.77 (during the initial random phase) to 0.89 for the NEI-selected candidates.

Discussion and Limitations

NEI represents a significant step forward for BO in noisy environments by accounting for covariance between candidate points and the current best points, which naturally encourages smarter exploration. However, some limitations remain. NEI is currently "myopic," looking only one step ahead rather than planning a multi-step information-gathering strategy. Additionally, the current formulation is designed for continuous parameter spaces; extending this to discrete or categorical parameters remains an area for future research. Finally, because NEI assigns zero value to points outside the feasible region, performance in highly constrained spaces might be further improved by incorporating penalties or utilities for exploring near-feasible regions.

Summary updated

BibTeX
@misc{letham2017constrained,
  author = {Benjamin Letham and Brian Karrer and Guilherme Ottoni and Eytan Bakshy},
  title = {{Constrained Bayesian Optimization with Noisy Experiments}},
  year = {2017},
  eprint = {1706.07094},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.07094},
}
Figure