AnyLearn
All lessons
AIadvanced

Acquisition Functions: Deciding Where to Look Next

A Gaussian process gives a mean and an uncertainty everywhere; the acquisition function turns them into one decision about where to spend the next expensive evaluation. This lesson covers Expected Improvement, GP-UCB and its no-regret guarantee, and Thompson sampling, and how each resolves exploration against exploitation.

Updated · AI-authored, review-gated · how lessons are made

Not signed in: your progress and quiz score won't be saved.
Progress1 / 9

Turning belief into one decision

The surrogate describes what you believe about the objective. It does not tell you what to do. At every candidate point the Gaussian process reports a mean and a variance, and you must collapse those into a single scalar score so you can pick the highest-scoring point and evaluate it.

That scoring rule is the acquisition function. It is cheap to compute, so you optimize it thoroughly over the whole input space, using ordinary gradient or grid methods, to find where it peaks. Then you pay for exactly one expensive evaluation there.

Every acquisition function is a different answer to one question: how should a high predicted mean, which argues for exploiting, be weighed against a high variance, which argues for exploring? The three that follow are the canonical answers.

Full lesson text

All 9 steps on one page, for reading, reference, and search.

Show

1. Turning belief into one decision

The surrogate describes what you believe about the objective. It does not tell you what to do. At every candidate point the Gaussian process reports a mean and a variance, and you must collapse those into a single scalar score so you can pick the highest-scoring point and evaluate it.

That scoring rule is the acquisition function. It is cheap to compute, so you optimize it thoroughly over the whole input space, using ordinary gradient or grid methods, to find where it peaks. Then you pay for exactly one expensive evaluation there.

Every acquisition function is a different answer to one question: how should a high predicted mean, which argues for exploiting, be weighed against a high variance, which argues for exploring? The three that follow are the canonical answers.

2. The exploration-exploitation trade-off

This tension is the same one at the heart of the multi-armed bandit, covered in reinforcement-learning-foundations. Exploit and you sample where the surrogate already predicts a good value, refining a known-promising region. Explore and you sample where the surrogate is most uncertain, testing whether something better is hiding.

Neither extreme works. Pure exploitation converges immediately onto the best point seen so far and never discovers the taller peak two regions over: it gets trapped in a local optimum. Pure exploration samples the most uncertain point every time, spreading effort uniformly and never settling to refine the best region it has found.

An acquisition function is a principled compromise between these, and the differences among the popular ones are mostly differences in how that compromise is struck and whether it comes with a guarantee.

3. Probability of Improvement: the cautious start

The simplest useful rule is Probability of Improvement. Let the best value observed so far be the incumbent. For each candidate, the GP gives a full Gaussian over its possible value, so you can compute the probability that this value beats the incumbent, and score the candidate by that probability.

It is intuitive and easy, but it has a known flaw: it is greedy. A point predicted to be a whisker above the incumbent with tiny uncertainty gets a probability near one, while a point that might be far better but is less certain scores lower. So PI over-exploits, clustering queries just past the current best and rarely taking the larger gamble.

A standard patch adds a margin, requiring a candidate to beat the incumbent by some amount before it counts, which forces a little more exploration. Even patched, PI is mostly a stepping stone to the next idea.

4. Expected Improvement: how much better, not just whether

Expected Improvement fixes the greed by scoring not the probability of beating the incumbent but the expected amount by which it is beaten. A point that will probably improve by a tiny margin and a point that will occasionally improve by a huge margin can now score equally, so large uncertain upside competes fairly with small certain gains.

The expectation has a clean closed form from the GP's Gaussian, so it stays cheap to optimize. The idea traces to Jonas Mockus in the 1970s, and it became the workhorse of the field through the 1998 Efficient Global Optimization algorithm of Donald Jones, Matthias Schonlau, and William Welch, published in the Journal of Global Optimization.

EI has a natural, parameter-free balance: the expectation is large either when the mean is high or when the variance is high, so exploration and exploitation fall out of one formula. It remains the default acquisition function in many libraries.

5. The upper confidence bound

GP-UCB takes a different route, borrowed directly from the bandit literature: optimism in the face of uncertainty. Instead of reasoning about improvement, it scores each point by an optimistic guess of its value, the posterior mean plus a multiple of the standard deviation.

The score is mean plus beta times standard deviation. Reading it is easy: a point scores well if its predicted value is high, or if its uncertainty is high, or both. The parameter beta is the single exploration dial. Small beta trusts the mean and exploits; large beta inflates the uncertainty bonus and explores.

The principle is to act as if each point is as good as its confidence interval plausibly allows. If that optimism proves right, you found a great point; if it proves wrong, you learned a lot about a high-uncertainty region. Either outcome is progress.

flowchart TD
A["At each point: mean m and std dev s"] --> B["Score = m + beta * s"]
B --> C["High where mean is high: exploit"]
B --> D["High where std dev is high: explore"]
C --> E["Pick the point with the highest score"]
D --> E

6. Why GP-UCB has a proof behind it

GP-UCB matters beyond its simplicity because it comes with a guarantee, established by Niranjan Srinivas, Andreas Krause, Sham Kakade, and Matthias Seeger in their 2010 ICML paper "Gaussian Process Optimization in the Bandit Setting". Krause leads the Learning and Adaptive Systems group at ETH Zurich and directs the ETH AI Center.

The result concerns regret, the gap between the best value you could have found and what you actually sampled, summed over all queries. They proved that with a suitable schedule for beta, GP-UCB achieves sublinear cumulative regret: the total regret grows more slowly than the number of evaluations, so the average regret tends to zero and the method provably converges to the optimum.

This was the first algorithm to give such rates for this setting, connecting the bound to how fast the kernel lets information accumulate. The paper received the ICML Test of Time Award in 2020.

7. Thompson sampling: let the posterior vote

A third rule sidesteps hand-designed scores. Thompson sampling, named for a 1933 idea of William R. Thompson, draws one random function from the GP posterior and picks the point that maximizes that single sample.

Because the sample is random, well-explored regions, where the posterior is tight, produce nearly the same sample every time, while uncertain regions vary wildly between draws. So the method naturally explores in proportion to uncertainty: an uncertain region occasionally produces a sample with a high peak there, and gets probed, without any explicit exploration parameter.

Its practical strength is parallelism. To choose a batch of points to evaluate at once, you draw several independent posterior samples and take the maximizer of each; they scatter across promising and uncertain regions automatically. That makes Thompson sampling a common choice when you can run many expensive evaluations simultaneously.

8. Choosing among them

For most single-query problems the choice is not decisive, and Expected Improvement is a sound default. The distinctions matter when you need a specific property.

AcquisitionBalances viaNotable property
Probability of Improvementprobability of beating the bestgreedy, over-exploits
Expected Improvementexpected size of improvementparameter-free default
GP-UCBmean plus beta times std devtunable, proven no-regret
Thompson samplinga random posterior drawparallelizes naturally

Reach for GP-UCB when you want an explicit exploration dial or the theoretical guarantee. Reach for Thompson sampling when you are running a batch of evaluations in parallel. Reach for Expected Improvement when you want a strong, assumption-light default and are querying one point at a time. All four consume nothing but the GP's mean and variance, so switching between them is a one-line change in practice.

9. The acquisition is itself an optimization

One subtlety completes the picture. You solve an expensive black-box optimization by repeatedly solving a cheap one: maximizing the acquisition function to find the next query.

That inner problem is friendly. The acquisition surface is cheap to evaluate, and for EI and GP-UCB you can even compute its gradient, so you attack it with ordinary optimizers, usually restarted from many points because it too can be multimodal. This is the trade at the core of the method: convert one costly, gradient-free problem into a sequence of cheap, well-behaved ones.

With a surrogate and an acquisition function in hand, you have a complete algorithm. The final lesson turns it into practice: the tools that implement it, tuning machine-learning models as the flagship use, and the situations where it falls short.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. What is the job of an acquisition function?
    • To collapse the GP's mean and variance at each point into one score for choosing the next query
    • To invert the kernel matrix of the Gaussian process
    • To evaluate the true expensive objective
    • To choose the kernel and its lengthscale
  2. Why is pure Probability of Improvement considered too greedy?
    • It ignores the incumbent best value
    • It scores whether a point beats the best, not by how much, so it clusters near the current best
    • It requires a gradient of the objective
    • It always samples the most uncertain point
  3. How does GP-UCB score a candidate point?
    • By the probability it beats the incumbent
    • By a random draw from the GP posterior
    • By the expected size of improvement over the best value
    • By the posterior mean plus beta times the standard deviation
  4. What did Srinivas, Krause, Kakade, and Seeger (2010) prove about GP-UCB?
    • That it achieves sublinear cumulative regret, so it provably converges to the optimum
    • That it is faster to compute than Expected Improvement
    • That it requires no Gaussian process
    • That it always finds the optimum in one evaluation
  5. What makes Thompson sampling especially convenient for parallel evaluation?
    • It never needs the GP posterior
    • It has no exploration parameter to tune
    • Drawing several independent posterior samples yields a batch of points that scatter across promising and uncertain regions
    • It always selects the single most uncertain point

Related lessons