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




