TL;DR
An acquisition function is a score that says how worth trying each possible input is. It is computed from a model's prediction at that input: the predicted mean, which is the best guess, and the predicted uncertainty, which says how unsure the model is. The next experiment is placed where the score is highest. Because the score is cheap to compute, it can be checked at thousands of candidate inputs even when each real experiment is slow or costly.
Builds on: Gaussian Process Regression · Leads to: Bayesian Optimization, Expected Improvement
Where it's used
Tuning machine learning models. A team wants the best learning rate and regularization strength for a model that takes a day to train. Each trial is expensive, so they fit a Gaussian process to the trials so far and use an acquisition function to pick the next pair of settings. This is the standard use of Bayesian Optimization in hyperparameter search.
Chemistry and materials. A lab wants a catalyst with the highest yield, and each synthesis takes days. The acquisition function points the next experiment at a mixture that the model predicts to be good or that the model knows little about, so that the lab does not repeat similar mixtures.
Engineering design. Choosing the shape of an aircraft wing or the settings of a process controller involves simulations that take hours. The same scoring rule decides which simulation to run next, and the search can stop after a fixed budget of runs.
How it works
Take three candidate inputs. The model is a Gaussian process fitted to earlier trials. It predicts, at each candidate, a mean and a standard deviation . The best value found so far is , and we want larger values.
| Candidate | Mean | Std |
|---|---|---|
| A | 1.0 | 0.5 |
| B | 0.6 | 1.0 |
| C | 1.5 | 0.1 |
- Read the model. Candidate A is predicted to match the best so far, with moderate uncertainty. Candidate B is predicted to be a bit worse, but its uncertainty is large. Candidate C is predicted to be clearly better, and the model is fairly sure. Check: the three rows give three different kinds of situation.
- Measure the gap. Subtract the current best from each mean: is for A, for B and for C. A positive gap means the candidate is predicted to beat the best so far. Check: only C has a positive predicted gap.
- Standardise the gap. Divide by the uncertainty, . For A, . For B, . For C, . A large means the candidate is likely to beat the best. Check: counts how many standard deviations the candidate sits above the current best.
- Score with probability of improvement. This is the chance the candidate beats , which is , where is the cumulative distribution of a standard Gaussian. The scores are for A, for B and essentially for C. Check: a score of means an even chance of beating the best.
- Score with expected improvement. This is the average amount the candidate is expected to beat by, counting zero when it does not. It is for A, for B and for C. Check: the score is always zero or more, and it is largest for C.
- Score with an upper confidence bound. Add a multiple of the uncertainty to the mean, , with . The scores are for A, for B and for C. Check: here B wins, because its large uncertainty is worth more than its low mean.
- Choose. Expected improvement and probability of improvement choose C, and the upper confidence bound chooses B. The rule is fixed in advance, and the choice depends on which score you pick.
flowchart LR T[Past trials] --> G[Gaussian process: mean and std at each candidate] G --> S[Acquisition score at each candidate] S --> P[Pick the candidate with the highest score] P --> R[Run the expensive experiment] R --> T
The plot shows how these scores depend on the predicted mean, when the uncertainty is fixed at and the best so far is . Probability of improvement rises towards and then flattens. Expected improvement keeps rising as the predicted mean grows.
- probability of improvement
- expected improvement
The math
Let be the unknown function to maximise, let and be the posterior mean and standard deviation of at input given the trials so far, and let be the best observed value. An acquisition function is a score built from , and . The next trial is at the input that maximises .
Write for the cumulative distribution function of a standard Gaussian and for its density, so that . The posterior of a Gaussian process is Gaussian at each input, so these two functions appear in the scores. Its uncertainty depends on the kernel chosen for the process.
Step 1 in symbols: the gap and the standardised gap
The numerator is how far the predicted mean sits above the best so far. Dividing by turns that gap into a number of standard deviations, which makes inputs with different uncertainties comparable.
Step 2 in symbols: probability of improvement
If the posterior is Gaussian, this is the probability that the true value at exceeds . It is when , and it tends to as grows.
Step 3 in symbols: expected improvement
The first term is the gap times the chance of a gain. The second is the size of the spread that lies above . Its value is always zero or more. Check it with candidate B: , and , so .
Step 4 in symbols: upper confidence bound
Here sets the trade-off. With the score is the mean alone, which is pure exploitation. A large rewards uncertainty, which is exploration.
Step 5 in symbols: the choice
The next input is
The maximisation is over a cheap model, not the real function. In one dimension it is a grid search. In higher dimensions, a numerical optimiser such as a gradient-based method with random restarts is used, because is much cheaper than one experiment.
Worked examples
Take a candidate with , , and best so far .
- The gap is .
- The standardised gap is .
- Probability of improvement is . The candidate has about an 84 percent chance of beating the best.
- Expected improvement is , using .
- Interpret. The expected gain is about units, which is larger than the gap of , because the spread adds to it. Probability of improvement says only "likely to win"; expected improvement says "by about this much".
Use the table from How it works: A with , B with , C with , and .
- For C the gap is and . For A, . For B, .
- Probability of improvement: for C, for A, for B. The winner is C.
- Expected improvement: C gives . A gives . B gives . The winner is C.
- Upper confidence bound with : C gives , A gives , B gives . The winner is B.
- Interpret. The two improvement-based rules pick the candidate the model is most sure about, C. The upper confidence bound picks the candidate the model knows least about, B, because gives uncertainty a large weight. Neither answer is wrong; they encode different attitudes to risk.
A tuning run has already tried 20 settings, and the best validation score so far is . Two candidate settings are on the table.
- Setting X is close to the best setting found. The model predicts with .
- Setting Y is in an unexplored corner. The model predicts with .
- Gap for X: . Standardised gap: .
- Expected improvement for X: .
- Gap for Y: . Standardised gap: .
- Here and . Expected improvement for Y: .
- Expected improvement favours Y, slightly, because Y's uncertainty is large enough to make a gain plausible. Interpret. If the team uses a rule that cares only about the mean, X always wins. The uncertainty term is what makes the search look at the unexplored corner.
Try it: Use . Candidate P has and . Compute its standardised gap , and its probability of improvement, to two decimal places.
Answer: The gap is , so . The probability of improvement is , to two decimal places. Check that the answer lies between and , as it must, since lies between and .
Common mistakes and tradeoffs
Mistake: "The acquisition function is the objective." It is tempting to think the score is the quantity being optimised. In fact it is a cheap stand-in. The real objective is only evaluated at the chosen input, and that evaluation is the expensive step the score is designed to save.
Mistake: "Pick the highest predicted mean." It is tempting to think the best guess is the best trial. In fact that rule ignores uncertainty, so it can keep trying near one good point and miss a better region that the model has not sampled. Example 3 shows the effect.
Mistake: "Pick the most uncertain input." The opposite error is equally common. Choosing only by uncertainty explores the edges of the space forever and never refines a good point.
Mistake: "The upper confidence bound's is universal." It is tempting to copy a value of from one problem to another. In fact sets how much exploration you buy, and the right value depends on the noise, the number of trials left and the smoothness of the function.
When to use it. Use an acquisition function when each evaluation is expensive, the input space is continuous or has a few dimensions, and the model is a reasonable fit to the function. Expected improvement is a common default because it has no tuning parameter and balances gain against risk.
When not to use it. When evaluations are cheap, a plain random or grid search is simpler and just as good. When the input space has hundreds of dimensions, a Gaussian process model becomes expensive and less reliable, and the acquisition step becomes hard to optimise.
Alternatives. Thompson sampling draws one plausible version of the function from the model and tries its best point, which needs no separate score. Batch acquisition rules choose several inputs at once when experiments can run in parallel. Bandit algorithms, covered in Multi-Armed Bandit, make the same exploration choice in a different setting, where the rewards are not a smooth function of the input.
History
Harold Kushner's 1964 work on finding the maximum of a noisy curve is an early example of choosing the next measurement by a probability-of-improvement style rule. In the late 1970s, Jonas Mockus and colleagues in Lithuania applied Bayesian methods to searching for extrema, including an expected-improvement criterion. The idea spread to engineering design in the 1990s, when Donald Jones, Matthias Schonlau and William Welch (1998) gave an efficient global optimisation method built on expected improvement, which made it widely used. Upper confidence bounds were analysed in the bandit literature and then adapted to Gaussian processes by Srinivas and colleagues in 2010. Each of these rules appeared because a team needed a cheap way to choose the next expensive experiment.
Recap
- An acquisition function turns a model's predicted mean and uncertainty into a score for each candidate input.
- Probability of improvement asks how likely a candidate is to beat the best so far, expected improvement asks by how much on average, and the upper confidence bound adds a multiple of the uncertainty to the mean.
- The mean rewards exploitation and the uncertainty rewards exploration; the scores differ in how they weigh the two.
- The next expensive trial goes to the input with the highest score, found by optimising the cheap score.
- The choice of score, and of for the upper confidence bound, changes which input is picked.
What to read next: Expected Improvement works out the most common score in full, and Bayesian Optimization puts the scores in the complete loop.
Check yourself
QuestionRecall: what does each of probability of improvement, expected improvement and the upper confidence bound measure, in one sentence each?Show answer
Probability of improvement is the chance that a candidate beats the best value so far. Expected improvement is the average amount by which it is expected to beat that value, counting zero when it does not. The upper confidence bound is the predicted mean plus a multiple of the uncertainty, so it rewards candidates that are predicted to be good or that the model knows little about.
QuestionComputation: a candidate has predicted mean and standard deviation , and the best so far is . Find , the probability of improvement using , and the upper confidence bound with .Show answer
The gap is , so . The probability of improvement is . The upper confidence bound is .
QuestionWhy: explain why a rule that picks only the highest predicted mean can get stuck near a good point that is not the best.Show answer
The predicted mean ignores how unsure the model is. A point near a good trial has a high mean and a small uncertainty, so the rule keeps choosing nearby points and refines them. An unexplored region with a lower mean but a large uncertainty may hide a higher true value, and the mean-only rule never tests it. Adding an uncertainty term, as expected improvement and the upper confidence bound do, gives those regions a chance.
QuestionApplied: you are tuning a model whose validation score takes two days per trial, and you have budget for 10 more trials. Your first candidate from an upper confidence bound with a large lands in a region far from the best trial so far. Should you accept it, and what would you change?Show answer
A large is doing its job, which is exploration, but with only 10 trials left it may waste budget. Accept the first suggestion if the region is plausibly good, but consider a smaller or expected improvement, which spends more of the budget near good points. A reasonable plan is to run a few exploratory trials, then shift the trade-off towards exploitation as the budget runs out.