Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

Regret Bounds for Thompson Sampling

Frequentist proofs, and the information-ratio analysis of Bayesian regret.

Thompson proposed his rule in 1933; the first proofs that its regret grows only logarithmically appeared in 2012. Two kinds of proof now exist. Frequentist proofs fix the arms and show that Thompson sampling attains the Lai–Robbins constant, through a change of measure that only probability matching allows. Bayesian proofs average over the prior and need remarkably little: any confidence bound, or a single information-theoretic inequality, bounds the regret. This lesson proves both and marks where they stop.

What you’ll learn

  • Distinguish frequentist from Bayesian regret, and state the main bounds for Thompson sampling with their conditions.
  • Prove Agrawal and Goyal's key lemma, which charges pulls of a suboptimal arm to pulls of the optimal arm through the odds (1−p)/p(1-p)/p, and assemble the bound E[Ni(T)]≤(1+ε)ln⁡T/kl⁡(μi,μ⋆)+O(1)\E[N_i(T)]\le(1+\varepsilon)\ln T/\operatorname{kl}(\mu_i,\mu^\star)+\order{1}.
  • Prove Russo and Van Roy's posterior-sampling decomposition, and derive a Bayesian regret bound of order KTlog⁡T\sqrt{KT\log T} from Hoeffding's inequality.
  • Define the information ratio, prove that it is at most K/2K/2 for KK arms, and derive the bound Γˉ H(A⋆) T\sqrt{\bar\Gamma\,H(A^\star)\,T}.
  • Identify the known gaps: dependence on the prior, Gaussian Thompson sampling's extra ln⁡K\sqrt{\ln K}, and the frequentist analysis of structured models.

Two kinds of guarantee

Two different questions can be asked about Thompson sampling. The frequentist question fixes the instance ν\nu, the arms' reward distributions, and asks how large the regret RT(ν)R_T(\nu) can be when the algorithm runs with a fixed prior, typically uniform. The Bayesian question assumes that the instance itself was drawn from a prior QQ, the same prior the algorithm uses, and asks for the regret averaged over that draw.

ResultSettingBound
Agrawal & Goyal (2012)Bernoulli, uniform priorFirst finite-time logarithmic bound, O((∑iΔi−2)2ln⁡T)\order{(\sum_i\Delta_i^{-2})^2\ln T}
Kaufmann, Korda & Munos (2012); Agrawal & Goyal (2013)Bernoulli, uniform prior(1+ε)∑iΔiln⁡T/kl⁡(μi,μ⋆)+C(ε,μ)(1+\varepsilon)\sum_i\Delta_i\ln T/\operatorname{kl}(\mu_i,\mu^\star)+C(\varepsilon,\mu): asymptotically optimal
Korda, Kaufmann & Munos (2013)One-parameter exponential families, Jeffreys priorAsymptotically optimal
Honda & Takemura (2014)Gaussian, unknown mean and variance, prior ∝(σ2)−1−α\propto(\sigma^2)^{-1-\alpha}Optimal if α<0\alpha<0; not if α≥0\alpha\ge0 (reference prior α=0\alpha=0, Jeffreys α=12\alpha=\tfrac12, whose regret is polynomial)
Agrawal & Goyal (2013, 2017)Rewards in [0,1][0,1], worst case over instancesBeta: O(KTln⁡T)\order{\sqrt{KT\ln T}}. Gaussian: O(KTln⁡K)\order{\sqrt{KT\ln K}}, attained on some instance
Russo & Van Roy (2014)Any prior, rewards in [0,1][0,1]Bayesian O(KTlog⁡T)\order{\sqrt{KT\log T}}, from any UCB analysis
Russo & Van Roy (2016)Any prior, rewards in an interval of length 1Bayesian 12KTln⁡K\sqrt{\tfrac12KT\ln K}
Bubeck & Liu (2013)Any prior, rewards in [0,1][0,1]Bayesian 14KT14\sqrt{KT}; some prior forces every algorithm above 120KT\tfrac1{20}\sqrt{KT}
The main guarantees for Thompson sampling on KK independent arms, as of the mid-2020s. Frequentist results are tied to a specific prior–likelihood pair; Bayesian ones hold for any prior, on average over that prior.

Charging bad pulls to the best arm

Take Bernoulli arms with uniform priors, and let arm 1 be optimal. Fix a suboptimal arm ii and two thresholds between its mean and the best one, μi<xi<yi<μ1\mu_i<x_i<y_i<\mu_1. Write μ^i(t)\hat\mu_i(t) for arm ii's empirical mean before round tt, θj(t)\theta_j(t) for the posterior samples drawn in round tt, and Ft−1\mathcal F_{t-1} for the history. Agrawal and Goyal sort the rounds in which arm ii is pulled with two events: Eiμ(t)={μ^i(t)≤xi}E^\mu_i(t)=\{\hat\mu_i(t)\le x_i\}, its average is honest, and Eiθ(t)={θi(t)≤yi}E^\theta_i(t)=\{\theta_i(t)\le y_i\}, its sample is modest.

DerivationThree ways to pull a suboptimal arm
  1. E[Ni(T)]=∑tPr⁡(At=i, Eiμ(t)‾)⏟(a) average too high+∑tPr⁡(At=i, Eiμ(t), Eiθ(t)‾)⏟(b) sample too high+∑tPr⁡(At=i, Eiμ(t), Eiθ(t))⏟(c) best arm’s sample too low\E[N_i(T)]=\underbrace{\sum_t\Pr\big(A_t=i,\ \overline{E^\mu_i(t)}\big)}_{\text{(a) average too high}}+\underbrace{\sum_t\Pr\big(A_t=i,\ E^\mu_i(t),\ \overline{E^\theta_i(t)}\big)}_{\text{(b) sample too high}}+\underbrace{\sum_t\Pr\big(A_t=i,\ E^\mu_i(t),\ E^\theta_i(t)\big)}_{\text{(c) best arm's sample too low}}

    Every pull of arm ii falls into one of three cases:

  2. (a) ≤ 1+∑k≥1e−kkl⁡(xi,μi) ≤ 1+1kl⁡(xi,μi)\text{(a)}\ \le\ 1+\sum_{k\ge1}e^{-k\operatorname{kl}(x_i,\mu_i)}\ \le\ 1+\frac{1}{\operatorname{kl}(x_i,\mu_i)}

    (a) Each such round has a different count kk of earlier pulls, and after kk pulls an average above xix_i has probability at most e−kkl⁡(xi,μi)e^{-k\operatorname{kl}(x_i,\mu_i)} by Chernoff's bound. Summing over kk:

  3. (b) ≤ ln⁡Tkl⁡(xi,yi)+1\text{(b)}\ \le\ \frac{\ln T}{\operatorname{kl}(x_i,y_i)}+1

    (b) With kk pulls and an honest average, the Beta–binomial identity and Chernoff's bound give Pr⁡(θi(t)>yi∣Ft−1)≤e−kkl⁡(xi,yi)\Pr(\theta_i(t)>y_i\mid\mathcal F_{t-1})\le e^{-k\operatorname{kl}(x_i,y_i)}, which is at most 1/T1/T once k≥Li(T)=ln⁡T/kl⁡(xi,yi)k\ge L_i(T)=\ln T/\operatorname{kl}(x_i,y_i). At most Li(T)L_i(T) pulls happen before that, and the TT rounds after it contribute at most T⋅1TT\cdot\frac1T:

  4. pi,t=Pr⁡(θ1(t)>yi ∣ Ft−1)p_{i,t}=\Pr\big(\theta_1(t)>y_i\ \big|\ \mathcal F_{t-1}\big)

    (c) is where probability matching enters. In these rounds arm ii won the comparison although its own sample was at most yiy_i, so the best arm's sample was below yiy_i as well, an event of conditional probability 1−pi,t1-p_{i,t}, where

Summing the lemma over rounds charges each bad round to a pull of arm 1. The odds (1−pi,t)/pi,t(1-p_{i,t})/p_{i,t} depend only on arm 1's posterior, which changes only when arm 1 is pulled. Between the kk-th pull of arm 1, at round τk\tau_k, and the next one the odds are frozen, and exactly one pull of arm 1 is charged:

(c) ≤ ∑tE[1−pi,tpi,t 1{At=1}] = ∑k=0T−1E[1pi,τk+1−1].\text{(c)}\ \le\ \sum_t\E\Big[\frac{1-p_{i,t}}{p_{i,t}}\,\mathbf 1\{A_t=1\}\Big]\ =\ \sum_{k=0}^{T-1}\E\Big[\frac{1}{p_{i,\tau_k+1}}-1\Big].

After kk pulls with SS successes, p=Pr⁡(Bin(k+1,yi)≤S)p=\Pr(\mathrm{Bin}(k+1,y_i)\le S), close to 1 once S/kS/k settles near μ1>yi\mu_1>y_i. Agrawal and Goyal show that E[1/pi,τk+1]−1\E[1/p_{i,\tau_k+1}]-1 is at most 3/Δi′3/\Delta_i' for k<8/Δi′k<8/\Delta_i', where Δi′=μ1−yi\Delta_i'=\mu_1-y_i, and decays exponentially in kk afterwards, so the whole sum is a constant, of order Δi′−4\Delta_i'^{-4} at worst. Adding (a), (b) and (c):

E[Ni(T)] ≤ ln⁡Tkl⁡(xi,yi)+C(μi,μ1,xi,yi).\E[N_i(T)]\ \le\ \frac{\ln T}{\operatorname{kl}(x_i,y_i)}+C(\mu_i,\mu_1,x_i,y_i).

Choosing xi,yix_i,y_i so close to μi,μ1\mu_i,\mu_1 that kl⁡(xi,yi)≥kl⁡(μi,μ1)/(1+ε)\operatorname{kl}(x_i,y_i)\ge\operatorname{kl}(\mu_i,\mu_1)/(1+\varepsilon) gives the asymptotically optimal bound, with a constant that grows like 1/ε21/\varepsilon^2 as the thresholds close in.

Check your understanding

Why can the sum in (c) be regrouped by pulls of arm 1, one term E[1/p−1]\E[1/p-1] per pull?

  1. Because arm 1 is pulled in every round
  2. Because pi,tp_{i,t} depends only on arm 1's posterior, which changes only when arm 1 is pulled, and each stretch between its pulls contains exactly one of them
  3. Because pi,tp_{i,t} is the same in every round
  4. Because the samples of different rounds are independent
Show the answer

B. Because pi,tp_{i,t} depends only on arm 1's posterior, which changes only when arm 1 is pulled, and each stretch between its pulls contains exactly one of them

From round τk+1\tau_k+1 up to and including the round of the next pull of arm 1, the odds are frozen at their value after kk pulls, and the indicator 1{At=1}\mathbf 1\{A_t=1\} is 1 exactly once in that stretch. So the stretch contributes E[(1−p)/p]=E[1/p]−1\E[(1-p)/p]=\E[1/p]-1, evaluated after kk pulls.

Bayesian regret from any confidence bound

DerivationThompson sampling inherits every UCB analysis (Russo & Van Roy, 2014)
  1. E[μA⋆−μAt]  =  E[Ut(At)−μAt]  +  E[μA⋆−Ut(A⋆)]\E\big[\mu_{A^\star}-\mu_{A_t}\big]\;=\;\E\big[U_t(A_t)-\mu_{A_t}\big]\;+\;\E\big[\mu_{A^\star}-U_t(A^\star)\big]

    Let Ut(i)U_t(i) be any function of the history Ht−1H_{t-1} and the arm. Given Ht−1H_{t-1}, UtU_t is fixed and AtA_t has the law of A⋆A^\star, so E[Ut(At)∣Ht−1]=E[Ut(A⋆)∣Ht−1]\E[U_t(A_t)\mid H_{t-1}]=\E[U_t(A^\star)\mid H_{t-1}]. Add and subtract it in the regret of round tt:

  2. Pr⁡(G‾) ≤ 2KT⋅e−2n w(n)2 = 2KT⋅T−4 = 2KT3\Pr(\overline G)\ \le\ 2KT\cdot e^{-2n\,w(n)^2}\ =\ 2KT\cdot T^{-4}\ =\ \frac{2K}{T^{3}}

    Instantiate with Hoeffding bounds for rewards in [0,1][0,1]: Ut(i)=min⁡{1,μ^i+w(Ni)}U_t(i)=\min\{1,\hat\mu_i+w(N_i)\} with w(n)=2ln⁡T/nw(n)=\sqrt{2\ln T/n}, and Ut(i)=1U_t(i)=1 for an arm never pulled. Given the means the rewards are i.i.d., so Hoeffding's inequality with a union bound over KK arms, TT possible counts and both tails shows that the event GG, "every average lies within ww of its mean", rarely fails:

  3. BRT ≤ K+∑i=1K∑n=1Ni(T)22ln⁡Tn+2TPr⁡(G‾) ≤ K+42KTln⁡T+4KT2\mathrm{BR}_T\ \le\ K+\sum_{i=1}^K\sum_{n=1}^{N_i(T)}2\sqrt{\frac{2\ln T}{n}}+2T\Pr(\overline G)\ \le\ K+4\sqrt{2KT\ln T}+\frac{4K}{T^2}

    On GG the bound never fails at A⋆A^\star, and the width at the played arm is at most 2w(NAt)2w(N_{A_t}); each arm is played once with no data, at a cost of at most 1. Sum the widths arm by arm with ∑n=1mn−1/2≤2m\sum_{n=1}^mn^{-1/2}\le2\sqrt m, then use Cauchy–Schwarz, ∑iNi(T)≤KT\sum_i\sqrt{N_i(T)}\le\sqrt{KT}:

  4. Russo and Van Roy state this with slightly different constants. The power of the argument is that UtU_t is arbitrary: confidence ellipsoids give O~(dT)\tilde{\mathcal O}(d\sqrt T) for linear bandits, and for a general class of reward functions they bound the widths with a complexity measure they introduced, the eluder dimension. Thompson sampling never computes any of these bounds, so its Bayesian regret is at most the best of them.

The information ratio

The UCB route pays log⁡T\sqrt{\log T} for its union bound over rounds. Russo and Van Roy (2016) found a route that never mentions confidence bounds. Let Et\E_t and Pr⁡t\Pr_t condition on Ht−1H_{t-1}, let YtY_t be the reward observed in round tt, and compare the expected regret of the round with what the round reveals about the optimal arm:

Δt=Et[μA⋆−μAt],It=It(A⋆; (At,Yt)),Γt=Δt2It\Delta_t=\E_t\big[\mu_{A^\star}-\mu_{A_t}\big],\qquad I_t=I_t\big(A^\star;\,(A_t,Y_t)\big),\qquad\Gamma_t=\frac{\Delta_t^2}{I_t}
ItI_t is the mutual information, under the posterior, between the optimal arm and the round's action and observation, and Γt\Gamma_t is the information ratio. A small ratio means that every unit of regret buys information about A⋆A^\star: the algorithm can only be wrong in ways that teach it something.
DerivationProof that Thompson sampling has Γₜ ≤ K/2
  1. Δt=∑aα(a) Et[μa∣A⋆=a]−∑aα(a) Et[μa]=∑aα(a)(Et[μa∣A⋆=a]−Et[μa])\Delta_t=\sum_a\alpha(a)\,\E_t[\mu_a\mid A^\star=a]-\sum_a\alpha(a)\,\E_t[\mu_a]=\sum_a\alpha(a)\Big(\E_t[\mu_a\mid A^\star=a]-\E_t[\mu_a]\Big)

    Write α(a)=Pr⁡t(A⋆=a)\alpha(a)=\Pr_t(A^\star=a). Thompson sampling plays At∼αA_t\sim\alpha independently of the means and of the outcomes, so its expected regret is a sum over the arms:

  2. It=∑aα(a) It(A⋆;Yt,a)=∑a∑a⋆α(a) α(a⋆) DKL(Pr⁡t(Yt,a∈⋅∣A⋆=a⋆) ∥ Pr⁡t(Yt,a∈⋅))I_t=\sum_a\alpha(a)\,I_t\big(A^\star;Y_{t,a}\big)=\sum_{a}\sum_{a^\star}\alpha(a)\,\alpha(a^\star)\,\KL\Big(\Pr_t\big(Y_{t,a}\in\cdot\mid A^\star=a^\star\big)\,\Big\|\,\Pr_t\big(Y_{t,a}\in\cdot\big)\Big)

    The information splits the same way: AtA_t alone carries no information about A⋆A^\star, and given At=aA_t=a the round reveals Yt,aY_{t,a}. A mutual information is an average of KL divergences between conditional and marginal laws:

  3. It ≥ 2∑a, a⋆α(a) α(a⋆)(Et[μa∣A⋆=a⋆]−Et[μa])2I_t\ \ge\ 2\sum_{a,\,a^\star}\alpha(a)\,\alpha(a^\star)\Big(\E_t[\mu_a\mid A^\star=a^\star]-\E_t[\mu_a]\Big)^2

    Pinsker's inequality, DKL(P∥Q)≥2 TV(P,Q)2\KL(P\|Q)\ge2\,\mathrm{TV}(P,Q)^2, together with ∣EPY−EQY∣≤TV(P,Q)|\E_PY-\E_QY|\le\mathrm{TV}(P,Q) for YY in an interval of length 1, turns each divergence into a squared difference of means. Since Et[Yt,a∣A⋆=a⋆]=Et[μa∣A⋆=a⋆]\E_t[Y_{t,a}\mid A^\star=a^\star]=\E_t[\mu_a\mid A^\star=a^\star]:

  4. Δt2 ≤ K∑aα(a)2(Et[μa∣A⋆=a]−Et[μa])2 ≤ K∑a, a⋆α(a) α(a⋆)(Et[μa∣A⋆=a⋆]−Et[μa])2 ≤ K2 It\Delta_t^2\ \le\ K\sum_a\alpha(a)^2\Big(\E_t[\mu_a\mid A^\star=a]-\E_t[\mu_a]\Big)^2\ \le\ K\sum_{a,\,a^\star}\alpha(a)\,\alpha(a^\star)\Big(\E_t[\mu_a\mid A^\star=a^\star]-\E_t[\mu_a]\Big)^2\ \le\ \frac K2\,I_t

    Apply Cauchy–Schwarz to the regret, writing α(a)=α(a)⋅α(a)\alpha(a)=\sqrt{\alpha(a)}\cdot\sqrt{\alpha(a)} over KK terms, then add the off-diagonal terms a⋆≠aa^\star\ne a of the double sum, which are nonnegative:

  5. So Γt≤K/2\Gamma_t\le K/2 in every round, for every prior, and the theorem gives BRT≤12KTln⁡K\mathrm{BR}_T\le\sqrt{\tfrac12KT\ln K}. Probability matching entered only through the weights: regret and information are averaged with the same α\alpha, which is what lets one bound the other.

FeedbackBound on Γt\Gamma_t for Thompson samplingBayesian regret
Full information (every arm's reward observed)1/21/212Tln⁡K\sqrt{\tfrac12T\ln K}
KK-armed banditK/2K/212KTln⁡K\sqrt{\tfrac12KT\ln K}
Linear bandit in Rd\R^d, finite action set A\mathcal Ad/2d/212dTln⁡∣A∣\sqrt{\tfrac12dT\ln\abs{\mathcal A}}
Russo and Van Roy's bounds on the information ratio. In the linear case the number of actions enters only through the entropy term: one action's reward informs the whole parameter vector.
Predict before you look

Evaluate the information-ratio bound 12KTln⁡K\sqrt{\tfrac12KT\ln K} for K=10K=10 arms and T=10,000T=10{,}000 rounds.

Show the answer

340

12⋅10⋅10,000⋅ln⁡10≈115,100\tfrac12\cdot10\cdot10{,}000\cdot\ln10\approx115{,}100, whose square root is about 339. The confidence-bound route gives K+42KTln⁡T≈5,440K+4\sqrt{2KT\ln T}\approx5{,}440, and Bubeck and Liu's prior-free bound 14KT≈4,43014\sqrt{KT}\approx4{,}430. The information argument is sixteen times sharper here: it needs no union bound over rounds, and its constants are small.

The ratio is useful beyond Thompson sampling. Information-directed sampling (Russo & Van Roy, 2018) chooses in every round the action distribution that minimizes Δt2/It\Delta_t^2/I_t itself, which is how it pulls the informative but suboptimal arm that Thompson sampling ignores in the revealing-action example of Thompson Sampling & Bayesian Bandits. The ratio also reaches beyond Bayesian settings: combined with a minimax theorem relating worst-case Bayesian regret to minimax regret, Lattimore and Szepesvári (2019) generalized these tools to prove a minimax bound of 2KT\sqrt{2KT} for adversarial KK-armed bandits and new bounds for partial monitoring.

Where the analyses stop

Priors. Frequentist guarantees exist for specific prior–likelihood pairs, and the pair matters: uniform priors for Bernoulli arms, Jeffreys priors for one-parameter exponential families, and, for Gaussian arms with unknown variance, priors uniform in the variance or the standard deviation, while the Jeffreys and reference priors fail (Honda & Takemura, 2014). Bayesian guarantees hold for every prior, but only on average over instances drawn from it.

The worst case. The instance-free frequentist bounds are O(KTln⁡T)\order{\sqrt{KT\ln T}} for Beta Thompson sampling and O(KTln⁡K)\order{\sqrt{KT\ln K}} for the Gaussian version, and Agrawal and Goyal exhibit an instance on which the Gaussian version suffers regret of order KTln⁡K\sqrt{KT\ln K}, so it misses the minimax rate KT\sqrt{KT} of Regret Lower Bounds. Clipping the samples repairs this: MOTS (Jin, Xu, Shi, Xiao & Gu, 2021) achieves O(KT)\order{\sqrt{KT}}, and a variant for Gaussian rewards is in addition asymptotically optimal.

Structure. For linear bandits Thompson sampling's Bayesian regret is O~(dT)\tilde{\mathcal O}(d\sqrt T) by both routes above, but frequentist proofs inflate the posterior's spread so that each sample is optimistic with constant probability, and lose a factor d\sqrt d: O~(d3/2T)\tilde{\mathcal O}(d^{3/2}\sqrt T) (Agrawal & Goyal, 2013; Abeille & Lazaric, 2017). Hamidi and Bayati (2020) argue that the inflation is fundamental: without it, linear Thompson sampling can suffer linear regret. Linear Bandits: LinUCB & OFUL compares this with optimism.

Key takeaways

  • Frequentist bounds hold on every fixed instance; Bayesian bounds average over instances drawn from the algorithm's own prior. Thompson sampling has both: the Lai–Robbins constant for Bernoulli arms with uniform priors, and Bayesian regret of order KT\sqrt{KT} for any prior.
  • Agrawal and Goyal's key lemma charges each pull of a suboptimal arm made with a modest sample to a pull of the optimal arm, at the odds (1−p)/p(1-p)/p that the optimal arm's sample is low; for Beta posteriors these odds sum to a constant, leaving ln⁡T/kl⁡\ln T/\operatorname{kl}.
  • Russo and Van Roy's decomposition: because AtA_t and A⋆A^\star share their conditional law, any history-based confidence bound splits the Bayesian regret into widths and failures, giving O(KTlog⁡T)\order{\sqrt{KT\log T}} from Hoeffding's inequality, O~(dT)\tilde{\mathcal O}(d\sqrt T) for linear models and eluder-dimension bounds in general.
  • The information ratio Γt=Δt2/It\Gamma_t=\Delta_t^2/I_t is at most K/2K/2 for Thompson sampling, by Pinsker's inequality and Cauchy–Schwarz with regret and information weighted by the same α\alpha, so BRT≤Γˉ H(A⋆) T≤12KTln⁡K\mathrm{BR}_T\le\sqrt{\bar\Gamma\,H(A^\star)\,T}\le\sqrt{\tfrac12KT\ln K}.
  • Gaps remain: frequentist guarantees depend on the prior, Gaussian Thompson sampling loses ln⁡K\sqrt{\ln K} in the worst case, and linear Thompson sampling needs an inflated posterior and an extra d\sqrt d.

Check yourself

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

Question 1

In Agrawal and Goyal's analysis, how are the rounds in which a suboptimal arm ii is pulled despite a modest sample, θi(t)≤yi\theta_i(t)\le y_i, accounted for?

  1. They are impossible once arm ii has been pulled ln⁡T/kl⁡(xi,yi)\ln T/\operatorname{kl}(x_i,y_i) times
  2. They are charged to rounds in which the optimal arm is pulled, with weight the odds (1−pi,t)/pi,t(1-p_{i,t})/p_{i,t} that the optimal arm's sample falls below yiy_i
  3. They are bounded by Hoeffding's inequality applied to arm ii's rewards
  4. They are charged to the prior, whose weight vanishes as TT grows
Show the answer

B. They are charged to rounds in which the optimal arm is pulled, with weight the odds (1−pi,t)/pi,t(1-p_{i,t})/p_{i,t} that the optimal arm's sample falls below yiy_i

If arm ii wins with a low sample, the optimal arm's sample must be low too. The key lemma compares this event with the event that the optimal arm wins against the same competition, which costs a factor (1−p)/p(1-p)/p. Summed over the pulls of the optimal arm, these odds give a constant for Beta posteriors.

Question 2

Bubeck and Liu prove that Thompson sampling's Bayesian regret is at most 14KT14\sqrt{KT} for every prior. What does this say about one particular instance?

  1. Nothing directly: it bounds the average regret over instances drawn from the prior the algorithm uses, and an instance the prior considers unlikely can have larger regret
  2. The regret on every instance is at most 14KT14\sqrt{KT}
  3. The regret on every instance grows logarithmically
  4. Thompson sampling with any prior has worst-case frequentist regret of order KT\sqrt{KT}
Show the answer

A. Nothing directly: it bounds the average regret over instances drawn from the prior the algorithm uses, and an instance the prior considers unlikely can have larger regret

Bayesian regret is an average over ν∼Q\nu\sim Q, with QQ the algorithm's own prior. It implies, for instance, that the regret exceeds 14KT/δ14\sqrt{KT}/\delta only on a set of instances of prior probability at most δ\delta (Markov's inequality), but no bound for any single instance.

Question 3

Russo and Van Roy's decomposition rests on E[Ut(At)∣Ht−1]=E[Ut(A⋆)∣Ht−1]\E[U_t(A_t)\mid H_{t-1}]=\E[U_t(A^\star)\mid H_{t-1}]. What makes this true?

  1. UtU_t is an upper confidence bound, so it exceeds every mean
  2. The rewards are bounded in [0,1][0,1]
  3. Given the history, UtU_t is a fixed function and AtA_t has the same distribution as A⋆A^\star, provided the instance was drawn from the algorithm's prior
  4. The arms are independent under the prior
Show the answer

C. Given the history, UtU_t is a fixed function and AtA_t has the same distribution as A⋆A^\star, provided the instance was drawn from the algorithm's prior

Probability matching says that AtA_t and A⋆A^\star have the same conditional law, and UtU_t is determined by Ht−1H_{t-1}, so the two expectations agree. No property of UtU_t is needed for the identity; whether UtU_t is a good bound only affects how small the two resulting terms are. The identity does need A⋆A^\star to follow the posterior, that is, a correct prior.

Question 4

Which assumptions does the proof that Thompson sampling's information ratio is at most K/2K/2 actually use?

  1. Independent priors across the arms
  2. Bernoulli rewards
  3. Uniform priors
  4. Rewards in an interval of length 1, and an action drawn from the posterior of A⋆A^\star independently of the outcomes
Show the answer

D. Rewards in an interval of length 1, and an action drawn from the posterior of A⋆A^\star independently of the outcomes

Pinsker's inequality turns information into squared differences of means, which needs rewards in an interval of length 1, and probability matching makes the regret and the information share the weights α(a)=Pr⁡t(A⋆=a)\alpha(a)=\Pr_t(A^\star=a). Nothing else is used: the prior can be arbitrary, with any dependence between arms.

Further reading

  • S. Agrawal & N. Goyal, "Near-optimal regret bounds for Thompson sampling," Journal of the ACM 64(5) (2017).
  • E. Kaufmann, N. Korda & R. Munos, "Thompson sampling: An asymptotically optimal finite-time analysis," Algorithmic Learning Theory (2012).
  • D. Russo & B. Van Roy, "Learning to optimize via posterior sampling," Mathematics of Operations Research 39(4), 1221–1243 (2014).
  • D. Russo & B. Van Roy, "An information-theoretic analysis of Thompson sampling," Journal of Machine Learning Research 17(68), 1–30 (2016).
  • T. Lattimore & C. Szepesvári, Bandit Algorithms, ch. 34–36 (Cambridge University Press, 2020).