Non-Stationary Bandits
Bandits whose environment changes over time, so regret is measured against a comparator that may switch arms. Standard adversarial regret becomes vacuous when losses shift. Tracking regret competes with the best action sequence that has at most m−1 switches. Exp4 over all switching sequences achieves Õ(√(nmk)), matching an Ω(√(nmk)) lower bound even for learners told the change points, but it is computationally infeasible. Mirror descent with negentropy restricted to the clipped simplex Pₖ₋₁ ∩ [α,1]ᵏ is efficient: the clipping prevents over-commitment and keeps every restart cost at most log(1/α), giving √(mnk log(nk/m)) + √(mnk); plain Exp3 has linear tracking regret. In stochastic bandits with abrupt changes, any policy with o(n) regret Rₙ on a stationary instance suffers n/(22Rₙ) on some two-change instance, so logarithmic stationary regret forces Ω(n/log n). Notes cover contextualising time, discounted and sliding-window UCB and their tuning problem, adaptive multi-scale algorithms, Brownian drift, total-variation budgets with (Vk log k)^{1/3}n^{2/3} rates, and history (Gittins, restless bandits, fixed share, Exp3.S).
Corresponds to Lattimore & Szepesvári, Chapter 31.
Motivation: the benchmark must move with the world
IntuitionWhy a fixed comparator fails
Standard regret compares with the best fixed arm in hindsight. When the environment changes, every fixed arm can be bad, so a small regret against them guarantees nothing. As the Exp3 notes warned, the adversarial framework is not a model of non-stationarity: its regret has stationarity built in. The fix is to enlarge the competitor class to sequences that are allowed to switch arms, and to ask for algorithms that track the best arm.
ExampleA vacuous guarantee
Two arms with losses and . Every fixed arm loses , so Exp3’s guarantee becomes . A coin flip achieves . Yet the sequence is perfectly regular: play arm 2, then arm 1, for total loss near 0, i.e. negative standard regret. A meaningful benchmark should demand this.
| Setting | Comparator | Best achievable | Key algorithm |
|---|---|---|---|
| Adversarial, at most switches | best switching sequence | Exp4 (statistics); clipped mirror descent (efficient) | |
| Stochastic, at most abrupt changes | per-round best arm | no gain over adversarial: stationary ⇒ | forgetting (discounting, sliding windows), adaptive multi-scale exploration |
| Stochastic, total variation | per-round best arm | Besbes et al.; adaptive variants |
Adversarial bandits
DefinitionSwitching sequences and tracking regret
Let be the action sequences with at most changes: . The non-stationary (tracking) regret is
is ordinary regret. In the example above, , so small tracking regret requires detecting the change quickly.
| Component | Detail |
|---|---|
| Competitor | the best piecewise-constant arm sequence with at most pieces |
| Parameter | , a budget on the comparator’s switches (the learner may switch freely) |
| Trade-off | larger means a more meaningful benchmark and more regret |
Exp4 over switching sequences
TheoremTracking regret via Exp4 (Exercise 31.1)
Make each sequence an expert recommending in round . Theorem 18.1 gives
using and , so . Choose the change points, then the arm in each piece.
TheoremLower bound (Exercise 31.2)
For , every policy has on some adversarial bandit. Run independent hard instances in sequence, each with horizon ; each costs (Chapter 15), for a total of .
ImportantNot knowing when changes happen costs almost nothing
The lower bound holds even for policies told the change points, and Exp4 matches it up to logs without that knowledge. The catch is computation: naive Exp4 is linear in , which is astronomically large.
Online stochastic mirror descent on the clipped simplex
WarningPlain Exp3 has linear tracking regret (Exercise 31.3)
In the two-arm example, after rounds in which arm 2 is better, arm 1’s probability is roughly , which is astronomically small at the standard learning rate. When the losses switch, Exp3 almost never samples arm 1, so it gets almost no evidence that arm 1 has improved and stays stuck: . Over-commitment prevents discovering change points.
AlgorithmExp3 restricted to the clipped simplex
Let with , the unnormalised negentropy, and uniform. Each round, sample , form , and update
via the two-step process: (exponential-weights step), then KL-project onto the clipped simplex. The projection floors small coordinates at and rescales the rest (Exercise 26.12).
TheoremTheorem 31.1 — Tracking regret of clipped mirror descent
With and :
ProofRestart the mirror descent analysis at each change point
Step 1: Split at the comparator’s switches. Let the optimal be constant (equal to ) on blocks , with and . Then .
Step 2: Pay for the clipping. , but the clipped point (weight on , elsewhere) loses at most per round, since . So each block costs at most .
Step 3: Mirror descent from an arbitrary start. By the general-start bound (28.11) and the Exp3 stability computation (Exercise 28.10), each block costs at most .
Step 4: Clipping bounds the restart cost. has every coordinate at least , so . Summing over the blocks gives the bound.
∎
IntuitionClipping as built-in forgetting
Without clipping, the “distance” from the current distribution to a newly optimal arm can grow without bound, which is Exp3’s failure. Flooring every probability at caps it at , so the algorithm can always restart cheaply at each change point. It pays per round for the forced exploration, and balances the two costs. This is the mirror-descent form of the fixed-share idea (Herbster–Warmuth 1998).
WarningNot knowing
With unknown, take and . The bound degrades by a factor of about , to . No adversarial algorithm achieving without knowing is known.
RemarkRelated algorithms
Exp3.S (Auer et al. 2002) is an efficient implementation of Exp4 over switching sequences, made tractable by a careful initialisation (György et al. 2019). Exp3.P, suitably tuned, also achieves Exp3.S-type bounds (Audibert–Bubeck 2010), presumably Exp3-IX too. György–Szepesvári (2016) made the clipping explicit and bounded regret by the cumulative change of loss vectors, which distinguishes abrupt from gradual change.
ExampleExperiment (Exercise 31.4)
With , and a single switch at : Exp3 and Exp3-IX react slowly at standard learning rates, while clipped mirror descent tracks the switch. Compare several learning rates for each.
Stochastic bandits
DefinitionPiecewise-stationary Gaussian bandit
Each arm has a mean function , and with i.i.d. . The regret is against the per-round optimum:
with the mean vector changing at most times: .
FormulaWith known change points
Restart UCB on each block. Concavity of () gives
with the smallest gap over all blocks: logarithmic and non-vacuous. In the adversarial case, not knowing the change points cost almost nothing. Does the same hold here? No.
TheoremTheorem 31.2 — Good stationary regret forces bad non-stationary regret
Let , , and stationary with . If a policy has , then for all large there is a non-stationary with at most two change points and gaps such that
ImportantConsequences
- on a stationary instance implies worst-case regret against two changes.
- on some non-trivial stationary instance implies minimax regret on non-stationary ones.
- So there is no hope of beating Exp4-type rates in the stochastic switching setting, even asymptotically. To guard against abrupt changes, a policy must keep re-checking suboptimal arms, which is incompatible with logarithmic regret.
ProofHide a change in the block where arm 2 is sampled least
Step 1: A neglected block. Split into equal blocks . By pigeonhole, some block has (31.5).
Step 2: The alternative. equals except that on , arm 2 gets with . This is two change points. With , , so arm 2 is optimal on by .
Step 3: Indistinguishable. Only arm-2 samples inside carry information, so by the divergence decomposition . By Bretagnolle–Huber, .
Step 4: Under this event is rare. By Markov and (31.5), .
Step 5: So under , arm 1 is overplayed in . Each such play costs at least :
Step 6: Translate. , so and , giving . Since , the term is negligible, and .
∎
IntuitionThe neglected block is where the trap is set
A low-regret stationary policy samples arm 2 rarely, so some stretch of time gets very few arm-2 samples. An adversary can secretly make arm 2 the best there, by just enough that those few samples can’t reveal it. The rarer the sampling (the smaller ), the longer the stretch and the larger the loss.
RemarkWhat stochasticity still buys
Adversarial algorithms can’t exploit distributional structure: Gaussian rewards are unbounded, and Bernoulli rewards have small variance near the boundary. And in the stochastic setting, algorithms that adapt to an unknown number of switches now exist (see Note 2 below). In the adversarial setting none is known.
Notes
RemarkMake it stationary with context (Note 1)
Gym ads do better in January than in July. A time-oblivious bandit sees this as non-stationary, but adding time of year to the context turns it into a stationary contextual bandit. Consider this before reaching for non-stationary algorithms.
AlgorithmForgetting: discounted UCB and sliding-window UCB (Note 2)
Discounted UCB with :
(in the book’s formula is a discounted sum; it should be normalised by to estimate a mean).
Sliding-window UCB with window : use only the last rounds, and , with bonus .
Tuning problem: no fixed or gives minimax regret. They are empirically useful when the stochastic assumption holds (Kocsis–Szepesvári 2006; analysed by Garivier–Moulines 2011). Extensions exist for linear bandits and MDPs.
RemarkAdapting to unknown switches
Auer et al. (2018, 2019) and Chen et al. (2019) match optimally tuned adversarial rates, about , without knowing , in the stochastic setting (first for , then arms and contextual). The key idea is multi-scale explicit exploration: randomly scheduled checks of varying durations, so that changes of any size are detected at proportionate cost.
DefinitionSlow drift and variation budgets (Notes 3–4)
- Brownian drift: follows reflected Brownian motion. The best arm changes with constant probability each round, so regret is necessarily linear. The question becomes its slope in terms of volatility and interval size (Slivkins–Upfal 2008).
- Total variation: with and , some policy achieves This is nearly minimax optimal (Besbes et al. 2014), and achievable without knowing by the adaptive algorithms above.
DerivationThe variation-budget lower bound
Split into blocks. In each, all arms are equal except a randomly placed best arm, better by . Each block costs , for a total of . Each block switch moves the means by at most , so . Setting this equal to gives , and the regret .
RemarkHistory
Gittins index: each arm is a Markov chain that evolves only when played, treated as Bayesian optimisation (Chapter 35). Restless bandits (Whittle 1988): every chain evolves every round, but only the played arm is observed. This is hard, with few positive results and a challenging frequentist analysis (Ortner et al. 2012). The adversarial tracking ideas descend from fixed share (Herbster–Warmuth 1998, 2001). Contextual non-stationary bandits: Luo et al. (2018), Chen et al. (2019).
Quick reference
| Object | Statement | Note |
|---|---|---|
| Vacuous example | a fixed comparator is too weak | |
| Switching class | : at most changes | = ordinary regret |
| Tracking regret | ||
| Exp4 over sequences | infeasible to compute | |
| Lower bound | even with known change points | |
| Clipped MD | ||
| Tuned | ; unknown costs | |
| Plain Exp3 | over-commitment | |
| Known changes (stochastic) | restart UCB | |
| Garivier–Moulines | with two changes | stationary ⇒ |
| Forgetting | discounted / sliding-window UCB | no minimax-optimal tuning |
| Variation budget | adaptive versions exist |
Facts to keep to hand
- Non-stationarity needs a moving benchmark. Tracking regret against switching sequences restores meaning. Its price is : about , nearly the same as if the change points were known.
- Statistically, Exp4 solves it; computationally, clipping does. Mirror descent on a floored simplex keeps every arm at probability at least , so each restart costs at most . Plain Exp3 commits too hard and never notices changes.
- In stochastic switching environments, low stationary regret is a liability. A policy that samples a suboptimal arm only times leaves long stretches unchecked, where a hidden change costs . Guarding against change requires continual exploration.
- Forgetting is the stochastic toolkit, and the newest methods adapt. Discounting and sliding windows work in practice but can’t be tuned minimax. Multi-scale randomised exploration adapts to unknown switch counts and variation budgets. Sometimes the right move is to model the cause of change as context.
References
- Lattimore & Szepesvári, Bandit Algorithms — Chapter 31
- Garivier & Moulines, “On upper-confidence bound policies for switching bandit problems” (2011)
- Besbes, Gur & Zeevi, “Stochastic multi-armed-bandit problem with non-stationary rewards” (2014)