Method · Machine learning
Bayesian optimization
Bayesian optimization is a strategy for finding the best value of a function that is expensive to evaluate and whose formula is unknown.
The function might be the accuracy of a machine-learning model as a function of its settings, the yield of a chemical reaction as a function of temperature and concentration, or the efficiency of a robot as a function of its control parameters. In each case a single evaluation costs minutes, hours, or a physical experiment, so the goal is to reach a good answer in as few evaluations as possible.
Key facts
| 12 | Minutes for Bayesian optimization to reach near-optimal step frequency, Kim et al. 2017[1] |
|---|---|
| 80% | Share of latent points decoding to realistic molecules under constrained search, Griffiths 2020[2] |
| 95.6208 | Best accuracy from support vector classifier with Bayesian optimization, Elgeldawi et al. 2021[3] |
| 50 | Compositions needed to optimize high-entropy alloys for oxygen reduction, Pedersen et al. 2021[4] |
Overview
Bayesian optimization
The central difficulty is that with few evaluations there is little information, yet each new evaluation must be chosen without knowing the answer in advance. Bayesian optimization handles this by keeping a probabilistic surrogate model, a cheap stand-in that approximates the unknown function and, crucially, records how uncertain that approximation is at every point. A second component, the acquisition function, scores each candidate point by how useful an evaluation there would be, weighing the chance that it improves on the best result so far against the chance that it reduces uncertainty somewhere unexplored. The point with the best score is evaluated on the real system, the surrogate is updated with the result, and the loop repeats.[5][6]

A concrete case makes the loop tangible. Suppose a neural network takes hours to train and its validation accuracy depends on a learning rate and a regularization strength. A grid search would train the model at every combination on a fixed lattice, most of them uninformative. Bayesian optimization instead fits its surrogate to the handful of runs completed so far, uses the acquisition function to pick the single most promising untried combination, runs that one training job, and folds the result back into the model. Early choices tend to spread across the space, because uncertainty is high everywhere; later choices cluster near the region that looks best, because the surrogate has become confident there.[5]
The approach belongs to a broader family of probabilistic global optimizers that construct an approximation to the merit landscape of the conditions and then propose a new set of conditions for the next evaluation based on that approximation. The scheme speculates about the outcome of an experiment using all previous experiments, then verifies the speculation by requesting one more.[7] What distinguishes it from random or grid search is that every evaluation is chosen with the accumulated evidence in mind, so redundant evaluations are avoided.
Two design decisions shape how well the method performs, and both are matters of judgment rather than fixed rules. The first is the surrogate: a Gaussian process is the common choice, but random forests and Bayesian neural networks are also used, and each carries different assumptions about the shape of the landscape and different computational costs.[7] The second is the acquisition function, where several formulations exist, including expected improvement, upper confidence bound, and entropy-based criteria, and they balance exploration against exploitation in different ways.[5] The right pairing depends on the problem, which is why practical guidance treats these choices as central rather than incidental.
A further tension is scale. The method is at its most effective when evaluations are few and the domain is modest in dimension; as dimensions grow, the number of points needed to cover the space rises sharply, and the surrogate becomes harder to fit reliably.[5] This is the main reason the technique is usually presented as a tool for expensive, low-dimensional problems rather than a universal optimizer.
Bayesian optimization spends its limited evaluations where they are most informative, by pairing a probabilistic model of the unknown function with a rule for choosing the next point.
Where it is used
The setting that has driven much of the method's development is the tuning of machine-learning algorithms, where the objective is validation performance and each evaluation is a training run. The same structure appears wherever a black-box function is costly: laboratory experiments, heavy simulations, and the control settings of physical apparatus. In all of these, the appeal is the same, namely that a small number of well-chosen trials can substitute for a large number of arbitrary ones.
History
From response surfaces to a Bayesian search rule
Design of experiments is a systematic method for choosing trial conditions, and Bayesian optimization has been surveyed in comparison to existing DOE methods.[8] Response surface methods fit a parametric function, such as a polynomial, to a set of sample points and use the resulting surface to approximate the cost as a function of the parameters.[1]
The Bayesian framing changes that. Instead of committing to a fixed schedule of trials, it treats the unknown objective as a random quantity and places a prior over it, a probability distribution expressing what is believed about the function's shape before any data exist. Each evaluation supplies evidence, and Bayes' rule combines prior and evidence into a posterior, an updated distribution over the function that is narrower where data have been collected and still broad where they have not. The posterior is not a single guess but a whole family of plausible functions, each weighted by how well it agrees with the observations so far.
Once the objective is represented this way, choosing the next trial becomes a decision problem rather than a bookkeeping one. Any candidate point can be scored by a utility, a number expressing how valuable an evaluation there would be, computed from the posterior. The point with the highest expected utility is the one worth measuring. This is the step that turns curve fitting into a search rule: the fitted surface is consulted not merely to read off its peak, but to decide where the next measurement will teach the most.
The utility has to weigh two competing motives. Sampling where the posterior predicts a high value is exploitation, betting that the current best guess is roughly right. Sampling where the posterior is wide is exploration, betting that an unmeasured region might hide something better, or might turn out to be worse and thereby sharpen the picture elsewhere. A rule that only exploits can settle on the first decent point it finds; a rule that only explores wanders without ever committing. The utility-based selection of the next observation must take into account both exploration and exploitation.[6]
This way of organizing the problem was consolidated in tutorial treatments that laid out the components in general form: a prior over the objective, evidence from evaluations, a posterior, and a utility-based selection of the next observation, together with worked extensions to problems such as modeling a user's preferences and hierarchical reinforcement learning.[6] The same structure underlies the broader literature on adaptive experimental design, which surveys how prior knowledge, constraints, batch evaluation, multiple objectives, and mixed variable types are handled within the Bayesian scheme, in contrast to the fixed plans of classical design of experiments.[8] Bayesian optimization consists of constructing a surrogate for the objective and proposing new parameter points via an acquisition function, and several models and acquisition functions have been suggested.[7]
The shift from response surfaces to a Bayesian search rule is a shift in what the fitted model is for: not a summary of past trials, but the basis for deciding which trial comes next.
How it works
The surrogate model and the acquisition function
Every iteration of the loop rests on two pieces of machinery, and the division of labour between them is the heart of the method. The first piece is the surrogate model, a cheap approximation of the expensive objective built from the evaluations made so far. It does two jobs at once: it predicts the objective's value at points not yet tried, and it states how confident that prediction is. The second piece, the acquisition function, reads those predictions and uncertainties and converts them into a single score for each candidate point, a score that says how worthwhile an evaluation there would be. The surrogate answers "what do we believe about this point?"; the acquisition function answers "given that belief, where should we look next?".[5]

The standard surrogate is a Gaussian process, a probabilistic model that treats the unknown objective as a random function and specifies how values at different points tend to co-vary. A kernel function encodes that similarity: two points close together in the input space are expected to have similar objective values, and the kernel sets how quickly that similarity fades with distance. Fitting the model to observations yields, at every point in the domain, a normal distribution with a mean (the best guess) and a variance (the uncertainty). This is exactly the behaviour a search rule needs, because it marks out precisely where the model is guessing.[7]
A Gaussian process is not the only option, and the choice carries consequences. Random forests, collections of regression trees whose leaves hold real numbers, tend to suit objectives with discrete or quasi-discrete values, and their training cost scales with the number of observations and linearly with the dimensionality of the parameter space.[7] Bayesian neural networks, whose weights are distributions rather than single numbers, keep much of the flexibility of a Gaussian process at a computational cost closer to that of a forest. Each surrogate embeds different assumptions about the shape of the landscape, and a model whose assumptions fit the problem badly will mislead the search even if the acquisition function is well designed.[7]
The acquisition function is where the model's output becomes a decision. Expected improvement measures the expected amount by which an evaluation at a candidate point would beat the best value observed so far, computed under the surrogate's distribution; where the mean is high the improvement is likely, and where the variance is high a large improvement remains possible, so both contribute. The upper confidence bound takes the predicted mean and adds a multiple of the predicted standard deviation, so that a single tunable weight sets how much benefit of the doubt an uncertain point receives. Entropy-based criteria approach the question information-theoretically, scoring a point by how much it would reduce uncertainty about the location of the optimum itself rather than about the function everywhere.[5][7]
These formulations differ in detail but share a purpose: each resolves the tension between exploitation, sampling where the model predicts a high value, and exploration, sampling where the model is uncertain. The tension is unavoidable. A rule that only exploits trusts the current best guess and can settle into the first promising region it finds, missing a better one elsewhere. A rule that only explores keeps filling in gaps in the picture and never commits to an answer. The acquisition function makes the balance explicit and, in most formulations, adjustable, so the same loop can be tuned toward caution or toward boldness depending on how expensive a wasted evaluation is.[6]
The balance also shifts naturally over the course of a run, without anyone resetting it. Exploration gives way to exploitation as a consequence of the model updating, not because a schedule dictates it. This is the sense in which the method is adaptive: the same rule produces a wide-ranging search at the start and a focused one at the end.[5]
A homely comparison makes the division of labour clear. A person searching an unfamiliar building for the best view might reason from a rough floor plan, marking rooms already checked and rooms still unknown. The floor plan is the surrogate: it summarizes what is known and flags what is not. The decision of which door to open next is the acquisition function, and it depends on whether the goal is to confirm a promising room or to rule out an untried wing. Neither piece alone constitutes a search; the plan without a rule for choosing doors goes nowhere, and a rule without a plan has nothing to reason from.
Because both pieces are modular, the framework accommodates problems that depart from the textbook case. The surrogate can be swapped for a forest or a neural network when the landscape or the budget demands it, and the acquisition function can be swapped for one that favours information about the optimum, or one that handles several objectives at once.[5][7] What stays fixed is the arrangement: a probabilistic model that predicts and quantifies uncertainty, and a scoring rule that turns those quantities into the next place to look. Later sections take up how a single iteration is carried out in practice, how the method has performed in measured comparisons, and where the approach runs into difficulty as problems grow.
The surrogate supplies belief and uncertainty; the acquisition function turns them into a decision about where to measure next.
Choosing the next experiment, step by step
One full iteration of Bayesian optimization is a short sequence of steps, and seeing them in order makes the method's economy clear. The loop begins with the observations collected so far, each a pair consisting of a set of conditions and the measured outcome. The surrogate is fitted to those pairs, producing a posterior distribution over the objective: a best guess at every point in the domain, together with an estimate of how uncertain that guess is. The acquisition function is then computed across the whole domain from that posterior, and the point where it reaches its highest value is the one chosen for the next evaluation. The real objective is measured there, the new pair is added to the observations, and the surrogate is refitted. The cycle repeats until the budget of evaluations runs out or the search stops improving.[5]
The order matters because each step depends on the one before it. The acquisition function cannot be computed until the posterior exists, and the posterior cannot be formed until the previous result has been folded in. This is what makes the procedure sequential rather than planned: the choice of the second experiment depends on the outcome of the first, the choice of the third on the outcomes of the first two, and so on. A grid search inverts this logic, fixing every trial condition before any result is seen. The grid is easy to parallelize, but it does not account for results obtained from recently executed experiments or computations. Random search is a simplistic approach that does not account for results from recent evaluations either.[7]
The sequential loop also explains why the method tolerates noise. Real measurements rarely return the true value of the objective; sensor readings drift, experimental conditions vary slightly, and a training run on a fixed dataset can still land on a different validation score depending on initialization. The surrogate tolerates stochastic noise in function evaluations rather than treating observations as exact. The acquisition function weighs uncertainty, balancing exploration and exploitation.[5]
A walking experiment shows the loop working under exactly these conditions. The objective was metabolic cost as a function of step frequency, a quantity inferred indirectly from noisy breathing measurements, and each evaluation required minutes of walking rather than a computation. The surrogate was a Gaussian process over step frequency, and the acquisition rule chose each new frequency from the posterior. Because the model carried its uncertainty explicitly, it could pick a frequency near the current best guess when the evidence was strong and a frequency further away when the picture was still vague, and it did so while treating each noisy cost estimate as partial evidence rather than as the truth.[1] The comparison against other search methods belongs to a later section; what matters here is that the loop's structure, fit, score, measure, update, is what allowed a small number of costly and noisy trials to be spent well.
Two practical details shape how the steps are carried out. The first is that finding the maximum of the acquisition function is itself an optimization problem.[5] The second is that training a Gaussian process surrogate is computationally costly, scaling cubically with the number of observations.[7] Neither detail changes the logic of the iteration; both affect how quickly it can run.
Each iteration converts everything learned so far into one decision about where to measure next, and the result of that measurement immediately reshapes the next decision.
Research
Evidence that it works
Claims about a search method are worth little without measurements, and the evidence for Bayesian optimization comes in three forms: comparisons on standard test functions where the true optimum is known, comparisons on physical tasks where the cost of each trial is real, and a large public competition in which many methods were run against one another under identical rules. Each form answers a slightly different question, and each has to be read within its own limits.
The cleanest setting is a set of benchmark functions, mathematical functions with known global minima, used as stand-ins for the varied and often nonconvex landscapes that real problems present. A benchmark study of this kind compared a Bayesian optimizer called Phoenics against particle swarm optimization and the covariance matrix adaptation evolution strategy, two widely used search methods that improve a population of candidate solutions over successive rounds. The gap was large enough that even when the population methods were given ten times as many evaluations, from 200 to 2000, they still failed to achieve lower deviations than Phoenics achieved after 200 evaluations, on 12 of the 15 functions for PSO and 13 for CMA-ES.[7] The comparison says something specific: on these landscapes, the model-guided choice of each next point extracted more from a fixed budget than the undirected improvement of a population did.
Benchmarks are abstract, though, and a natural objection is that a method tuned on mathematical functions may not transfer to a physical system where each trial costs time and discomfort. The walking experiment mentioned earlier meets that objection directly. Its objective was metabolic cost as a function of step frequency, measured indirectly from noisy breathing data, with each condition requiring minutes of steady walking. Bayesian optimization reached a near-optimal step frequency in twelve minutes, with convergence times varying by about two minutes between subjects, and the participants expended less total metabolic energy over the course of the experiment than under the gradient method.[1] The result matters because the two methods fail in different ways: gradient descent needs repeated measurements at nearly identical settings to estimate a slope, which is expensive when each measurement is a bout of walking, while the surrogate-based search can act on a single noisy reading at each setting and still choose sensibly where to go next.
The third form of evidence is a contest. A competition of this design tests robustness rather than peak performance on any single problem: an entry that wins has to do well across a range of unknown landscapes, which is closer to how the method is used in practice than any single benchmark.
A separate comparison addresses a more mundane question that practitioners actually face: how the automated method stacks up against the simple alternatives of grid search and random search. In a study of hyperparameter selection for kernel ridge regression applied to a computational chemistry problem, with two different descriptors of molecular structure, the automated Bayesian approach and random search both became substantially more efficient in computational time than an exhaustive grid search as the number of hyperparameters grew, while delivering equivalent or better accuracy.[9] The finding is worth stating carefully. It does not say the Bayesian method dominated random search; the source reports that both became significantly more efficient than grid search as the number of hyperparameters increased, while delivering equivalent or better accuracy.[9] What it shows is where the advantage over brute force comes from, namely from not evaluating a fixed lattice of combinations when most of the lattice is uninformative.
Read together, the three kinds of evidence point in the same direction without proving a universal rule. The benchmark study shows a gain over population-based search on a curated set of mathematical landscapes.[7] The walking experiment shows a gain over gradient descent on one physical task with a noisy, slow objective.[1] The regression study shows that both Bayesian optimization and random search became significantly more efficient than exhaustive grid search as the number of hyperparameters increased, while delivering equivalent or better accuracy.[9] Each result holds for the problem it measured, and none of them establishes that the method will win on an arbitrary new problem. What they establish is that the mechanism described in earlier sections, spending each evaluation where the model says it will teach the most, produces measurable savings when evaluations are expensive, which is the setting the method was built for.
The evidence is consistent in direction but bounded in scope: each comparison favours Bayesian optimization on the particular landscape and budget it tested, not on every problem.
In practice
Tuning machine-learning models
Machine learning offers the most thoroughly worked application of the method, because it supplies an objective that is easy to state and expensive to measure. A learning algorithm carries hyperparameters, settings chosen before training begins rather than learned from the data: the regularization strength of a support vector machine, the number of trees in a forest, the learning rate and weight decay of a neural network. These settings often change performance considerably, and the mapping from settings to validation accuracy is unknown in advance, noisy, and costly to probe, since every probe means training a model and scoring it on held-out data. That combination is precisely the profile Bayesian optimization was designed for, and the method has been used to tune latent Dirichlet allocation, structured support vector machines and convolutional networks, in some cases reaching or surpassing the performance of a human expert doing the same job by hand.[10]

The practical concerns of this setting differ from those of a clean mathematical benchmark in ways that shape how the loop is run. The first is that evaluations vary in cost. Training a large network for many epochs can take hours, while a small model on a subset of the data takes minutes, and a search that ignores this will waste its budget on slow trials that teach little. One response is to model the duration of an evaluation alongside its outcome, so that the acquisition function weighs the expected improvement of a candidate against the time it will consume, and the search prefers a quick, informative trial over a slow one of similar promise.[10] The second concern is parallelism. A single sequential loop leaves most of a cluster idle, so methods have been developed that propose a batch of candidate settings to evaluate at once, chosen so that the members of the batch are informative jointly rather than redundant with one another.[10]
A third concern is that the surrogate's assumptions can have a large impact on whether the search succeeds or fails. The same study that introduced cost-aware and parallel variants found that the Gaussian process prior and the associated inference procedure could have a large impact on the success or failure of Bayesian optimization, and that thoughtful choices in this part of the machinery can lead to results that exceed expert-level performance.[10] This is a useful corrective to the impression that the acquisition function is where the intelligence resides. A surrogate whose assumptions fit the landscape badly will misdirect the search no matter how carefully the next point is scored.
The same lesson appears in a library built for exactly this task. Hyperopt provides algorithms and parallelization infrastructure for hyperparameter optimization in Python, and its authors describe sequential model-based optimization, their name for the Bayesian approach, as one of the most efficient methods per function evaluation, which is what makes it appropriate for algorithms that are slow to train.[11] The library treats the choice of classifier and even the choice of preprocessing step as a single large optimization problem, defining a search space that spans many standard components and common ways of composing them. On standard benchmarks, searching that space proved practical and effective, improving on best-known scores for the model space on both MNIST and convex shapes. The library treats the choice of classifier and even the choice of preprocessing module as a single large hyperparameter optimization problem, defining a search space that encompasses many standard components and common patterns of composing them.[11]
Broader surveys of the field place Bayesian optimization among a family of automatic methods that runs from grid and random search through evolution strategies to bandit-based early stopping, and they treat the choice among them as a practical decision with consequences for runtime and reproducibility. The recurring advice is that automatic hyperparameter optimization methods can be employed to avoid a time-consuming and irreproducible manual process of trial-and-error.[12]
A concrete comparison illustrates what careful tuning buys. In a study of hyperparameter selection for six classifiers applied to Arabic sentiment analysis, five tuning techniques were compared: grid search, random search, Bayesian optimization, particle swarm optimization and a genetic algorithm. The best accuracy in the study came from a support vector classifier both before and after tuning, with a score of 95.6208 obtained when using Bayesian optimization.[3] The result is a single data point on a single dataset and should be read as such; it shows that the method can be the best of several options on a real classification task, not that it will be on every task.
What unites these accounts is a shift in what the practitioner attends to. The learning algorithm itself is fixed; the work moves to specifying a search space, choosing a surrogate whose assumptions suit the landscape, deciding how to handle evaluations of unequal duration, and deciding how many to run at once. Each of these is a judgment, and each has more effect on the outcome than the mechanical details of the loop. The method does not remove expertise from model tuning so much as relocate it, from guessing settings by hand to designing the search that guesses them automatically.
In hyperparameter tuning the surrogate's assumptions and the handling of cost and parallelism matter more than the choice of acquisition rule.
Laboratory, materials and machine settings
A chemistry laboratory is close to the ideal setting for the method, because a reaction has many adjustable conditions and each trial consumes reagents, instrument time and a chemist's attention. Temperature, concentration, catalyst loading and solvent choice combine into a landscape that is usually nonconvex, with several local optima, and the yield at any combination is unknown until the reaction is run. Phoenics, the optimizer introduced earlier for benchmark comparisons, was built with this setting in mind: it constructs a surrogate from all previous observations and proposes new conditions from it, so that redundant evaluations are avoided, and it was demonstrated on the Oregonator, a model of a nonlinear reaction network, where it quickly identified conditions yielding the desired dynamic behaviour despite a large search space.[7] The demonstration is a simulation rather than a bench experiment, but the structure it exercises is the laboratory's own: a costly evaluation, a landscape with multiple optima, and a budget too small for exhaustive coverage.

Materials design adds a complication that changes how the surrogate must be built. A materials system is described partly by numbers, such as a processing temperature or a microstructure descriptor, and partly by categories with no natural ordering, such as which filler and which matrix are chosen, or which surface treatment is applied. Standard practice encoded such categories as 0/1 dummy variables and fitted an ordinary Gaussian process on top, which amounts to assuming a separate response surface for every combination of levels and fails to capture correlations between them when the number of levels is large. A latent-variable approach instead maps each qualitative level to a point in a low-dimensional numerical space learned alongside the model, so that categories that behave similarly end up close together and the Gaussian process can interpolate across them.[13] The mapping has a physical reading: a qualitative choice such as a material type stands in for underlying quantitative variables that are too numerous or too poorly characterized to measure directly, and the learned coordinates capture their collective effect.
That machinery was tested on two materials problems. One was the concurrent selection of materials and optimization of microstructure for the light absorption of a quasi-random solar cell; the other was a combinatorial search over material constituents for a hybrid organic-inorganic perovskite. The latent-variable version achieved superior performance compared with the state-of-the-art MATLAB BO implementation that represents qualitative factors with dummy variables, and the learned coordinates offered meaningful visualization of the correlation between qualitative levels.[13] The second point is easy to overlook. A search that returns a good design but no account of why the categories ranked as they did leaves the materials scientist with a result but no understanding, and the low-dimensional map supplies at least a partial account.
Alloy discovery pushes the same logic into a compositional space too vast to traverse. A high-entropy alloy mixing five elements offers an enormous number of possible compositions, and Bayesian optimization was run on a DFT-based model to predict the most active compositions for the electrochemical oxygen reduction reaction, sampling as few compositions as possible.[4] Bayesian optimization was run on a model built from density functional theory to predict the most active compositions for two five-element alloys, Ag-Ir-Pd-Pt-Ru and Ir-Pd-Pt-Rh-Ru, with the aim of sampling as few compositions as possible. The predicted optima were then scrutinized with DFT and subjected to experimental validation, where optimal catalytic activities were verified for the binary alloys Ag-Pd, Ir-Pt and Pd-Ru. The study also puts a number on the scale of the problem: optimizing these alloys for the oxygen reduction reaction was determined to require on the order of fifty compositions to be sampled.[4] Fifty is a small enough figure to be practical and a large enough one to rule out guessing.
Membrane design shows the method operating across a gap between a learned model and a fabricated object. Polymeric membranes for water desalination are defined by a choice of monomer and by fabrication conditions, an effectively infinite candidate space that trial-and-error experimentation cannot cover. Machine-learning models were trained to predict water permeability and salt rejection from the monomer type, represented by a chemical fingerprint, and the fabrication conditions; Bayesian optimization was then applied to those models to work backwards, identifying monomer and condition combinations predicted to break the existing upper bound on the trade-off between water/salt selectivity and permeability. Eight membranes were fabricated at the identified combinations, and they exceeded the prevailing upper bound.[14] The sequence is worth noting: the optimizer searched a surrogate rather than the physical system, and the physical system then confirmed the surrogate's recommendations.
Accelerators and lasers present the case where the apparatus itself is the objective function and a single evaluation means a machine pulse. The Linac Coherent Light Source, an x-ray free-electron laser, changes configuration several times a day, so setup time matters, and the task was to maximize x-ray pulse energy by controlling groups of quadrupole magnets. A Gaussian process supplied probabilistic predictions of the machine response to the magnet settings, allowing a balance of exploration and exploitation, and the model's parameters could be learned from archived scans while correlations between devices were extracted from the beam transport. Combining historical data with knowledge of accelerator physics produced a sample-efficient routine that significantly outperformed existing optimizers.[15] The archived scans are the distinctive ingredient: the machine had been run before, and the surrogate could start from that record rather than from nothing.
A laser-plasma accelerator poses a harder version of the same problem, since generating a high-quality electron beam requires balancing many physical effects at once. Bayesian optimization of key laser and plasma parameters was first studied in particle-in-cell simulations and then demonstrated in experiments, where the accelerator autonomously tuned the beam energy spread to the subpercent level at 254 MeV and 4.7 pC/MeV spectral density, starting from an arbitrary set point. A further study of a robust regime improved stability and delivered sub-five-percent rms energy spread beams for 90% of all shots.[16] The shift from an arbitrary starting point to a tuned machine, without a human turning knobs, is the practical claim, and the fraction of acceptable shots is the measure of whether the tuning held.
What these settings share is that the objective is a black box in the strict sense: no formula connects the settings to the outcome, gradients are unavailable or meaningless, and every evaluation costs something real. The method's contribution in each is the same, namely a surrogate that stands in for the apparatus and an acquisition rule that decides which experiment is worth running next. Where the settings differ is in what the surrogate must absorb: categorical variables in materials, archived history in an accelerator, a learned property model in membrane design. Those differences are handled by changing the surrogate, not the loop.
In laboratory and machine settings the surrogate often stands in for a simulation or a learned property model, and the physical experiment then tests what the surrogate recommended.
Safety and constraints
The loop described so far assumes that any point in the search space may be evaluated. In many real systems that assumption fails. In these settings the objective is not the only unknown. There are also constraint functions, quantities that must stay above (or below) a threshold for the trial to be acceptable, and whose relationship to the settings is just as unknown as the objective's. Constrained Bayesian optimization extends the loop to handle them: the search maximizes the objective while evaluating only settings that satisfy every constraint, at least with high probability.

The formal setup is simple to state. The goal is to maximize a performance measure over the parameter domain, subject to a set of constraints each written so that a non-negative value means safe. If the constraint functions were known in advance, unsafe settings could simply be struck from the domain and the problem would reduce to ordinary optimization. They are not known, so they must be learned from the same costly experiments that measure performance, and the learning has to happen without first stepping somewhere dangerous. That circularity is the heart of the problem: the search needs data about safety in order to know where it may safely go.[17]
Two ingredients break the circle. The first is an initial safe set, a collection of settings already known to satisfy the constraints, however poorly they perform. In robotics such settings can often be taken from a simulation or from domain knowledge: a conservative controller that flies sluggishly but reliably. The second is a regularity assumption, expressed through the surrogate. If the constraint functions are modelled as a Gaussian process, the model supplies not just a best guess at each point but a confidence interval around it, and smoothness assumptions imply that a point near a known-safe region cannot have an arbitrarily bad constraint value. Combining the two allows safety to be generalized beyond the initial set: a candidate is judged safe when its confidence bound stays on the safe side, and the search expands outward from what is already known to work.[17]
This changes what the search can promise. Because safety must hold throughout, the method cannot generally find the global optimum of the constrained problem; it aims instead for the best setting that is safely reachable from the starting set, and it must hold the constraints with high probability over the entire sequence of experiments, not merely on average.[17] The guarantee is therefore conditional on the model's assumptions being right, and it is a statement about the run as a whole rather than about any single trial.
Keeping performance and safety apart
An early algorithm in this line, SafeOpt, defined safety as a minimum level of the performance measure itself: the system was never allowed to fall below a critical performance value. That coupling is often too restrictive, because performance and safety can pull in opposite directions. The shortest path for a robot may pass close to an obstacle, while safety demands distance.[17] A later generalization decoupled the two, allowing multiple arbitrary safety constraints separate from the objective. Given an initial safe set, the algorithm maximizes performance while evaluating only parameters that satisfy every constraint with high probability, and it explores carefully by exploiting regularity assumptions encoded in a Gaussian process prior.[17]
The test case was a quadrotor vehicle, with the task of safely tuning the parameters of linear and nonlinear control laws. The experiments showed the approach optimizing controller parameters while respecting the safety constraints with high probability, and the same machinery was extended so that context variables could carry knowledge safely to new situations, for instance optimizing a control law for different flying speeds. The practical point is that the tuning was demonstrated in experiments on a quadrotor vehicle, with the constraint acting as a fence that the search could approach but not cross.[17]
Constraints that describe validity
Not every constraint is a physical limit. In automatic chemical design, molecules are generated by decoding points from a continuous latent space, a compressed numerical representation learned by a variational autoencoder, and Bayesian optimization searches that space for molecules with desirable properties. The original scheme had a pathology: it tended to produce invalid molecular structures. The proposed explanation was that the optimizer was querying points far from the data the autoencoder had been trained on, in regions where the decoder had learned nothing useful.[2]
The diagnosis was tested by measuring how the share of valid decodings changed with distance from the training data in latent space. Validity fell as points moved further out, and the points collected by unconstrained Bayesian optimization did worst of all, which placed them farthest from the data; far out, the decoder over-produced methane, the simplest possible output.[2] The remedy was to treat validity as a constraint. A Bayesian neural network was trained to output the probability that a latent point decodes into a realistic molecule, and the search was reformulated so that it optimized the objective subject to that probability. More than 80% of the latent points decoded under the constrained scheme produced realistic molecules, against less than 5% for the unconstrained baseline, and the constrained search also generated higher-quality molecules by the drug-likeness metrics.[2]
What the two cases share is the structure of the fix. A constraint is something the search must learn rather than something it is told, and the surrogate is what lets it learn without paying the cost of a violation.
A constraint turns part of the search space into territory the optimizer may approach but must not enter, and the surrogate is what marks the boundary before it is crossed.
Alternatives
How it compares with other search methods
Every search method answers the same question differently: given a budget of evaluations, which settings should be tried? The answers range from fixing the whole schedule in advance to letting each result reshape the next choice, and the differences between them show up most clearly when evaluations are costly.

Grid search fixes a lattice of settings before any result is seen and evaluates every node. It is simple, easy to explain, and trivially parallel, but it cannot react, so it spends evaluations on combinations that early results have already made uninteresting. Random search abandons the lattice and samples settings independently, which avoids the grid's blind spots in high dimensions without gaining any ability to learn from what it has measured. A study of hyperparameter selection for kernel ridge regression in computational chemistry, using two descriptors of molecular structure, compared grid search, random search and Bayesian optimization.
As the number of hyperparameters grew, the Bayesian method and random search both became significantly more efficient in computational time than the exhaustive grid, while delivering equivalent or even better accuracy.[9] The result is worth reading precisely: on this problem the Bayesian approach did not clearly beat random search, and both left the grid behind once the space had more than a couple of dimensions. What separates them from the grid is the refusal to evaluate a fixed lattice when most of it is uninformative.
Gradient descent sits at the other extreme. It estimates the slope of the objective with respect to the parameters and steps downhill, and it converges reliably when the objective is smooth and the measurements are clean. Its weakness is the cost of that slope estimate: several evaluations at nearly identical settings are needed to see which way the surface tilts, which is expensive when each evaluation is a physical trial. The walking experiment described earlier put the two methods side by side on the same task, minimizing metabolic cost by choosing a step frequency. Compared to the gradient descent approach, Bayesian optimization identified a near-optimal step frequency with a faster time to convergence (12 minutes), smaller inter-subject variability in convergence time (±2 minutes), and lower overall energy expenditure.[1] The comparison is instructive because the methods fail differently: gradient descent needs repeated nearby measurements to estimate a slope, while the surrogate-based search can act on a single noisy reading at each setting and still choose sensibly where to go next.
Evolutionary strategies, such as the covariance matrix adaptation method, maintain a population of candidate solutions and improve it over successive generations. Each iteration of the covariance matrix adaptation evolution strategy requires multiple parameter evaluations, which leaves room for sample-efficiency gains.[1] In the fifteen-function benchmark study mentioned earlier, after 200 evaluations particle swarm optimization and the evolution strategy yielded significantly higher deviations from the global optimum than the Bayesian optimizers, and even with 2000 evaluations particle swarm optimization (and the covariance matrix adaptation evolution strategy) failed to achieve lower deviations than Phoenics after 200 evaluations for 12 (and 13) out of 15 functions.[7] That comparison holds for the curated landscapes it tested, not for every problem.
A different competitor attacks the budget from the side of time rather than the choice of point. Bandit-based early stopping methods, of which Hyperband is the best known, allocate a predefined resource such as training iterations or data samples to randomly sampled configurations and abandon the poor ones early, framing the problem as pure exploration rather than guided search. The appeal is speed: on a suite of deep-learning and kernel-based learning problems, Hyperband provided over an order-of-magnitude speedup over the competitor set of popular Bayesian optimization methods and other approaches it was compared against.[18] The trade-off is guidance. Random configurations cut short early converge quickly but do not use what has been learned to steer later choices, and hybrid schemes have been built to combine the two, reporting gains over both Bayesian optimization and Hyperband across a range of problem types.[19]
No single method wins everywhere, and the choice follows from the shape of the problem. A fixed grid suits a small space with cheap, parallel evaluations. Random search suits high dimensions where a lattice would be hopeless and the budget is large. Gradient descent suits smooth objectives with inexpensive, low-noise measurements. Evolutionary strategies suit rugged landscapes where a population can straddle several basins. Early stopping suits training runs that can be cut short and judged partway. Bayesian optimization suits the case it was built for: few evaluations, each expensive, with noise and no usable gradient. The comparisons above show it winning in that setting and sharing its advantage with random search in others, which is the honest summary of where it stands.
Criticism
Costs, failure modes and open problems
The loop is cheap in evaluations but not in computation, and the two costs pull against each other. Fitting a Gaussian process requires inverting a covariance matrix whose size grows with the number of observations, and that inversion scales cubically, so doubling the data makes the fit roughly eight times as expensive.[20] Early in a run this is negligible; the surrogate refits in a fraction of a second while the real objective takes hours. Late in a run, after hundreds of observations, the refit can become the bottleneck, and the search stalls not because it has run out of ideas but because it can no longer update its model fast enough to have one.

The cost of the surrogate
The standard remedy is to change the surrogate. A neural network used as an adaptive basis function regression model performs competitively with state-of-the-art GP-based approaches while scaling linearly rather than cubically with the number of data points, permitting a previously intractable degree of parallelism.[20] The trade is a loss of the exact, closed-form uncertainty that makes a Gaussian process so convenient to reason about; uncertainty must be approximated, and the approximation can be wrong in ways the acquisition function will not know about.
A second remedy keeps the Gaussian process but shrinks what each one has to model. Fitting a collection of local models, each responsible for a region of the space, and allocating samples among them by a bandit rule, avoids the homogeneity that a single global model imposes on a large domain. On problems spanning reinforcement learning, robotics and the natural sciences, this local approach outperformed state-of-the-art methods from machine learning and operations research.[21] The idea behind it is that a global model averages over regions that behave quite differently, and the average misleads the search everywhere.
Dimensionality
The method's difficulty with dimension is structural rather than a matter of tuning. Covering a space densely enough to say anything useful requires a number of points that rises exponentially with the number of dimensions, and the surrogate's confidence intervals widen accordingly. The usual statement of the method's range, continuous domains of fewer than about twenty dimensions, follows from this.[5]
One line of attack assumes that the objective, though formally high-dimensional, varies along only a few directions. If the intrinsic dimensionality is low, the search can be conducted in a random low-dimensional embedding of the full space, and the resulting algorithm was shown to solve problems with billions of dimensions under that assumption, while also achieving state-of-the-art performance on the forty-seven discrete parameters of a mixed-integer programming solver.[22] The assumption is doing the work: when the objective genuinely depends on many directions at once, the embedding offers no escape.
When the landscape moves
A quieter assumption is that the objective stays put. The surrogate pools every observation ever made, which is what gives it its sample efficiency, but pooling is only valid if an old measurement still describes the system today. In the walking experiment, metabolic cost could drift within a session as a subject adapted, or rise with body temperature and cardiovascular drift, and the gradient-based methods it was compared against were less exposed to this because they used only recent data to choose the next setting. An attempt to weight recent observations more heavily led the search to re-explore ground it had already covered and lengthened the experiment, so the practical answer was to design the protocol to keep the landscape steady, for instance by completing a warm-up before optimization began and keeping sessions short with adequate rest.[1]
Non-stationarity can also be a property of the function rather than a nuisance. Hyperparameters of machine-learning models are often transformed by hand before optimization, for example by searching in log-space, precisely because the sensitivity of the objective varies across the space. A method that learns such a transformation automatically, by warping the input space through a flexible family of bijective maps, improved on the state of the art on a set of challenging benchmark tasks, producing better results faster and more reliably.[23] The lesson generalizes: when the surrogate's assumption of a uniform notion of similarity is wrong, the fix is to change the representation, not the acquisition rule.
What remains open
Several difficulties have no settled answer. The choice of surrogate and acquisition function still depends on judgment, and a model whose assumptions fit the landscape badly will misdirect the search however well the next point is scored.[10] Constraints can be handled when they are smooth enough to model, but the guarantee is conditional on assumptions that are hard to check in advance.[17] Batch methods that evaluate several points at once recover parallelism at the price of choosing points that are informative jointly rather than individually, a harder problem than the sequential one.[20] And the evidence for the method's advantage, while consistent, comes from comparisons each bounded by the landscape and budget it tested.
The method's limits are the price of its assumptions: a smooth, stationary, low-dimensional landscape that can be modelled cheaply enough to be worth modelling at all.
Key studies
| Year | Study | Sample | Design | Finding |
|---|---|---|---|---|
| 2012 | Snoek et al.[10] | a diverse set of contemporary algorithms including latent Dirichlet allocation, structured SVMs and convolutional neural networks | automatic hyperparameter tuning with Bayesian optimization | When the Gaussian process prior and the inference procedure were chosen with care, the tuning results were better than those of human experts. |
| 2016 | Lisha et al.[18] | a suite of hyperparameter optimization problems including deep-learning and kernel-based learning problems | bandit-based algorithm compared with popular Bayesian optimization methods | Hyperband provided over an order-of-magnitude speedup over the competitor set. |
| 2016 | Wang et al.[22] | problems with up to billions of dimensions, plus a mixed integer linear programming solver with 47 discrete parameters | random embedding algorithm with theoretical analysis and empirical tests | REMBO effectively solved problems with billions of dimensions when intrinsic dimensionality was low, and achieved state-of-the-art performance on the 47-parameter solver. |
| 2017 | Kim et al.[1] | unaided human subjects walking at controlled step frequencies | human-in-the-loop optimization experiment comparing Bayesian optimization with gradient descent | Bayesian optimization reached a near-optimal step frequency in about 10 minutes versus about 21 minutes for gradient descent, with lower estimated energy use (31.5 ± 6.5 Kcal versus 69.6 ± 41.9 Kcal). |
| 2018 | Häse et al.[7] | 15 benchmark functions covering diverse response surfaces | benchmark comparison of Phoenics, GP-based and RF-based Bayesian optimization, PSO and CMA-ES, with 20 runs per function | At 200 evaluations, particle swarm optimization and CMA-ES were significantly further from the global optimum than the three Bayesian methods. Raising the budget tenfold, to 2000 evaluations, still left them behind Phoenics at 200 evaluations on 12 of the 15 benchmark functions for PSO and 13 of the 15 for CMA-ES. |
| 2020 | Griffiths & Hernández-Lobato[2] | Bayesian optimization carried out under constraints, searching the latent space of a variational autoencoder | Reformulating the search as a constrained problem mitigated the production of invalid molecules and yielded marked improvements in validity. | |
| 2021 | Stuke et al.[9] | kernel ridge regression models for molecular HOMO energies on the QM9 dataset, including a 2k-molecule training subset | comparison of grid search, random search and Bayesian optimization for hyperparameter tuning | Grid search and the Bayesian method found almost identical error minima (0.277 eV versus 0.270 eV), and Bayesian optimization and random search became more efficient than grid search as the number of hyperparameters grew. |
| 2021 | Jalas et al.[16] | a laser-plasma accelerator in simulation and experiment | Bayesian optimization of laser and plasma parameters | Beginning from an arbitrary set point, the plasma accelerator tuned itself until the beam energy spread reached the subpercent level at 254 MeV, with a spectral density of 4.7 pC/MeV. |
| 2021 | Elgeldawi et al.[3] | six machine-learning classifiers on a constructed Arabic sentiment dataset | comparative analysis of grid search, random search, Bayesian optimization, particle swarm optimization and genetic algorithms | The support vector machine classifier gave the highest accuracy both before and after tuning, with a score of 95.6208 when using Bayesian optimization. |
| 2021 | Pedersen et al.[4] | two high-entropy alloys, Ag-Ir-Pd-Pt-Ru and Ir-Pd-Pt-Rh-Ru | Bayesian optimization on a density functional theory model, followed by experimental validation | The number of experiments needed to optimize the vast compositional space for the oxygen reduction reaction was determined to be on the order of 50. |
| 2022 | Gao et al.[14] | eight fabricated membranes | machine-learning model plus Bayesian optimization to select monomers and fabrication conditions, followed by experimental fabrication | Eight membranes were made under the monomer and fabrication conditions that the search identified, and they exceeded the present upper bound. |
| 2023 | Berkenkamp et al.[17] | a quadrotor vehicle | safe Bayesian optimization with multiple safety constraints separate from the objective | The algorithm maximized performance while only evaluating parameters that satisfied safety for all constraints with high probability. |
See also
References
- Kim, M., Ding, Y., Malcolm, P., Speeckaert, J., Siviy, C. J., Walsh, C. J., & Kuindersma, S. (2017). Human-in-the-loop Bayesian optimization of wearable device parameters. PLOS ONE, 12(9), e0184054. doi:10.1371/journal.pone.0184054
- Griffiths, R. R., & Hernández-Lobato, J. M. (2020). Constrained Bayesian optimization for automatic chemical design using variational autoencoders. Chemical Science, 11(2), 577-586. doi:10.1039/c9sc04026a
- Elgeldawi, E., Sayed, A., Galal, A. R., & Zaki, A. M. (2021). Hyperparameter Tuning for Machine Learning Algorithms Used for Arabic Sentiment Analysis. Informatics, 8(4), 79. doi:10.3390/informatics8040079
- Pedersen, J. K., Clausen, C. M., Krysiak, O. A., Xiao, B., Batchelor, T. A. A., Löffler, T., Mints, V. A., Banko, L., Arenz, M., Savan, A., Schuhmann, W., Ludwig, A., & Rossmeisl, J. (2021). Bayesian Optimization of High‐Entropy Alloy Compositions for Electrocatalytic Oxygen Reduction**. Angewandte Chemie, 133(45), 24346-24354. doi:10.1002/ange.202108116
- Frazier, P. I. (2018). A Tutorial on Bayesian Optimization. arXiv. doi:10.48550/arxiv.1807.02811 Free full text
- Brochu, E., Cora, V. M., & Freitas, N. d. (2010). A Tutorial on Bayesian Optimization of Expensive Cost Functions, with Application to Active User Modeling and Hierarchical Reinforcement Learning. arXiv. doi:10.48550/arxiv.1012.2599 Free full text
- Häse, F., Roch, L. M., Kreisbeck, C., & Aspuru-Guzik, A. (2018). Phoenics: A Bayesian Optimizer for Chemistry. ACS Central Science, 4(9), 1134-1145. doi:10.1021/acscentsci.8b00307
- Greenhill, S., Rana, S., Gupta, S., Vellanki, P., & Venkatesh, S. (2020). Bayesian Optimization for Adaptive Experimental Design: A Review. IEEE Access, 8, 13937-13948. doi:10.1109/access.2020.2966228
- Stuke, A., Rinke, P., & Todorović, M. (2021). Efficient hyperparameter tuning for kernel ridge regression with Bayesian optimization. Machine Learning: Science and Technology, 2(3), 035022. doi:10.1088/2632-2153/abee59
- Snoek, J., Larochelle, H., & Adams, R. P. (2012). Practical Bayesian Optimization of Machine Learning Algorithms. arXiv. doi:10.48550/arxiv.1206.2944 Free full text
- Bergstra, J., Komer, B., Eliasmith, C., Yamins, D., & Cox, D. D. (2015). Hyperopt: a Python library for model selection and hyperparameter optimization. Computational Science & Discovery, 8(1), 014008. doi:10.1088/1749-4699/8/1/014008
- Bischl, B., Binder, M., Lang, M., Pielok, T., Richter, J., Coors, S., Thomas, J., Ullmann, T., Becker, M., Boulesteix, A., Deng, D., & Lindauer, M. (2023). Hyperparameter optimization: Foundations, algorithms, best practices, and open challenges. WIREs Data Mining and Knowledge Discovery, 13(2). doi:10.1002/widm.1484
- Zhang, Y., Apley, D. W., & Chen, W. (2020). Bayesian Optimization for Materials Design with Mixed Quantitative and Qualitative Variables. Scientific Reports, 10(1). doi:10.1038/s41598-020-60652-9
- Gao, H., Zhong, S., Zhang, W., Igou, T., Berger, E., Reid, E., Zhao, Y., Lambeth, D., Gan, L., Afolabi, M. A., Tong, Z., Lan, G., & Chen, Y. (2022). Revolutionizing Membrane Design Using Machine Learning-Bayesian Optimization. Environmental Science & Technology, 56(4), 2572-2581. doi:10.1021/acs.est.1c04373
- Duris, J., Kennedy, D., Hanuka, A., Shtalenkova, J., Edelen, A., Baxevanis, P., Egger, A., Cope, T., McIntire, M., Ermon, S., & Ratner, D. (2020). Bayesian Optimization of a Free-Electron Laser. Physical Review Letters, 124(12). doi:10.1103/physrevlett.124.124801
- Jalas, S., Kirchen, M., Messner, P., Winkler, P., Hübner, L., Dirkwinkel, J., Schnepp, M., Lehe, R., & Maier, A. R. (2021). Bayesian Optimization of a Laser-Plasma Accelerator. Physical Review Letters, 126(10). doi:10.1103/physrevlett.126.104801
- Berkenkamp, F., Krause, A., & Schoellig, A. P. (2023). Bayesian optimization with safety constraints: safe and automatic parameter tuning in robotics. Machine Learning, 112(10), 3713-3747. doi:10.1007/s10994-021-06019-1
- Lisha, L., Jamieson, K., DeSalvo, G., Rostamizadeh, A., & Talwalkar, A. (2016). Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization. arXiv. doi:10.48550/arxiv.1603.06560 Free full text
- Falkner, S., Klein, A., & Hutter, F. (2018). BOHB: Robust and Efficient Hyperparameter Optimization at Scale. arXiv. doi:10.48550/arxiv.1807.01774 Free full text
- Snoek, J., Rippel, O., Swersky, K., Kiros, R., Satish, N., Sundaram, N., Patwary, M. A., Prabhat, & Adams, R. P. (2015). Scalable Bayesian Optimization Using Deep Neural Networks. arXiv. doi:10.48550/arxiv.1502.05700 Free full text
- Eriksson, D., Pearce, M., Gardner, J. R., Ryan, T., & Poloczek, M. (2019). Scalable Global Optimization via Local Bayesian Optimization. arXiv. doi:10.48550/arxiv.1910.01739 Free full text
- Wang, Z., Hutter, F., Zoghi, M., Matheson, D., & De Feitas, N. (2016). Bayesian Optimization in a Billion Dimensions via Random Embeddings. Journal of Artificial Intelligence Research, 55, 361-387. doi:10.1613/jair.4806
- Snoek, J., Swersky, K., Zemel, R., & Adams, R. P. (2014). Input Warping for Bayesian Optimization of Non-stationary Functions. arXiv. doi:10.48550/arxiv.1402.0929 Free full text
Cite this page: Atlas Nova editors. (2026). Bayesian optimization. Atlas Nova. https://velocer.io/atlas/bayesian-optimization/