Simple Algorithm
Reinforcement Learning · Fixed Point · 26 min

Best-Arm Identification

When only the final choice counts: fixed-confidence and fixed-budget exploration.

An A/B test, a drug screen or a hyperparameter search does not care how much reward is collected along the way: only the final recommendation counts. That changes everything. It pays to keep sampling a clearly inferior arm if that sharpens the comparison at the top, and an algorithm with optimal regret turns out to be a poor identifier. This lesson develops the two standard formulations of best-arm identification, their algorithms and their sharp limits.

What you’ll learn

  • Define fixed-confidence (δ\delta-PAC) and fixed-budget best-arm identification, and simple regret.
  • Analyze successive elimination and state its sample complexity O(∑iΔi−2log⁡(K/(δΔi)))\order{\sum_i\Delta_i^{-2}\log(K/(\delta\Delta_i))}.
  • Derive the lower bound E[τδ]≥T⋆(μ)kl⁡(δ,1−δ)\E[\tau_\delta]\ge T^\star(\mu)\operatorname{kl}(\delta,1-\delta) and compute T⋆T^\star for two arms; explain how Track-and-Stop attains it.
  • Describe successive rejects and sequential halving for a fixed budget, and their link to hyperparameter search.
  • Explain why algorithms with low cumulative regret identify the best arm slowly.

When only the final choice counts

In pure exploration a learner samples arms for a while and then recommends one; pulls cost nothing in themselves, only the recommendation is judged. Best-arm identification asks for the arm with the highest mean, assumed unique. Two formulations dominate, and they trade the roles of time and error.

Uniform sampling is the baseline. With n/Kn/K samples per arm and 1-subgaussian rewards, recommending the empirical best errs with probability at most ∑iexp⁡(−⌊n/K⌋Δi2/4)\sum_{i}\exp(-\lfloor n/K\rfloor\Delta_i^2/4), which decays exponentially in nn but at a rate set by the smallest gap, while the arms far from the top get as many samples as the contenders. Good algorithms stop sampling an arm once it is clearly out.

A regret-minimizing policy also yields a recommendation: draw the recommended arm in proportion to how often each arm was pulled, and the simple regret is exactly Rn/nR_n/n (Lattimore & Szepesvári, Proposition 33.2). That gives worst-case simple regret of order K/n\sqrt{K/n}, which is optimal in the worst case, but on an easy instance it is very far from the exponential decay that dedicated exploration achieves; the last step makes this precise.

Check your understanding

A team will show two checkout pages to 20,000 visitors in total and then ship the better one for years. What is the natural formulation?

  1. Cumulative regret over the 20,000 visitors
  2. Fixed-budget best-arm identification: minimize the probability of shipping the worse page
  3. Fixed-confidence identification with δ=0\delta=0
  4. Adversarial bandits, because visitors differ
Show the answer

B. Fixed-budget best-arm identification: minimize the probability of shipping the worse page

The budget is fixed and the long-run consequences of the decision dwarf what happens during the test, so the error probability of the final choice is what matters. If the test may stop early once the winner is clear, the fixed-confidence formulation fits instead.

Successive elimination

text
SUCCESSIVE-ELIMINATION(δ):                     # rewards in [0, 1], unique best arm
    S ← {1, ..., K};  t ← 0
    repeat
        t ← t + 1
        pull every arm in S once;  update its average μ̂_a(t) of t samples
        α_t ← sqrt( ln(c·K·t² / δ) / t )         # c ≥ 4
        remove from S every arm a with  max_b μ̂_b(t) − μ̂_a(t) ≥ 2·α_t
    until |S| = 1
    return the arm left in S

Successive elimination as analyzed by Even-Dar, Mannor and Mansour (2006). Each surviving arm is sampled in lockstep, and an arm leaves as soon as its confidence interval falls entirely below the leader's.

DerivationProof sketch
  1. 1−∑a=1K∑t≥12δcKt2=1−π23c δ ≥ 1−δ(c≥4)1-\sum_{a=1}^K\sum_{t\ge1}\frac{2\delta}{cKt^2}=1-\frac{\pi^2}{3c}\,\delta\ \ge\ 1-\delta\qquad(c\ge4)

    Good event. By Hoeffding's inequality, Pr⁡(∣μ^a(t)−μa∣≥αt)≤2e−2tαt2=2(δ/(cKt2))2≤2δ/(cKt2)\Pr(|\hat\mu_a(t)-\mu_a|\ge\alpha_t)\le2e^{-2t\alpha_t^2}=2\big(\delta/(cKt^2)\big)^2\le2\delta/(cKt^2). A union bound over arms and rounds, with ∑t1/t2=π2/6\sum_t1/t^2=\pi^2/6, puts every estimate inside its interval at all times with probability at least

  2. The best arm survives. On the good event the leader's average is at most its mean plus αt\alpha_t, which is at most μ⋆+αt\mu^\star+\alpha_t, while the best arm's average is at least μ⋆−αt\mu^\star-\alpha_t. Their difference is at most 2αt2\alpha_t, never enough to eliminate the best arm, so the returned arm is correct.

  3. μ^a⋆(t)−μ^i(t) ≥ Δi−2αt ≥ 2αtoncet ≥ 16Δi2ln⁡cKt2δ\hat\mu_{a^\star}(t)-\hat\mu_i(t)\ \ge\ \Delta_i-2\alpha_t\ \ge\ 2\alpha_t\qquad\text{once}\qquad t\ \ge\ \frac{16}{\Delta_i^2}\ln\frac{cKt^2}{\delta}

    Bad arms leave. Arm ii is eliminated once the best arm's lower end clears arm ii's upper end by the margin, which holds as soon as 4αt≤Δi4\alpha_t\le\Delta_i:

  4. Solving the implicit inequality gives ti=O(Δi−2ln⁡(K/(δΔi)))t_i=\order{\Delta_i^{-2}\ln(K/(\delta\Delta_i))} rounds for arm ii, which is also how long the best arm keeps being sampled against its closest rival. Summing over arms gives the bound.

Predict before you look

Ten arms: the best, one rival at gap 0.05, and eight arms at gap 0.5. The complexity H1=∑iΔi−2H_1=\sum_i\Delta_i^{-2}, with the best arm's term set by its closest rival (Δa⋆:=0.05\Delta_{a^\star}:=0.05), drives elimination. What is H1H_1?

Show the answer

832

2×(1/0.052)+8×(1/0.52)=800+32=8322\times(1/0.05^2)+8\times(1/0.5^2)=800+32=832. Sampling uniformly until the closest pair is resolved costs about K/Δmin⁡2=4,000K/\Delta_{\min}^2=4{,}000 in the same units, nearly five times more, because the eight easy arms would get as many samples as the two contenders.

Elimination wastes effort in a different way: it samples all survivors in lockstep, though only the arms near the top need precision. LUCB (Kalyanakrishnan, Tewari, Auer & Stone, 2012) samples just two arms per round, the empirical leader and the rival with the highest upper confidence bound, and stops when the leader's lower bound clears every rival's upper bound; its expected sample complexity is of order H1log⁡(H1/δ)H_1\log(H_1/\delta). lil'UCB (Jamieson, Malloy, Nowak & Bubeck, 2014) replaces the union bound over time by confidence bounds from the law of the iterated logarithm, so the logarithmic factor shrinks to about log⁡(log⁡(Δi−2)/δ)\log(\log(\Delta_i^{-2})/\delta).

The sharp lower bound and Track-and-Stop

How few samples can a δ\delta-PAC strategy need? The tool of Regret Lower Bounds applies at a stopping time. Take the indicator Z=1{a^τ=a⋆(μ)}Z=\mathbf 1\{\hat a_\tau=a^\star(\mu)\} and any instance λ\lambda whose best arm differs: correctness gives EμZ≥1−δ\E_\mu Z\ge1-\delta and EλZ≤δ\E_\lambda Z\le\delta, and the data-processing inequality gives the transportation inequality of Kaufmann, Cappé and Garivier (2016), with d(⋅,⋅)d(\cdot,\cdot) the divergence between two arms of the family (the Bernoulli kl⁡\operatorname{kl}, or (x−y)2/(2σ2)(x-y)^2/(2\sigma^2) for Gaussians):

∑a=1KEμ[Na(τ)] d(μa,λa) ≥ kl⁡(δ,1−δ)for every λ with a⋆(λ)≠a⋆(μ)\sum_{a=1}^K\E_\mu\big[N_a(\tau)\big]\,d(\mu_a,\lambda_a)\ \ge\ \operatorname{kl}(\delta,1-\delta)\qquad\text{for every }\lambda\text{ with }a^\star(\lambda)\ne a^\star(\mu)
To be right in μ\mu and in every alternative λ\lambda, the strategy must collect enough evidence against each alternative. kl⁡(δ,1−δ)∼ln⁡(1/δ)\operatorname{kl}(\delta,1-\delta)\sim\ln(1/\delta) as δ→0\delta\to0, and kl⁡(δ,1−δ)≥ln⁡(1/(2.4δ))\operatorname{kl}(\delta,1-\delta)\ge\ln(1/(2.4\delta)) for all δ\delta.
DerivationFrom the transportation inequality to T*
  1. kl⁡(δ,1−δ) ≤ Eμ[τ] inf⁡λ∈Alt(μ)∑awa d(μa,λa) ≤ Eμ[τ] sup⁡w∈ΣKinf⁡λ∈Alt(μ)∑awa d(μa,λa)\operatorname{kl}(\delta,1-\delta)\ \le\ \E_\mu[\tau]\ \inf_{\lambda\in\mathrm{Alt}(\mu)}\sum_aw_a\,d(\mu_a,\lambda_a)\ \le\ \E_\mu[\tau]\ \sup_{w\in\Sigma_K}\inf_{\lambda\in\mathrm{Alt}(\mu)}\sum_aw_a\,d(\mu_a,\lambda_a)

    Divide and multiply by Eμ[τ]\E_\mu[\tau], writing wa=Eμ[Na(τ)]/Eμ[τ]w_a=\E_\mu[N_a(\tau)]/\E_\mu[\tau], which is a point of the simplex. The inequality holds for every alternative, hence for the worst one:

  2. T⋆(μ)−1=max⁡ww1w2Δ22σ2=Δ28σ2,T⋆(μ)=8σ2Δ2T^\star(\mu)^{-1}=\max_{w}\frac{w_1w_2\Delta^2}{2\sigma^2}=\frac{\Delta^2}{8\sigma^2},\qquad T^\star(\mu)=\frac{8\sigma^2}{\Delta^2}

    Two Gaussian arms with variance σ2\sigma^2 and gap Δ\Delta. The cheapest alternative moves both means to a common value mm; minimizing w1(μ1−m)2+w2(μ2−m)2w_1(\mu_1-m)^2+w_2(\mu_2-m)^2 over mm gives w1w2Δ2w_1w_2\Delta^2. Divide by 2σ22\sigma^2 and maximize over w1+w2=1w_1+w_2=1, at w=(12,12)w=(\tfrac12,\tfrac12):

  3. ∑a=1K2σ2Δa2 ≤ T⋆(μ) ≤ 2∑a=1K2σ2Δa2\sum_{a=1}^K\frac{2\sigma^2}{\Delta_a^2}\ \le\ T^\star(\mu)\ \le\ 2\sum_{a=1}^K\frac{2\sigma^2}{\Delta_a^2}

    For KK Gaussian arms there is no closed form, but T⋆T^\star is sandwiched by the familiar complexity, with Δa⋆\Delta_{a^\star} set to the smallest gap:

Predict before you look

Two Gaussian arms with σ2=0.25\sigma^2=0.25 (the variance of a fair coin) and gap 0.10.1, at δ=0.01\delta=0.01, where kl⁡(0.01,0.99)≈4.50\operatorname{kl}(0.01,0.99)\approx4.50. What lower bound does the theorem give on the expected number of samples?

Show the answer

900

T⋆=8σ2/Δ2=8×0.25/0.01=200T^\star=8\sigma^2/\Delta^2=8\times0.25/0.01=200, so E[τ]≥200×4.50=900\E[\tau]\ge200\times4.50=900, about 450 per arm. For Bernoulli arms with means 0.6 and 0.5 the exact constant is T⋆≈198T^\star\approx198, giving about 890.

Track-and-Stop (Garivier & Kaufmann, 2016) attains the bound as δ→0\delta\to0. Its sampling rule computes the optimal proportions w⋆(μ^(t))w^\star(\hat\mu(t)) for the current estimates and pulls the arm whose count lags furthest behind them, with forced exploration so that every arm gets at least about t\sqrt t samples and the estimates converge. Its stopping rule is a generalized likelihood ratio test due to Chernoff: stop when the evidence against the most plausible alternative, tinf⁡λ∈Alt(μ^(t))∑aNa(t)td(μ^a(t),λa)t\inf_{\lambda\in\mathrm{Alt}(\hat\mu(t))}\sum_a\frac{N_a(t)}{t}d(\hat\mu_a(t),\lambda_a), exceeds a threshold of order ln⁡(t/δ)\ln(t/\delta). For exponential families it is δ\delta-PAC and lim sup⁡δ→0E[τδ]/ln⁡(1/δ)≤αT⋆(μ)\limsup_{\delta\to0}\E[\tau_\delta]/\ln(1/\delta)\le\alpha T^\star(\mu), with α≥1\alpha\ge1 set by the threshold and equal to 1 for the Bernoulli choice in the paper.

The optimal proportions can surprise. For Bernoulli arms with means (0.5,0.1,0.02)(0.5,0.1,0.02), w⋆≈(39%,42%,19%)w^\star\approx(39\%,42\%,19\%): the runner-up gets more samples than the best arm. The proportions depend on the shape of the reward distributions, not only on the gaps.

Fixed budget: rejecting and halving

With a fixed budget nn there is no stopping rule, only an allocation. Sort the gaps so that Δ(1)=Δ(2)≤Δ(3)≤⋯≤Δ(K)\Delta_{(1)}=\Delta_{(2)}\le\Delta_{(3)}\le\dots\le\Delta_{(K)}, where Δ(1)\Delta_{(1)} is the best arm's term, and define H2=max⁡i i Δ(i)−2H_2=\max_i\,i\,\Delta_{(i)}^{-2}. It is close to H1=∑iΔ(i)−2H_1=\sum_i\Delta_{(i)}^{-2}: H2≤H1≤log⁡(2K) H2H_2\le H_1\le\log(2K)\,H_2.

Sequential halving (Karnin, Koren & Somekh, 2013) is even simpler: in each of ⌈log⁡2K⌉\lceil\log_2K\rceil rounds, spend an equal share of the budget on the surviving arms and keep the better half. For 1-subgaussian rewards its error probability is at most 3log⁡2K⋅exp⁡(−n/(16H2log⁡2K))3\log_2K\cdot\exp\big(-n/(16H_2\log_2K)\big) (Lattimore & Szepesvári, Theorem 33.10). Fixed-budget upper and lower bounds are known to match only up to logarithmic factors, and sequential halving is considered roughly optimal.

Halving is also a workhorse of hyperparameter search, where an arm is a configuration and a pull is more training. Jamieson and Talwalkar (2016) cast this as non-stochastic best-arm identification, since a training curve is not a stream of i.i.d. samples but a sequence converging to a final loss, and Hyperband (Li, Jamieson, DeSalvo, Rostamizadeh & Talwalkar, 2018) runs successive halving at several trade-offs between the number of configurations and the budget each receives. Its guarantees are correspondingly weaker: early losses can rank configurations differently from final ones.

Check your understanding

Sequential halving runs on K=16K=16 arms with budget nn, in log⁡216=4\log_2 16=4 rounds that each spend n/4n/4 split equally over the survivors. How many samples does each of the two finalists get in the last round?

  1. n/8n/8
  2. n/16n/16
  3. n/32n/32
  4. n/4n/4
Show the answer

A. n/8n/8

Round ℓ\ell splits n/4n/4 over 16,8,4,216,8,4,2 arms, giving n/64n/64, n/32n/32, n/16n/16 and finally n/8n/8 samples per arm. Uniform allocation would give each arm n/16n/16 in total; halving gives the two contenders far more of the budget than the twelve arms it discarded early.

Regret and identification pull apart

With logarithmic regret, ε(n)=ln⁡n\varepsilon(n)=\ln n, the bound reads Ern≥Δ2n−D\E r_n\ge\frac\Delta2n^{-D}: the simple regret can fall only polynomially, while uniform sampling makes it fall exponentially. Lattimore and Szepesvári (ch. 33) make this precise for Gaussian arms: an asymptotically optimal regret policy has a misidentification probability that, on some instances, decays no faster than about n−(1+ε)n^{-(1+\varepsilon)}. The mechanism is the one the regret lower bound demands: a good regret policy pulls each suboptimal arm only about log⁡n\log n times, which leaves those arms' means uncertain. A side effect matters in practice: the averages of arms that a regret minimizer stops pulling after an unlucky stretch stay biased downward.

Posterior sampling can be adapted to identification. Top-two Thompson sampling (Russo, 2016) draws the arm Thompson sampling would pull, and with some probability resamples until a different arm comes up, so the strongest challenger keeps being tested; Russo showed that, with resampling probability 1−β1-\beta, such top-two rules make the posterior probability of a wrong answer vanish at the best exponential rate achievable by any rule that gives the best arm a fraction β\beta of the samples, and with β=12\beta=\tfrac12 within a factor of two of the best rate overall. Choosing the objective first, regret or identification, is the practical lesson.

Key takeaways

  • Best-arm identification judges only the final recommendation: either δ\delta-PAC with minimal expected sample size (fixed confidence), or minimal error probability for a budget nn (fixed budget).
  • Successive elimination drops arms as confidence intervals separate and needs O(∑iΔi−2log⁡(K/(δΔi)))\order{\sum_i\Delta_i^{-2}\log(K/(\delta\Delta_i))} samples; LUCB and lil'UCB sharpen the allocation and the logarithm.
  • Every δ\delta-PAC strategy needs E[τ]≥T⋆(μ)kl⁡(δ,1−δ)\E[\tau]\ge T^\star(\mu)\operatorname{kl}(\delta,1-\delta), with T⋆(μ)−1=sup⁡winf⁡λ∈Alt(μ)∑awad(μa,λa)T^\star(\mu)^{-1}=\sup_w\inf_{\lambda\in\mathrm{Alt}(\mu)}\sum_aw_ad(\mu_a,\lambda_a); for two Gaussian arms T⋆=8σ2/Δ2T^\star=8\sigma^2/\Delta^2, and Track-and-Stop attains the bound as δ→0\delta\to0.
  • With a fixed budget, successive rejects and sequential halving achieve error exp⁡(−Θ(n/(H2log⁡K)))\exp(-\Theta(n/(H_2\log K))) without knowing the gaps; halving also underlies Hyperband.
  • Low cumulative regret forces slow identification (Bubeck, Munos & Stoltz): decide whether you want to earn or to learn before choosing the algorithm.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

A best-arm identification algorithm is δ\delta-PAC with δ=0.05\delta=0.05. What does that guarantee?

  1. It always stops within a fixed number of samples
  2. Its simple regret is at most 0.05
  3. On every instance with a unique best arm it stops almost surely and recommends the best arm with probability at least 0.95
  4. Its cumulative regret grows logarithmically
Show the answer

C. On every instance with a unique best arm it stops almost surely and recommends the best arm with probability at least 0.95

δ\delta-PAC is a correctness guarantee that holds uniformly over instances, while the number of samples is random and adapts to the instance, roughly T⋆(μ)ln⁡(1/δ)T^\star(\mu)\ln(1/\delta) for a good strategy.

Question 2

For an asymptotically optimal fixed-confidence strategy, about how does the expected sample size change when δ\delta goes from 0.010.01 to 0.00010.0001?

  1. It roughly doubles
  2. It grows about 100-fold
  3. It grows about 10-fold
  4. It stays the same
Show the answer

A. It roughly doubles

E[τδ]≈T⋆(μ)ln⁡(1/δ)\E[\tau_\delta]\approx T^\star(\mu)\ln(1/\delta), and ln⁡(104)=2ln⁡(102)\ln(10^4)=2\ln(10^2). Confidence is cheap: squaring the error probability only doubles the work, while halving the smallest gap quadruples it.

Question 3

Why does successive elimination need far fewer samples than uniform sampling when the gaps differ a lot?

  1. It uses a tighter concentration inequality
  2. It knows the gaps in advance
  3. It samples the best arm more often than the others
  4. It drops each arm once its confidence interval separates from the leader's, so arms with large gaps receive few samples
Show the answer

D. It drops each arm once its confidence interval separates from the leader's, so arms with large gaps receive few samples

Arm ii leaves after about Δi−2ln⁡(K/(δΔi))\Delta_i^{-2}\ln(K/(\delta\Delta_i)) rounds, so its cost scales with its own gap; uniform sampling gives every arm the budget the hardest pair needs, about K/Δmin⁡2K/\Delta_{\min}^2 in total.

Question 4

Why can one algorithm not be optimal both for cumulative regret and for identifying the best arm?

  1. Because regret is measured in rewards and identification in probabilities
  2. Because low regret requires pulling each suboptimal arm only about log⁡n\log n times, which leaves their means too uncertain for the identification error to fall exponentially
  3. Because identification algorithms cannot use confidence intervals
  4. Because regret algorithms never stop
Show the answer

B. Because low regret requires pulling each suboptimal arm only about log⁡n\log n times, which leaves their means too uncertain for the identification error to fall exponentially

Bubeck, Munos and Stoltz proved that cumulative regret bounded by Cε(n)C\varepsilon(n) forces simple regret of at least Δ2e−Dε(n)\frac\Delta2e^{-D\varepsilon(n)} on some instance; with ε(n)=ln⁡n\varepsilon(n)=\ln n that is only polynomial decay. The samples that identification needs are exactly the ones regret minimization avoids.

Further reading

  • E. Even-Dar, S. Mannor & Y. Mansour, "Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems," Journal of Machine Learning Research 7, 1079–1105 (2006).
  • A. Garivier & E. Kaufmann, "Optimal best arm identification with fixed confidence," Conference on Learning Theory (2016).
  • E. Kaufmann, O. Cappé & A. Garivier, "On the complexity of best-arm identification in multi-armed bandit models," Journal of Machine Learning Research (2016).
  • J.-Y. Audibert, S. Bubeck & R. Munos, "Best arm identification in multi-armed bandits," Conference on Learning Theory (2010).
  • S. Bubeck, R. Munos & G. Stoltz, "Pure exploration in multi-armed bandits problems," Algorithmic Learning Theory (2009).