Concentration of Measure for Bandits
How fast a sample mean learns the true mean. Tail probabilities of the empirical mean; Markov and Chebyshev and why their 1/(nε²) decay is too slow; calibrating against the central limit theorem with the Gaussian tail bound, and why the CLT is asymptotic, unreliable for rare events, and fails for Bernoulli(1/n); the Cramér–Chernoff method, moment- and cumulant-generating functions, light and heavy tails; σ-subgaussian random variables, their Gaussian-like tails, closure under scaling and independent sums, and the deviation-form confidence bounds µ ≤ µ̂ + √(2σ²log(1/δ)/n); examples (Gaussian, bounded, exponential); and the results from the notes and exercises — Hoeffding's lemma and inequality, Bennett and Bernstein, large-deviation rate functions and the Bernoulli KL rate, the Bernoulli subgaussianity constant, χ² tails, the expected maximum of subgaussians, and the Bretagnolle–Huber–Carol inequality.
Corresponds to Lattimore & Szepesvári, Chapter 5.
Motivation: how long does it take to learn a mean?
The regret decomposition reduces every bandit analysis to one question: how many times must each arm be pulled before we can tell, with enough confidence, that it isn’t the best? That requires knowing how fast an empirical mean concentrates around its true mean, and not just on average but in the tails: how often the estimate is badly wrong.
IntuitionThe central question
After samples of an arm, how unlikely is it that the sample mean is off by more than , and how does that probability fall with and ? Bandit algorithms need answers that are finite-time (valid for this , not as ) and exponentially small (so that confidence intervals can be made very reliable cheaply).
flowchart TD M["Markov: mean only, decays like 1 over epsilon"] --> C["Chebyshev: variance, decays like 1 over n epsilon squared"] M --> CC["Cramér-Chernoff: Markov applied to exp of lambda X"] CC --> SG["Subgaussian: exp of minus n epsilon squared over 2 sigma squared"] SG --> H["Hoeffding: bounded variables"] CC --> B["Bennett and Bernstein: variance plus a one-sided bound"] CC --> LD["Large deviations: exact exponential rate"]
Tail probabilities
Setup. are i.i.d. with mean and variance .
DefinitionSample (empirical) mean
By linearity, : the sample mean is an unbiased estimator.
TheoremVariance of the average (Exercise 5.1)
ProofVariances of independent terms add
. Expanding the square, the cross terms vanish for by independence, leaving .
∎
IntuitionThe squared error shrinks like
The typical error is of order : halving it takes four times as many samples. But a mean squared error says little about how often the error is large, which is what decides whether a bandit algorithm discards a good arm.
DefinitionTail probabilities
As functions of :
- upper tail: (overestimate);
- lower tail: (underestimate);
- two-sided tail: .
| Component | Detail |
|---|---|
| Signature | , a function |
| Input | An error tolerance. |
| Output | The probability the estimate misses by at least that much, in that direction. |
| What we want | Explicit upper bounds valid for every finite . |
Markov and Chebyshev
TheoremLemma 5.1
For any random variable and :
- Markov: ;
- Chebyshev: .
NoteAlready covered
Proofs, the tight balls-in-buckets example, and Chebyshev confidence intervals are in concentration-inequalities-and-limit-theorems and concentration-inequalities-and-limit-theorems. Markov is “one of the golden hammers of probability theory”, and everything below is Markov applied to a cleverly chosen function of .
FormulaChebyshev for the sample mean
Combining (5.1) with Chebyshev:
It needs only a finite variance, which is its strength. Its weakness is the decay: only polynomial in , and very loose for well-behaved .
IntuitionHigher moments help, and the limit of that idea is the MGF
Applying Markov to for larger gives faster decay, provided those moments exist, and one could optimize over . Doing this optimization over a continuous parameter is the Cramér–Chernoff method.
Calibrating with the central limit theorem
What should we hope for? Let . With nothing beyond a finite variance, the CLT says converges in distribution to .
FormulaGaussian tail bound
For :
DerivationMultiply by
On , , so inserting it can only increase the integral. Then has antiderivative , which evaluates to . (The table gives exact values.)
FormulaThe CLT heuristic for the sample mean
It decays slightly faster than : the sample mean concentrates exponentially fast. This is the benchmark.
ExampleGaussian tail versus Chebyshev (Exercise 5.3)
Let . Chebyshev’s one-sided bound is , and the Gaussian is . Their ratio is , which is at most (maximized at ). So the Gaussian bound is always smaller.
- The improvement is dramatic for large , i.e. many samples or a coarse tolerance. At : Chebyshev , Gaussian about .
- Both bounds are trivial (at least 1) for small : Chebyshev for , the Gaussian bound for .
(Worked here; the book poses it as an exercise.)
WarningWhy the CLT can’t be used to design algorithms
- It’s asymptotic. It says nothing for any particular , and a bandit algorithm must act at every .
- "" is folklore. Take Bernoulli. As , Poisson (Poisson limit), which looks nothing like a Gaussian. (Exercise 5.6 explores this; there is no contradiction with the CLT because the distribution changes with .)
- The error rate is too coarse for small tails. Berry–Esseen: if , then (in the book’s normalization, which takes ). The rate is tight for that class, but it is vacuous when the tail probabilities themselves are smaller than , which is exactly the regime confidence bounds live in.
Finite-time exponential bounds need extra assumptions on the distribution.
The Cramér–Chernoff method and subgaussian random variables
DefinitionMoment- and cumulant-generating functions
| Component | Detail |
|---|---|
| Signature | |
| Domain | The where the expectation is finite: an interval containing 0 (Exercise 5.9). |
| Name | when 0 is interior, hence “moment-generating”. |
| Shape | is convex, and is convex ( is log-convex). by Jensen. |
DefinitionLight and heavy tails
is heavy tailed if for all , and light tailed otherwise.
Example: for Exponential(1), for . The MGF exists only on , which is light tailed but not globally finite.
AlgorithmThe Cramér–Chernoff method
For any , exponentiating preserves the event, and Markov does the rest:
Then optimize : .
IntuitionMarkov on the right function
Markov is weak because decays slowly. Applying it to turns a polynomial bound into an exponential one. The free parameter trades how much the exponential amplifies the tail against how large the MGF is.
DefinitionSubgaussian random variable (Def. 5.2)
is -subgaussian if for all ,
| Component | Detail |
|---|---|
| Parameter | , the “variance proxy” scale. |
| Benchmark | has exactly, so it is -subgaussian with equality. |
| Meaning | The MGF is dominated everywhere by a centred Gaussian’s. |
| Not centred? | Convention: say is -subgaussian when the noise is. Subgaussianity is a property of a variable and its law, so the terminology is doubly abused. |
TheoremTheorem 5.3 — Subgaussian tails
If is -subgaussian, then for all ,
ProofCramér–Chernoff with the subgaussian bound
For :
The exponent is a parabola in , minimized at , where it equals .
∎
FormulaTwo-sided and deviation forms
is also -subgaussian, so the lower tail obeys the same bound, and by the union bound . Solving for :
With overwhelming probability, lies in .
LemmaLemma 5.4 — Calculus of subgaussians
If is -subgaussian, and are independent and -, -subgaussian:
- and ;
- is -subgaussian;
- is -subgaussian.
ProofTaylor expansion, substitution, and factorized MGFs
1. Expand both sides for small : . Dividing by and letting gives and , so . Then dividing by gives .
2. .
3. By independence, .
(Exercise 5.7.)
∎
RemarkWithout independence (Exercise 5.8)
For dependent , the sum is still -subgaussian (via Hölder’s inequality), so the scales add linearly instead of in quadrature.
The sample mean
CorollaryCorollary 5.5 — Subgaussian concentration of the sample mean
If the are independent and -subgaussian, then for all ,
ProofAverage, then apply Theorem 5.3
By Lemma 5.4 parts 2 and 3, is -subgaussian. Apply (5.5) with in place of .
∎
FormulaConfidence bounds (deviation form)
For any , each of the following holds with probability at least :
A union bound gives a two-sided interval with .
ImportantThis is the formula behind UCB
(5.6) is an upper confidence bound on an arm’s mean from pulls. Its width shrinks like and grows only like as the required reliability increases. Algorithms built on it are in explore-then-commit-and-ucb-algorithms.
ExampleWhy instead of matters
Two-sided confidence-interval half-widths, in units of :
| Chebyshev, | Subgaussian, | |
|---|---|---|
| 3.2 | 2.4 | |
| 31.6 | 3.9 | |
| 1000 | 5.4 |
Bandit algorithms take union bounds over many arms and rounds, so they need tiny . Chebyshev intervals would explode. (Numbers computed here.)
RemarkChebyshev versus Chernoff once more
Since for , the subgaussian bound beats Chebyshev except when is very small, and is exponentially smaller once .
Which variables are subgaussian
ExampleExample 5.6
| Random variable | Subgaussian? |
|---|---|
| -subgaussian | |
| mean zero, a.s. | -subgaussian |
| mean zero, a.s. | -subgaussian (Hoeffding’s lemma) |
| Bernoulli (centred) | -subgaussian for every |
| Exponential (any rate) | not subgaussian for any |
| not subgaussian (but Chernoff still works) |
WarningSubgaussian is a real restriction
Exponential, , Poisson-type and heavier tails are not subgaussian. The broader classes subexponential and subgamma cover such tails with weaker MGF conditions. Standard bandit analyses assume subgaussian rewards (Bernoulli, bounded, or Gaussian noise).
Refinements and companions (Notes and Exercises)
Converse: Gaussian tails imply subgaussianity, with slack
TheoremTails to MGF
If and for all , then is -subgaussian.
ProofExpand the MGF, bound each moment by a tail integral
The linear term vanishes because . Each moment is written as a tail integral, the assumed tail bound is plugged in, and the sum is evaluated (the book uses Mathematica, getting an error-function expression).
∎
ExampleSome slack is unavoidable (Exercise 5.4)
The density has exactly Gaussian tails, , yet is not -subgaussian for any , so the best constant is , not 1. Tail behaviour and MGF behaviour match only up to constants.
RemarkBeating the subgaussian bound
For Gaussians, (5.4) is slightly sharper than by the polynomial prefactor. Talagrand (1995) showed similar refinements hold for bounded random variables.
Hoeffding
TheoremHoeffding’s lemma
If and a.s., then , i.e. is -subgaussian.
ProofTaylor with remainder, plus a tilted distribution (Exercise 5.11 hint)
Step 1: by Taylor, for some between 0 and . Here and .
Step 2: Tilt. Define . Then is the variance of .
Step 3: , and any variable supported on an interval of length has variance at most . So .
∎
TheoremHoeffding’s inequality
If are independent with a.s., then
For -valued rewards this is , i.e. in Corollary 5.5.
ProofLemma, then subgaussian calculus
Each centred is -subgaussian. The average is subgaussian with , and is the claim.
∎
Bennett and Bernstein: use the variance
IntuitionHoeffding ignores the variance
A -valued arm with mean has variance about , far below Hoeffding’s worst case of . Bounds that use the actual variance can be much tighter for such low-variance arms.
TheoremBennett and Bernstein (Exercise 5.14)
Let be independent with a.s., , , and . Then
The first form is Bennett, the second Bernstein. In deviation form, with probability at least ,
IntuitionTwo regimes
For small deviations the variance term dominates, which is Gaussian-like with the true variance. For large deviations the range term dominates, which is Poisson-like.
RemarkMartingale versions
Bennett’s bound holds for adapted sequences with conditional means, with the variance replaced by the predictable variation , on the event . Exercise 5.15 gives a related version with a free parameter :
must be fixed in advance (choosing it from the data would make it random). Fixing that takes union bounds or the method of mixtures (Chapter 20). Empirical-variance versions also exist (Audibert et al.; Maurer–Pontil).
Large deviations: the exact exponential rate
TheoremChernoff bound with the rate function (Exercise 5.10)
For i.i.d. zero-mean whose MGF is finite everywhere,
and this becomes an equality as (Cramér’s theorem). Here is the Legendre transform (convex conjugate, Fenchel dual, Cramér transform, rate function) of .
| Distribution (centred) | Rate function |
|---|---|
| Rademacher, | for ; otherwise |
| Bernoulli, centred | for ; otherwise |
where is the relative entropy between Bernoulli and Bernoulli.
IntuitionThe rate of a Bernoulli deviation is a KL divergence
The chance that a -coin looks like a -coin over flips is about . The cost of being fooled is exactly how distinguishable the two coins are. KL divergence reappears later in bandit lower bounds and in KL-UCB.
WarningThe CLT gets large deviations wrong
- Scales. The CLT describes deviating at scale . Large deviation theory describes deviations at scale (). Pretending the CLT applies there predicts rate , which is generally wrong: the true rate is .
- Moderate deviations, at scale with , are where “ruthless” use of the Gaussian formula happens to give correct answers.
ExampleHow wrong for a Bernoulli arm (Exercise 5.13)
Take , , and ask for the smallest with as . The required is about , so the ratio of sample sizes is the inverse ratio of rates:
The Gaussian approximation underestimates the samples needed by about 25%. The upper tail of a low-mean Bernoulli is heavier than the matching Gaussian’s, even though the CLT holds. (Worked here.)
Smaller constants for Bernoulli
TheoremBernoulli subgaussianity constant (Exercise 5.12; Kearns–Saul)
Bernoulli is -subgaussian for every , and its best constant is
with by taking the limit. is larger than the standard deviation away from ; for small it shrinks only like . For the one-sided upper tail with , the variance itself suffices: for (MGF of the centred variable).
: Chernoff without a global MGF
ExampleTail of a variable
with i.i.d. standard Gaussian has for only. Chernoff over with the optimal gives
which is essentially tight (Laurent–Massart). Cramér–Chernoff works whenever the MGF exists on some interval .
Maxima and categorical distributions
TheoremExpected maximum of subgaussians (Exercise 5.18)
If are -subgaussian, possibly dependent, and , then
ProofJensen, then bound the max by the sum
For : . So ; choose . The tail bound is a union bound over the applications of (5.5). (Proof filled in from the hint.)
∎
IntuitionMany draws, only growth
The largest of subgaussian noise terms is of size . This is why union bounds over arms or rounds cost only a factor in confidence widths.
TheoremBretagnolle–Huber–Carol (Exercise 5.17)
For i.i.d. on , with true pmf and empirical pmf ,
Proof idea: . Each inner product is an average of bounded terms, and a union bound over the sign vectors produces the .
NoteTwo more exercises
5.16: if on (stochastically at least uniform), then . This is a Chernoff bound for a sum of exponentials, used for p-values. 5.19: a tight bound on when a.s., with Bernoulli variables as the worst case.
Quick reference
| Object | Statement | Note |
|---|---|---|
| Sample mean variance | error of order | |
| Chebyshev | variance only, polynomial | |
| Gaussian tail | the CLT benchmark | |
| Berry–Esseen | CDF error | useless for tiny tails |
| Cramér–Chernoff | Markov on | |
| Subgaussian | Gaussian-dominated MGF | |
| Subgaussian tail | ||
| Calculus | mean 0, ; : ; independent sum: | dependent sum: |
| Sample mean | is -subgaussian | |
| Confidence bound | w.p. | the UCB width |
| Hoeffding | ⇒ -subgaussian; tail | : |
| Bernstein | uses the true variance | |
| Rate function | Bernoulli: KL | |
| MGF only on | ||
| Expected maximum | holds under dependence | |
| Bretagnolle–Huber–Carol | categorical |
Facts to keep to hand
- Every bound here is Markov’s inequality in disguise. Chebyshev applies it to ; Cramér–Chernoff applies it to and optimizes . The more of the distribution the function captures, the faster the decay.
- Subgaussian means Gaussian-quality tails without being Gaussian. It is preserved by scaling and independent sums, so sample means of subgaussian rewards concentrate like at every finite . Bounded rewards are subgaussian (Hoeffding); exponential and are not.
- The confidence width is . Reliability costs only , which is what makes union bounds over arms and rounds affordable, and is the core of UCB.
- The CLT is the wrong tool for algorithms. It is asymptotic, its error is even when tails are far smaller, and at large-deviation scales its rate is wrong. The right rate is a Legendre transform, which for Bernoulli rewards is a KL divergence.
- Use the variance when it’s small. Bennett and Bernstein add a range term but replace the worst-case scale with the true variance, which pays off for low-variance arms.
References
- Lattimore & Szepesvári, Bandit Algorithms — Chapter 5
- Boucheron, Lugosi & Massart, Concentration Inequalities (2013) — recommended further reading and exercises
Mentioned in
- Bayesian Bandits
- Block Cipher Constructions and Pseudorandom Objects
- Confidence Bounds and Optimal Design for Least Squares Estimators
- Convex Analysis for Bandits
- Explore-Then-Commit and the Upper Confidence Bound Algorithms
- Markov Decision Processes — From Bandits to Reinforcement Learning
- Pseudorandomness — Expander Chernoff and ε-Biased Distributions
- Pure Exploration and Best-Arm Identification
- Stochastic Processes, Markov Chains, and Stochastic Bandits
- The Exp3 and Exp3-IX Algorithms