Contextual Bandits

Bandits with side information. Why ignoring context makes the benchmark too weak, and the general trade-off of choosing a competitor class (meaningful benchmark versus learnability). Adversarial k-armed contextual bandits; regret against the best context-to-arm map; one Exp3 per context and its 2√(nk|C| log k) worst case. Shrinking the competitor class with partitions, similarity constraints, or supervised-learning predictors. Bandits with expert advice; Exp4 (exponential weights over experts, importance-weighted action estimates propagated through the advice matrix), its √(2nk log M) regret, recovering the per-context bound with M = k^|C|, and the agreement-adaptive √(E*ₙ log M) bound with a time-varying learning rate. Notes on computation (O(M + k) per round), optimisation oracles, reduction of stochastic contextual bandits to cost-sensitive ERM, Exp4-IX, non-oblivious experts, finite-memory policies, epoch-greedy ETC at O(n^{2/3}), and VC-class competitors.

· 16 min read · 3,109 words

Corresponds to Lattimore & Szepesvári, Part V introduction and Chapter 18.

Motivation: real problems have many actions and side information

IntuitionWhy the earlier algorithms aren’t enough

A targeted-advertising system may have thousands of actions, and before each decision it sees contextual information about the user and the ads. The algorithms so far can’t use side information, and ignoring it makes the problem effectively non-stationary: the best ad for a teenager and for a retiree differ, so “the best single ad in hindsight” is a poor target.

NoteHow Part V handles this

  • Large action sets: add structure so that what is learned about one action generalizes to others. Ads have features (topic, format), and the reward is modelled as a nice function (linear, smooth) of the features.
  • Context: model the mean reward as a function of context features and action features together. As later chapters show, this amounts to an action set that changes every round.
  • Linear structure (Chapter 19 onward) is the main case: stochastic-linear-bandits.
  • Computation becomes a central concern, which it never was with a few arms.
  • Delayed or unattributed rewards (Part VII) and non-stationarity (Chapter 31) are treated elsewhere.

ImportantChoosing a benchmark is a trade-off

A weak benchmark is pointless: matching it perfectly can still mean performing badly. A strong benchmark is more meaningful but harder to learn to compete with, and the learning penalty must be weighed against the gain. This is the bandit version of the bias–variance trade-off, and it runs through this whole chapter. The chapter first shows how to compete with richer benchmarks; it does not settle how rich to make them.


Contextual bandits: one bandit per context

DefinitionAdversarial kk-armed contextual bandit

The adversary secretly fixes rewards (xt)t=1n(x_t)_{t=1}^n with xt∈[0,1]kx_t\in[0,1]^k and contexts (ct)t=1n(c_t)_{t=1}^n with ct∈Cc_t\in\mathcal C, an arbitrary fixed set. In each round the learner:

  1. observes ctc_t;
  2. picks a distribution Pt∈Pk−1P_t\in\mathcal P_{k-1} and samples At∼PtA_t\sim P_t;
  3. observes only Xt=xtAtX_t = x_{tA_t}.
flowchart LR
  A["Adversary fixes rewards x_t and contexts c_t"] --> C["Learner sees context c_t"]
  C --> P["Learner picks P_t, samples A_t"]
  P --> O["Observes only X_t = x_t,A_t"]
  O --> C

DefinitionContextual regret

Compete with the best context-dependent choice in hindsight:

Rn=E[∑c∈Cmax⁡i∈[k]∑t: ct=c(xti−Xt)](18.1)R_n = \mathbb E\Big[\sum_{c\in\mathcal C}\max_{i\in[k]}\sum_{t:\,c_t = c}(x_{ti} - X_t)\Big] \tag{18.1}

Equivalently, with Φ\Phi the set of all maps C→[k]\mathcal C\to[k],

Rn=E[max⁡ϕ∈Φ∑t=1n(xtϕ(ct)−Xt)](18.5)R_n = \mathbb E\Big[\max_{\phi\in\Phi}\sum_{t=1}^n\big(x_{t\phi(c_t)} - X_t\big)\Big] \tag{18.5}

ComponentDetail
BenchmarkThe best policy ϕ:C→[k]\phi : \mathcal C\to[k] in hindsight.
Versus Chapter 11There, Φ\Phi contained only the kk constant maps.
RandomnessOnly the learner’s, since rewards and contexts are fixed in advance.

One Exp3 per context

AlgorithmIndependent Exp3 instances

If C\mathcal C is finite, run a separate Exp3 for each context, and in round tt consult only the instance for ctc_t. Each instance’s regret is

Rnc=E[max⁡i∑t: ct=c(xti−Xt)]≤2k nclog⁡k,nc=∑t=1nI{ct=c}(18.2)R_{nc} = \mathbb E\Big[\max_i\sum_{t:\,c_t = c}(x_{ti} - X_t)\Big]\le2\sqrt{k\,n_c\log k}, \qquad n_c = \sum_{t=1}^n\mathbb I\{c_t = c\} \tag{18.2}

WarningUse an anytime Exp3

ncn_c isn’t known in advance, so the learning rate can’t be tuned to it. Use a version with a decreasing learning rate (Exercise 28.13), for which (18.2) holds without knowing ncn_c.

TheoremRegret of one Exp3 per context

Rn=∑cRnc≤2∑c∈Cklog⁡(k) nc≤2nk∣C∣log⁡k(18.3–18.4)R_n = \sum_cR_{nc}\le2\sum_{c\in\mathcal C}\sqrt{k\log(k)\,n_c}\le2\sqrt{nk|\mathcal C|\log k} \tag{18.3–18.4}

ProofCauchy–Schwarz on the context counts (Exercise 18.1)

∑cnc≤∣C∣∑cnc=n∣C∣\sum_c\sqrt{n_c}\le\sqrt{|\mathcal C|\sum_cn_c} = \sqrt{n|\mathcal C|}, with equality when every context occurs n/∣C∣n/|\mathcal C| times. Equivalently, by Jensen, uniform context frequencies are the worst case. With one context the bound reduces to the ordinary 2nklog⁡k2\sqrt{nk\log k}.

∎

RemarkWhich bound to prefer

Ignoring context, Exp3 guarantees E∑tXt≥max⁡i∑txti−2knlog⁡k\mathbb E\sum_tX_t\ge\max_i\sum_tx_{ti} - 2\sqrt{kn\log k}. Per-context Exp3 guarantees E∑tXt≥∑cmax⁡i∑t:ct=cxti−2kn∣C∣log⁡k\mathbb E\sum_tX_t\ge\sum_c\max_i\sum_{t:c_t=c}x_{ti} - 2\sqrt{kn|\mathcal C|\log k}. The second benchmark is higher but the penalty is larger by ∣C∣\sqrt{|\mathcal C|}. For large nn and useful contexts the second wins; it is vacuous whenever n≤4k∣C∣log⁡kn\le4k|\mathcal C|\log k.


Bandits with expert advice

The problem. When C\mathcal C is large, one bandit per context wastes almost all the data: each context is seen too rarely to learn anything. But large context sets are rarely unstructured. In movie recommendation, the context (age, demographics, viewing history) lives in a combinatorially large space, yet similar users tend to like similar movies. So compete with a smaller, smarter set Φ\Phi of policies.

ExampleWays to shrink Φ\Phi

IdeaCompetitor class Φ\PhiAlgorithmic consequence
Partitionsmaps constant on each part of a partition P\mathcal P of C\mathcal Cone Exp3 per part: regret depends on ∣P∣\lvert\mathcal P\rvert, not ∣C∣\lvert\mathcal C\rvert
Similaritymaps whose average dissimilarity 1∣C∣2∑c,d(1−s(c,d))I{ϕ(c)≠ϕ(d)}\frac1{\lvert\mathcal C\rvert^2}\sum_{c,d}(1 - s(c,d))\mathbb I\{\phi(c)\ne\phi(d)\} is at most θ\thetaa meaningful target, but no simple Exp3 meta-algorithm
Supervised learningpredictors ϕ1,…,ϕM\phi_1, \ldots, \phi_M trained offline on batch datacompete online with the best of them, with no need to pick one by offline evaluation

IntuitionOnce Φ\Phi is fixed, contexts barely matter

Each round, all a learner needs is what each policy recommends now. That suggests forgetting the internal structure of Φ\Phi and treating its members as black-box experts.

DefinitionBandits with expert advice

MM experts. In round tt each expert mm announces a probability vector Em(t)∈Pk−1E^{(t)}_m\in\mathcal P_{k-1} over actions (it may randomize), collected in the advice matrix E(t)∈[0,1]M×kE^{(t)}\in[0,1]^{M\times k}. The learner observes E(t)E^{(t)}, chooses PtP_t, samples AtA_t and receives Xt=xtAtX_t = x_{tA_t}. The regret is against the best expert in hindsight:

Rn=E[max⁡m∈[M]∑t=1nEm(t)xt−∑t=1nXt](18.6)R_n = \mathbb E\Big[\max_{m\in[M]}\sum_{t=1}^nE^{(t)}_mx_t - \sum_{t=1}^nX_t\Big] \tag{18.6}

where Em(t)xtE^{(t)}_mx_t is expert mm‘s expected reward in round tt. The experts are oblivious: their advice doesn’t depend on the learner’s actions.

RemarkMore general than contextual bandits

A contextual bandit is the special case where each expert is a fixed map ϕ:C→[k]\phi : \mathcal C\to[k], with Emi(t)=I{ϕ(ct)=i}E^{(t)}_{mi} = \mathbb I\{\phi(c_t) = i\}. This is the “socks for feet” picture: experts look at the context and recommend; the learner decides whom to trust.


Exp4

AlgorithmExp4 — “exponential weighting for exploration and exploitation with experts” (Algorithm 11)

Input n,k,M,η,γn, k, M, \eta, \gamma. Set Q1=(1M,…,1M)Q_1 = (\frac1M, \ldots, \frac1M) (a row vector over experts). For t=1,…,nt = 1, \ldots, n:

  1. receive advice E(t)E^{(t)};
  2. play At∼Pt=QtE(t)A_t\sim P_t = Q_tE^{(t)}, i.e. sample an expert Mt∼QtM_t\sim Q_t, then At∼EMt(t)A_t\sim E^{(t)}_{M_t};
  3. receive Xt=xtAtX_t = x_{tA_t};
  4. estimate action rewards: X^ti=1−I{At=i}Pti+γ(1−Xt)\hat X_{ti} = 1 - \frac{\mathbb I\{A_t = i\}}{P_{ti} + \gamma}(1 - X_t);
  5. propagate to experts: X~t=E(t)X^t\tilde X_t = E^{(t)}\hat X_t, so expert mm gets X~tm=∑iEmi(t)X^ti\tilde X_{tm} = \sum_iE^{(t)}_{mi}\hat X_{ti};
  6. exponential weights over experts: Qt+1,m=exp⁡(ηX~tm)Qtm∑jexp⁡(ηX~tj)QtjQ_{t+1,m} = \dfrac{\exp(\eta\tilde X_{tm})Q_{tm}}{\sum_j\exp(\eta\tilde X_{tj})Q_{tj}}.

IntuitionScore experts, not arms

Exp3 keeps weights on arms. Exp4 keeps weights on experts: it estimates every arm’s reward by importance weighting, credits each expert with what it would have earned in expectation under its own advice, and reweights. With γ=0\gamma = 0 this is the original Exp4; γ>0\gamma > 0 gives Exp4-IX (implicit exploration).

WarningCost

O(M)O(M) memory and O(M+k)O(M + k) computation per round (sampling in two stages). Practical only when MM and kk are both modest, which rules out naive use with combinatorially many experts.

Regret analysis

TheoremTheorem 18.1 — Regret of Exp4

With γ=0\gamma = 0 and η=2log⁡(M)/(nk)\eta = \sqrt{2\log(M)/(nk)},

Rn≤2nklog⁡M(18.7)R_n\le\sqrt{2nk\log M} \tag{18.7}

LemmaLemma 18.2 — Exponential weights over experts

For any m∗∈[M]m^*\in[M],

∑t=1nX~tm∗−∑t=1n∑m=1MQtmX~tm≤log⁡Mη+η2∑t=1n∑m=1MQtm(1−X~tm)2\sum_{t=1}^n\tilde X_{tm^*} - \sum_{t=1}^n\sum_{m=1}^MQ_{tm}\tilde X_{tm}\le\frac{\log M}\eta + \frac\eta2\sum_{t=1}^n\sum_{m=1}^MQ_{tm}(1 - \tilde X_{tm})^2

This is exactly the potential argument of Theorem 11.2 with experts in place of arms (Exercise 18.2). It needs X~tm≤1\tilde X_{tm}\le1, which holds because each X^ti≤1\hat X_{ti}\le1 and X~tm\tilde X_{tm} is a convex combination of them.

ProofProof of Theorem 18.1: unbiased propagation, then a variance bound of exactly kk

Step 1: The benchmark is fixed. Experts are oblivious, so the best expert m∗=arg⁡max⁡m∑tEm(t)xtm^* = \arg\max_m\sum_tE^{(t)}_mx_t is deterministic (18.8).

Step 2: Unbiasedness carries through the advice. With γ=0\gamma = 0, Et[X^t]=xt\mathbb E_t[\hat X_t] = x_t, so Et[X~t]=E(t)Et[X^t]=E(t)xt\mathbb E_t[\tilde X_t] = E^{(t)}\mathbb E_t[\hat X_t] = E^{(t)}x_t (18.10). And ∑mQtmX~tm=∑iPtiX^ti\sum_mQ_{tm}\tilde X_{tm} = \sum_iP_{ti}\hat X_{ti}, whose conditional mean is the learner’s expected reward. Taking expectations in Lemma 18.2,

Rn≤log⁡Mη+η2∑tE[∑mQtm(1−X~tm)2](18.11)R_n\le\frac{\log M}\eta + \frac\eta2\sum_t\mathbb E\Big[\sum_mQ_{tm}(1 - \tilde X_{tm})^2\Big] \tag{18.11}

Step 3: Switch to losses. With Y^ti=1−X^ti=AtiytiPti\hat Y_{ti} = 1 - \hat X_{ti} = \frac{A_{ti}y_{ti}}{P_{ti}} and Y~tm=1−X~tm=Em(t)Y^t=EmAt(t)ytAtPtAt\tilde Y_{tm} = 1 - \tilde X_{tm} = E^{(t)}_m\hat Y_t = \frac{E^{(t)}_{mA_t}y_{tA_t}}{P_{tA_t}},

Et[Y~tm2]=∑iPti(Emi(t)yti)2Pti2=∑i(Emi(t)yti)2Pti≤∑iEmi(t)Pti(18.12)\mathbb E_t[\tilde Y_{tm}^2] = \sum_iP_{ti}\frac{(E^{(t)}_{mi}y_{ti})^2}{P_{ti}^2} = \sum_i\frac{(E^{(t)}_{mi}y_{ti})^2}{P_{ti}}\le\sum_i\frac{E^{(t)}_{mi}}{P_{ti}} \tag{18.12}

using Emi(t),yti∈[0,1]E^{(t)}_{mi}, y_{ti}\in[0,1].

Step 4: Averaging over experts gives exactly kk.

∑mQtm∑iEmi(t)Pti=∑i∑mQtmEmi(t)Pti=∑iPtiPti=k\sum_mQ_{tm}\sum_i\frac{E^{(t)}_{mi}}{P_{ti}} = \sum_i\frac{\sum_mQ_{tm}E^{(t)}_{mi}}{P_{ti}} = \sum_i\frac{P_{ti}}{P_{ti}} = k

Step 5: Tune. Rn≤log⁡Mη+ηnk2=2nklog⁡MR_n\le\frac{\log M}\eta + \frac{\eta nk}2 = \sqrt{2nk\log M}.

∎

ImportantExperts cost only log⁡M\log M

The variance term is kk per round regardless of MM: an expert’s estimate is noisy only through the arms it recommends, and averaged over the learner’s own distribution this always sums to kk. The number of experts enters only through the starting uncertainty log⁡M\log M. That is why exponentially many experts are statistically affordable.

CorollaryContextual bandits recovered and generalized

  • All maps on a finite context set: M=k∣C∣M = k^{|\mathcal C|}, so log⁡M=∣C∣log⁡k\log M = |\mathcal C|\log k and Rn≤2nk∣C∣log⁡kR_n\le\sqrt{2nk|\mathcal C|\log k}, the per-context Exp3 bound with a slightly better constant.
  • Any finite class Φ\Phi of maps C→[k]\mathcal C\to[k], with C\mathcal C arbitrary or infinite: Rn≤2nklog⁡∣Φ∣R_n\le\sqrt{2nk\log|\Phi|}. The size of the context space no longer matters, only the size of the policy class.

Adapting to agreement among experts

DefinitionEffective number of experts

Et∗=∑s=1t∑i=1kmax⁡m∈[M]Emi(s)E_t^* = \sum_{s=1}^t\sum_{i=1}^k\max_{m\in[M]}E^{(s)}_{mi}

If all experts agree, each round contributes ∑iEi=1\sum_iE_i = 1, so Et∗=tE_t^* = t. In general (Exercise 18.7)

En∗≤nmin⁡(k,M)(18.13)E_n^*\le n\min(k,M) \tag{18.13}

since ∑imax⁡mEmi≤∑i1=k\sum_i\max_mE_{mi}\le\sum_i1 = k and ≤∑i∑mEmi=M\le\sum_i\sum_mE_{mi} = M. So En∗/nE_n^*/n is an effective number of experts, measuring how much they disagree.

TheoremTheorem 18.3 — Agreement-adaptive regret

With time-varying learning rate ηt=log⁡(M)/Et∗\eta_t = \sqrt{\log(M)/E_t^*}, for a universal constant CC,

Rn≤CEn∗log⁡M(18.14)R_n\le C\sqrt{E_n^*\log M} \tag{18.14}

(Proof: Exercise 18.4, adapting the Exp3 analysis to decreasing learning rates; see Exercises 28.12–28.13.)

IntuitionLearning is easy when experts agree

If every expert says the same thing, there is nothing to learn, and the bound grows like nlog⁡M\sqrt{n\log M} rather than nklog⁡M\sqrt{nk\log M}. The bound is data-dependent (in adversarial bandits, data and instance coincide), never worse than (18.7) up to constants, and, since ηt\eta_t doesn’t use nn, the algorithm is anytime. This is the first time-varying learning rate in the book; they become a main tool for adapting to the instance later.


Notes and extensions

RemarkExp4 as a building block

Define your own experts and Exp4 gives a regret bound for free, though not always an efficient algorithm.

  • Non-stationary bandits (Chapter 31): experts are switching sequences of arms. One of the rare cases where Exp4 runs efficiently with combinatorially many experts.
  • Finite-memory policies (Exercise 18.5): with observations ot∈[O]o_t\in[O] and experts all maps [O]m→[k][O]^m\to[k] of the last mm observations, M=kOmM = k^{O^m} and E[Rn]≤2knOmlog⁡k\mathbb E[R_n]\le\sqrt{2knO^m\log k}.
  • When Exp4 isn’t computationally efficient, it is still a good way to find out what regret is statistically achievable.

WarningComputation is the real obstacle

In general there is no way around O(M+k)O(M + k) per round. One escape is an optimisation oracle that, given contexts and reward vectors, returns the best expert in hindsight (the offline problem (18.8)). Chapter 30 shows follow-the-perturbed-leader with such an oracle for combinatorial bandits, though those settings carry extra information that makes reward estimation possible. Note that ERM can be NP-hard even for linear classifiers.

TheoremStochastic contextual bandits: epoch-greedy ETC (Exercise 18.8)

Contexts CtC_t i.i.d. from ξ\xi, rewards from PCtAtP_{C_tA_t} with mean μ(c,i)\mu(c,i), policy value μ(ϕ)=∫μ(c,ϕ(c)) dξ(c)\mu(\phi) = \int\mu(c,\phi(c))\,d\xi(c), and regret Rn=nsup⁡ϕ∈Φμ(ϕ)−E∑tXtR_n = n\sup_{\phi\in\Phi}\mu(\phi) - \mathbb E\sum_tX_t. Explore uniformly for mm rounds, estimate μ^(ϕ)=km∑t≤mI{At=ϕ(Ct)}Xt\hat\mu(\phi) = \frac km\sum_{t\le m}\mathbb I\{A_t = \phi(C_t)\}X_t, then commit to ϕ^∗=arg⁡max⁡ϕμ^(ϕ)\hat\phi^* = \arg\max_\phi\hat\mu(\phi) using the oracle. For finite Φ\Phi and tuned mm,

Rn=O(n2/3(klog⁡∣Φ∣)1/3)R_n = O\big(n^{2/3}(k\log|\Phi|)^{1/3}\big)

DerivationWhere n2/3n^{2/3} comes from

Each μ^(ϕ)\hat\mu(\phi) is an average of mm i.i.d. unbiased terms in [0,k][0,k] with variance at most kk (the indicator fires with probability 1/k1/k). By Bernstein and a union bound over Φ\Phi, every estimate is within about klog⁡∣Φ∣/m\sqrt{k\log|\Phi|/m} of the truth (the range term kmlog⁡∣Φ∣\frac km\log|\Phi| is lower order at the optimal mm). So the committed policy loses at most about 2klog⁡∣Φ∣/m2\sqrt{k\log|\Phi|/m} per round, and Rn≲m+nklog⁡∣Φ∣/mR_n\lesssim m + n\sqrt{k\log|\Phi|/m}. Balancing at m≈n2/3(klog⁡∣Φ∣)1/3m\approx n^{2/3}(k\log|\Phi|)^{1/3} gives the bound. Using Hoeffding with range kk instead would give the worse k2/3k^{2/3}. (Sketch worked here.) This is the explore-then-commit version of epoch-greedy (Langford–Zhang 2008), the contextual cousin of ETC.

RemarkReducing contextual bandits to cost-sensitive ERM

Agarwal et al. (2014) give a polynomial-time algorithm with regret about that of Theorem 18.1, using only an ERM oracle. Each round it forms importance-weighted reward estimates, estimates every expert’s regret, and solves a feasibility problem for a sparse distribution over experts whose importance weights stay bounded while its average estimated regret stays small. The distribution is recomputed on an exponentially growing schedule. Any progress on cost-sensitive ERM translates directly into contextual bandits. Earlier attempt: Dudík et al. (2011).

TheoremInfinite policy classes with finite VC dimension (Exercise 18.9)

For stochastic contextual bandits with k=2k = 2 and d=VC(Φ)d = \mathrm{VC}(\Phi), some policy achieves

Rn≤Cndklog⁡ndR_n\le C\sqrt{ndk\log\frac nd}

Explore for an initial period, keep one representative from each group of policies that agree on the observed contexts, and run Exp4 on those. Sauer’s lemma bounds the number of representatives by (em/d)d(em/d)^d, so log⁡M≈dlog⁡md\log M\approx d\log\frac md. Exchangeability of i.i.d. contexts makes the representatives behave like the full class on the remaining rounds. (Beygelzimer et al. 2011.)

RemarkHigh probability and non-oblivious experts

  • Exp4-IX (Exercise 18.3; Neu 2015): with probability 1−δ1-\delta, R^n≤C(nklog⁡M+nklog⁡Mlog⁡1δ)\hat R_n\le C\big(\sqrt{nk\log M} + \sqrt{\frac{nk}{\log M}}\log\frac1\delta\big), the analogue of Theorem 12.1. Exp3.P generalizes too (Beygelzimer et al. 2011).
  • Non-oblivious experts (Exercise 18.6): define Rn′=max⁡mE[∑tEm(t)xt−∑tXt]R_n' = \max_m\mathbb E\big[\sum_tE^{(t)}_mx_t - \sum_tX_t\big]. Then Rn′≤RnR_n'\le R_n always (the max of expectations is at most the expectation of the max), and Theorem 18.1 holds for Rn′R_n': the proof never needs a deterministic m∗m^* if the comparison expert is fixed before taking expectations. A non-trivial bound on RnR_n itself is open.
  • Lower bounds depend on the experts’ structure. They are sometimes tight (examples come later), sometimes not.

RemarkHistory and related settings

Exp4 is due to Auer et al. (2002); Theorem 18.1 matches their result with a slightly smaller constant. McMahan–Streeter (2009) observed that expert agreement, not MM or kk, is what matters, and optimized the played distribution to stay close to PtP_t while exploring every expert. Theorem 18.3’s learning-rate-only adaptation appears to be new. Other settings: FTPL with static experts and contexts known upfront (Syrgkanis et al. 2016); i.i.d. contexts with adversarial rewards (Lazaric–Munos 2009; Rakhlin–Sridharan 2016, including approximate oracles); bandit multiclass classification with mistake bounds against convex surrogates (Kakade et al. 2008). Survey: Tewari–Murphy (2017).


Quick reference

ObjectStatementNote
Contextual regretEmax⁡ϕ∈Φ∑t(xtϕ(ct)−Xt)\mathbb E\max_{\phi\in\Phi}\sum_t(x_{t\phi(c_t)} - X_t)Φ\Phi = all maps gives (18.1)
One Exp3 per context2∑cknclog⁡k≤2nk∣C∣log⁡k2\sum_c\sqrt{k n_c\log k}\le2\sqrt{nk\lvert\mathcal C\rvert\log k}needs anytime Exp3
Worst caseuniform context frequenciesCauchy–Schwarz
Vacuous whenn≤4k∣C∣log⁡kn\le4k\lvert\mathcal C\rvert\log kricher benchmark, larger penalty
Expert advicerows Em(t)∈Pk−1E^{(t)}_m\in\mathcal P_{k-1}; regret vs best expertoblivious experts
Exp4 playPt=QtE(t)P_t = Q_tE^{(t)}pick an expert, follow it
Exp4 updateX~t=E(t)X^t\tilde X_t = E^{(t)}\hat X_t; Qt+1∝QteηX~tQ_{t+1}\propto Q_te^{\eta\tilde X_t}loss-based IW estimates
Exp4 regret2nklog⁡M\sqrt{2nk\log M} at η=2log⁡M/(nk)\eta = \sqrt{2\log M/(nk)}variance term is exactly kk
Finite Φ\Phi2nklog⁡∣Φ∣\sqrt{2nk\log\lvert\Phi\rvert}context-space size irrelevant
AgreementEn∗=∑t∑imax⁡mEmi(t)≤nmin⁡(k,M)E_n^* = \sum_t\sum_i\max_mE^{(t)}_{mi}\le n\min(k,M)=n=n if experts agree
Adaptive Exp4CEn∗log⁡MC\sqrt{E_n^*\log M} with ηt=log⁡M/Et∗\eta_t = \sqrt{\log M/E_t^*}anytime
CostO(M+k)O(M + k) per roundoracles needed for large MM
Epoch-greedy ETCO(n2/3(klog⁡∣Φ∣)1/3)O(n^{2/3}(k\log\lvert\Phi\rvert)^{1/3})stochastic, oracle-efficient
VC classesCndklog⁡(n/d)C\sqrt{ndk\log(n/d)}Sauer’s lemma + Exp4
Finite memory2knOmlog⁡k\sqrt{2knO^m\log k}experts on the last mm observations

Facts to keep to hand

  • The competitor class is a modelling choice. Bigger classes mean more meaningful regret and larger regret: per-context learning pays ∣C∣\sqrt{|\mathcal C|}, and is vacuous until n≫k∣C∣log⁡kn\gg k|\mathcal C|\log k.
  • Score experts, not arms. Exp4 importance-weights the arms, credits each expert through its advice, and runs exponential weights over experts. Its variance term stays kk per round, so the number of experts costs only log⁡M\log M.
  • Statistics is cheap; computation is not. nklog⁡∣Φ∣\sqrt{nk\log|\Phi|} is achievable for any finite (or finite-VC) policy class, but naive Exp4 is linear in ∣Φ∣|\Phi|. Oracle-based reductions to cost-sensitive ERM are the practical route.
  • Agreement among experts is what makes learning hard or easy. The effective number of experts En∗/nE_n^*/n, captured by a time-varying learning rate, interpolates between full-information-like and bandit-like regret.

References

← All notes