Kullback–Leibler Upper Confidence Bound

From HandWiki
Short description: Asymptotically optimal algorithm for a decision theory problem


Behaviour of an UCB algorithm on a bandit run

In multi-armed bandit problems, KL-UCB (for Kullback–Leibler Upper Confidence Bound)[1] is a type of UCB-type algorithm that is asymptotically optimal, in the sense that its regret matches the problem-dependent lower bound derived by Lai and Robbins.[2]

Multi-armed bandit problem

The Multi-armed bandit problem is a sequential game where one player has to choose at each turn between K actions (arms). Behind every arm a there is an unknown distribution νa that lies in a set 𝒟 known by the player (for example, 𝒟 can be the set of Gaussian distributions or Bernoulli distributions).

At each turn t the player chooses (pulls) an arm at, he then gets an observation Xt of the distribution νat.

Regret minimization

The goal is to minimize the regret at time T that is defined as

RT:=∑a=1KΔa𝔼[Na(T)]

where

  • μa:=𝔼[νa] is the mean of arm a
  • μ*:=maxaμa is the highest mean
  • Δa:=μ*−μa
  • Na(t) is the number of pulls of arm a up to turn t

The player has to find an algorithm that chooses at each turn t which arm to pull based on the previous actions and observations (as,Xs)s<t to minimize the regret RT.

This is a trade-off problem between exploration to find the best arm (the arm with the highest mean) and exploitation to play as much as possible the arm that we think is the best arm.[3]

Applications

Multi-armed bandit algorithms are used in a variety of fields; for example, they have applications in clinical trials, recommender systems, telecommunications[4], and precision agriculture.[5]

Algorithm KL-UCB

The algorithm is a UCB-type algorithm based on optimism, which means that at each turn t we compute an upper confidence bound (UCB) for the mean of each arm a; we then pull the arm with the highest UCB.

The difference with KL-UCB is that it uses an estimation of the lower bound of Lai–Robbins[2] to make the upper confidence bound.[1]

History

The algorithm was first introduced in 2011 for Bernoulli distribution.[1] It was then extended to one-dimensional exponential families and bounded distributions in 2013.[6] An adaptation called KL-UCB-Switch, which uses a mix of MOSS[7] and KL-UCB, was developed to obtain both the problem-dependent and problem-independent asymptotic lower bounds in 2022.[8] The algorithm was also extended to Lipschitz bandits in 2014.[9]

Formal algorithm

The index of an arm a at turn t for KL UCB

At first, the algorithm pulls all the arms once. Then, for each turn t≥K+1, for each arm a, we compute:

Ua(t):=max⁡{μ | Na(t)𝒦inf(ν^a(t),μ,𝒟)≤δt}

where

Then we choose the arm at with the highest index:

at:=arg⁡maxaUa(t)

We note that the algorithm does not require knowledge of T.

Example

In the special case of Gaussian distribution with fixed variance σ2, we have:

Ua(t)=μ^a(t)+2σ2δtNa(t)

with μ^a(t) being the empirical mean of arm a at turn t.

Pseudocode

The player gets the set D
for each arm i do:
    n[i] ← 1; nu[i] ← None; d ← ln(K)
for t from 1 to K do:
    select arm t
    observe reward r
    n[t] ← n[t] + 1
    nu[t] ← update empirical distribution
for t from K+1 to T do:
    for each arm i do:
        index[i] ← compute_index(n[i], nu[i], D, d)
    select arm a with highest index[a]
    observe reward r
    n[a] ← n[a] + 1
    nu[a] ← update empirical distribution
    d ← ln(t+1)

Theoretical results

In the multi-armed bandit problem we have the Lai–Robbins[2] asymptotic lower bound on regret. The algorithm KL-UCB matches this lower bound for one-dimensional exponential families with δt:=ln⁡t+3ln⁡ln⁡t and for distributions bounded in [0,1] with δt:=ln⁡t+ln⁡ln⁡t.[6]

Lai–Robbins lower bound

In 1952 Lai and Robbins proved an asymptotic, problem-dependent lower bound on regret.

It states that for every consistent algorithm on the set 𝒟 — that is, an algorithm for which, for every (ν1,…,νK)∈𝒟K, the regret RT is subpolynomial (i.e. RT=oT→+∞(Tα) for all α>0) — we have:

RT≥(∑a:μa<μ*Δa𝒦inf(νa,μ*,𝒟))ln⁡T+oT→+∞(ln⁡T).

This bound is asymptotic (as T→+∞) and gives a first-order lower bound of order ln⁡T with the optimal constant in front of it.

Regret bound for KL-UCB

The algorithm matches the Lai–Robbins[2] lower bound for one-dimensional exponential-family distributions and for distributions bounded in [0,1].[6]

One-dimensional exponential family

For 𝒟 being the set of one-dimensional exponential families, with δt:=ln⁡t+3ln⁡ln⁡t we have the following upper bound on the regret of KL-UCB:[6]

RT≤(∑a:μa<μ*Δa𝒦inf(νa,μ*,𝒟))ln⁡T+OT(ln⁡T).

Bounded distributions in [0,1]

For 𝒟=𝒫([0,1]) (the set of distributions supported on [0,1]), and for δt:=ln⁡t+ln⁡ln⁡t, we have the following upper bound on the regret of KL-UCB:[6]

RT≤(∑a:μa<μ*Δa𝒦inf(νa,μ*,𝒟))ln⁡T+OT((ln⁡T)4/5ln⁡ln⁡T).

Runtime

For 𝒟=𝒫([0,1]), the runtime needed per step and for an arm k with n observations is 𝒪(n(ln⁡n)2).[10] This is higher than that of other optimal algorithms, such as NPTS[11] with 𝒪(n).[10] MED[12] with 𝒪(nln⁡n).[10] and IMED[13] with 𝒪(nln⁡n).[10]

The high runtime of KL-UCB is due to a two-level optimisation: for each arm and candidate mean μ, the algorithm evaluates 𝒦inf(ν^a(t),μ,𝒟) and then maximises μ subject to Na(t)𝒦inf(ν^a(t),μ,𝒟)≤δt. For distributions bounded in [0,1] the inner problem has no closed form and must be solved numerically, which increases the per-step cost.[12][6]

See also

References

  1. ↑ 1.0 1.1 1.2 Maillard, Odalric-Ambrym; Munos, Rémi; Stoltz, Gilles (2011). "A Finite-Time Analysis of Multi-armed Bandits Problems with Kullback-Leibler Divergences". in Kakade, Sham M.; von Luxburg, Ulrike. 19. Budapest, Hungary: PMLR. pp. 497–514. https://proceedings.mlr.press/v19/maillard11a.html. 
  2. ↑ 2.0 2.1 2.2 2.3 Lai, T.L.; Robbins, Herbert (1985). "Asymptotically Efficient Adaptive Allocation Rules". Advances in Applied Mathematics 6 (1): 4–22. doi:10.1016/0196-8858(85)90002-8. https://www.sciencedirect.com/science/article/pii/0196885885900028. 
  3. ↑ Lattimore, Tor; Szepesvári, Csaba (2020). Bandit Algorithms. Cambridge: Cambridge University Press. 
  4. ↑ Bouneffouf, Djallel; Rish, Irina (2019). "A survey on practical applications of multi-armed and contextual bandits". arXiv:1904.10040 [cs.LG].
  5. ↑ Gautron, Romain; Baudry, Dorian; Adam, Myriam; Falconnier, Gatien N; Hoogenboom, Gerrit; King, Brian; Corbeels, Marc (2024). "A new adaptive identification strategy of best crop management with farmers". Field Crops Research (Elsevier) 307: 109249. 
  6. ↑ 6.0 6.1 6.2 6.3 6.4 6.5 6.6 Cappé, Olivier; Garivier, Aurélien; Maillard, Odalric-Ambrym; Munos, Rémi; Stoltz, Gilles (2013). "Kullback-Leibler Upper Confidence Bounds for Optimal Sequential Allocation". The Annals of Statistics: 1516–1541. 
  7. ↑ Audibert, Jean-Yves; Bubeck, Sébastien (2009). "Minimax policies for adversarial and stochastic bandits". Proceedings of the 22nd Annual Conference on Learning Theory (COLT). pp. 217--226. 
  8. ↑ Garivier, Aurélien; Hadiji, Hédi; Ménard, Pierre; Stoltz, Gilles (2022). "KL-UCB-switch: Optimal Regret Bounds for Stochastic Bandits from Both a Distribution-Dependent and a Distribution-Free Viewpoints". Journal of Machine Learning Research 23 (179): 1–66. 
  9. ↑ Magureanu, Stefan; Combes, Richard; Proutière, Alexandre (2014). "Lipschitz Bandits: Regret Lower Bounds and Optimal Algorithms". arXiv:1405.4758 [cs.LG].
  10. ↑ 10.0 10.1 10.2 10.3 Baudry, Dorian; Pesquerel, Fabien; Degenne, Rémy; Maillard, Odalric-Ambrym (2023). "Fast Asymptotically Optimal Algorithms for Non-Parametric Stochastic Bandits". Advances in Neural Information Processing Systems 36: 11469–11514. 
  11. ↑ Riou, Charles; Honda, Junya (2020). "Bandit Algorithms Based on Thompson Sampling for Bounded Reward Distributions". in Kontorovich, Aryeh; Neu, Gergely. 117. PMLR. pp. 777–826. https://proceedings.mlr.press/v117/riou20a.html. 
  12. ↑ 12.0 12.1 Honda, Junya; Takemura, Akimichi (2010). "An Asymptotically Optimal Bandit Algorithm for Bounded Support Models". pp. 67–79. 
  13. ↑ Honda, Junya; Takemura, Akimichi (2015). "Non-Asymptotic Analysis of a New Bandit Algorithm for Semi-Bounded Rewards". Journal of Machine Learning Research 16 (113): 3721–3756. http://jmlr.org/papers/v16/honda15a.html.