Analysis of Thompson Sampling for the multi-armed bandit problem
Paper · 2011 · Shipra Agrawal and Navin Goyal
Summary
Choosing an action can serve two purposes: obtaining a good outcome now and learning which action deserves future attention. These purposes sometimes conflict. An option with disappointing results may truly be weak, or it may simply have received too few opportunities. Shipra Agrawal and Navin Goyal investigate a particularly simple way of managing this uncertainty: Thompson sampling. For every available option, the procedure draws a possible value of its expected reward from a distribution representing current evidence. It then chooses the option with the highest sampled value. Their paper establishes a logarithmic upper bound on expected regret for this randomized procedure in the stochastic multi-armed bandit setting.
The setting has a finite collection of actions, called arms. Each arm produces independent rewards from an unchanged but unknown distribution, and the outcome of a selection becomes available immediately. Regret measures the expected reward sacrificed relative to continually selecting an arm with the highest mean. The authors’ question is whether Thompson sampling can keep this accumulated opportunity cost small as decisions continue. Earlier investigations, as described in the paper, had found encouraging practical behavior, including resilience when observations arrived late. Existing theory, however, had established only weaker sublinear guarantees. This analysis closes part of that gap between practical interest and mathematical understanding.
The procedure studied here maintains beta distributions using success and failure counts. For binary rewards, these counts update directly after each selection. For arbitrary rewards within [0, 1], the authors introduce an extra random trial: the observed reward becomes the probability of generating a success. This construction gives the resulting binary evidence the same mean as the original reward. As a result, the analysis of binary observations also applies to this particular bounded-reward extension. Although the procedure uses Bayesian distributions internally, the theorem concerns fixed unknown reward parameters; it does not require those parameters to have been generated from its initial distributions.
For two arms, the guarantee is O((ln T)/∆ + 1/∆³), with T denoting the decision horizon and ∆ the difference between the expected rewards. For N arms, the principal bound is O((Σₐ₌₂ᴺ 1/∆ₐ²)² ln T), where each ∆ₐ measures an inferior arm’s distance from the best mean. Both expressions grow logarithmically with T when the reward distributions remain fixed. Their dependence on the gaps is less satisfactory. The authors explicitly distinguish their success on horizon dependence from the remaining weaknesses in constants and, especially for many arms, the inverse-gap factors.
The proof’s distinctive move is to examine the pauses between selections of the optimal arm. Learning enough about an inferior option does not guarantee its immediate abandonment: an underexplored optimal option can still generate an unfavorable sample. The analysis therefore studies how the optimal arm recovers opportunities after its current observations are fixed. With additional arms, it must also account for competitors whose exploration is unfinished and which interrupt that recovery. These arguments deliver theoretical guarantees instead of a new empirical comparison. The paper supplies algorithms, distribution identities, concentration estimates, and finite-time bounds; it does not introduce a benchmark dataset or report new experimental regret curves.
Interesting ideas
Let uncertainty influence allocation. A distribution over an option’s possible quality can determine how frequently it receives attention. Sampling creates opportunities for alternatives that remain plausible without requiring a separate, fixed exploration schedule. This is useful in repeated experiments and adaptive resource allocation when observations are limited and the objective is cumulative performance.
Inspect how promising options regain attention. A selector can understand its weaker alternatives quite accurately while continuing to neglect the strongest one. Tracking the interval before a promising option returns exposes this failure mode. Recovery analysis can illuminate adaptive testing, search, and experimental scheduling whenever early observations influence later access to evidence.
Find an interface that preserves the required observable. The bounded-reward construction changes what the algorithm records while retaining each arm’s mean. That is sufficient for the authors’ reduction, even though it does not retain every property of the original observations. Similar reasoning can simplify data adapters and verification: identify the quantity required by the argument, then prove that the conversion preserves it.
Account separately for learning and avoidable persistence. An alternative with little evidence raises a different analytical problem from an alternative that remains selected after extensive observation. The proof’s saturation partition makes those costs visible. Comparable distinctions can improve diagnostics in adaptive systems, where additional sampling and changes to the decision rule answer different problems.
Respect dependence created by previous decisions. An interruption count and a waiting duration may both reflect the same history. Their expectations cannot automatically be multiplied as though they were unrelated. Conditioning at the appropriate boundary offers a reusable discipline for reasoning about any process whose future actions depend on earlier outcomes.
Distinguish the variables in a performance claim. A favorable dependence on elapsed time can coexist with unfavorable dependence on the number of alternatives or their similarity. The paper makes these dimensions explicit. This habit strengthens evaluation and benchmarks by preventing a result about one scaling variable from becoming an unrestricted efficiency claim.
Name the relaxation responsible for pessimism. The authors identify worst-case placement of unfinished exploration as a source of their loose general bound. That explanation gives later analysis a concrete target. In mathematical engineering, documenting where a conservative estimate enters can be as useful as displaying the final inequality.
Deep dive: Analysis of Thompson Sampling for the multi-armed bandit problem
Agrawal and Goyal explain why Thompson sampling earns logarithmic regret, how its probability argument works, and where its guarantees remain loose. · about 36 minutes to read
How Mova uses it
Mova implements a small language system in Rust, with explicit linguistic rules, statistical components, bounded workers, and separate procedures for proposing and admitting changes. Its documented mechanisms do not establish a Thompson-sampling controller. The connections below are proposals grounded in those mechanisms. The status marks describe overlap with documented capabilities, rather than implementation receipts for this paper. A proposed addition remains unverified, and an absent entry in the digest does not establish that no related work exists.
Idea: Allocate development trials through uncertainty. Where: Section 1.2, Algorithm 1. Area: experimental scheduling. Mova: нове. A possible controller could choose among configured repair strategies by sampling estimated success probabilities. Its decisions would allocate authorized experiments; existing checks would determine whether any resulting change qualified for admission. Why Mova: scarce development effort could reach plausible alternatives that have received little evidence, with every selection retained for inspection. A beta-based controller is not established by the documented implementation.
Idea: Explain recovery after discouraging observations. Where: Proof Techniques, discussion of the optimal arm’s sampling history. Area: robustness. Mova: нове. Controlled development studies could examine whether an initially unlucky strategy eventually receives another opportunity. The study would distinguish a strategy’s underlying usefulness from the selection history that makes it look unpromising. Why Mova: a useful parser repair or dictionary investigation should not disappear from consideration solely because its earliest authorized trials were unusually difficult. No recovery guarantee for Mova follows from this paper.
Idea: Verify what a conversion preserves. Where: Section 1.2, the bounded-reward reduction. Area: data interfaces and mathematics. Mova: частково є (docs/hybrid-system.md, declared observations and assumptions; source-bound groupants and typed correspondences). Mova already distinguishes compatible observations from stronger equivalence claims. A statistical adapter could declare that it preserves an expected score while changing the observation format. Why Mova: a precise interface would prevent mean preservation from being mistaken for preservation of linguistic meaning, evidence, or every statistical property.
Idea: Separate evidence acquisition from residual selection errors. Where: the N-arm proof, saturated and unsaturated sets. Area: diagnostics. Mova: частково є (tools/dictindex/README.md, support counts and review proposals; bounded self-study in tools/enrich/README.md). A development report could distinguish strategies with insufficient trials from strategies that continue to receive attention despite substantial negative evidence. Why Mova: the distinction helps determine whether to collect more observations or revise a selection policy. The paper’s numerical saturation rule would require its own assumptions before transfer.
Idea: Preserve adaptive dependencies in analysis. Where: Lemma 5 and Appendix C.5. Area: probability and verification. Mova: нове. A mathematical account of an adaptive worker controller could condition on the recorded history before bounding subsequent waiting. It should justify any combination of interruption and duration estimates. Why Mova: worker choices and outcomes share history, so treating summary statistics as independent could produce an unsupported scheduling guarantee. This is a proposed verification practice, with no measured Mova application established.
Idea: Report different scaling variables independently. Where: Section 1.3 and Remark 1. Area: evaluation. Mova: частково є (README.md, scoped measurements and explicit limits; docs/hybrid-system.md, bounded configured execution). A controller report could state separately how cost changes with the trial horizon, candidate population, and similarity of candidate quality. Why Mova: a successful small queue need not imply efficient exploration of a much larger queue, particularly when candidate strategies perform similarly.
Idea: Identify the step that enlarges a bound. Where: Proof Techniques, worst-case allocation of interruptions. Area: mathematical reporting. Mova: частково є (groupants, explicit assumptions and evidence; tools/enrich/README.md, idealized simulations distinguished from forecasts). An analysis could attach an explanation to each conservative relaxation and show which one dominates the result. Why Mova: reviewers could tell whether a pessimistic estimate reflects observed worker behavior, incomplete evidence, or deliberate mathematical caution.
Idea: Confine randomized exploration to an explicit boundary. Where: Algorithm 1 and the fixed-parameter interpretation in the Introduction. Area: architecture. Mova: частково є (README.md, deterministic native decisions; separate gated self-revision). An experimental sampling policy could run within a bounded development process while recording its random seed, choices, and outcomes. Why Mova: the exploration mechanism would remain inspectable and reproducible without silently changing the meaning of a native linguistic answer. Such a policy has not been demonstrated in the digest.
Idea: Retain the observations beneath compact counts. Where: Section 1.2, success and failure updates. Area: provenance. Mova: частково є (tools/dictindex/README.md, attributed occurrences and immutable source versions; experiment journals described in README.md). A scheduler may need only counts for selection, but its audit record should retain the trial, input version, observed outcome, and admission decision supporting each update. Why Mova: compact statistical state cannot reveal whether nominally comparable trials used changed corpora or different definitions of success.
Idea: Label an exploration prior as an assumption. Where: Introduction and Section 1.2. Area: epistemic representation. Mova: частково є (prag/src/frames.rs, typed evidential distinctions; world assertion and retention gates). The assumed distribution used to guide a controller could be stored separately from source-supported knowledge. Why Mova: a belief useful for allocating experiments should not become a narrative assertion, dictionary meaning, or admitted fact merely because it influences an action.
Idea: Keep evidence quantity visible. Where: Section 1.2, beta parameters and concentration. Area: statistics. Mova: частково є (tools/dictindex/README.md, feature support; prag/src/eval.rs, confidence-reliability analysis). A proposed controller could display success and failure support alongside its current estimated quality. Why Mova: similar averages can have very different evidential strength, and explicit counts would help reviewers understand why an uncertain strategy still receives trials.
Idea: Document execution inputs separately from analytical quantities. Where: Algorithms 1–2 and the two-arm proof threshold. Area: software contracts. Mova: частково є (groupants, invariants and conformance conditions; bounded capability interfaces). A controller specification could distinguish stored counts and random samples from unknown reward gaps used solely in a theorem. Why Mova: proof notation should not conceal an unavailable runtime input or suggest that the worker must know the answer before selecting an experiment.
Idea: Define a reward before collecting adaptive evidence. Where: Section 1.1, fixed reward distributions and regret. Area: experimental design. Mova: частково є (README.md, measured changes; tools/enrich/README.md, comparisons on unchanged questions). A scheduler study would need a stable outcome definition, distinguishing a completed action from a verified improvement. Why Mova: producing more frames, more drafts, or more successful transports does not on its own establish better understanding or useful learning.
Idea: Examine cumulative expenditure, not only the final artifact. Where: Section 1.1, cumulative regret. Area: evaluation. Mova: нове. A development controller could be assessed on the opportunity cost accumulated while reaching an accepted result, alongside the result’s quality. Its reference policy and reward scale would need explicit justification. Why Mova: an eventual improvement can conceal a costly exploration history, which matters when worker capacity or teacher review is limited.
Idea: Adapt a bounded score through a binary observation. Where: Algorithm 2. Area: statistical data processing. Mova: нове. For a suitably defined development score in [0, 1], a recorded auxiliary trial could supply binary updates to an experimental selector. The original score and the extra random outcome should both remain available. Why Mova: this offers a specific mathematical adapter to a compact counting procedure, while making the discarded information visible. Its practical value would require measurement.
Idea: Compare initialization choices explicitly. Where: Section 1.2, Beta(1, 1); Conclusion, prior mismatch. Area: sensitivity analysis. Mova: нове. A proposed scheduler could be evaluated under alternative starting assumptions on protected development tasks. The analysis here does not authorize arbitrary priors with the same guarantee. Why Mova: initialization can shape which strategies receive early attention, and that influence should be distinguished from preferences learned through observed outcomes.
Idea: Establish a version boundary for each statistical process. Where: Section 1.1, unchanged arm distributions. Area: provenance and experimental validity. Mova: частково є (tools/dictindex/README.md, separately named source versions and index epochs; tools/enrich/README.md, fingerprint checks). Existing version identities could define which observations a controller may pool. Why Mova: a parser update can change a repair strategy’s effectiveness, so observations collected under different configurations may no longer describe the same stochastic option.
Idea: Test whether an arm remains stable. Where: Section 1.1, independent identically distributed rewards. Area: statistical assumptions. Mova: нове. Before invoking a bandit guarantee, a study should examine whether repeated trials of a strategy still represent a consistent reward process. Version identity alone does not establish this. Why Mova: changing task mixtures or interactions between admitted repairs could invalidate fixed-distribution reasoning even when the controller’s implementation is unchanged.
Idea: Measure neglected intervals directly. Where: the two-arm proof, Yⱼ and X(j, s, y). Area: scheduling diagnostics. Mova: нове. A controller trace could record the stretches during which a candidate receives no new trial and relate them to its last evidence. Why Mova: aggregate selection frequency can hide long periods of starvation, while bounded workers need opportunities that arrive within useful operational timescales. The paper motivates this diagnostic without proving a corresponding worker-service guarantee.
Idea: Record exploratory interruptions. Where: the N-arm proof, M(t) and γⱼ. Area: operational analysis. Mova: нове. A proposed controller could record when competing exploratory work prevents an otherwise plausible strategy from receiving the next slot. Such a trace would describe competition rather than asserting that the skipped strategy was truly optimal. Why Mova: queue interference can explain delayed investigation even when a candidate’s own evidence has not worsened.
Idea: Use fixed hidden outcome sequences in synthetic comparisons. Where: Appendix C.4, arm-indexed reward variables. Area: evaluation design. Mova: нове. An owned synthetic fixture could assign each strategy a sequence of outcomes, revealing the next outcome only after selection. Policies could then encounter a common underlying experimental setting. Why Mova: this helps isolate allocation behavior from differences introduced by regenerating conditions for each policy. Real language-task rewards would still require separate validation.
Idea: Diagnose sparse evidence separately. Where: Lemma 3 and Appendix C.2. Area: statistical analysis. Mova: частково є (prag/src/eval.rs, confidence strata; tools/dictindex/README.md, support-aware proposals). A controller report could distinguish behavior before evidence is substantial from behavior after stable estimation becomes plausible. Why Mova: concentration-based reasoning may describe mature candidates while missing the early histories that determine whether those candidates are explored at all.
Idea: Combine an exceptional-event probability with its possible cost. Where: Lemma 2 and the two-arm regret decomposition. Area: bounded-risk analysis. Mova: нове. A controller analysis could state both the chance of an exceptional decision and its maximum contribution within the declared run. Why Mova: a rare event can still matter if it consumes a large share of a bounded experiment budget. Existing execution bounds offer a place to express consequences, but they do not supply the probability estimate.
Idea: Reuse exact distribution relationships where supported. Where: Lemma 1 and Appendix B, Fact 1. Area: mathematics. Mova: частково є (math, exact arithmetic and symbolic expressions; source-bound mathematical descriptions). The beta–binomial relationship could become a documented mathematical object or a checked calculation, subject to the availability of the needed probability functions. Why Mova: translating between equivalent observations may simplify analysis, but current support for these particular distributions is unknown.
Idea: Distinguish raw rewards from controller evidence. Where: Algorithm 2 and its justification. Area: data representation. Mova: частково є (docs/hybrid-system.md, distinct evidence kinds; source-bound retained records). A real-valued observation and the binary event generated from it should have separate typed identities. Why Mova: investigators must be able to tell which quantity was observed, which was constructed, and which entered the update. That distinction prevents a statistical convenience from obscuring provenance.
Idea: Keep pending outcomes separate from negative outcomes. Where: Section 1.1, immediate observation; Conclusion, delayed feedback. Area: worker-state handling. Mova: частково є (persistent worker state and explicit outcomes in docs/hybrid-system.md). A future selector could represent unfinished reviews without updating failure counts prematurely. Why Mova: an absent result is not evidence that an experiment failed, and conflating them would create a process different from the one analyzed here.
Idea: Study delayed decisions as a different setting. Where: Introduction and Conclusion. Area: evaluation and operations. Mova: нове. A controller with several pending experiments would need a separate study of how it selects before outcomes arrive. The immediate-feedback theorem would serve as a reference setting only. Why Mova: asynchronous workers and teacher reviews naturally create missing observations at decision time, precisely where the paper leaves a theoretical extension open.
Idea: Preserve admission after adaptive allocation. Where: Section 1.2, action selection from accumulated outcomes. Area: learning boundaries. Mova: вже є (tools/enrich/README.md, staged teaching material awaits admission; README.md, gated rule changes). Sampling can decide which proposal receives investigation, while established validators decide whether its output enters durable knowledge or shipped behavior. Why Mova: an allocation policy measures expected usefulness of experiments; it does not prove a linguistic rule or dictionary definition correct.
Idea: Prevent assessment outcomes from becoming scheduler training evidence. Where: Section 1.1, history-dependent decisions. Area: evaluation integrity. Mova: вже є (docs/architecture.md, teacher-separated assessment and release evaluation boundaries). A proposed controller should learn from development trials while preserving the independent role of assessment questions. Why Mova: repeated adaptive access would make an assessment part of the controller’s observed history, changing what a subsequent score could establish.
Idea: Report evidence according to its actual scope. Where: Introduction, Section 1.3, and Conclusion. Area: scientific communication. Mova: вже є (README.md, implementation limits; docs/hybrid-system.md, experimental capabilities distinguished from direction). A successful bounded scheduler trial, a theorem under fixed assumptions, and favorable earlier application reports should retain separate statuses. Why Mova: transparent reporting makes useful partial results available without turning them into unsupported general claims.
These transfers chiefly concern experiment allocation, statistical reasoning, and evidence handling. The paper supplies no direct account of syntax, pragmatic interpretation, or dictionary meaning. Any benefit to those areas would come through choosing and evaluating development work, with the linguistic mechanisms and admission criteria retaining their own responsibilities.
The problem and its context
Decisions reveal only selected outcomes
In the stochastic bandit problem, a decision-maker repeatedly selects from the same set of arms. A selection produces a reward and an observation about that arm. It does not reveal what the unselected arms would have produced. The resulting information is therefore shaped by the decision procedure itself.
This creates the exploration problem. An arm may look unattractive because it performs poorly, but it may also look unattractive because the available evidence is sparse or unlucky. Choosing it provides information at the possible expense of immediate reward. Avoiding it preserves current performance while potentially delaying discovery of a better alternative.
The paper assumes that the environment has a stable statistical structure. Each arm’s rewards come from a fixed distribution supported within [0, 1]. Repeated outcomes for an arm are independent and identically distributed, and reward sequences belonging to different arms are independent. The algorithm sees each selected reward immediately.
These assumptions isolate uncertainty about quality from changes in quality. The challenge comes from learning unknown means while collecting rewards, rather than from tracking an environment that changes its behavior. That distinction is central to the theorem’s interpretation.
The performance objective accumulates across the entire sequence. A procedure that eventually identifies a good arm may still incur substantial cost while getting there. Conversely, a trial of an inferior arm can be justified if the resulting information improves later choices. The relevant question is how much expected reward the entire learning process sacrifices.
The reference is knowledge of the best mean
Regret compares the procedure with an ideal decision-maker that knows which arm has the greatest expected reward. This reference has statistical knowledge, not foresight about individual random outcomes.
An inferior arm can occasionally produce a better realized reward than the optimal arm. That does not reverse their roles in the analysis. The optimal arm is defined by its mean, and the expected cost of choosing a competitor is the difference between their means.
This definition makes regret additive by arm. If a competitor is selected repeatedly, each selection contributes the same expected gap. As a consequence, an upper bound on how frequently inferior arms are selected leads directly to an upper bound on cumulative regret.
The authors explicitly leave other objectives outside their analysis. In particular, they do not investigate PAC-style guarantees. Their question concerns cumulative expected performance over a horizon, rather than a separate promise about identifying the best arm with a specified confidence.
The established alternatives
The Introduction describes upper-confidence-bound methods as prominent approaches with strong guarantees. Such methods combine an empirical reward estimate with an exploration term. An arm with little evidence receives an optimistic adjustment, giving it an opportunity to challenge apparently stronger alternatives.
The paper also mentions the allocation strategy associated with Gittins. In the setting described by the authors, that approach concerns known priors and geometrically discounted rewards. Its assumptions and objective differ from the fixed-parameter cumulative-regret setting analyzed here.
Thompson sampling belongs to probability-matching methods. It represents uncertainty about the arms and selects according to the probability that an arm is best under that representation. The authors trace this idea to Thompson’s work in 1933.
The practical attraction was already visible in the studies they discuss. Those investigations reported performance competitive with confidence-bound alternatives, including advertising and recommendation applications. They also suggested favorable behavior when feedback was delayed or batched.
The paper presents these observations as motivation for stronger theory. Its own contribution is not another application comparison. It asks why a simple randomized selection rule can achieve a strong regret guarantee under a basic stochastic setting.
What was missing theoretically
Earlier analyses discussed by Agrawal and Goyal established expected regret of o(T). This excludes persistent linear growth, but it does not identify logarithmic growth. The distinction matters because many different rates satisfy a sublinear statement.
A logarithmic guarantee places Thompson sampling alongside established methods on the horizon dimension. It still leaves other questions open: the coefficient of the logarithm, the penalty for closely matched arms, and the effect of additional alternatives.
The authors frame their contribution accordingly. They establish a stronger finite-time result while acknowledging that its full parameter dependence falls short of the best comparison they present.
Their analysis also changes how the Bayesian language should be read. The arm means are fixed unknown quantities. Initial beta distributions organize the procedure’s uncertainty; they are not an assumption that nature selected the true means from those distributions. This lets the authors compare the resulting guarantee with guarantees for confidence-bound procedures in the same fixed-parameter setting.
The method, step by step
Specify the quantities being learned
Let N denote the number of available arms. Arm i has unknown mean reward µᵢ. At decision time t, the selected arm is i(t), and its reward becomes available before the next decision.
The best achievable mean is:
µ* = maxᵢ µᵢ
The symbol µ* identifies the greatest arm mean. The maximum ranges over the available arms. The algorithm does not receive the values µᵢ or µ*.
The gap for arm i is:
∆ᵢ = µ* − µᵢ
Here ∆ᵢ measures the expected opportunity cost of selecting that arm. An optimal arm has no gap. Every strictly inferior arm has a positive gap.
The cumulative objective can be expressed as:
E[R(T)] = E[Σₜ₌₁ᵀ (µ* − µᵢ₍ₜ₎)]
R(T) denotes regret over the horizon T. The summation adds the expected reward shortfall associated with each selected arm, and E denotes expectation over the stochastic process.
This formula is useful because it connects a decision sequence to a statistical objective without comparing individual realized rewards against hypothetical outcomes. The proof can focus on selection counts and the known mathematical role of their associated gaps.
Use binary observations first
The initial algorithm description assumes Bernoulli rewards. Each selection returns either 0 or 1, and an arm’s success probability equals its mean reward.
For each arm, the procedure records successes Sᵢ and failures Fᵢ. These counts summarize the evidence used for selection. Before any observation, both counts are initialized to 0.
The beta family supplies distributions over possible success probabilities. Its density is:
f(x; α, β) = Γ(α + β)x^(α − 1)(1 − x)^(β − 1) / (Γ(α)Γ(β))
The variable x is a possible probability in (0, 1). The positive shape parameters are α and β. The function Γ supplies the normalization appearing in the density.
For this family, the mean is:
E[x] = α / (α + β)
The relative sizes of α and β locate the distribution’s center. As evidence accumulates through the count updates, the distribution becomes more concentrated around the corresponding estimated success rate.
The algorithm begins with Beta(1, 1) for every arm. That distribution is uniform over (0, 1). A success adds to the success-side parameter, while a failure adds to the failure-side parameter.
After observations, arm i uses:
Beta(Sᵢ + 1, Fᵢ + 1)
Sᵢ and Fᵢ are the accumulated binary counts for that arm. The added 1 in each parameter comes from the specified initial distribution.
The convenience is computational and analytical. The procedure need not retain an increasingly complicated posterior expression after every observation. Its distribution remains within the same family, with parameters determined by counts.
Sample a possible quality for every arm
At each decision, the algorithm generates a fresh value for every arm:
θᵢ(t) ∼ Beta(Sᵢ + 1, Fᵢ + 1)
θᵢ(t) is the sampled candidate mean used at time t. It is not the reward produced by selecting arm i.
The selected arm is determined by:
i(t) = arg maxᵢ θᵢ(t)
The arg max operation returns the identity associated with the largest sampled value. The procedure then observes the chosen arm’s reward and updates that arm’s counts.
Drawing values independently from the current distributions and selecting their maximum gives the probability-matching interpretation. An arm’s chance of selection corresponds to its current probability of having the greatest mean under the procedure’s uncertainty representation.
This differs from always choosing the arm with the greatest posterior average. An uncertain arm can win a sampling round even when its average is not currently highest. That possibility creates exploration.
Nor does the procedure explicitly ask whether to explore or exploit at a separate stage. Both behaviors arise from the same comparison. Concentrated distributions tend to express established estimates; broader distributions allow less-tested alternatives to remain competitive.
The decision and observation cycle
The steps in order.
Extend to real-valued bounded rewards
The generalized procedure retains the same selection mechanism but changes the observation update. Suppose the selected arm produces a reward r̃ₜ within [0, 1]. The algorithm generates an additional Bernoulli trial whose probability of success is r̃ₜ.
Let rₜ denote this constructed binary outcome. The procedure updates successes or failures using rₜ, while the original reward remains the quantity relevant to the bandit objective.
The mathematical bridge is:
Pr(rₜ = 1 | selecting arm i) = ∫₀¹ r̃ fᵢ(r̃) dr̃ = µᵢ
The function fᵢ is the reward density used in the authors’ calculation. The integration averages the constructed success probability over possible original rewards. Its value is the arm’s original mean µᵢ.
Thus the count updates behave as though the arm itself generated Bernoulli rewards with that mean. The authors can prove their results for the Bernoulli count process and transfer them to this bounded-reward procedure.
The construction preserves the quantity needed for expected regret. It does not claim to preserve the complete distribution of the original rewards. In particular, the internal binary evidence and the observed real reward have different roles.
This distinction also delimits the theorem. The analysis covers the authors’ specified extension, rather than every procedure that uses beta distributions after observing bounded values.
Understand why concentration alone is insufficient
For a confidence-bound procedure, enough observations of an inferior arm can make further selection unlikely regardless of how many observations the optimal arm has received. If the optimal arm has little evidence, its optimism term encourages a return to it.
The corresponding argument does not transfer directly to Thompson sampling. An optimal arm with few observations can generate low samples repeatedly, even when its competitor has become well understood.
The paper considers the extreme case in which the optimal arm has never been selected. Its sampled value is still uniform. A concentrated inferior arm can exceed that value with a probability that is not negligible merely because the inferior arm has many observations.
Therefore, understanding the inferior arm is only part of the task. The proof must examine the optimal arm’s own history, including unfavorable early success counts.
This is why the analysis follows intervals between optimal-arm selections. Within such an interval, the optimal arm receives no new reward. Its distribution therefore remains unchanged, and repeated fresh samples from it have a fixed conditional success probability for crossing a suitable threshold.
Allow an initial exploration budget
For two arms, the authors label arm 1 optimal and arm 2 inferior. Their mean difference is ∆. They introduce a threshold for the number of selections of arm 2:
L = 24(ln T)/∆²
L is a proof quantity. T is the horizon, ln is the natural logarithm, and ∆ is the unknown reward gap. The running algorithm does not need to calculate L.
Before the inferior arm reaches this threshold, the analysis simply charges its selections to an initial exploration budget. Afterwards, it uses concentration to control how far its samples can rise above its actual mean.
The comparison value is:
y = µ₂ + ∆/2
µ₂ is the inferior arm’s mean. The term ∆/2 places y between the two means. If the optimal arm’s sample exceeds y and the inferior arm’s sample stays below y, the optimal arm is selected.
The resulting argument has separate components: the initial sampling allowance, ordinary waiting for a favorable optimal-arm draw, and exceptional occasions when the well-sampled inferior arm produces an unusually high draw.
Represent the pause as a geometric experiment
Suppose the optimal arm has been selected j times and produced s successes. Its current distribution is Beta(s + 1, j − s + 1).
The authors define X(j, s, y) by repeatedly drawing from this distribution until a draw exceeds y. X counts the unsuccessful attempts before that crossing.
Its conditional expectation is:
E[X(j, s, y)] = 1/Pr(θ₁ > y) − 1
θ₁ has the fixed beta distribution determined by j and s. The denominator is the probability of a threshold-crossing draw. The subtraction reflects the convention of excluding the successful attempt from the count.
This is a geometric waiting calculation because the distribution does not change before the optimal arm is played again. It gives the proof a tractable substitute for a portion of the original adaptive process.
The actual interval can be longer when the inferior arm produces an exceptional sample. The proof accounts for those events separately instead of asserting that the geometric variable exactly describes every interval.
The observed success count s is also random. A satisfactory bound must average over its distribution, including unlucky histories. Replacing s with its expected value would omit precisely the histories that can make recovery slow.
Translate beta probabilities into binomial probabilities
The central distribution identity is:
Fᵝᵉᵗᵃ₍α,β₎(y) = 1 − Fᴮ₍α+β−1,y₎(α − 1)
Fᵝᵉᵗᵃ denotes a beta cumulative distribution function. Fᴮ denotes a binomial cumulative distribution function, with the indicated trial count and success probability. The parameters α and β are positive integers.
Appendix B explains this identity through ordered uniform random variables. A statement about where an ordered value falls can be reinterpreted as a statement about how many uniform draws lie below a threshold.
For the waiting experiment, the identity yields:
E[X(j, s, y)] = 1/Fᴮ₍j+1,y₎(s) − 1
The binomial cumulative probability in the denominator is evaluated at s. This form makes it possible to compare the distribution of actual optimal-arm successes with a binomial distribution associated with the lower threshold y.
The translation is more than a change of notation. It places the difficult reciprocal probability inside a family for which the authors can use concentration, median properties, and direct likelihood comparisons.
Treat early and late histories differently
When j is large, the empirical success rate of the optimal arm is likely to lie near µ₁. Its beta distribution is then likely to produce a value above a threshold strictly below µ₁.
The proof uses Chernoff–Hoeffding estimates to control deviations. One upper-tail form is:
Pr(Sₙ ≥ nµ + a) ≤ e^(−2a²/n)
Sₙ is the sum of n bounded variables under the stated conditional-mean assumptions. Their common conditional mean is µ, and a is a non-negative deviation. A corresponding lower-tail estimate controls unusually small sums.
The early regime needs another argument. With few observations, a poor success count can still have appreciable probability. At the same time, the resulting beta distribution may have a small chance of crossing y, producing a long expected wait.
The authors compare binomial probability masses and cumulative probabilities directly. They use:
D = y ln(y/µ₁) + (1 − y) ln((1 − y)/(1 − µ₁))
D is the Bernoulli divergence in the orientation displayed by this expression. It quantifies separation between the threshold probability y and the optimal mean µ₁.
They also introduce:
R = µ₁(1 − y)/(y(1 − µ₁))
R compares the corresponding odds. For y below µ₁, it supports bounds on ratios of binomial probability terms.
Another ingredient is the location of a binomial median near its mean. This lets the proof bound cumulative probabilities for success counts on the favorable side of the threshold.
Together these tools cover histories where concentration is strong and histories where it is not. Summing their contributions, then adding initial exploration and exceptional events, produces the two-arm regret bound.
Introduce the many-arm partition
For additional arms, the authors classify each inferior arm according to whether it has accumulated sufficient observations. Arm a has its own threshold:
Lₐ = 24(ln T)/∆ₐ²
∆ₐ is that arm’s gap from the optimal mean. An arm is called saturated after reaching its threshold; otherwise it remains unsaturated.
The saturated collection at time t is C(t). This set evolves as selections occur. Again, it belongs to the proof rather than the runtime requirements of the sampling procedure.
For saturated arms, the analysis controls samples within intervals around their true means. For unsaturated arms, it uses the fact that each can receive only a limited number of further selections before joining the saturated set.
The optimal arm may nonetheless draw a value high enough to defeat all saturated competitors and still lose to an unsaturated one. This is the interruption that complicates the general analysis.
The authors define:
M(t): θ₁(t) > maxₐ∈C(t) (µₐ + ∆ₐ/2)
M(t) is the event that the optimal arm’s sampled value exceeds every saturated-arm comparison threshold. If C(t) is empty, the proof regards M(t) as satisfied.
Occurrences of this event divide the interval between optimal-arm selections into smaller pieces. Their count within an interval is γⱼ. An occurrence that does not lead to selecting the optimal arm requires an unsaturated competitor or an exceptional saturated-arm draw.
Track which saturated competitor matters
The proof also records which arm has the greatest mean within the saturated set during each relevant subinterval. This matters because regret depends on the identity of the selected arm, not merely on whether the optimal arm was missed.
When all saturated samples remain within their prescribed ranges, a selected saturated arm cannot be arbitrarily worse than the best saturated competitor. The authors bound its gap through that competitor’s gap.
This produces a more informative accounting than charging every such selection at the largest available cost. The main theorem retains this arm-sensitive subdivision; the alternative bound later simplifies it.
The saturated set can grow inside an interval. Accordingly, the best saturated competitor may change even though the optimal arm’s posterior remains fixed. The proof’s subdivision accommodates those changes.
Condition before combining costs
The interruption count and subinterval lengths are dependent. Both are functions of the sampled values and choices made along the same history.
Appendix C.5 conditions on the optimal arm’s success count and the history available before a subinterval begins. Given that information, the relevant duration is bounded using a geometric threshold-crossing experiment.
This establishes the circumstances under which the waiting estimate remains valid. It avoids treating an adaptively selected interval as though it had been fixed independently of the process.
The total unfinished exploration is then bounded by the sum of the saturation thresholds. Rare concentration failures add another controlled contribution.
To combine these ingredients, the authors allow interruptions to occur in unfavorable places in the optimal arm’s history. That worst-case allocation is a major reason the resulting many-arm bound has weak dependence on small gaps.
Experiments and results
What is actually evaluated
There is no newly reported experimental dataset, train/test division, application benchmark, or numerical regret simulation. The paper evaluates the procedure mathematically through finite-time bounds.
Its metric is expected cumulative regret under unchanged independent reward distributions with immediate feedback. References to practical advertising, recommendation, or delayed-observation behavior describe earlier studies discussed by the authors.
The principal result should therefore be read as a guarantee about a specified stochastic process. It does not provide a measured runtime advantage or an observed percentage improvement over another procedure.
The two-arm theorem
Theorem 1 states:
E[R(T)] = O((ln T)/∆ + 1/∆³)
T is the number of decisions under consideration. ∆ is the positive difference between the optimal and inferior means. O suppresses constants in the upper-bound statement.
For fixed ∆, the horizon-dependent part grows with ln T. The additive inverse-gap term remains important, particularly when the arm means are close.
The explicit conclusion of the proof is:
E[R(T)] ≤ 40(ln T)/∆ + 48/∆³ + 18∆
The coefficients 40, 48, and 18 are analytical constants in the displayed guarantee. They do not summarize observed trials.
Before converting selection counts into regret, the proof obtains:
E[k₂(T)] ≤ 40(ln T)/∆² + 48/∆⁴ + 18
k₂(T) is the inferior-arm selection count appearing in the paper’s notation. Charging the arm’s gap for those selections gives the regret expression.
This distinction helps interpret the inverse powers. The cost of each inferior selection becomes smaller as the means approach one another, even though distinguishing the arms requires more evidence. Regret combines both effects.
The many-arm theorem
Theorem 2 gives:
E[R(T)] ≤ O((Σₐ₌₂ᴺ 1/∆ₐ²)² ln T)
The sum includes the inferior arms after the optimal arm is labeled 1. N is the total arm count.
The logarithmic horizon dependence is preserved. The squared sum, however, creates a much less favorable guarantee when gaps are small or many inferior alternatives are present.
The authors explicitly contrast their general gap dependence with UCB1. They describe the effective exponent as 4 for their bound and 1 for the UCB1 comparison.
Stated inverse-gap exponents in the general-arm bounds
The new Thompson-sampling guarantee has the less favorable gap exponent.
The numbers
| System or setting | inverse-gap exponent |
|---|---|
| UCB1 comparison | 1 |
| Thompson sampling analysis (this paper) | 4 |
These values describe the bounds’ mathematical forms. They are not empirical measurements of sensitivity, and the comparison does not establish that the algorithm itself incurs regret matching its upper bound.
An alternative tradeoff
Remark 1 supplies:
E[R(T)] ≤ O((∆max/∆min³)(Σₐ₌₂ᴺ 1/∆ₐ²) ln T)
∆min is the smallest gap among inferior arms, and ∆max is the largest. The authors obtain this expression by modifying the regret accounting in the proof.
They describe its arm-count dependence as preferable to the principal theorem’s, with a corresponding disadvantage in gap dependence. The alternative therefore illustrates a tradeoff between analytical descriptions rather than a different algorithm.
Which expression is informative depends on the collection of means. A result can be logarithmic in the horizon while remaining conservative for a particular configuration of alternatives.
The confidence-bound comparison
The paper presents UCB1’s guarantee as:
E[R(T)] ≤ 8(Σᵢ₌₂ᴺ 1/∆ᵢ) ln T + (1 + π²/3)Σᵢ₌₂ᴺ ∆ᵢ
The first sum controls the gap factors multiplying ln T. The second sum contributes an additive term. π is the mathematical constant in that expression.
The authors also discuss the earlier asymptotic lower bound expressed using divergence between reward distributions. Their claim of optimal horizon dependence refers to agreement with logarithmic growth, not equality with the lower bound’s full coefficient.
Bayes-UCB appears as another theoretical comparison. Its decision values come from beta posterior quantiles, combining posterior information with confidence-bound selection. The authors explain that its analysis follows a structure closer to existing confidence-bound arguments.
The achievement here is different: it establishes strong horizon dependence for the randomized sampling rule while developing machinery needed to handle that rule’s particular difficulties.
What the ablations show
The paper reports no experimental ablation study; its explanatory comparisons come from reductions, distinct analytical regimes, and alternative ways of bounding the same algorithm.
The two-arm case reveals the core obstacle
With only one inferior competitor, the analysis can isolate the optimal arm’s return time after the competitor has received substantial evidence.
This shows why the usual confidence-bound intuition is incomplete. Certainty about a competitor does not ensure that the optimal arm generates a winning sample promptly. Its own evidence may be sparse or discouraging.
The geometric calculation addresses that residual uncertainty directly. The proof’s attention to success-count distributions is therefore essential to the argument, rather than extra detail added after concentration has solved the problem.
Additional arms create shared-history effects
The general setting introduces unfinished exploration by other arms. Those competitors consume selections that could otherwise provide more observations of the optimal arm.
A collection of independent pairwise arguments would miss this interaction. The number of observations available for the optimal arm depends on selections of all competitors, and each competitor’s opportunity to win depends on that shared state.
The saturation partition exposes the mechanism. Already-studied arms can be controlled through concentration, while underexplored arms have a finite but potentially disruptive selection budget.
The analysis attributes much of its weaker gap dependence to pessimistic placement of those interruptions. This identifies a specific source of proof looseness rather than merely observing that the final expression is large.
Reward conversion establishes applicability, not superiority
The bounded-reward extension shows that the chosen internal binary update has the required mean. It permits reuse of the Bernoulli proof.
There is no comparison establishing that this update is more effective than retaining the full real-valued reward. The construction is analytically useful because it reproduces the count process needed by the argument.
This is an important distinction between proving that a procedure works under a broader observation interface and proving that the interface is statistically preferable.
Early histories need explicit protection
The large-evidence regime allows concentration estimates. The low-evidence regime does not.
By analyzing both, the authors show how the argument survives histories in which the optimal arm initially performs poorly. A proof restricted to typical mature estimates would leave those histories unaccounted for.
The binomial probability ratios and median facts provide the missing control. They bound the combined effect of a discouraging history’s probability and the long wait it can induce.
This analysis also explains why expected waiting cannot be assessed solely from the expected success count. Reciprocal probabilities are sensitive to unfavorable histories, so averaging must occur at the correct stage.
The alternative bound changes accounting
The principal proof tracks the best saturated competitor and charges regret using that local comparison. The alternative proof uses a coarser cost involving ∆max while controlling duration through the closest inferior competitor.
Nothing in the selection algorithm changes. Only the way the analysis combines duration and per-selection loss changes.
This comparison demonstrates how a simplification can improve one aspect of an expression while worsening another. It also reinforces that a theorem’s parameter dependence partly reflects the proof technique, instead of a measured law of the algorithm’s behavior.
Limitations
Explicitly acknowledged: the bound remains loose
The authors state that their constants and gap dependence are inferior to the comparison they give for UCB1. Their main success is logarithmic growth with the horizon.
They distinguish easier-looking refinements from harder ones. More careful calculation might improve constants, but improving the inverse-gap dependence appears to require more substantial progress.
For the many-arm argument, they identify worst-case allocation of interruptions as a central source of pessimism. The total amount of unfinished exploration is bounded, yet its possible timing forces a conservative combination with unfavorable optimal-arm histories.
As a result, the theorem does not establish the sharpest attainable regret description for Thompson sampling. It also does not show that its displayed upper bound is reached by some difficult instance.
Explicitly deferred: delayed and richer feedback settings
The theorem assumes that the outcome of a selection is available immediately. The Introduction discusses earlier encouraging results for delayed or batched observations, but the Conclusion leaves their theoretical explanation open.
The authors explain that proving comparative superiority in that setting would require both stronger Thompson-sampling analysis and suitable lower bounds for competitors. Favorable reports alone do not settle that mathematical comparison.
They also identify contextual bandits, prior mismatch, and changes to posterior shapes as future directions. Applications involving several parameters, including regularized logistic regression, are mentioned as lacking the analysis pursued here.
These are substantive boundaries. An application that chooses actions before earlier results return has a different information history. An application whose reward depends on context also differs from an arm with a single unchanged reward distribution.
Setup-derived: the environment must remain statistically stable
A careful reader must retain the assumption of fixed reward distributions. If selecting an action changes its future quality, or if external conditions alter that quality, the theorem’s process no longer describes the application.
Independence also matters. Outcomes within an arm are identically distributed independent draws, and different arms have independent reward sequences. Correlations or interactions need a separate argument.
The action set is finite. The algorithm draws a value for every available arm at each decision. No claim is established for an unrestricted collection of structured actions or for generating new actions during the run.
The rewards lie within [0, 1]. This bound supports the concentration arguments and the auxiliary Bernoulli construction. A reward outside that interval cannot be used directly as the success probability specified by Algorithm 2.
Setup-derived: expectation has a particular meaning
The headline guarantee concerns expected regret. It does not promise that every run stays below the same expression.
The proof bounds exceptional events because their contributions matter to expectation. That does not turn the headline theorem into a complete account of the distribution of realized regret.
Likewise, the objective differs from final-choice identification. A procedure might have good cumulative reward without providing a separately stated confidence guarantee that its final preferred arm is optimal. The authors explicitly exclude PAC-style objectives from their treatment.
The theorem also concerns a horizon under fixed positive gaps for inferior arms. Small gaps can enlarge the bound substantially. Logarithmic dependence on T should therefore not be interpreted as an unconditional promise that a finite application will incur little loss.
Setup-derived: the specified updates matter
Beta(1, 1) is part of the analyzed initialization. The paper discusses prior mismatch as unfinished work, so its result should not be extended automatically to arbitrary starting distributions.
For general bounded rewards, the theorem relies on the extra binary trial. An alternative update that adds fractional rewards directly to parameters is a different process unless an appropriate equivalence is established.
The mean-preserving construction also discards information from each real-valued observation. That does not invalidate the reduction, but it limits what the reduction claims. It preserves what the proof needs, instead of every property of the reward sequence.
These distinctions matter when implementing a method under the same name. A familiar label does not remove the need to check whether initialization, observation timing, and update rules match the analyzed procedure.
Evidential limits: theory does not replace measurement
The paper does not supply new application measurements. It cannot establish a practical speedup, a numerical improvement in observed regret, or superior performance on a particular benchmark.
Its comparisons with prior experimental findings and with earlier theoretical results have different evidential roles. The experiments motivate interest; the theorem explains a property under stated assumptions.
Conversely, the weaker general upper bound does not demonstrate poorer practical behavior than UCB1. It states what this argument guarantees. The authors themselves connect the remaining gap to conservative analytical steps.
The main presentation assumes an optimal arm labeled 1 and treats a unique optimum. Appendix A supplies the authors’ argument for extending the discussion to multiple optimal arms. That treatment should remain attached to its stated setting, rather than becoming a broader claim that arbitrary additions to an action set improve regret.
What came after
The later citing works identify several directions in which this analysis remained relevant. Their bibliographic descriptions support the citation relationship and the subjects named in their titles. They do not specify exactly which algorithmic component or theorem each later work uses.
Weight Uncertainty in Neural Networks, published in 2015, connects the citation trail to uncertainty about network weights. The central concern named by its title differs from the finite collection of scalar arm means analyzed by Agrawal and Goyal. Its citation establishes a relationship to this research, but does not establish that the same regret guarantee applies to weight uncertainty or that the waiting-time proof is reused.
LLM Prompt Duel Optimizer: Efficient Label-Free Prompt Optimization, from 2026, places the later connection in prompt optimization. Its title identifies efficiency and label-free comparison as concerns. The available account does not describe its reward process, its treatment of uncertainty, or its experimental findings. It would therefore be unwarranted to identify it as an implementation of the precise beta-count procedure or as a direct application of these bounds.
MAB-DQA: Addressing Query Aspect Importance in Document Question Answering with Multi-Armed Bandits, also from 2026, explicitly brings bandit selection into question answering. The stated application concerns the importance of different query aspects in document questions. That identifies a later use of the bandit framework, while leaving the detailed relationship to Thompson sampling unspecified.
Across these directions, the transferable contribution is the possibility of analyzing randomized uncertainty-driven decisions without assuming that favorable practical behavior is self-explanatory. Agrawal and Goyal show how concentration, recovery intervals, and unfinished exploration fit together in a finite-time argument. A later application can borrow that perspective, but its own observation process determines whether the original assumptions survive. Where rewards change, feedback arrives late, or actions interact, the mathematical connection requires further work.
Cite
Cite as Shipra Agrawal and Navin Goyal. 2011. Analysis of Thompson Sampling for the multi-armed bandit problem. arXiv (Cornell University).
@misc{agrawal2011analysis,
title = {{Analysis of Thompson Sampling for the multi-armed bandit problem}},
author = {Shipra Agrawal and Navin Goyal},
year = {2011},
doi = {10.48550/arxiv.1111.1797},
eprint = {1111.1797},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.1111.1797}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/agrawal-2011-analysis-thompson-sampling-multi-armed/