The Exp3 and Exp3-IX Algorithms
Adversarial (assumption-free) finite-armed bandits. Why models, and when to drop stochasticity; why randomization is necessary (deterministic policies suffer n(1−1/k)); the adversarial protocol, regret against the best fixed arm, and the reduction showing adversarial regret bounds stochastic regret (so the minimax regret is at least c√(nk)). Importance-weighted estimators (reward-based and loss-based), unbiasedness, the 1/P variance blow-up, and why every unbiased estimator is importance-weighted. Exp3 (exponential weights on loss-based estimates), the telescoping-potential proof of 2√(nk log k) and the sharper √(2nk log k), and its heavy-tailed regret distribution. Exp3-IX: implicit exploration by adding γ to the denominator, a bias–variance trade, a concentration lemma exploiting negatively correlated estimates, and high-probability regret O(√(nk log(k/δ))). Notes on Hedge, oblivious versus reactive adversaries, policy regret, non-stationarity, first-order and quadratic-variation bounds, Exp3.P, the Gumbel trick and follow-the-perturbed-leader.
Corresponds to Lattimore & Szepesvári, Part III introduction and Chapters 11–12.
Motivation: all models are wrong
IntuitionWhat a bandit model is for
“All models are wrong, but some are useful” (Box). The stochastic model (each arm’s rewards drawn i.i.d. from a fixed distribution) is almost never literally true. The authors’ view: a bandit model exists to predict how algorithms will perform on the problems you will actually face. It can fail in two opposite ways:
| Failure | Effect |
|---|---|
| Too specific | Assumptions detached from reality. Predicted and real performance can diverge catastrophically. |
| Too general | Algorithms become over-cautious and leave performance on the table. |
This is the bias–variance trade-off at the level of modelling. A correct specialized model gives better algorithms; a wrong one can be disastrous.
ImportantWhich stochastic assumptions actually matter
The critical one is that each arm’s mean doesn’t drift over time. That arms have fixed, independent distributions matters much less. Bandits with drifting means are non-stationary (Chapter 31).
DefinitionThe adversarial bandit (informal)
Drop almost every assumption about how rewards are generated. The environment, now called the adversary, may even read the algorithm’s code before choosing rewards. The only thing kept is the objective: compete with the best fixed action in hindsight.
ExampleRandomization is the only defence
One round, two arms. You announce a strategy; your friend secretly picks ; you play and suffer regret .
- Deterministic (): she sets , , and your regret is 1.
- Randomized (fair coin): her best reply is , and your expected regret is .
With one round you can’t do better. Over many rounds the adversary’s relative advantage shrinks, to out of .
Adversarial bandit environments
Definition-armed adversarial bandit
An arbitrary sequence of reward vectors with , fixed in advance (an oblivious adversary).
flowchart LR A["Adversary secretly fixes x_1 ... x_n in [0,1]^k"] --> R["Round t"] R --> P["Learner picks a distribution P_t over arms"] P --> S["Sample A_t from P_t"] S --> O["Observe only X_t = x_t,A_t"] O --> R
DefinitionPolicy and regret
A policy is any map from histories to distributions over arms. No measurability is needed: actions are discrete and rewards are deterministic. The regret is
where the only randomness is the learner’s own. The worst-case regret is , and the minimax regret is .
| Component | Detail |
|---|---|
| Signature | |
| Benchmark | The best single arm over the whole game, chosen in hindsight. |
| Randomness | Only the learner’s sampling, since is fixed. |
| Not | The best arm in each round (see the tracking-regret warning below). |
TheoremDeterministic policies have linear regret (Exercise 11.2)
For every deterministic policy there is an with .
ProofThe adversary simulates you and zeroes out your choice
A deterministic policy’s action at time is a function of past rewards, which the adversary can compute in advance. Set and for . The learner earns 0. Each round contributes to , so some arm earns at least , and that is the regret.
∎
RemarkUCB and ETC are deterministic
All the algorithms of explore-then-commit-and-ucb-algorithms are deterministic, so all of them suffer linear regret against some adversary. In game-theoretic terms, this is a zero-sum game in which the learner moves first, and moving first without randomizing means being exploited.
WarningCompeting with the best arm in each round is hopeless (Exercise 11.4)
The “tracking” regret is at least for every policy, randomized or not. Make one uniformly random arm pay 1 each round, independently of the learner. The learner finds it with probability , while the per-round maximum is always 1. The benchmark must be a fixed arm.
Relation to stochastic bandits
TheoremAdversarial regret bounds stochastic regret
Let be a stochastic bandit with rewards in , and use the random-table model (, all independent). For any adversarial policy ,
The middle step is Jensen’s inequality, since the maximum is convex (Exercise 11.3).
ImportantConsequences, in both directions
- Adversarial ⇒ stochastic: a policy with small worst-case adversarial regret has small worst-case stochastic regret on -bounded bandits. It may still be far from the best instance-dependent stochastic performance.
- Stochastic lower bounds ⇒ adversarial lower bounds: stochastic Bernoulli bandits force regret at least (lower-bounds-for-finite-armed-bandits, Exercise 15.4), so .
The adversarial problem is not much harder than the stochastic one in the worst case.
WarningReductions need their assumptions checked
The argument relies on bounded support. “Adversarial algorithms work on stochastic problems” is not a general law; the linear case (Chapter 29) has real subtleties.
NoteMeasurability
Stochastic regret needs policies that are probability kernels (canonical model). The lower-bound transfer is safe because Bernoulli instances have finitely many reward sequences. For infinite action sets, the policy must be measurable in the past actions.
Importance-weighted estimators
The problem. Only the chosen arm’s reward is observed. To rank arms we need estimates of every arm’s reward each round.
DefinitionImportance-weighted estimator (reward-based)
With ,
TheoremUnbiased, with variance proportional to
With the conditional expectation given the first rounds,
ProofThe indicator has conditional mean , and is known
Write , so . Since is determined by the past and ,
Subtract .
∎
IntuitionUnbiased by rare jackpots
Most rounds arm isn’t played, and its estimate is 0. When it is played, its reward is inflated by . On average it comes out right, but an arm played with probability produces estimates of size up to . Variance about is the central difficulty of adversarial bandits.
DefinitionLoss-based importance-weighted estimator
In terms of losses , and , this is just : the same formula applied to losses. It is also unbiased, with .
| Reward-based (11.3) | Loss-based (11.6) | |
|---|---|---|
| Values | ||
| Variance | ||
| Better when | rewards are small | rewards are large (losses small) |
| Dangerous surprise | positive (small , large ): pushes all other arms’ probabilities toward 0 | negative (small , small ): pushes the played arm toward 0 |
ImportantThe one-sided range is what Exp3 needs
The loss-based estimate is bounded above by 1. The Exp3 proof uses , which only holds for . That one-sided bound is why Exp3 uses (11.6), and it is also why dangerously small probabilities are more frequent with the reward-based estimator.
RemarkCentring and uniqueness
Subtracting any constant before importance weighting and adding it back keeps the estimator unbiased and gives the lowest variance for rewards near , but the best depends on what is being estimated. Every unbiased estimator of from a single sample has the form with (Exercise 11.5). There is no unbiased alternative to importance weighting.
The Exp3 algorithm
DefinitionExponential weighting
With the estimated cumulative reward and learning rate ,
This is a softmax of estimated cumulative rewards.
| Learning rate | Behaviour |
|---|---|
| Large | concentrates on the estimated leader: aggressive exploitation, but poor arms get tiny probabilities and their estimates explode in variance. |
| Small | stays near uniform: steady exploration, slow to exploit. |
AlgorithmExp3 — “exponential-weight algorithm for exploration and exploitation” (Algorithm 9)
Input . Set . For :
- compute by (11.7);
- sample and observe ;
- update for every arm.
NoteSampling in practice (Exercise 11.1)
With one uniform , return the smallest with . This is the inverse CDF on cumulative sums. Floating-point non-uniformity can matter in practice.
Regret analysis
TheoremTheorem 11.1 — Exp3’s regret
For any , Exp3 with has
ProofA telescoping potential, two exponential inequalities, and a variance bound
Fix an arm and let . It is enough to bound for every .
Step 1: Express the regret through estimates. Unbiasedness gives and . By the tower rule,
Step 2: The potential. Let , with . Then
Step 3: Bound each ratio. Since (the loss-based estimate is at most 1), use for and then :
Step 4: Telescope and take logs.
Step 5: The variance term. With ,
Step 6: Tune. at .
∎
IntuitionTwo error sources balanced by
is the cost of starting uncommitted (uniform over arms). is the cost of reacting to noisy estimates, where importance weighting makes each round contribute variance of order . Optimizing balances them at .
RemarkWhere the potential argument comes from
It starts from the trivial soft-max inequality and telescopes . This is the same potential that drives Kelly-style and universal portfolio mixtures: exponential weights are a wealth-weighted mixture over experts.
TheoremTheorem 11.2 — A improvement
With , Exp3 has .
ProofUse the second-order Taylor bound on its valid side
The key inequality: holds for , but not for . Since , write , whose exponent is :
Summing with weights and using : .
The variance term: with , . So
and . Tune .
∎
NoteComparing the exponential bounds on
is a lower bound everywhere. is an upper bound for , but loose. is a much tighter upper bound, but only valid for . Shifting by moves the estimates into the region where the tight bound applies.
Notes on Exp3
WarningSmall expected regret, terrible regret distribution (Exercise 11.6)
Define the random regret . For any reasonable learning rate and large , there is a two-armed bandit with . Construction, in losses:
In the first half, arm 2’s probability can be driven to about . When arm 2 becomes the good arm, Exp3 can’t recover in time.
Why Markov’s inequality doesn’t contradict this: the bound needs . But the random regret is often negative: Exp3 frequently beats the best fixed arm on this sequence, since it switches arms when the losses switch. Large positive and large negative outcomes average to a small mean. The book’s box plots show exactly this spread.
RemarkVariants and extensions
- Full information (prediction with expert advice): the whole is observed, so true rewards replace estimates. That is Hedge (exponential weights), with regret via Hoeffding’s lemma, asymptotically optimal. Bandit feedback costs a factor of about .
- Reactive adversaries: if may depend on the learner’s past actions, the same bound holds with the same proof. Whether regret against a fixed arm is a meaningful goal then is another question.
- Policy regret is impossible: if , even against constant action sequences, take versus . The first action decides everything, and one of the two environments forces linear regret. Limited adversary memory restores sublinear regret.
- Not a model of non-stationarity: “best fixed arm in hindsight” has stationarity built in. When the best arm changes, compete with sequences of actions instead (Chapter 31).
- Removing : a mirror-descent variant (the Tsallis-INF family, Chapter 28) gets . With learning rate it also gets regret on stochastic bandits (Zimmert–Seldin 2019), “best of both worlds”, with subtleties for non-oblivious adversaries.
- Non-uniform prior : favouring an arm lowers regret if it is optimal, at an unavoidable price if not.
- Anytime: use the doubling trick, or more elegantly a decreasing (Exercise 28.13).
- Unbounded rewards: only much weaker results are possible (Allenberg et al. 2006).
- History: Auer et al. (1995) introduced Exp3 with explicit uniform exploration mixed in; Stoltz (2005) observed it isn’t needed.
TheoremExp3 is follow-the-perturbed-leader with Gumbel noise (Exercises 11.7–11.8)
Gumbel trick: if with i.i.d. uniform, then . So
samples exactly from Exp3’s distribution. Exponential weights = argmax of perturbed scores, which gives a sampling-free implementation and a bridge to other perturbation-based algorithms.
ExampleExp3 on a stochastic bandit (Exercise 11.9)
Bernoulli arms with and . Exp3’s regret depends strongly on and is generally far worse than UCB or KL-UCB, which exploit the stochastic structure. Worst-case adversarial guarantees cost instance-dependent performance.
The Exp3-IX algorithm
The problem. Exp3’s expected regret is near-optimal, but its regret can be linear with constant probability. The culprit is the importance-weighted estimate’s variance of order . The goal is a high-probability bound: with probability at least , .
Setup (losses throughout). is the observed loss, the learner’s total loss, arm ‘s total loss, and with any estimates , and . The random regret against arm is .
FormulaThe deterministic part of Exp3’s analysis
For any estimates with , (11.15) in loss form is
so
A high-probability bound needs each of these to be controlled with high probability.
DefinitionImplicit-exploration (IX) estimator
For a small ,
It still satisfies , so (12.3) applies.
IntuitionBias buys variance, and the bias points the helpful way
. Losses are underestimated, i.e. the estimator is optimistic, and the optimism is largest for rarely played arms (small ). So poorly performing arms keep getting occasional plays. Exp3-IX explores more than Exp3 without ever mixing in a uniform distribution. Hence “implicit exploration”: the exploration comes from modified estimates, not from altering directly.
AlgorithmExp3-IX — Algorithm 10
Input . Set . For :
- ;
- sample and observe ;
- .
Regret analysis
TheoremTheorem 12.1 — High-probability regret of Exp3-IX
Let , , and
- With , which doesn’t depend on :
- With , tuned to :
ImportantOne algorithm for all , or a better bound for one
gives a single algorithm that is good at every confidence level, with entering linearly times . gives the better , but only for the chosen in advance. Chapter 17 shows this trade-off is unavoidable.
LemmaLemma 12.2 — Concentration for negatively correlated estimates
Let be adapted for each , with
- for every with (negative correlation), and
- .
Let be predictable with . Then for all ,
LemmaLemma 12.5 — A discounted exponential is linear-bounded
For : .
ProofMonotone in λ, then a log inequality
. The first step holds because the expression decreases in and . The second is for : equality at 0, and the left side’s derivative is smaller.
∎
ProofProof of Lemma 12.2: a supermartingale and Markov
Step 1: One round. By Lemma 12.5, . Multiply over and expand the product:
The cross terms of the product have nonpositive conditional expectation by negative correlation, which saves a factor of . The last step is .
Step 2: A supermartingale. Let and . Step 1 gives , so .
Step 3: Markov. . This is the Cramér–Chernoff method in martingale form (cf. Exercise 5.15).
∎
LemmaLemma 12.3 — The loss estimates don’t overshoot by much
With probability at least , simultaneously
ProofFit the IX estimator into Lemma 12.2
Write
and take , , . Only one arm is played per round, so for (negatively correlated), and . Lemma 12.2 gives the sum bound with probability . For a single arm, use . Then union bound the events with .
∎
LemmaLemma 12.4 — The bias is exactly γ times the total estimate
ProofOne line per round
. Sum over .
∎
ProofProof of Theorem 12.1
By (12.3) and Lemma 12.4,
On the event of Lemma 12.3, , so
Substitute and .
∎
ImportantTwo lessons from the analysis
- One-sided concentration is cheap because the estimator is biased downward. by enough that the upward deviation can be bounded with no dependence on , at scale (the largest possible summand). The price is rather than .
- Negative correlation replaces independence. For a fixed round, the indicators are negatively correlated, since exactly one is 1, so the sum over arms concentrates without a union bound over .
A Bernstein-type martingale inequality also works, losing only a factor of 2: with probability (Exercise 12.1). It is arguably more transparent.
Notes on Exp3-IX
RemarkExpected regret, anytime versions, and refined bounds
- Expected regret: integrate the tail, , which gives (Exercise 12.7).
- Anytime: , give about the same regret (Kocák et al. 2014; Neu 2015).
- First-order bounds: when the best arm has small total loss, , which can be far below (Exercise 28.14).
- Quadratic-variation bounds: with , Hazan–Kale get . Mirror descent removes the (Chapter 28).
AlgorithmExp3.P — explicit exploration plus biased estimates (Exercises 12.3–12.4)
Use (deliberately biased downward) and mix in uniform exploration:
With and tuned, with probability (Auer et al. 2002). This approach generalizes to settings where loss estimates can be negative, which arises in more complex feedback models. The generic analysis needs only , , and unbiasedness of .
ExampleExperiments (Exercises 12.5–12.6)
- Stochastic Bernoulli arms (, , one arm , the rest ): compare Exp3 and Exp3-IX expected regret across .
- Rerunning the instability example: Exp3-IX’s regret distribution no longer has the catastrophic positive tail. In the book’s figure, its regret on that switching sequence sits well below zero across the range. Implicit exploration keeps the eventually-good arm alive.
RemarkHistory
Exp3-IX and the IX estimator are due to Kocák et al. (2014), originally for large action sets with side information. Its high-probability property is from Neu (2015). Earlier variance-reduction ideas truncated the weights, which makes estimators non-smooth. High-probability adversarial bounds go back to Auer et al. (2002b) and Abernethy–Rakhlin (2009).
Quick reference
| Object | Statement | Note |
|---|---|---|
| Adversarial regret | best fixed arm in hindsight | |
| Deterministic policies | randomization is required | |
| Tracking regret | for every policy | the benchmark is too strong |
| Reduction | stochastic regret adversarial worst case | Jensen on the max |
| Minimax lower bound | from Bernoulli bandits | |
| IW estimator | unbiased; variance | |
| Loss-based IW | bounded above by 1 | |
| Exp3 | softmax of estimated cumulative reward | |
| Exp3 regret | , or with | potential telescopes |
| Key inequalities | ; (); () | |
| Exp3 instability | on some instance | random regret can be negative |
| Hedge (full information) | bandit feedback costs about | |
| Gumbel trick | Exp3 = perturbed leader | |
| IX estimator | optimistic bias, lower variance | |
| IX bias | exact identity | |
| Overshoot bound | negative-correlation lemma | |
| Exp3-IX | w.p. | : all ; : one |
Facts to keep to hand
- Against an adversary, randomize. Any deterministic policy can be simulated and defeated. The fair-coin trick in the one-round game becomes exponential weights over rounds.
- Adversarial is barely harder than stochastic in the worst case. Both minimax regrets are up to logs. Adversarial algorithms give up the instance-dependent behaviour that stochastic algorithms enjoy, unless best-of-both-worlds methods are used.
- Importance weighting is the only unbiased option, and it costs variance about . Exp3 controls the variance in expectation via , but not in the tails.
- Exp3’s analysis is a potential argument. Telescope , bound each ratio with a quadratic upper bound on (which needs a one-sided bounded estimator), and tune to balance against variance.
- Trade a little bias for a lot of concentration. Adding to the denominator (IX) makes losses optimistic, keeps every arm explored, and makes the estimates concentrate one-sidedly at scale . Negative correlation of the play indicators avoids paying for a union bound over arms.
References
- Lattimore & Szepesvári, Bandit Algorithms — Part III introduction; Chapters 11–12