Best arm identification

From HandWiki
Short description: Multi-armed bandit sequential game


Best arm identification (BAI) is a sequential one-player game where the player has to find the best action (arm) among a list of actions (arms) by collecting information in the most efficient way.

It is a multi-armed bandit game as a player only gets information about an arm by playing it. The most common objective in multi-armed bandit games is to minimize the regret (i.e., play the best action as much as possible), but in BAI, the goal is to find the best arm as efficiently as possible.

This problem naturally arises in scenarios such as adaptive clinical trials[1] where the number of patients is limited and the quantification of the confidence in a treatment is important. It also arises in hyperparameter optimization[2] where the goal is to find the optimal choice of hyperparameters for an algorithm with the smallest possible number of experiments, as it can be costly in terms of time, energy, or money.

Stochastic multi-armed bandit

The stochastic multi-armed bandit (MAB) is a sequential game with one player and K actions (arms). Each arm has an unknown probability distribution associated with it.

At each turn, the player has to choose one action and receive an observation from the probability distribution associated with the arm. The more you play an arm, the more you get information on its probability distribution.

Best arm identification

In BAI the goal is to find the arm that has the probability distribution with the highest mean. BAI may be either fixed confidence or fixed horizon. In a fixed-confidence game, a confidence level δ is fixed at the beginning of the game and the goal is to find the best arm with this confidence level in as few turns as possible. In a fixed horizon game, the number of turns T is fixed, and the goal is to find the best arm with the highest possible confidence in T turns.

Math formalisation

We have one player and K actions (arms). Behind each arm k{1,,K} lies an unknown distribution νk with mean μk. Each distribution νk belongs to a known family 𝒟 (such as the set of Gaussian distributions or Bernoulli distributions). At each time step t, the player selects an arm at and observes an independent sample Xtνat from the corresponding distribution.

We will note μ*:=maxμa the highest mean. An arm a that satisfies μa=μ* is called an optimal arm; otherwise it is called suboptimal arm.

In best arm identification (BAI) the objective is to identify an optimal arm.[3]

Two main settings for BAI appear in the literature:

  • Fixed confidence: In this setting, one typically assumes that there exists a unique optimal arm. A confidence level δ(0,1) is specified at the beginning. The algorithm must stop at some finite stopping time τδ<+ and return an arm a^τδ such that the probability of error is bounded: (a^τδa*)δ. The objective is to minimize the expected sample complexity 𝔼[τδ].

Such a setting appears, for example, when a constraint on the confidence is required (for example, if we require a confidence level of 95%, so δ=10.95=0.05).

  • Fixed horizon: In this setting, the number of samples T is fixed in advance. The goal is to design an algorithm that minimizes the probability of misidentifying the optimal arm: (a^Ta*).

This setting appears when the number of experiments is limited (for drug tests, the number of patients can be fixed in advance).

Example of simple modelling

In the case where we have K treatments and we want to be sure with a confidence level of 95% which treatment is the best to heal a specific disease. Each treatment heals or does not heal the disease with a probability μk, which means that each distribution is a Bernoulli distribution, so 𝒟 is the set of Bernoulli distributions. We can use a BAI algorithm to minimize 𝔼[τ0.05], the number of patients required to find the best treatment with probability 95%.

Applications

Best arm identification naturally arises in several practical domains:

  • Adaptive clinical trials: The objective is to identify the most effective treatment based on sequentially collected patient data. Each treatment can be modeled as having an underlying distribution of outcomes. The goal is to identify the treatment with the highest expected outcome with high confidence (fixed confidence setting δ) while minimizing the number of drug test patients (minimise 𝔼[τδ]), as it costs to pay patients for this and we would like to use as little as possible less effective drugs.[1][4][5]
  • Hyperparameter tuning: Selecting the best configuration for machine learning models efficiently by treating each hyperparameter setting as an arm. The goal is to find the best hyperparameter with as few experiments possible as experiments are costly in time and in energy[2]

Fixed confidence level

Typical run for a BAI algorithm with fixed confidence

In the fixed-confidence setting, the goal is to design an algorithm that identifies the best arm with a prescribed confidence level δ while minimizing the expected number of samples. Any such algorithm requires two key components:

  • Stopping rule: A decision criterion that determines when to stop sampling. Formally, this defines a stopping time τδ and returns an arm a^τδ such that (a^τδa)δ and (τδ<+)=1.
  • Sampling rule: A policy π that, at each round t, selects the next arm to sample at based on all previous observations (as,Xs)s<t.

Algorithm structure

The general structure of a fixed-confidence BAI algorithm can be described as follows:

Input: Distribution family 𝒟, confidence level δ
Initialize: 
    For each arm i: set Ni1, ν^iNone
    Set τ0, stopFalse
while stop==False do:
    a Sampling_rule(𝒟, δ, N, ν^)
    Observe reward Xνa
    Update: NaNa+1
    Update empirical distribution ν^aτ
    ττ+1
    stop ← Stopping_rule(𝒟, δ, N, ν^)
return a^τargmaxaμ^a

Lower bound

C* when we have two Gaussian arms of variance 1 and means equal to μ and μ+x

The minimal expected number of pulls to obtain the confidence level of 1δ was determined in 2016.[6] For a given instance ν and a fixed δ, it provides the minimum value of 𝔼[τδ] possible.

To give the lower bound, we first need to define the function kl(δ,1δ), the Kullback–Leibler divergence between two Bernoulli distributions with means δ and 1δ. This is equivalent to ln(1/δ) when δ tend to 0.

For any algorithm satisfying the δ-correctness constraint, the expected sample complexity satisfies 𝔼[τδ]Ckl(δ,1δ) where the problem-dependent constant C only depends on ν. An optimal sampling rule ω* is associated with this optimal constant.[6]

Asymptotically optimal algorithms

Since kl(δ,1δ)ln(1/δ) as δ0, an algorithm is called asymptotically optimal if limδ0𝔼[τδ]ln(1/δ)=C.

The first algorithm proposed to achieve asymptotic optimality is the Track-and-Stop algorithm,[6] which consists of tracking the optimal sampling rule ω* in the lower bound by using the empirical distribution and choosing the next arm to play according to this estimated optimal sampling rule.

Fixed horizon

In the fixed-horizon setting, the total number of samples T is specified in advance, contrasting with the fixed-confidence setting where sampling continues until a confidence criterion is met. The algorithm must select an arm at each round t{1,,T}, and at the end of the horizon, it returns a recommendation a^T. The objective is to minimize the probability of error (a^Ta).

This setting is particularly relevant when computational or experimental resources are strictly limited, such as in clinical trials when we want to figure out which of K is the best, and patient enrollment is fixed. Each arm corresponds to a choice of treatment given to one patient between K which gives an observation of the distribution of the treatment, and each patient corresponds to a turn t. The total number of patients is the horizon T

Algorithm structure

A typical fixed-horizon BAI algorithm proceeds as follows:

Input: Distribution family 𝒟, horizon T
Initialize: 
    For each arm i: pull once and set Ni1, ν^i initial empirical distribution
for t from K+1 to T do:
    at Sampling_rule(𝒟, T, N, ν^)
    Observe reward Xtνat
    Update: NatNat+1
    Update empirical distribution ν^at
return a^Targmaxaμ^a

Unlike the fixed-confidence setting, there is no stopping rule because we stop at time T. The algorithm is only base on a sampling rule.

Lower bound

The lower bound in the fixed-horizon setting gives the best confidence level we can reach with a given number of turns T. It is expressed as an asymptotic result when T is large.

Lower bound theorem: For any algorithm, for any instance ν, there exists a constant H(ν) that depends only on ν such that the probability of error satisfies limT+(a^T𝒜)exp(TH(ν))[7]

This result shows that the error probability decays exponentially with the number of turns T.

Simple regret

An alternative performance metric for fixed-horizon BAI is the simple regret, defined as rT:=𝔼[μμa^T*], which measures the expected suboptimality of the returned arm.

While (a^T*a) treats all mistakes with the same cost, the simple regret rT accounts for the gap between the optimal mean μ* and the mean of the arm considered as the optimal arm by the algorithm μa^T*. This distinction is important in applications where the cost of choosing a suboptimal arm depends on how far it is from optimal.[8]

See also

References

  1. 1.0 1.1 Robertson, David S.; Lee, Kevin M.; López-Kolkovska, Beatriz C.; Villar, Sofía S. (2023). "Response-adaptive randomization in clinical trials: from myths to practical considerations". Statistical Science 38 (2): 185–208. doi:10.1214/22-STS865. 
  2. 2.0 2.1 Brandt, Jasmin; Wever, Marcel; Bengs, Viktor; Hüllermeier, Eyke (2024). "Best arm identification with retroactively increased sampling budget for more resource-efficient HPO". 3742–3750. 
  3. Jamieson, Kevin; Nowak, Robert (2014). "Best-arm identification algorithms for multi-armed bandits in the fixed confidence setting". pp. 1–6. doi:10.1109/CISS.2014.6814096. 
  4. Kaufmann, Emilie; Cappé, Olivier; Garivier, Aurélien (2014). "On the Complexity of A/B Testing". 35. Barcelona, Spain: PMLR. pp. 461–481. https://proceedings.mlr.press/v35/kaufmann14.html. 
  5. Degenne, Rémy; Nedelec, Thomas; Calauzènes, Clément; Perchet, Vianney (2019). "Bridging the gap between regret minimization and best arm identification, with application to A/B tests". arXiv:1810.04088 [cs.LG].
  6. 6.0 6.1 6.2 6.3 6.4 Garivier, Aurélien; Kaufmann, Emilie (2016). "Optimal Best Arm Identification with Fixed Confidence". arXiv:1602.04589 [math.ST].
  7. Barrier, Antoine; Garivier, Aurélien; Stoltz, Gilles (2023). "On Best-Arm Identification with a Fixed Budget in Non-Parametric Multi-Armed Bandits". arXiv:2210.00895 [cs.LG].
  8. Bubeck, Sébastien; Munos, Rémi; Stoltz, Gilles (2011). "Pure exploration in finitely-armed and continuous-armed bandits". Theoretical Computer Science (Elsevier) 412 (19): 1832–1852. doi:10.1016/j.tcs.2010.12.059.