Bayesian Optimization
Bayesian Optimization (BO) is a sequential model-based strategy for the global optimization of expensive black-box functions, combining a probabilistic surrogate model—typically a Gaussian Process—with an acquisition function that trades off exploration and exploitation to select the next evaluation point. It matters profoundly in modern AI because it underpins automated hyperparameter tuning, neural architecture search, and experimental design, enabling practitioners to find near-optimal configurations with orders of magnitude fewer function evaluations than grid or random search. A remarkable fact: under mild regularity conditions, Bayesian Optimization with GP-UCB achieves sublinear cumulative regret, meaning its average per-step error converges to zero even though the objective function is never explicitly modeled in closed form.
The "aha moment" is this: instead of treating optimization as a purely algebraic problem, Bayesian Optimization treats the objective function itself as a random variable with a prior distribution, and every evaluation is a Bayesian update that sharpens our beliefs about where the optimum lies. The surrogate model gives us not just a prediction but a full posterior distribution over function values, encoding uncertainty—and the acquisition function turns that uncertainty into a decision, strategically querying the most informative point next. This is fundamentally different from gradient-based methods: you never need a derivative, only the ability to evaluate f(x) and pay the cost once per query. The power comes from spending cheap model-based computation to avoid expensive real-world evaluations.
How It Works
Bayesian Optimization proceeds by maintaining a surrogate probabilistic model of the objective , which is assumed expensive to evaluate (e.g., each call takes minutes to hours). The canonical surrogate is a Gaussian Process.
Gaussian Process Prior. A GP is specified by a mean function and a positive-definite kernel :
Explanation: This asserts that any finite collection of function values is jointly Gaussian, with covariance structure determined entirely by the kernel encoding smoothness and lengthscale assumptions. Given noisy observations where , , the GP posterior at a new point is Gaussian with analytically tractable moments:
Explanation: The posterior mean is the prior mean corrected by a weighted sum of residuals, where the weights are determined by how correlated the new point is to all observed points through the kernel matrix . Here , , and . The posterior variance is:
Explanation: Posterior variance equals prior variance minus the reduction in uncertainty attributable to the observed data, and is zero at observed points when noise is absent.
Acquisition Functions. The acquisition function is maximized (cheaply) to select the next query point . Three canonical choices are:
- Expected Improvement (EI), the most widely used:
Explanation: EI computes the expected amount by which a query at would exceed the current best observed value , where and are the standard normal CDF and PDF respectively.
- GP-UCB (Upper Confidence Bound):
Explanation: UCB explicitly constructs an optimistic upper bound on the function value, where is a confidence parameter that grows with to ensure sufficient exploration; Srinivas et al. (2010) derive to guarantee probability regret bounds.
Regret and Convergence. The cumulative regret after evaluations is . Srinivas et al. (2010) establish that for a GP with squared-exponential kernel, GP-UCB achieves:
Explanation: Here is the maximum information gain after observations, which grows as for SE kernels—meaning and the algorithm is asymptotically no-regret.
Kernel Hyperparameter Learning. Kernel hyperparameters (e.g., lengthscale , output scale ) are typically fit by maximizing the log marginal likelihood:
Explanation: This objective, where , balances data fit (first term) against model complexity (second term, the Occam factor), and its gradients are analytically available, enabling efficient optimization via L-BFGS.
Kushner was a control theorist and probabilist at Brown University whose work on stochastic differential equations led him to formulate one of the earliest probabilistic approaches to global optimization. In his 1964 paper "A New Method of Locating the Maximum Point of an Arbitrary Multipeak Curve in the Presence of Noise", he proposed using a Wiener process prior and selecting the next evaluation point to maximize the probability of improvement—establishing the probabilistic acquisition function paradigm that BO inherits directly. Remarkably, Kushner's paper predates the term "Bayesian Optimization" by decades and was largely ignored by the machine learning community until the GP-BO renaissance of the 2000s.
Jonas Mockus, a Lithuanian mathematician working at the Institute of Mathematics and Informatics in Vilnius, developed what he called the "Bayesian approach to global optimization" throughout the 1970s, culminating in his 1989 monograph Bayesian Approach to Global Optimization. He rigorously formalized the notion of Expected Improvement as the optimal one-step-look-ahead acquisition function under a Bayesian decision-theoretic framework, proved existence and consistency results, and introduced the concept of the "efficient global optimization" loop that remains essentially unchanged today. A surprising historical note: Mockus worked largely in isolation behind the Iron Curtain, and his foundational contributions were rediscovered and popularized in the West through Jones, Schonlau & Welch's 1998 EGO paper, which cited him but introduced the ideas to an entirely new community.
Carl Rasmussen is a Danish machine learning researcher at the University of Cambridge whose co-authored textbook Gaussian Processes for Machine Learning (2006, with Christopher Williams) became the canonical reference for the GP machinery that powers virtually all modern Bayesian Optimization implementations. His GPML MATLAB toolbox operationalized GP inference and marginal likelihood optimization, directly enabling the wave of BO research in the late 2000s and 2010s. Rasmussen also made foundational contributions to automatic kernel discovery and model selection using GPs, which directly address the kernel misspecification problem that remains a central challenge in BO.
Intuition
Imagine you are a gold prospector in an unmapped territory, and drilling a test well costs $50,000. You would not drill randomly—you'd use geology (your prior), the results of previous wells (your observations), and a strategy: drill where the rock looks promising and where you haven't looked yet. Bayesian Optimization is precisely this: the Gaussian Process is the geologist's model of subsurface gold concentration, updated every time a new well is drilled. The acquisition function is the prospector's decision rule: "I'll drill next at the place where I expect the highest amount of gold I haven't already found"—which forces you to visit uncertain regions when you're unsure, and to confirm strong signals when confidence is high. The crucial intuition for the posterior variance is this: think of a rubber sheet stretched tightly over the observed data points. Between known points, the sheet bows upward—that bowing is posterior uncertainty. The acquisition function sends you to places where the sheet bows highest and where the sheet's average height (the mean) is already elevated. When you drill a new well and observe the result, you anchor the sheet at that point—variance collapses to zero there—and the rest of the sheet re-adjusts. The whole game is anchoring the sheet in the right places with as few anchors as possible.