Stochastic Linear Bandits
Bandits where each action is a feature vector and the mean reward is linear in an unknown parameter. Stochastic contextual bandits with feature maps (and why unstructured contexts are hopeless); the stochastic linear bandit model and its special cases (finite-armed, contextual, combinatorial); LinUCB/OFUL — optimism over an ellipsoidal confidence set around the regularised least-squares estimate; the elliptical potential lemma and the O(d√n log n) regret bound; computation (the bonus form ⟨θ̂,a⟩ + √β‖a‖_{V⁻¹}, Sherman–Morrison, rarely-switching updates); kernels, generalised linear models, spectral bandits and Lipschitz contexts. Fixed finite action sets: phased elimination with G-optimal (Kiefer–Wolfowitz) exploration and O(√(dn log(nk))) regret, changing finite action sets, and misspecification. Sparse parameters: selective explore-then-commit on the hypercube with O(‖θ‖₀√(n log n)) regret, and online-to-confidence-set conversion turning a sparse online regression algorithm into OLR-UCB with O(√(dnm₀) log n) regret.
Corresponds to Lattimore & Szepesvári, Chapters 19, 22 and 23. The statistical machinery (confidence ellipsoids from the method of mixtures, and optimal experimental design) is in confidence-bounds-and-optimal-design-for-least-squares.
Motivation: learning transfers across actions
IntuitionThe central idea
With unrelated arms, every arm must be learned separately, which costs . If every action is described by a feature vector and the mean reward is , then every pull teaches something about every action, because each pull is a noisy measurement of . The difficulty of the problem becomes the dimension , not the number of actions, which can be enormous or infinite.
| Chapter | Setting | Algorithm | Regret |
|---|---|---|---|
| 19 | Arbitrary bounded action sets, possibly changing | LinUCB / OFUL | |
| 22 | Fixed finite action set, | Phased elimination + G-optimal design | |
| 23 | Sparse , | SETC (hypercube); OLR-UCB (general) | ; |
Stochastic contextual bandits
DefinitionStochastic contextual bandit
In round the learner observes a context , chooses , and receives
where is the reward function and the noise is conditionally 1-subgaussian: a.s., with the information just before is seen. Hence .
RemarkConditioning on more is harmless
If the noise is subgaussian given a larger σ-algebra , the tower rule gives subgaussianity given . So the condition can be checked with respect to anything that contains the learner’s information.
DefinitionContextual regret
The benchmark action is random, through .
WarningMeaningful only if actions don’t steer future contexts
No restriction is placed on how contexts arise. If a “suboptimal” action now could lead to better contexts later, this regret undervalues it. The definition makes sense when the learner’s actions don’t (greatly) affect subsequent contexts.
WarningUnstructured contexts are hopeless
Estimating separately for every pair costs in the worst case with contexts, since knowing need not reveal anything about . With like , that is useless. Real contexts are structured: varies smoothly with its arguments. Compare the expert-advice view.
DefinitionFeature map and linear reward
Given a known feature map and unknown ,
The span of is the feature space.
| Component | Detail |
|---|---|
| Signature | |
| Examples | indicators of (visitor category, book category) combinations; the last hidden layer of a neural network trained on historical data |
| Smoothness | Hölder: (dual norm) |
| Infinite | Norm bounds on play the role of finite dimension, which makes linearity far less restrictive (kernels) |
The stochastic linear bandit
DefinitionStochastic linear bandit
In round the learner receives a decision set , chooses , and observes
with conditionally 1-subgaussian given the history, and . Only the feature vector matters, not the identity of the action.
| Choice of | Recovers |
|---|---|
| The finite-armed bandit with | |
| The contextual linear bandit | |
| (incidence vectors) | Combinatorial bandits: matchings, shortest paths, spanning trees (Chapter 30) |
LinUCB: optimism over a confidence set
DefinitionOptimistic index
Given a confidence set that probably contains ,
Known as LinRel, LinUCB or OFUL (“optimism in the face of uncertainty for linear bandits”). The book calls every such algorithm LinUCB.
IntuitionSame principle, harder confidence set
Exactly the optimism principle: act as if the world is as good as plausibly possible. But a reward now informs every action, so the confidence object is a set in , not an interval per arm. It should (a) contain with high probability and (b) be as small as possible.
DefinitionRegularised least squares
With penalty factor ,
guarantees a unique minimizer even if the actions don’t span .
DerivationSetting the gradient to zero (Exercise 19.1)
The objective is a strictly convex quadratic (for ). Its gradient is ; setting it to zero gives . See linear-transformations-and-matrices for the matrix facts.
DefinitionEllipsoidal confidence set
is closed and satisfies
with increasing and . Here . The ellipsoid is centred at the estimate; its principal axes are ‘s eigenvectors, with lengths proportional to . As grows, the ellipsoid shrinks.
IntuitionWhy an ellipsoid
With Gaussian noise, a deterministic spanning design and , the vector is standard normal in , so . The radius is a quantile. Directions probed often (large eigenvalues of ) are pinned down tightly. The adaptive-design version is Theorem 20.5 in the confidence-bounds note.
Regret analysis
DefinitionAssumption 19.1
- ;
- mean gaps bounded: ;
- actions bounded: ;
- with probability , for all , with satisfying (19.7).
TheoremTheorem 19.2 — Regret of LinUCB
Under Assumption 19.1, with probability ,
With , the method of mixtures (Theorem 20.5) allows
CorollaryCorollary 19.3 — Expected regret
With : .
LemmaLemma 19.4 — Elliptical potential lemma
Let , and . Then
ProofDeterminants grow by per step
Step 1: for .
Step 2: Matrix determinant lemma. , and has eigenvalues and 1 (repeated), so
Step 3: AM–GM on the eigenvalues. .
∎
IntuitionYou can’t keep being surprised
measures how new direction is relative to what has been explored. Each novel action inflates the volume , but the volume can only grow polynomially in , so the total novelty is . At most rounds can have novelty at least 1 (Exercise 19.3).
ProofProof of Theorem 19.2: optimism, Cauchy–Schwarz, potential
Work on the event for all . Let be optimal, , and attain .
Step 1: Optimism. .
Step 2: Cauchy–Schwarz in the -geometry. Both and lie in , so
Step 3: Truncate. Also (gaps at most 1, so differences at most 2), hence .
Step 4: Cauchy–Schwarz over time, then Lemma 19.4.
∎
RemarkLarger reward ranges (Exercise 19.3)
If gaps are only bounded by , the at most rounds with cost at most each, and the rest of the analysis is unchanged. enters only as an additive constant independent of .
Computation
FormulaThe ellipsoidal index (Exercise 19.2)
For ,
Write with . Then is maximized by aligned with , giving .
ImportantLinUCB is UCB, generalised
Estimated reward + exploration bonus. With and , is diagonal with pull counts on the diagonal, is arm ‘s empirical mean, and the bonus is . Choosing recovers UCB exactly. The generic analysis gives here, close to the specialized analyses of Chapters 7–9. That dimension-free doesn’t satisfy (19.7), but the proof doesn’t actually need it.
RemarkComputing the action in general
solves a bilinear problem (19.12), which is hard in general. Two tractable cases:
- is the convex hull of finitely many points and linear optimisation over is easy: compute for each and keep the best pair.
- and is small: evaluate (19.13) for each arm. Rank-one Sherman–Morrison updates of give work per round (Exercise 19.8).
Rarely switching LinUCB (Exercise 19.4): for a fixed set of actions, recompute the action only when has grown by since the phase began. Using for , the regret bound holds with replaced by , while the cost falls from to .
Notes and extensions
RemarkRefinements and tightness
- Data-dependent radius: (19.14) is never worse than (19.8) and sometimes modestly better.
- Worst-case flavour: the bound barely depends on or the geometry of . Instance-dependent theory is open, except for fixed finite action sets (Chapter 25).
- Tightness: is tight up to logs (Chapter 24), but the hard instances have infinite or exponentially large action sets. The Cauchy–Schwarz step (19.11) often loses a log (for example when ), yet Li et al. (2019) built contextual sequences where both it and Lemma 19.4 are tight.
- Few actions per round (): algorithms with exist (next section).
RemarkBeyond plain linearity
- Kernels: infinite-dimensional via a kernel . The dimension in Lemma 19.4 is replaced by a data-dependent effective dimension, and the confidence sets must be rebuilt (Srinivas et al.; Valko et al.).
- Generalised linear models: , for example the logistic (Filippi et al. 2010). With on the relevant region, a confidence set from gives (Exercise 19.6). The dependence is unpleasant and probably improvable.
- Other design principles: Thompson sampling (Chapter 36); optimisation-based asymptotically optimal algorithms for fixed action sets (very asymptotic, not practical yet); information-directed sampling, which minimizes squared expected regret divided by information gain (Russo–Van Roy; Kirschner–Krause).
TheoremSpectral bandits (Exercise 19.7)
Regularise anisotropically with (eigenvalues ). If , then with
we get and . Strong regularisation in “unlikely” directions shrinks the effective dimension, but if fails, the confidence sets are wrong and the regret degrades with .
Graph application (Valko et al. 2014): arms are the vertices of a graph with Laplacian , and . Then , so a small means rewards vary little across strong edges. Use .
TheoremLipschitz contexts (Exercise 19.5)
With and each -Lipschitz, discretize the contexts (or run Exp4 over piecewise-constant policies) to get , and the minimax rate is . In the exponent worsens with the dimension. Adaptive discretisation helps under margin conditions (Perchet–Rigollet).
ExampleLinUCB versus UCB (Exercise 19.8)
- Two Gaussian arms as : LinUCB is close to, but slightly worse than, finite-armed UCB, which has sharper constants.
- random unit vectors in , : UCB’s regret grows with , while LinUCB’s stays roughly flat. Structure wins once .
RemarkHistory
Linear bandits: Abe–Long (1999). Optimism with finitely many actions: Auer (2002). Confidence ellipsoids: Dani et al. (2008), Rusmevichientong–Tsitsiklis (2010), Abbasi-Yadkori et al. (2011). An expected holds for any action-set shape with bounded means. For the unit ball and smooth convex action sets, explore-then-commit (PEGE) is already near-optimal.
Fixed finite action sets (Chapter 22)
Setting. with , fixed over time; conditionally 1-subgaussian noise; all gaps . Goal: , better than LinUCB’s by up to when is moderate.
IntuitionDecouple design from data, then use fixed-design confidence widths
Adaptive data forces LinUCB’s confidence sets to pay a in every direction. If each phase’s actions are chosen only from earlier phases’ data, the in-phase design is fixed, and the sharper per-direction bound applies. A G-optimal design makes that width uniformly small over all surviving arms with only about samples (Kiefer–Wolfowitz).
AlgorithmPhased elimination with G-optimal exploration (Algorithm 12)
Input , . Set . For phases :
- find a G-optimal design on (maximize ), with support at most ;
- set and ;
- play each exactly times;
- compute least squares from this phase only: , with ;
- eliminate: .
TheoremTheorem 22.1 — Regret of phased elimination
With probability at least ,
and with , .
ProofSketch (Exercise 22.1)
Phase length: by Kiefer–Wolfowitz (, support at most ), , and , so every surviving arm’s estimate is within with high probability.
The optimal arm survives: a union bound over arms and phases (the factor) gives .
Bad arms die on schedule: let . Then . So in phase every surviving arm has gap .
Sum over phases: phase costs about . Stopping the phase sum when reaches gives , by the same balancing as in Theorem 7.2.
∎
RemarkNotes
- A fixed action set is essential. For changing sets with , SupLinRel (Auer 2002) and SupLinUCB (Chu et al. 2011) reach , but they need non-random action sets and a delicate decoupling device. Li et al. (2019) proved a matching lower bound , up to iterated-log factors. These algorithms are less practical than LinUCB or Thompson sampling.
- Infinite : with Chapter 20’s confidence sets instead, the regret is .
- Misspecification is handled gracefully: if with , then (Exercise 22.2). The amplification of misspecification is often unavoidable (Lattimore–Szepesvári 2019). If linearity can be tested cheaply, switching between linear and finite-armed algorithms gets (Ghosh et al. 2017).
- Novelty: using Kiefer–Wolfowitz here appears to be new, adapted from adversarial linear bandits’ use of John’s ellipsoid (Bubeck et al. 2012; Part VI). With symmetrization it is much cleaner.
Sparse linear bandits (Chapter 23)
The problem. Features are designed by people who don’t know which ones matter. Too many features means large and slow learning; omitting a useful one means a badly wrong model. Ideally, irrelevant features should be nearly free.
DefinitionSparsity
, the zero-”norm”. It fails absolute homogeneity, so it isn’t a norm (Exercise 23.1).
Assumption 23.1: known with and ; for all actions; noise conditionally 1-subgaussian given .
WarningWhy passive sparse-regression theory doesn’t transfer
Sparse-recovery results (lasso and similar) assume a well-conditioned covariance of the actions (a small ratio of largest to smallest eigenvalue). A good bandit policy plays the optimal action most of the time, so its covariance has one dominant eigenvector pointing at . That is badly conditioned by design. A different approach is needed.
Elimination on the hypercube
Setting. . Coordinates can be chosen independently, so : learn each sign separately. In the worst case that costs (Chapter 24), but exploring a coordinate with costs nothing.
LemmaRademacher probing estimates one coordinate
If are conditionally independent given the past , and is Rademacher, then
Other coordinates contribute zero-mean noise, and the variance is bounded using and unit noise.
AlgorithmSelective explore-then-commit, SETC (Algorithm 13)
Each coordinate runs its own explore-then-commit:
- while the confidence interval contains 0: play Rademacher and keep estimating ;
- once (or ): commit to (or ) forever.
The intervals are with , an anytime bound from the 1-D method of mixtures (Exercise 20.8).
TheoremTheorem 23.2 — Regret of SETC
For universal constants ,
without knowing .
ProofPer-coordinate regret decomposition
Step 1: The regret splits by coordinate.
and when .
Step 2: For . Let be the commitment time and the event that . Off , the algorithm commits to the right sign, so .
Step 3: Exploration length. Just before committing, the interval contained both 0 and , so , which gives .
Step 4: (Lemma 23.3), so . The form follows by the usual small/large-gap split, per coordinate (Exercise 23.2).
∎
LemmaLemma 23.3 — The intervals are valid
.
ProofEach probe’s error is -subgaussian
With and , while exploring . Condition first on (noise: factor ), then on (Rademacher is 1-subgaussian by Hoeffding’s lemma: factor ), and use . So . Then apply the anytime bound of Exercise 20.8.
∎
Online-to-confidence-set conversion
The problem. On a general action set, coordinates can’t be probed separately. Plan: shrink LinUCB’s ellipsoid using a sparse online regression algorithm.
WarningAmbient dimension can’t be removed in general
With , a linear bandit is a -armed bandit, and Theorem 15.2’s hard instances are 2-sparse. So even for very sparse . The target is with , not .
DefinitionOnline linear regression
Each round: the environment picks arbitrarily and reveals ; the learner predicts ; then is revealed and the loss is . Regret against weights :
The learner has guarantee relative to if against every environment (23.6).
DerivationFrom prediction regret to a confidence set
Step 1: Algebra. If , expanding gives
Step 2: The cross term is a martingale. is predictable, so ‘s increments are conditionally subgaussian with variance proxy , which sums to . The self-normalised bound (Theorem 20.4, one dimension) gives, uniformly in with probability , .
Step 3: Solve the implicit inequality. (23.9). The left side grows linearly in and the right side sublinearly, so
TheoremTheorem 23.4 — Online-to-confidence-set conversion
If and , then
contains for all with probability . (The term, from , keeps the set bounded when the actions don’t span.)
FormulaThe same set as an ellipsoid (Exercise 23.5)
With and (regression on the predictions, not the rewards),
so is an ellipsoid centred at with squared radius . It is nonempty with high probability, by Theorem 23.4.
AlgorithmOLR-UCB (Algorithm 14)
Each round: build from Theorem 23.4 using the predictor’s past outputs; play the optimistic ; feed to the online predictor to get ; observe and feed it back.
TheoremTheorem 23.5 — Regret of OLR-UCB
With probability ,
This is Theorem 19.2 with the radius now controlled by the predictor’s regret , not by .
TheoremTheorem 23.6 — Sparse online regression (Gerchinovitz)
Some predictor achieves, against any environment with and ,
so .
CorollarySparse linear bandit regret
Subgaussian noise is unbounded, but with probability every . Plugging into Theorem 23.5:
compared with for LinUCB, an improvement of .
WarningCaveats
- Not computationally efficient: no polynomial-time online regressor with logarithmic sparse regret is known, so OLR-UCB has no efficient implementation.
- must be known: no algorithm gets for all sparsity levels simultaneously (Chapter 24).
- The ambient remains, unavoidably (Theorem 24.3). Recent work instead assumes nice context distributions to import high-dimensional statistics (Kim–Paik 2019; Bastani–Bayati 2020).
- Use the tightest data-dependent : online-learning bounds start data-dependent and are loosened for exposition. Here the tight version matters.
RemarkThe conversion is generic
Any online regression guarantee yields a confidence set, for any structural assumption on , including the non-sparse case. Rakhlin–Sridharan (2017) show the relationship goes both ways: tail inequalities imply regret bounds and vice versa. Similar constructions appear in Gentile and coauthors’ work. SETC is from Lattimore et al. (2015); the conversion from Abbasi-Yadkori et al. (2012).
Quick reference
| Object | Statement | Note |
|---|---|---|
| Linear bandit | , | finite-armed, contextual, combinatorial as special cases |
| Ridge estimate | , | |
| Confidence ellipsoid | ||
| LinUCB index | UCB when | |
| Elliptical potential | grows by | |
| LinUCB regret | tight up to logs in the worst case | |
| Unstructured contexts | why features are needed | |
| Spectral | anisotropic regularisation | |
| GLM | link-dependent factor | |
| Fixed finite | phased elimination + G-optimal design | |
| Changing, | SupLinUCB | |
| Misspecification | phased elimination | |
| Hypercube (SETC) | ; | no knowledge of sparsity |
| Conversion | regression regret → confidence set | |
| OLR-UCB | not efficient; needs |
Facts to keep to hand
- Linearity turns arms into directions. Every observation constrains , so the cost scales with , not the number of actions. LinUCB is UCB with an ellipsoid in place of intervals.
- The elliptical potential lemma is the engine. Novel directions inflate , which can only grow like , so total novelty is . Cauchy–Schwarz turns that into regret.
- Adaptive data costs a ; decoupling buys it back. Phases whose designs depend only on past phases can use fixed-design widths, and Kiefer–Wolfowitz makes them uniformly small with about samples.
- Sparsity helps, but not completely. Separable action sets (the hypercube) allow . In general the ambient survives as , and the best-known algorithm is not efficient.
- Online regression and confidence sets are two views of one thing. A predictor’s squared-loss regret bound plus self-normalised concentration gives a valid ellipsoid for any structural class.
References
- Lattimore & Szepesvári, Bandit Algorithms — Chapters 19, 22, 23