liveBook · Manning

Bayesian optimization

As explained in Bayesian Optimization in Action

A Bayesian optimization workflow is an iterative procedure that models an objective, selects candidate points, evaluates them, and updates the observed dataset.

Bayesian optimization is an iterative method for maximizing an expensive black-box objective: a process whose formula is unknown and whose evaluations consume time, money, or other limited resources. Rather than spending a fixed budget on grid or random search, it uses each observed input–output pair to choose a more useful next evaluation. section 1.1.2 section 1.4

The workflow has two cooperating parts. A predictive model, commonly a Gaussian process (GP), estimates objective values and uncertainty across the search space. A policy turns those predictions into an acquisition score, selects the highest-scoring candidate, evaluates the objective there, and adds the result to the dataset. The loop stops when the evaluation budget is exhausted or another termination condition is met. section 1.2 section 1.2.3 section 4.1.1

Figure 1.5 The BayesOpt loop, which combines a GP for modeling and a policy for decision-making. This complete workflow may now be used to optimize black box functions.

The loop diagram makes the feedback cycle explicit: fit a GP from observations, score candidates with a policy, query the selected point, and repeat. section 1.2.3

A policy must balance two competing goals:

  • Exploit regions with high predicted objective values, concentrating evaluations where good results seem likely. section 4.1
  • Explore regions with high uncertainty, seeking information that could reveal a better optimum. section 1.2.2 section 4.1.2
  • Score candidates according to a chosen rule, such as Probability of Improvement or Expected Improvement, and optimize that score to propose a query. section 4.5

A ten-query one-dimensional search

Suppose an unknown objective is defined on −5 to 5, with only 10 allowed evaluations. Random search can cluster queries in unpromising regions, while grid search may still fail to narrow in efficiently. Bayesian optimization begins from observations, updates its GP after each query, and shifts attention away from sufficiently explored local regions; in the illustrated run, it finds the global optimum by the end of the budget. section 1.2.4

This approach is useful whenever trying a setting is costly and the relationship between settings and outcomes is not available analytically. Hyperparameter tuning is a common case, but the same formulation applies to scientific and industrial searches such as materials discovery, drug discovery, and mining-related decisions. When several experiments can run simultaneously, batch Bayesian optimization extends the loop to select multiple queries in parallel. section 1.1 section 1.1.3 section 7.0

A practical Python loop can fit a GPyTorch GP, construct a BoTorch policy, and call optimize_acqf() within stated bounds to find a candidate that maximizes its acquisition score. Inspecting GP predictions, uncertainty intervals, observed points, and acquisition scores helps assess whether the policy is guiding the search effectively. section 4.1.1 section 4.5

How Bayesian Optimization in Action covers it

How deep it goes
Develops the GP–policy loop, acquisition scoring, exploration–exploitation tradeoffs, and Python scaffolding; later extends policies and specialized settings.
Examples
Uses a bounded one-dimensional objective, random and grid-search baselines, hyperparameter tuning, materials discovery, and a restaurant-choice analogy.
What it assumes
Introduces the method without assuming advanced Gaussian-process knowledge, then uses probability, calculus, Python, GPyTorch, and BoTorch.
What you can do after
Build it from scratch as a GP-and-policy loop and apply it with GPyTorch and BoTorch to bounded black-box searches.
How it connects
Connects Gaussian processes, acquisition functions, active learning, exploration–exploitation, hyperparameter tuning, multi-armed bandits, and batch optimization.

Also explained in

Compare how 5 books explain Bayesian optimization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bayesian Optimization in Action. The section links point to the parts of the book it draws on.