How does Bayesian optimization (e.g., Gaussian processes) work for hyperparameter tuning, and when is it worth it?
Answer
Bayesian optimization tunes an expensive black-box objective by maintaining a probabilistic surrogate model of it, usually a Gaussian process that predicts both the mean performance and the uncertainty at every untried configuration. An acquisition function (expected improvement is the common default) scores each candidate by trading off exploitation (likely to be good) against exploration (highly uncertain), and the configuration maximizing it is evaluated next; the result updates the surrogate and the loop repeats. It needs far fewer trials than grid or random search when each evaluation costs minutes to hours, but the Gaussian process costs to fit in the number of trials and struggles in high-dimensional or heavily categorical spaces.
(1) Surrogate: the GP posterior gives a predictive mean and uncertainty
from a handful of noisy trials, and it is cheap to query, unlike the real objective.
(2) Acquisition: expected improvement picks the point with the largest expected gain over the incumbent, automatically balancing exploration and exploitation without hand-tuned schedules.
(3) When It Is Worth It: when trials dwarf surrogate cost (minutes or more per trial, tens of dimensions at most). Meta’s Ax platform (built on BoTorch) runs exactly this loop to tune recommender systems and AR/VR hardware designs, while Google’s Vizier has tuned over 70 million objectives and swaps in more scalable algorithms once the trial count outgrows GP fitting costs.

Figure 1: One iteration of the loop: the GP posterior (mean with uncertainty band, top) is fitted to the evaluated points, and the expected-improvement acquisition (bottom) peaks where a high predicted mean and high uncertainty combine. That peak becomes the next expensive evaluation.
Mathematical Formulation:
Where:
is the expensive black-box objective (for example validation accuracy) and
the best value observed so far.
- The expectation is taken under the GP posterior, so
grows both with predicted quality
and with uncertainty
.
is the next configuration to evaluate; the acquisition maximization is cheap because it queries only the surrogate.
| Feature | Bayesian Optimization | Grid / Random Search |
|---|---|---|
| How Points Are Chosen | Surrogate model plus acquisition function | Fixed lattice / uniform sampling |
| Trials to a Good Region | Fewest, for smooth low-dimensional objectives | Grows exponentially (grid) or slowly (random) |
| Per-Step Overhead | GP fit | None |
| Parallelism | Needs batch acquisition (qEI) | Trivially parallel |
| Worth It When | Trials cost minutes or more, up to tens of dimensions | Cheap trials, high dimensions, quick baseline |

Figure 2: Best value found so far against evaluations spent. Bayesian optimization’s surrogate-guided choices reach a good region in far fewer trials than random or grid search, which is exactly why it pays off only when each trial is expensive.
Leave a Reply