Optimal Best Arm Identification with Fixed Confidence

Aurélien Garivier, Emilie Kaufmann

Introduction

In some of these applications, the real objective is not to maximize the cumulated reward, but rather to identify the arm that yields the largest mean reward μ∗=max⁡1≤a≤Kμa\mu^{*}=\max_{1\leq a\leq K}\mu_{a}, as fast and accurately as possible, regardless of the number of bad arm draws. Let Ft=σ(X1,…,Xt){\cal F}_{t}=\sigma(X_{1},\dots,X_{t}) be the sigma-field generated by the observations up to time tt. A strategy is then defined by:

a sampling rule (At)t(A_{t})_{t}, where AtA_{t} is Ft−1{\cal F}_{t-1}-measurable;

a stopping rule τ\tau, which is a stopping time with respect to Ft{\cal F}_{t};

and a Fτ{\cal F}_{\tau}-measurable decision rule a^τ\hat{a}_{\tau}.

The second contribution is a new δ\delta-PAC algorithm that asymptotically achieves this lower bound, that we call the Track-and-Stop strategy. In a nutshell, the idea is to sample so as to equalize the probability of all possible wrong decisions, and to stop as soon as possible. The stopping rule, which we name after Chernoff, can be interpreted in three equivalent ways: in statistical terms, as a generalized likelihood ratio test; in information-theoretic terms, as an application of the Minimal Description Length principle; and in terms of optimal transportation, in light of the lower bound. The sampling rule is a by-product of the lower bound analysis, which reveals the existence of optimal proportions of draws for each arm. By estimating and tracking these proportions, our algorithm asymptotically reaches the optimal sample complexity as δ\delta goes to .

The paper is organized as follows. In Section 2, the lower bound is given with a short proof. Section 3 contains a commented description of our stopping and sampling rules. The analysis of the resulting algorithm is sketched in Sections 4 (validity of the stopping rule) and LABEL:sec:SCAnalysis (sample complexity analysis), establishing its asymptotic optimality. Section LABEL:sec:experiments contains practical comments and results of numerical experiments, in order to show the efficiency of our strategy even for moderate values of δ\delta. We also briefly comment on the gain over racing strategies, which can be explained in light of Theorem 2.1. Most proofs and technical details are postponed to the Appendix.

Lower Bounds on the sample complexity

The pioneering work of LaiRobbins85bandits has popularized the use of changes of distributions to show problem-dependent lower bounds in bandit problems: the idea is to move the parameters of the arms until a completely different behavior of the algorithm is expected on this alternative bandit model. The cost of such a transportation is induced by the deviations of the arm distributions: by choosing the most economical move, one can prove that the alternative behavior is not too rare in the original model. Recently, COLT14 and Combes14Unimodal have independently introduced a new way of writing such a change of measure, which relies on a transportation lemma that encapsulates the change of measure and permits to use it at a higher level. Here we go one step further by combining several changes of measures at the same time, in the spirit of GravesLai97. This allows us to prove a non-asymptotic lower bound on the sample complexity valid for any δ\delta-PAC algorithm on any bandit model with a unique optimal arm. We present this result in the particular case of arms that belong to a canonical exponential family,

With some abuse of notation, an exponential family bandit model ν=(νμ1,…,νμK)\nu=(\nu^{\mu_{1}},\dots,\nu^{\mu_{K}}) is identified with the means of its arms μ=(μ1,…,μK)\bm{\mu}=(\mu_{1},\dots,\mu_{K}).

Let δ∈(0,1)\delta\in(0,1). For any δ\delta-PAC strategy and any bandit model μ∈S\bm{\mu}\in\mathcal{S},

We will see that the supremum in Equation \eqrefequ:Original is indeed a maximum, and we call

the corresponding distribution on the arms. The proof of Theorem 2.1 shows that w∗w^{*} is the proportion of arm draws of any strategy matching this lower bound.

The particular case where S\mathcal{S} is the class of bandit models with Poisson rewards in which all suboptimal arms are equal is considered in the very insightful paper by Rajesh15Oddball, where a closed-form formula is given for both T∗(μ)T^{*}(\bm{\mu}) and w∗(μ)w^{*}(\bm{\mu}). In this paper, we consider best arm identification in all possible bandit models with a single best arm, and in the rest of the paper we fix

Let δ∈(0,1)\delta\in(0,1), μ∈S\bm{\mu}\in\mathcal{S}, and consider a δ\delta-PAC strategy. For every t≥1t\geq 1, denote by Na(t)N_{a}(t) the (random) number of draws of arm aa up to time tt. The ‘transportation’ Lemma 1 of JMLR15 relates the expected number of draws of each arm and the Kullback-Leibler divergence of two bandit models with different optimal arms to the probability of error δ\delta:

2 About the Characteristic Time and the Optimal Proportions

We study here the optimization problem \eqrefequ:Original, so as to better understand the function T∗T^{*} and w∗w^{*} (Proposition 2.6), and in order to provide an efficient algorithm for computing first w∗(μ)w^{*}(\bm{\mu}) (Theorem 2.5), then T∗(μ)T^{*}(\bm{\mu}) (Lemma 2.3). The main ideas are outlined here, while all technical details are postponed to Appendix LABEL:proofs:Nu. Simplifying T∗(μ)T^{*}(\bm{\mu}) requires the introduction of the following parameterized version of the Jensen-Shannon divergence (which corresponds to α=1/2\alpha=1/2): for every α∈\alpha\in, let

The first step is, for any ww, to identify the minimizer of the transportation cost:

It is easy to see that, at the optimum, the quantities (w1+wa)Iw1/(w1+wa)(μ1,μa)(w_{1}+w_{a})I_{{w_{1}}/({w_{1}+w_{a}})}(\mu_{1},\mu_{a}) are all equal.

This permits to obtain a more explicit formula for w∗(μ)w^{*}(\bm{\mu}) involving only a single real parameter. Indeed, for every a∈{2,…K}a\in\{2,\dots K\} let

The function gag_{a} is a strictly increasing one-to-one mapping from [0,+∞[[0,+\infty[ onto [0,d(μ1,μa)[[0,d(\mu_{1},\mu_{a})[. We define xa:[0,d(μ1,μa)[→[0,+∞[x_{a}:[0,d(\mu_{1},\mu_{a})[\to[0,+\infty[ as its inverse function: xa(y)=ga−1(y)x_{a}(y)=g_{a}^{-1}(y). Denoting x1x_{1} the function constantly equal to 11, one obtains the following characterization of w∗(μ)w^{*}(\bm{\mu}):

where y∗y^{*} is the unique solution of the equation Fμ(y)=1F_{\bm{\mu}}(y)=1, and where

is a continuous, increasing function on [0,d(μ1,μ2)[[0,d(\mu_{1},\mu_{2})[ such that Fμ(0)=0F_{\bm{\mu}}(0)=0 and Fμ(y)→∞F_{\bm{\mu}}(y)\to\infty when y→d(μ1,μ2))y\to d(\mu_{1},\mu_{2})).

Thus, w∗w^{*} can be simply computed by applying (for example) the bisection method to a function whose evaluations requires the resolution of KK smooth scalar equations. By using efficient numerical solvers, we obtain a fast algorithm of complexity, roughly speaking, proportional to the number of arms. This characterization of w∗(μ)w^{*}(\bm{\mu}) also permits to obtain a few sanity-check properties, like for example:

For all μ∈S\bm{\mu}\in\mathcal{S}, for all aa, wa∗(μ)≠0w_{a}^{*}(\bm{\mu})\neq 0.

w∗w^{*} is continuous in every μ∈S\bm{\mu}\in\mathcal{S}.

If μ1>μ2≥⋯≥μK\mu_{1}>\mu_{2}\geq\dots\geq\mu_{K}, one has w2∗(μ)≥⋯≥wK∗(μ)w_{2}^{*}(\bm{\mu})\geq\dots\geq w_{K}^{*}(\bm{\mu}).

Observe that one may haveThis can happen when the right-deviations of νμ2\nu^{\mu_{2}} are smaller than the left-deviations of νμ1\nu^{\mu_{1}}; for example, with Bernoulli arms of parameters μ=(0.5,0.1,0.02)\bm{\mu}=(0.5,0.1,0.02), ν∗(μ)≈(39%,42%,19%)\nu^{*}(\bm{\mu})\approx(39\%,42\%,19\%). w2>w1w_{2}>w_{1}. In general, it is not possible to give closed-form formulas for T∗(μ)T^{*}(\bm{\mu}) and w∗(μ)w^{*}(\bm{\mu}). In particular, T∗(μ)T^{*}(\bm{\mu}) cannot be written as a sum over the arms of individual complexity terms as in previous works (MannorTsi04; JMLR15). But the following particular cases can be mentioned.

For a two-armed bandit model μ=(μ1,μ2)\bm{\mu}=(\mu_{1},\mu_{2}), T∗(μ)T^{*}(\bm{\mu}) and w∗(μ)w^{*}(\bm{\mu}) can be computed algebraically. Lemma 2.3 and the fact that w2=1−w1w_{2}=1-w_{1} imply that

Some algebra shows that the maximum is reached at α=α∗(μ1,μ2)\alpha=\alpha_{*}(\mu_{1},\mu_{2}) defined by the equation d(μ1,μ∗)=d(μ2,μ∗)d(\mu_{1},\mu_{*})=d(\mu_{2},\mu_{*}), where μ∗=α∗(μ1,μ2)μ1+(1−α∗(μ1,μ2))μ2\mu_{*}=\alpha_{*}(\mu_{1},\mu_{2})\mu_{1}+(1-\alpha_{*}(\mu_{1},\mu_{2}))\mu_{2}. The value of the maximum is then the ‘reversed’ Chernoff information d∗(μ1,μ2):=d(μ1,μ∗)=d(μ2,μ∗)d_{*}(\mu_{1},\mu_{2}):=d(\mu_{1},\mu_{*})=d(\mu_{2},\mu_{*}). This permits to recover the bound already given in COLT14:

The Gaussian case.

When d(x,y)=(x−y)2/(2σ2)d(x,y)=(x-y)^{2}/(2\sigma^{2}), T∗(μ)T^{*}(\mu) and w∗(μ)w^{*}(\bm{\mu}) can be computed by solving a rational equation. Indeed, Equation \eqrefeq:relation and Lemma 2.4 imply that

for some λ∈(0,(μ1−μ2)2)\lambda\in(0,(\mu_{1}-\mu_{2})^{2}). For K=3K=3, λ\lambda is the solution of a polynomial equation of degree 4 and has therefore an (obscure) algebraic expression. The following inequalities, established in Appendix LABEL:proof:BoundGaussian give a better insight of the order of magnitude of T∗(μ)T^{*}(\bm{\mu}): if Δ1=Δ2\Delta_{1}=\Delta_{2} and Δa=μ1−μa\Delta_{a}=\mu_{1}-\mu_{a} for a≥2a\geq 2, then

The Track-and-Stop Strategy

We now describe a new strategy which is the first (as far as we know) to asymptotically match the lower bound of Theorem 2.1. Denote by μ^(t)=(μ^1(t),…,μ^K(t))\hat{\mu}(t)=(\hat{\mu}_{1}(t),\dots,\hat{\mu}_{K}(t)) the current maximum likelihood estimate of μ\bm{\mu} at time tt: μ^a(t)=Na(t)−1∑s≤tXs\mathds1{As=a}\hat{\mu}_{a}(t)=N_{a}(t)^{-1}\sum_{s\leq t}X_{s}\mathds{1}\{A_{s}=a\}. As seen in Section 2, a good sampling rule should respect the optimal proportions of arm draws given by w∗(μ)w^{*}(\bm{\mu}). There are several ways to ensure this, and we present two of them in Section 3.1. A good stopping rule should determine the earliest moment when sufficient statistical evidence has been gathered for identifying the best arm: we propose one (with several interpretations) in Section 3.2, showing in Section 4 how to tune it in order to ensure the δ\delta-PAC property. As for the decision rule, we simply choose a^τδ=argmaxa∈A μ^a(τδ)\hat{a}_{\tau_{\delta}}=\underset{a\in\mathcal{A}}{\text{argmax}}\ \hat{\mu}_{a}(\tau_{\delta}). The optimality of the Track-and-Stop strategy is shown in Section LABEL:sec:SCAnalysis.

The first idea for matching the proportions w∗(μ)w^{*}(\bm{\mu}) is to track the plug-in estimates w∗(μ^(t))w^{*}(\hat{\mu}(t)). In bandit settings, using plug-in estimates is always hazardous, because bad initial estimate may lead to abandon an arm and to prevent further observations that would correct the initial error. Indeed, one may see (both theoretically and in numerical experiments) that a naive plug-in sampling rule sometimes fails. But there is a very simple fix, which consists in forcing sufficient exploration of each arm to ensure a (sufficiently fast) convergence of μ^(t)\hat{\mu}(t).

The shortest way to do this (which we term C-Tracking) is to slightly alter the optimization solution: for every ϵ∈(0,1/K]\epsilon\in(0,1/K], let wϵ(μ)w^{\epsilon}(\bm{\mu}) be a L∞L^{\infty} projection of w∗(μ)w^{*}(\bm{\mu}) onto \Sigma^{\epsilon}_{K}=\big{\{}(w_{1},\dots,w_{K})\in[\epsilon,1]:w_{1}+\dots+w_{K}=1\big{\}}. Choosing ϵt=(K2+t)−1/2/2\epsilon_{t}=(K^{2}+t)^{-1/2}/2 and

we prove in Appendix LABEL:proof:Tracking that:

For all t≥1t\geq 1 and a∈Aa\in\mathcal{A}, the C-Tracking rule ensures that Na(t)≥t+K2−2KN_{a}(t)\geq\sqrt{t+K^{2}}-2K and that

It is slightly more efficient in practice to target directly w∗(μ^(t))w^{*}(\hat{\bm{\mu}}(t)), and to force exploration steps whenever an arm is in deficit. Introducing Ut={a:Na(t)<t−K/2}U_{t}=\{a:N_{a}(t)<\sqrt{t}-K/2\}, the D-Tracking rule (At)(A_{t}) is sequentially defined as

The D-Tracking rule ensures that Na(t)≥(t−K/2)+−1N_{a}(t)\geq(\sqrt{t}-K/2)_{+}-1 and that for all ϵ>0\epsilon>0, for all t0t_{0}, there exists tϵ≥t0t_{\epsilon}\geq t_{0} such that

It is guaranteed under all these sampling rules that the empirical proportion of draws of each arm converges to the optimal proportion, as proved in Appendix LABEL:proof:ConvergenceFraction.

The C-Tracking and D-Tracking sampling rules both satisfy

We actually have a little more: a minimal convergence speed of μ^\hat{\mu} to μ\mu, which proves useful in the analysis of the expected sample complexity. Of course, other tracking strategies are possible, like for example the one introduced in CsabaTracking for the uniform estimation of all arms’ expectations.

2 Chernoff’s Stopping Rule

From a statistical point of view, the question of stopping at time tt is a more or less classical statistical test: do the past observations allow to assess, with a risk at most δ\delta, that one arm is larger than the others? For all arms a,b∈Aa,b\in\mathcal{A}, we consider the Generalized Likelihood Ratio statistic

where X‾Na(t)a=(Xs:As=a,s≤t)\underline{X}^{a}_{N_{a}(t)}=(X_{s}:A_{s}=a,s\leq t) is a vector that contains the observations of arm aa available at time tt, and where pμ(Z1,…,Zn)p_{\mu}(Z_{1},\dots,Z_{n}) is the likelihood of nn i.i.d. observations from wμw^{\mu}:

This statistic has a convenient closed-form expression for exponential family bandit models. Introducing for all arms a,ba,b a weighted average of their empirical mean:

it is well known and easy to see that if μ^a(t)≥μ^b(t)\hat{\mu}_{a}(t)\geq\hat{\mu}_{b}(t),

and that Za,b(t)=−Zb,a(t)Z_{a,b}(t)=-Z_{b,a}(t). The testing intuition thus suggests the following stopping rule:

where β(t,δ)\beta(t,\delta) is an exploration rate to be tuned appropriately. The form of this stopping rule can be traced back to Chernoff59The stopping rule τδ\tau_{\delta} was proposed under equivalent form (with a different threshold) in the context of adaptive sequential hypothesis testing. Best arm identification in a bandit model can be viewed as a particular instance in which we test KK hypotheses, Ha:(μa=max⁡i∈Aμi)H_{a}:(\mu_{a}=\max_{i\in\mathcal{A}}\mu_{i}), based on adaptively sampling the marginal of ν=(νμ1,…,νμK)\nu=(\nu^{\mu_{1}},\dots,\nu^{\mu_{K}}). However, Chernoff59 considers a different performance criterion, and its analysis holds when each of the hypotheses consists in a finite set of parameters, unlike the bandit setting.. As min⁡b∈A∖aZa,b(t)\min_{b\in\mathcal{A}\setminus a}Z_{a,b}(t) is non-negative if and only if μ^a(t)≥μ^b(t)\hat{\mu}_{a}(t)\geq\hat{\mu}_{b}(t) for all b≠ab\neq a, Z(t)=min⁡b∈A∖a^tZa^t,b(t)Z(t)=\min_{b\in\mathcal{A}\setminus\hat{a}_{t}}Z_{\hat{a}_{t},b}(t) whenever there is a unique best empirical arm a^t=argmaxa∈A μ^a(t)\hat{a}_{t}=\text{argmax}_{a\in\mathcal{A}}\ \hat{\mu}_{a}(t) at time tt. Obviously, \big{(}\hat{\mu}_{a}(\tau_{\delta})\big{)}_{a} has a unique maximizer, which is the final decision.

It is also possible to give a Minimum Description Length (MDL) interpretation of the stopping rule. It is well known that choosing the model that gives the shortest description of the data is a provably efficient heuristic (see Rissanen78, and Grunwald07MDL for a survey). In some sense, the stopping rule presented above follows the same principle. In fact, elementary algebra shows that

Choosing the Threshold in the Stopping Rule

We now explain how to choose the threshold β(t,δ)\beta(t,\delta) so as to ensure the δ\delta-PAC property: with probability larger than 1−δ1-\delta, any algorithm based on the stopping rule \eqrefdef:Stopping outputs the optimal arm, provided that it stops. The interpretations of the stopping rule presented in the last section suggest the presence of two ingredients: log⁡(1/δ)\log(1/\delta) for the risk, and log⁡(t)\log(t) for the fluctuations of the counts. We present here two results: one is based on an information-theoretic argument used for consistency proofs of MDL estimators, and the second is based on the probabilistic control of self-normalized averages taken from Combes14Lip. To keep things simple, the first argument is detailed only for the case of Bernoulli rewards (the standard framework of coding theory). The second argument is more general, but a little less tight.

Let δ∈(0,1)\delta\in(0,1). Whatever the sampling strategy, using Chernoff’s stopping rule \eqrefdef:Stopping on Bernoulli bandits with threshold

Proof sketch.

It thus holds that {align*} &P_μ(T_a,b¡ ∞) = ∑_t=1^∞P_μ(T_a,b=t) = ∑_t=1^∞E_μ[1_(T_a,b=t)] ≤∑_t=1^∞e^-β(t,δ)E_μ[1_(T_a,b=t) maxμa’ ≥μ’bpμa’(Xat)pμb’(Xbt)maxμa’ ≤μ’bpμa’(Xat)pμb’(Xbt)] ≤∑_t=1^∞e^-β(t,δ)E_μ[1_(T_a,b=t) maxμa’ ≥μ’bpμa’(Xat)pμb’(Xbt)pμa(Xat)pμb(Xbt)] = ∑_t=1^∞e^-β(t,δ)∫_{0,1}^t1_(T_a,b=t)(x_1,…,x_t) ⏟max_μ_a’ ≥μ’_b p_μ_a’(x^a_t)p_μ_b’(x^b_t)∏_i ∈A∖{a,b} p_μ_i(x_t^i)_(*)dx_1…dx_t . Of course the maximum likelihood (∗)(*) is not a probability density. A possible workaround (sometimes referred to as Barron’s lemma, see BRY98 and references therein) is to use a universal distribution like KT81, which is known to provide a tight uniform approximation:

[Willems95thecontext] Let pu(x)p_{u}(x) be the likelihood of successive observations x∈{0,1}nx\in\{0,1\}^{n} of a Bernoulli random variable with mean uu. Then the Krichevsky-Trofimov distribution

is a probability law on {0,1}n\{0,1\}^{n} that satisfies