MVA · Course notes

Sequential Learning

M2 MVA · Semester 2 · Learning · 5 ECTS

Contents

Introduction and overview

Module Sequential Learning
Official title Sequential learning
Instructors P. GAILLARD, R.DEGENNE (master-mva.com, 2026–2027)
Period Semester 2 · period 2 (04/01/2027 – 02/04/2027)
Credits and volume 5 ECTS · 18 h (lectures 18 h) per the Université Paris-Saclay programme table
Label Learning · domains on master-mva.com: Theory
Language English: the master-mva.com objective reads “The objectives of the course (in English) …”; no separate language field is displayed
Assessment Homework (“Devoir Maison”) and final exam (master-mva.com, “Mode de validation”; no weights displayed) · Université Paris-Saclay: “Evaluation Continue non Intégrale” (partial continuous assessment)
Prerequisites “Probability and Optimization Notion.” (master-mva.com)

Audience: a student with an M1 in mathematics, computer science or physics who knows basic probability and convex optimization, and who wants to learn how to decide well when the data arrive one at a time and may be chosen by an adversary.

Empirical first: on 10,000 rounds of two alternating losses, the natural rule “follow the leader” loses 5,000 more than the best fixed choice, while exponential weights lose only 30 more (block of ch. 2). A forecaster of binary events that is deterministic can be pushed to a calibration error above 0.5. A randomized one stays below 0.002 against the same adaptive opponent (block of ch. 7). This course explains both numbers.

Sequential learning studies algorithms that receive data on the fly, act, observe a feedback and update themselves before the next round, with no statistical assumption on the data. Their quality is the regret: the gap between their cumulative loss and that of the best fixed decision in hindsight. The course builds the main algorithms (exponential weights, online gradient descent, EXP3, UCB), proves their regret bounds and matching lower bounds, and connects them with stochastic optimization, game theory, calibration and partial monitoring.

The bandit chapters meet the exploration–exploitation lectures of Reinforcement Learning, and the online-to-batch conversion reconnects with Convex Optimization and Applications in Machine Learning and the stochastic gradient algorithm of Computational Statistics. Stopping Times and Online Algorithms also treats data one at a time, but measures algorithms by a competitive ratio against an omniscient benchmark rather than by a regret.

What you will be able to do

Official objectives and syllabus (2026–2027)

The course description on master-mva.com explains that in online learning, data are acquired and treated on the fly, feedbacks are received and algorithms are updated on the fly. It lists applications coming from the internet: choosing which ads to display, repeated auctions, spam detection, and the aggregation of experts or algorithms, together with boosting.

The stated objective is to introduce and study the main concepts of online learning (regret, calibration and others), to construct algorithms and to show the connection with game theory. The course also covers the bandit setting, with a pointer to the Reinforcement Learning course, and its generalization, partial monitoring. It is organised as six classes on the blackboard. The Université Paris-Saclay course detail displays only the nature of the assessment.

Official topic Course section
“Thèmes abordés”: regret minimization ch. 1 (Definition 1.2), then the algorithms and bounds of ch. 2 to ch. 5 and ch. 8
“Thèmes abordés”: calibration ch. 7, sections 7.3–7.4 (Definition 7.4, Proposition 7.5, Theorem 7.6)
“Thèmes abordés”: exponential weights algorithms ch. 2 (Theorem 2.2, Hedge, exp-concave losses), ch. 3.2 (exponential weights as a regularized leader), ch. 4 (EXP3), ch. 8.2
“Thèmes abordés”: stochastic optimization ch. 3.3 (online-to-batch conversion, stochastic gradient rates)
“Thèmes abordés”: game theory ch. 6 (minimax theorem, equilibria, swap regret), ch. 7 (vector-payoff games)
“Les intervenants” (last item of the list) Not a topic: the heading that introduces the instructors, Pierre Gaillard and Remy Degenne (INRIA), listed in the fiche
Objective: data acquired and treated on the fly, feedbacks received and algorithms updated on the fly ch. 1.1 (Definition 1.1, the protocol)
Application: choosing which ads to display ch. 1.1, ch. 4 and ch. 5 (bandit feedback), ch. 9.3 (contextual bandits)
Application: repeated auctions ch. 1.1, ch. 6.3 (Example 6.9: Hedge over a grid of bids, convergence to coarse correlated equilibria), ch. 8.1 (auction feedback)
Application: spam detection ch. 1.1, ch. 3 (online logistic regression, Python block)
Application: experts / algorithm aggregation ch. 2 (aggregation of forecasters, Corollary 2.3)
Application: boosting ch. 6.2 (boosting as a zero-sum game, Theorem 6.4)
Main concepts: regret, calibration, etc. Definitions 1.2 (regret), 6.6 (swap regret), 7.4 (calibration)
Construct algorithms Exponential weights, OGD, FTRL, EXP3, UCB, Thompson sampling, Blum–Mansour, regret matching, a calibrated forecaster, a partial-monitoring forecaster
Show the connection with game theory ch. 6 and ch. 7
The bandit setting (cf. the Reinforcement Learning course) ch. 4 (adversarial), ch. 5 (stochastic), ch. 9 (lower bounds, contextual bandits)
Its generalization: partial monitoring ch. 8
“Organisation des séances”: 6 classes on the blackboard Session plan: 6 sessions of 3 h
“Mode de validation”: homework (“Devoir Maison”) and final exam Fiche; Projects and assessment (homework-sized projects, exam proposal)
Université Paris-Saclay “Nature de l’évaluation”: “Evaluation Continue non Intégrale” Fiche; Projects and assessment
“Prérequis”: probability and optimization notions ch. 0
“Références”: the four official references References, first block; cited chapter by chapter

Extensions beyond the syllabus: the change-of-measure proof of the Lai–Robbins bound, small-loss bounds, linear and contextual bandits and best-arm identification (ch. 9), and the research chapter (ch. 10), both in self-study.

Where this course fits in the programme

Official prerequisites: “Probability and Optimization Notion.” In practice the proofs use convexity, subgradients, Hoeffding’s inequality and martingale differences at M1 level, recalled in ch. 0.

Course outline

Session plan

18 h in class = 6 sessions of 3 h.

The volume is the 18 h of lectures of the Université Paris-Saclay programme table, and master-mva.com announces six classes on the blackboard, so one session of 3 h per class is the natural split. The content of each session below is a proposal.

Level 1 = foundations, 2 = core results and algorithms, 3 = advanced and research-level material; the level never decreases.

Session Hours Level Content Practice
1 3 h 1 ch. 0 Review: subgradients and projections, Hoeffding–Azuma, KL divergence; ch. 1 The online protocol, regret, Cover’s impossibility, halving, the failure of follow-the-leader Ex. 1, 2, 3
2 3 h 2 ch. 2 Exponential weights: the regret bound, Hedge, high probability, the doubling trick, the lower bound, exp-concave losses Ex. 4, 10, 11
3 3 h 2 ch. 3 Online gradient descent, strongly convex losses, follow-the-regularized-leader, online-to-batch conversion and stochastic optimization Ex. 5, 12
4 3 h 2 ch. 4 Adversarial bandits: EXP3 and the lower bound; ch. 5 Stochastic bandits: UCB, Lai–Robbins, Thompson sampling Ex. 6, 7, 13
5 3 h 3 ch. 6 Minimax theorem by regret, boosting, correlated equilibria, swap regret; ch. 7.1–7.2 Blackwell approachability and regret matching Ex. 8, 14, 15
6 3 h 3 ch. 7.3–7.4 Calibration and its links with equilibria; ch. 8 Partial monitoring Ex. 9, 16, 17

Self-study, outside the 18 h (about 8 h in total): ch. 9 Complements: lower bounds, adaptivity and structured bandits (≈ 4 h, with Ex. 18) · ch. 10 Research directions and open problems (≈ 2 h, with Ex. 19) · running and modifying the Python blocks of chapters 2 to 8 (≈ 2 h).

How to study this module

0. Review: convexity, concentration and divergences

Every regret bound of the course combines three tools: an inequality of convexity, a bound on an exponential moment, and a divergence between probability vectors. This chapter recalls them at M1 level, with short proofs.

0.1 Convex functions and projections

Definition 0.1 — Subgradient and strong convexity Let K \subset \mathbb{R}^d be convex and f : K \to \mathbb{R} convex. A vector g is a subgradient of f at x, written g \in \partial f(x), if f(y) \geq f(x) + \langle g, y - x \rangle \quad \text{for all } y \in K . The function is \alpha-strongly convex if, for every x, y and every g \in \partial f(x), f(y) \geq f(x) + \langle g, y - x \rangle + \frac{\alpha}{2}\, \|y - x\|^2 . With another norm \|\cdot\| in place of the Euclidean one, this defines strong convexity for that norm. Its dual norm is \|g\|_* = \sup_{\|x\| \leq 1} \langle g, x \rangle .

Proposition 0.2 — Projection onto a closed convex set Let K be closed, convex and non-empty, and let \Pi_K(y) be the point of K closest to y. Then, for every u \in K, \|\Pi_K(y) - u\| \leq \|y - u\| .

Proof. Write \pi = \Pi_K(y). For u \in K and s \in [0, 1], the point \pi + s(u - \pi) lies in K.

Its distance to y is at least that of \pi. Differentiating at s = 0 gives the optimality condition \langle y - \pi, u - \pi \rangle \leq 0 . Expanding the square, \|y - u\|^2 = \|y - \pi\|^2 + \|\pi - u\|^2 + 2 \langle y - \pi, \pi - u \rangle, the last two terms are non-negative, and the claim follows. ∎

0.2 Exponential moments and concentration

Lemma 0.3 — Hoeffding’s lemma If a random variable X takes values in [a, b], then for every real s, \ln \mathbb{E}\big[e^{s X}\big] \leq s\, \mathbb{E}[X] + \frac{s^2 (b - a)^2}{8} .

Proof. Let \psi(s) = \ln \mathbb{E}[e^{sX}]. Then \psi(0) = 0 and \psi'(0) = \mathbb{E}[X].

The second derivative \psi''(s) is the variance of X under the tilted law with density proportional to e^{sX}. That law is supported in [a, b], and every such variance is at most (b - a)^2/4.

Taylor’s formula with this bound on \psi'' concludes. ∎

Theorem 0.4 — Azuma–Hoeffding inequality Let (X_t)_{t \leq T} be a martingale difference sequence for a filtration (\mathcal{F}_t).

Each X_t has zero conditional mean given \mathcal{F}_{t-1} and lies in an interval of length c_t whose endpoints are \mathcal{F}_{t-1}-measurable. Then, for every \varepsilon > 0, \mathbb{P}\Big( \sum_{t=1}^T X_t \geq \varepsilon \Big) \leq \exp\Big( - \frac{2 \varepsilon^2}{\sum_t c_t^2} \Big) .

Proof. By Markov’s inequality, the probability is at most e^{-s\varepsilon}\, \mathbb{E}[e^{s \sum_t X_t}] for every s > 0.

Conditioning on \mathcal{F}_{T-1} and applying Lemma 0.3 to X_T removes the last term at the price of a factor e^{s^2 c_T^2/8}. Repeating down to t = 1 gives the factor \exp(s^2 \sum_t c_t^2 / 8).

The choice s = 4\varepsilon / \sum_t c_t^2 concludes. ∎

Example 0.5 — The size of random fluctuations With T = 10{,}000 differences of range c_t = 1, the inequality holds with probability 1 - \delta = 0.95 at the level \varepsilon = \sqrt{\tfrac{T}{2} \ln \tfrac{1}{\delta}} = \sqrt{5000 \times 2.996} \approx 122.4 . Fluctuations of order \sqrt{T} are the unavoidable noise of any sequential procedure; the regret bounds of the course are of the same order.

0.3 The simplex and the Kullback–Leibler divergence

Definition 0.6 — Simplex and divergences The simplex \Delta_N is the set of probability vectors on \{1, \dots, N\}. For p, q \in \Delta_N, the Kullback–Leibler divergence and its Bernoulli version are \mathrm{KL}(p \,\|\, q) = \sum_{i=1}^N p_i \ln \frac{p_i}{q_i}, \qquad \mathrm{kl}(x, y) = x \ln \frac{x}{y} + (1 - x) \ln \frac{1 - x}{1 - y} . The divergence is non-negative and vanishes only when p = q, by Jensen’s inequality. Pinsker’s inequality compares it with the squared \ell_1 distance: \mathrm{KL}(p \,\|\, q) \geq \frac{1}{2}\, \|p - q\|_1^2, \qquad \mathrm{kl}(x, y) \geq 2 (x - y)^2 .

Proposition 0.7 — Gibbs variational formula For every vector v \in \mathbb{R}^N and every q \in \Delta_N, \ln \sum_{i=1}^N q_i\, e^{v_i} = \max_{p \in \Delta_N} \big( \langle p, v \rangle - \mathrm{KL}(p \,\|\, q) \big), and the maximum is attained at the Gibbs distribution, proportional to the vector of the q_i e^{v_i}.

Proof. Let Z be the left-hand sum and p^\star_i = q_i e^{v_i}/Z. A direct computation gives, for every p \in \Delta_N, \langle p, v \rangle - \mathrm{KL}(p \,\|\, q) = \ln Z - \mathrm{KL}(p \,\|\, p^\star) \leq \ln Z, with equality exactly at p = p^\star. ∎

The formula explains why exponential weights (ch. 2) are the regularized leader with an entropic penalty (ch. 3.2).

Key takeaways — chapter 0

  • A subgradient gives a linear lower bound on a convex function; strong convexity adds a quadratic term.
  • Projecting onto a convex set never increases the distance to a point of the set.
  • Hoeffding’s lemma bounds the exponential moment of a bounded variable; Azuma–Hoeffding extends it to martingale differences.
  • The Gibbs distribution maximizes a linear gain minus a Kullback–Leibler penalty.

1. The online protocol and the notion of regret

Online learning replaces a fixed data set by a game repeated over time between a learner and an environment. This chapter states the protocol, defines the regret, and shows why the learner needs randomization or convexity.

1.1 The protocol

Definition 1.1 — Online learning game Fix a decision set \mathcal{X} and a set of loss functions. At each round t = 1, 2, \dots, T:

  1. the learner chooses x_t \in \mathcal{X}, possibly at random;
  2. the environment chooses a loss function \ell_t, without seeing the learner’s random draw;
  3. the learner suffers \ell_t(x_t) and observes a feedback: the whole function \ell_t (full information) or only the number \ell_t(x_t) (bandit feedback).

The environment is oblivious if it fixes all the \ell_t before the game starts, and adaptive if \ell_t may depend on the past actions of the learner.

No statistical assumption is made on the sequence of losses. The applications of the course description fit this protocol.

Definition 1.2 — Regret The regret of the learner against a fixed decision u, and its worst case over \mathcal{X}, are R_T(u) = \sum_{t=1}^T \ell_t(x_t) - \sum_{t=1}^T \ell_t(u), \qquad R_T = \sup_{u \in \mathcal{X}} R_T(u) . An algorithm has no regret (is Hannan consistent) if R_T / T \to 0 for every sequence of losses. For a randomized learner, the expected regret replaces \ell_t(x_t) by its expectation.

The benchmark is the best fixed decision in hindsight, not the best sequence of decisions: against the best sequence no guarantee is possible, since the environment can make every action of the learner the worst one.

1.2 Why determinism fails

Proposition 1.3 — Cover’s impossibility Predict binary outcomes y_t \in \{0, 1\} with the 0–1 loss, against the two constant experts “always 0” and “always 1”. Every deterministic learner has regret at least T/2.

Proof. The environment knows the deterministic rule, so it can set y_t = 1 - \hat y_t at every round. The learner makes T mistakes. The two experts make T mistakes in total, so the better one makes at most T/2. ∎

Two remedies are used throughout the course. A randomized learner predicts 1 with probability p_t, and its expected loss |p_t - y_t| is linear in p_t. A convex problem lets the learner average the experts’ advice instead of choosing one.

Proposition 1.4 — The halving algorithm Suppose that one of N experts never errs. Predicting with the majority vote of the experts that have made no mistake so far makes at most \log_2 N mistakes.

Proof. Each mistake of the majority means that at least half of the remaining experts erred; they are removed. The surviving set therefore halves at each mistake, and it never becomes empty. ∎

1.3 Follow the leader can fail

The simplest rule plays the decision with the smallest cumulative loss so far: x_t \in \operatorname*{arg\,min}_{x \in \mathcal{X}} \sum_{s < t} \ell_s(x) .

Example 1.5 — An unstable leader Take two actions and the loss vectors (1/2, 0), then (0, 1), (1, 0), (0, 1), and so on.

  • After round 1 the leader is action 2, which then loses 1.
  • After round 2 the leader is action 1, which then loses 1, and so on.

Follow-the-leader loses 1 at every round after the first, while each action loses about T/2. The regret is about T/2: on T = 10{,}000 rounds the Python block of ch. 2 measures exactly 5,000.

The leader jumps because nothing slows it down. Chapters 2 and 3 add a regularization that makes the decision move slowly, and this stability is what bounds the regret.

1.4 A map of feedback models

Feedback Environment Typical rate of the minimax regret Chapter
Full information, N experts adversarial \sqrt{T \ln N} ch. 2
Full information, convex losses adversarial \sqrt{T}, or \ln T if strongly convex ch. 3
Bandit, N arms adversarial \sqrt{N T} ch. 4
Bandit, N arms stochastic \ln T times instance constants ch. 5
Partial monitoring adversarial bounded, \sqrt{T}, T^{2/3} or T ch. 8

Key takeaways — chapter 1

  • Online learning is a repeated game: the learner acts, the environment reveals a loss, the learner observes a feedback.
  • Regret compares the learner with the best fixed decision in hindsight.
  • Deterministic learners suffer linear regret against adversaries; randomization or convexity is necessary.
  • Follow-the-leader is unstable; regularization is the cure.

2. Prediction with expert advice: exponential weights

A learner must combine the advice of N experts whose losses are revealed after each round. This chapter builds the exponentially weighted average forecaster, proves its \sqrt{T \ln N} regret, and shows that this rate cannot be improved.

2.1 The forecaster and its regret

At each round, expert i suffers a loss \ell_t(i) \in [0, 1]. The learner plays a weight vector p_t \in \Delta_N and suffers the mixed loss \langle p_t, \ell_t \rangle. Write the cumulative losses as L_t(i) = \sum_{s \leq t} \ell_s(i) .

Definition 2.1 — Exponentially weighted average forecaster (EWA) With a learning rate \eta > 0, the forecaster plays p_t(i) = \frac{e^{-\eta L_{t-1}(i)}}{\sum_{j=1}^N e^{-\eta L_{t-1}(j)}} . It is due to Vovk (1990) and to Littlestone and Warmuth (1994); its randomized form is called Hedge (Freund and Schapire, 1997).

Theorem 2.2 — Regret of exponential weights For losses in [0, 1], every horizon T and every expert i, \sum_{t=1}^T \langle p_t, \ell_t \rangle - L_T(i) \leq \frac{\ln N}{\eta} + \frac{\eta T}{8} . With \eta = \sqrt{8 \ln N / T}, the regret is at most

Key result — the regret of exponential weights R_T \leq \sqrt{\frac{T}{2} \ln N} .

Proof. Use the potential W_t = \sum_i e^{-\eta L_t(i)}, with W_0 = N.

  1. One step. The ratio W_t / W_{t-1} is the expectation of e^{-\eta \ell_t(I)} for I drawn from p_t. Lemma 0.3 with s = -\eta gives \ln \frac{W_t}{W_{t-1}} \leq -\eta \langle p_t, \ell_t \rangle + \frac{\eta^2}{8} .
  2. Sum. Telescoping, \ln W_T - \ln N is at most -\eta \sum_t \langle p_t, \ell_t \rangle + \eta^2 T / 8.
  3. Lower bound. W_T is at least any of its terms, so \ln W_T \geq -\eta L_T(i).

Combine the last two lines and divide by \eta. ∎

With N = 100 experts and T = 10{,}000 rounds, the bound is \sqrt{5000 \times \ln 100} \approx 151.7, an average excess loss of 0.015 per round.

Corollary 2.3 — Aggregation of forecasters Suppose expert i predicts f_t(i) in a convex set, and the loss of a prediction f is \lambda(f, y_t) \in [0, 1], convex in f.

Predicting the weighted average of the f_t(i) with the weights of EWA has regret at most \sqrt{(T/2) \ln N} against the best expert.

Indeed, by Jensen’s inequality the loss of the average is at most \langle p_t, \ell_t \rangle, with \ell_t(i) = \lambda(f_t(i), y_t).

This is the aggregation of experts of the course description: the experts can be whole learning algorithms, such as forecasting models of electricity load.

2.2 Randomized play and high probability

With a finite set of actions and no convexity, the learner draws I_t from p_t (Hedge). Against an oblivious environment, the expected regret obeys Theorem 2.2. Against an adaptive one, the realized regret is controlled as follows.

Proposition 2.4 — Hedge with high probability With probability at least 1 - \delta, the realized regret of Hedge tuned as in Theorem 2.2 satisfies \sum_{t=1}^T \ell_t(I_t) - \min_i L_T(i) \leq \sqrt{\frac{T}{2} \ln N} + \sqrt{\frac{T}{2} \ln \frac{1}{\delta}} . Proof. The differences between \ell_t(I_t) and \langle p_t, \ell_t \rangle form a martingale difference sequence with ranges of length 1; apply Theorem 0.4.

The next lemma replaces Hoeffding’s lemma when the losses are non-negative but unbounded. It is the engine of the bandit algorithms of ch. 4 and 8.

Lemma 2.5 — Second-order bound for non-negative losses If EWA is run on arbitrary losses \hat\ell_t(i) \geq 0, then for every i, \sum_{t=1}^T \langle p_t, \hat\ell_t \rangle - \sum_{t=1}^T \hat\ell_t(i) \leq \frac{\ln N}{\eta} + \frac{\eta}{2} \sum_{t=1}^T \sum_{j=1}^N p_t(j)\, \hat\ell_t(j)^2 .

Proof. For x \geq 0, e^{-x} \leq 1 - x + x^2/2, and \ln(1 + u) \leq u. Hence step 1 of the previous proof becomes \ln \frac{W_t}{W_{t-1}} \leq -\eta \langle p_t, \hat\ell_t \rangle + \frac{\eta^2}{2} \sum_j p_t(j)\, \hat\ell_t(j)^2, and steps 2 and 3 are unchanged. ∎

2.3 Not knowing the horizon

Proposition 2.6 — The doubling trick Restart EWA at the times 2^m, m = 0, 1, \dots, each time tuned for an epoch of length 2^m. For every T the regret is at most \frac{\sqrt{2}}{\sqrt{2} - 1} \sqrt{\frac{T}{2} \ln N} \approx 3.41\, \sqrt{\frac{T}{2} \ln N} . Proof. Epoch m costs at most the square root of 2^{m-1} \ln N. Summing the geometric series up to the last epoch M, with 2^M \leq T, gives the constant.

A decreasing rate \eta_t proportional to \sqrt{\ln N / t} also works without restarts, with a similar constant (Cesa-Bianchi and Lugosi, 2006, ch. 2).

2.4 The rate cannot be improved

Proposition 2.7 — A lower bound with two experts Let the loss vectors be (B_t, 1 - B_t) with B_t independent fair coins. For every algorithm, the expected regret is at least \mathbb{E}\Big| S_T - \frac{T}{2} \Big| \sim \sqrt{\frac{T}{2\pi}}, \qquad S_T = \sum_{t \leq T} B_t .

Proof. The weight p_t is independent of B_t, so every algorithm has expected loss T/2. The two experts have losses S_T and T - S_T, and the smaller one equals T/2 - |S_T - T/2|. The asymptotic follows from the central limit theorem. ∎

So some sequence forces a regret of order \sqrt{T}. With N experts and random losses, the minimax regret is equivalent to \sqrt{(T/2) \ln N} when T and then N go to infinity (Cesa-Bianchi and Lugosi, 2006, ch. 3): the constant of Theorem 2.2 is optimal.

2.5 Exp-concave losses

Definition 2.8 — Exp-concavity A loss \lambda(\cdot, y) is \eta-exp-concave if f \mapsto e^{-\eta \lambda(f, y)} is concave for every outcome y.

Theorem 2.9 — Constant regret for exp-concave losses If the loss is \eta-exp-concave, the weighted average prediction of EWA with this \eta has regret at most R_T \leq \frac{\ln N}{\eta}, \quad \text{whatever } T .

Proof. By concavity, the loss of the averaged prediction satisfies e^{-\eta \lambda(\hat f_t, y_t)} \geq \sum_i p_t(i)\, e^{-\eta \ell_t(i)} = \frac{W_t}{W_{t-1}} . Taking logarithms and summing, the learner’s loss is at most (\ln N - \ln W_T)/\eta, and step 3 of Theorem 2.2 concludes. ∎

Two examples matter. The logarithmic loss of probability forecasts is 1-exp-concave, and EWA with \eta = 1 is then the Bayesian mixture: regret at most \ln N. The square loss on [0, 1] is 1/2-exp-concave, which gives regret at most 2 \ln N.

The block compares follow-the-leader and EWA on the unstable sequence of Example 1.5 and on 50 stochastic experts.

import numpy as np
rng = np.random.default_rng(0)

def ewa_regret(losses, eta):
    """Exponentially weighted average forecaster; losses has shape (T, N)."""
    L, total = np.zeros(losses.shape[1]), 0.0     # cumulative losses of the experts
    for l in losses:
        w = np.exp(-eta * (L - L.min()))          # shift for numerical stability
        total += (w / w.sum()) @ l
        L += l
    return total - L.min()                        # regret against the best expert

def ftl_regret(losses):
    L, total = np.zeros(losses.shape[1]), 0.0
    for l in losses:
        total += l[np.argmin(L)]                  # follow the current leader
        L += l
    return total - L.min()

T = 10_000
# Adversarial for FTL: (1/2, 0), then (0, 1), (1, 0), (0, 1), ...
adv = np.array([[0.5, 0.0]] + [[0.0, 1.0] if t % 2 == 0 else [1.0, 0.0]
                               for t in range(T - 1)])
# Stochastic: 50 experts with Bernoulli losses of means 0.40, ..., 0.60
sto = (rng.random((T, 50)) < np.linspace(0.4, 0.6, 50)).astype(float)

for name, X in [("adversarial, N = 2", adv), ("stochastic, N = 50", sto)]:
    N = X.shape[1]
    eta = np.sqrt(8 * np.log(N) / T)              # tuning of Theorem 2.2
    bound = np.sqrt(T / 2 * np.log(N))
    print(f"{name}: FTL {ftl_regret(X):7.1f} | EWA {ewa_regret(X, eta):6.1f}"
          f" | bound {bound:5.1f}")

On the unstable sequence, follow-the-leader has regret 5000.0, exactly T/2, and EWA has regret 29.7, below its bound 58.9. On the stochastic experts both have regret near 112, below the bound 139.9: when the data are benign, the leader is stable and regularization costs little.

Key takeaways — chapter 2

  • Exponential weights put on each expert a weight decreasing exponentially with its cumulative loss.
  • The potential proof gives the regret bound \sqrt{(T/2) \ln N}, logarithmic in the number of experts.
  • Random losses show that the \sqrt{T \ln N} rate and its constant are optimal.
  • Exp-concave losses, such as the logarithmic and square losses, enjoy a regret independent of T.

3. Online convex optimization and stochastic optimization

When the decision is a vector and the losses are convex, gradient steps replace the weights on experts. This chapter proves the regret of online gradient descent, unifies it with exponential weights through regularization, and turns regret bounds into rates for stochastic optimization.

3.1 Online gradient descent

Let K \subset \mathbb{R}^d be closed and convex with diameter D, and let the losses f_t be convex on K with subgradients of norm at most G.

Definition 3.1 — Online gradient descent (OGD) Start from x_1 \in K. After observing f_t, pick g_t \in \partial f_t(x_t) and set x_{t+1} = \Pi_K\big( x_t - \eta_t\, g_t \big) .

Theorem 3.2 — Regret of online gradient descent (Zinkevich, 2003) With a constant step \eta, for every u \in K, R_T(u) \leq \frac{D^2}{2 \eta} + \frac{\eta\, G^2 T}{2} . The step \eta = D / (G \sqrt{T}) gives R_T \leq D G \sqrt{T}, and the anytime step \eta_t = D / (G \sqrt{t}) gives R_T \leq \frac{3}{2} D G \sqrt{T}.

Proof.

  1. Convexity. f_t(x_t) - f_t(u) \leq \langle g_t, x_t - u \rangle.
  2. One step. By Proposition 0.2 and an expansion of the square, \|x_{t+1} - u\|^2 \leq \|x_t - u\|^2 - 2 \eta \langle g_t, x_t - u \rangle + \eta^2 G^2 .
  3. Sum. Isolate the inner product, sum over t: the distances telescope, and the first one is at most D.

For the anytime step, the telescoping sum with weights 1/(2\eta_t) is at most D^2/(2\eta_T), and the sum of the \eta_t is at most 2 D \sqrt{T} / G. ∎

Theorem 3.3 — Strongly convex losses (Hazan, Agarwal and Kale, 2007) If every f_t is \alpha-strongly convex, OGD with \eta_t = 1/(\alpha t) satisfies R_T \leq \frac{G^2}{2 \alpha} \big( 1 + \ln T \big) .

Proof. Strong convexity improves step 1 by the term -\frac{\alpha}{2} \|x_t - u\|^2. Combined with step 2, 2 \big( f_t(x_t) - f_t(u) \big) \leq \alpha (t - 1) \|x_t - u\|^2 - \alpha t\, \|x_{t+1} - u\|^2 + \frac{G^2}{\alpha t} . The first two terms telescope to a non-positive sum, and the harmonic sum is at most 1 + \ln T. ∎

3.2 Follow the regularized leader

Definition 3.4 — Follow the regularized leader (FTRL) Let \psi be a strongly convex regularizer on K. With linearized losses \langle g_s, x \rangle, FTRL plays x_t = \operatorname*{arg\,min}_{x \in K} \Big( \sum_{s < t} \langle g_s, x \rangle + \frac{\psi(x)}{\eta} \Big) .

Two regularizers recover the algorithms seen so far.

Theorem 3.5 — Regret of FTRL If \psi is 1-strongly convex for a norm with dual norm \|\cdot\|_*, then for every u \in K, R_T(u) \leq \frac{\psi(u) - \min_K \psi}{\eta} + \eta \sum_{t=1}^T \|g_t\|_*^2 .

Proof.

  1. Be the leader. By induction on T, the player who could use x_{t+1} at round t would beat every u up to the regularization: \sum_{t=1}^T \langle g_t, x_{t+1} \rangle \leq \sum_{t=1}^T \langle g_t, u \rangle + \frac{\psi(u) - \psi(x_1)}{\eta} .
  2. Stability. The objectives defining x_t and x_{t+1} are (1/\eta)-strongly convex and differ by a linear term. Adding their two strong-convexity inequalities gives \|x_t - x_{t+1}\| \leq \eta \|g_t\|_*.
  3. Hence \langle g_t, x_t - x_{t+1} \rangle \leq \eta \|g_t\|_*^2; add step 1. ∎

On the simplex with losses in [0, 1], the entropy is 1-strongly convex for the \ell_1 norm (Pinsker’s inequality) and has range \ln N. Theorem 3.5 gives a regret of order \sqrt{T \ln N}. The squared Euclidean norm gives \sqrt{N T} instead, because the gradients have Euclidean norm up to \sqrt{N}. The geometry of the regularizer matters: this is the idea of mirror descent (Shalev-Shwartz, 2012; Hazan, 2016).

3.3 From online to batch: stochastic optimization

Theorem 3.6 — Online-to-batch conversion (Cesa-Bianchi, Conconi and Gentile, 2004) Let Z_1, Z_2, \dots be i.i.d., f_t = f(\cdot, Z_t) convex, and F(x) = \mathbb{E}[f(x, Z)]. If an online algorithm has regret R_T(u) and \bar x_T is the average of its iterates, then \mathbb{E}\big[ F(\bar x_T) \big] - F(u) \leq \frac{\mathbb{E}[R_T(u)]}{T} .

Proof. The iterate x_t depends only on Z_1, \dots, Z_{t-1}, so the conditional expectation of f(x_t, Z_t) is F(x_t).

By Jensen’s inequality, F(\bar x_T) is at most the average of the F(x_t). Taking expectations, the excess risk is at most the expected regret divided by T. ∎

Corollary 3.7 — Rates of the stochastic gradient method OGD fed with one sample per step is projected stochastic gradient descent on F. Its averaged iterate satisfies \mathbb{E}[F(\bar x_T)] - \min_K F \leq \frac{3 D G}{2 \sqrt{T}}, \qquad \text{or} \qquad \leq \frac{G^2 (1 + \ln T)}{2 \alpha T} \ \text{ if } f \text{ is } \alpha\text{-strongly convex} .

The same algorithm thus has an adversarial guarantee and a statistical one. The logarithm of the strongly convex rate can be removed by averaging only the last iterates (Rakhlin, Shamir and Sridharan, 2012). The block runs OGD on a synthetic spam-filtering task with the logistic loss, on the ball of radius 5.

import numpy as np
rng = np.random.default_rng(1)
T, d, r = 5000, 20, 5.0                    # rounds, features, radius of the ball K
w_star = rng.normal(size=d); w_star *= 3 / np.linalg.norm(w_star)

def sample(n):                             # features z, label y = +1 (spam) or -1
    z = rng.normal(size=(n, d)) * 2 / np.sqrt(d)
    y = np.where(rng.random(n) < 1 / (1 + np.exp(-z @ w_star)), 1, -1)
    return z, y

def loss(w, z, y):  return np.logaddexp(0, -y * (z @ w))
def grad(w, z, y):  return -(y / (1 + np.exp(y * (z @ w))))[..., None] * z
def proj(w):        return w * min(1, r / np.linalg.norm(w))

Z, Y = sample(T)
G, D = np.linalg.norm(Z, axis=1).max(), 2 * r   # gradient bound, diameter of K
w, w_bar, total = np.zeros(d), np.zeros(d), 0.0
for t in range(T):
    total += loss(w, Z[t], Y[t])
    w_bar += (w - w_bar) / (t + 1)              # running average (online-to-batch)
    w = proj(w - D / (G * np.sqrt(t + 1)) * grad(w, Z[t], Y[t]))

u = np.zeros(d)                                 # best fixed vector in hindsight
for _ in range(2000):
    u = proj(u - 2.0 * grad(u, Z, Y).mean(axis=0))
regret = total - loss(u, Z, Y).sum()
print(f"regret {regret:.1f}  bound 1.5*D*G*sqrt(T) = {1.5 * D * G * np.sqrt(T):.0f}"
      f"  regret/T = {regret / T:.4f}")

Zt, Yt = sample(200_000)                        # fresh data: population risk
print(f"risk of averaged iterate {loss(w_bar, Zt, Yt).mean():.4f}, "
      f"of u {loss(u, Zt, Yt).mean():.4f}, of w* {loss(w_star, Zt, Yt).mean():.4f}")

The regret is 127.6, far below the worst-case bound 3498, that is 0.026 per email. On fresh data, the averaged iterate has logistic risk 0.5523, against 0.5518 for the best vector in hindsight and 0.5489 for the true parameter.

Key takeaways — chapter 3

  • Online gradient descent has regret D G \sqrt{T} for convex losses, and \ln T for strongly convex ones.
  • Follow-the-regularized-leader unifies gradient descent and exponential weights; the regularizer adapts the algorithm to the geometry of the decision set.
  • Online-to-batch conversion: the average iterate has excess risk at most the regret divided by T, which gives the rates of stochastic gradient descent.

4. Adversarial bandits

In ad selection, the learner sees whether the displayed ad was clicked, and nothing about the others. This chapter shows how exponential weights survive this loss of information, and what it costs.

4.1 Estimating what was not observed

The protocol is that of ch. 2, with an oblivious environment: at round t the learner draws an arm I_t from p_t, suffers \ell_t(I_t) \in [0, 1] and observes only this number. The benchmark is the pseudo-regret \bar R_T = \mathbb{E}\Big[ \sum_{t=1}^T \ell_t(I_t) \Big] - \min_{i} \sum_{t=1}^T \ell_t(i) .

Definition 4.1 — Importance-weighted estimator The estimated loss of arm i at round t is \hat\ell_t(i) = \frac{\ell_t(i)}{p_t(i)}\, \mathbf{1}\{I_t = i\} . It is computable, since it vanishes for every arm except the one played.

Lemma 4.2 — Mean and second moment Conditionally on the past, writing \mathbb{E}_t for this conditional expectation, for every arm i, \mathbb{E}_t\big[ \hat\ell_t(i) \big] = \ell_t(i), \qquad \mathbb{E}_t\Big[ \sum_{i=1}^N p_t(i)\, \hat\ell_t(i)^2 \Big] = \sum_{i=1}^N \ell_t(i)^2 \leq N . Proof. Arm i is drawn with probability p_t(i); in that case the estimate is \ell_t(i)/p_t(i) and its weighted square is \ell_t(i)^2/p_t(i).

The estimator is unbiased, but its variance blows up when p_t(i) is small; the weighting by p_t in the regret bound exactly compensates.

4.2 EXP3

Algorithm 4.3 — EXP3 (Auer, Cesa-Bianchi, Freund and Schapire, 2002) Run exponential weights (Definition 2.1) on the estimated losses: p_t(i) is proportional to e^{-\eta \hat L_{t-1}(i)}, where \hat L_{t-1}(i) is the sum of the estimates up to round t - 1. Draw I_t from p_t.

Theorem 4.4 — Regret of EXP3 Against an oblivious environment, \bar R_T \leq \frac{\ln N}{\eta} + \frac{\eta N T}{2}, \qquad \text{so} \qquad \bar R_T \leq \sqrt{2 N T \ln N} \ \text{ for } \ \eta = \sqrt{\frac{2 \ln N}{N T}} .

Proof.

  1. The estimates are non-negative, so Lemma 2.5 holds on every trajectory, for every arm i.
  2. Take expectations. By Lemma 4.2, the left-hand side becomes the expected loss of the learner minus the loss of arm i; the second-order term is at most N T.
  3. The environment is oblivious, so the losses of arm i are not random, and the bound holds for the best arm. ∎

With N = 10 arms and T = 50{,}000 rounds, the bandit bound is about 1517, against 240 for full information. The price of seeing a single loss is a factor \frac{\sqrt{2 N T \ln N}}{\sqrt{(T/2) \ln N}} = \sqrt{4 N} \approx 6.3 .

4.3 The lower bound

Theorem 4.5 — Minimax lower bound (Auer et al., 2002) For every N \geq 2, every T and every algorithm, some oblivious sequence of losses gives \bar R_T \geq \frac{1}{20} \min\big( \sqrt{N T},\ T \big) . Proof idea. Let all arms have Bernoulli losses of mean 1/2, except one random arm of mean 1/2 - \varepsilon. To find the good arm, the learner must sample most arms about 1/\varepsilon^2 times, otherwise it cannot tell them apart; the change-of-measure argument of ch. 9.1 makes this precise. The choice \varepsilon \approx \sqrt{N/T} gives a regret of order \varepsilon T = \sqrt{N T}.

The \sqrt{\ln N} gap between Theorems 4.4 and 4.5 is closed by FTRL with other regularizers (Audibert and Bubeck, 2009; Zimmert and Seldin, 2021). EXP3 controls the expected regret only; high-probability versions add implicit exploration (Neu, 2015).

import numpy as np
rng = np.random.default_rng(2)
T, N = 50_000, 10
# Oblivious adversary: loss levels drift with time, arm 0 is always 0.1 better
drift = 0.5 + 0.35 * np.sin(2 * np.pi * np.arange(T) / 7000)
means = np.clip(drift[:, None] + np.where(np.arange(N) == 0, -0.1, 0.0), 0, 1)
losses = (rng.random((T, N)) < means).astype(float)   # drawn once, before play

def exp3(losses, eta, rng):
    Lhat, total = np.zeros(losses.shape[1]), 0.0   # estimated cumulative losses
    for l, u in zip(losses, rng.random(len(losses))):
        w = np.exp(-eta * (Lhat - Lhat.min()))
        p = w / w.sum()
        i = min(np.searchsorted(np.cumsum(p), u), len(p) - 1)   # draw I_t ~ p_t
        total += l[i]                              # only l[i] is observed
        Lhat[i] += l[i] / p[i]                     # importance-weighted estimate
    return total

best = losses.sum(axis=0).min()
eta = np.sqrt(2 * np.log(N) / (N * T))
regrets = [exp3(losses, eta, np.random.default_rng(s)) - best for s in range(5)]
print("EXP3 regrets over 5 runs:", np.round(regrets).astype(int))
print(f"mean {np.mean(regrets):.0f} | bound sqrt(2NT ln N) = {np.sqrt(2*N*T*np.log(N)):.0f}"
      f" | uniform play: {losses.mean(axis=1).sum() - best:.0f}")

Over five runs the regret of EXP3 ranges from 913 to 1231, with mean 1034, below the bound 1517. Playing uniformly at random would cost 4552.

Key takeaways — chapter 4

  • Importance weighting turns bandit feedback into unbiased estimates of the whole loss vector.
  • EXP3 is exponential weights on these estimates; its pseudo-regret is at most \sqrt{2 N T \ln N}.
  • Bandit feedback costs a factor of order \sqrt{N}, and no algorithm beats \sqrt{N T} up to constants.

5. Stochastic bandits

When the rewards of each arm are i.i.d., the learner can estimate the best arm and stop exploring the others. This chapter shows that the regret then grows only logarithmically, at a rate fixed by the gaps between arms.

5.1 The model and the regret decomposition

Arm i gives i.i.d. rewards in [0, 1] with mean \mu_i.

Let \mu^\star be the largest mean, \Delta_i = \mu^\star - \mu_i the gap of arm i, and n_i(T) the number of pulls of arm i up to T.

Proposition 5.1 — Regret decomposition The regret against the best arm satisfies R_T = T \mu^\star - \mathbb{E}\Big[ \sum_{t=1}^T \mu_{I_t} \Big] = \sum_{i=1}^N \Delta_i\, \mathbb{E}\big[ n_i(T) \big] . Proof. Given the past, the expected reward at round t is \mu_{I_t}; group the rounds by arm.

A good algorithm pulls each suboptimal arm rarely. Exploring each arm a fixed number of times and then committing works only if the gaps are known (Exercise 6).

5.2 Optimism: UCB

Algorithm 5.2 — UCB with horizon T Pull each arm once. Then pull the arm with the largest index U_i(t) = \hat\mu_i(t) + \sqrt{\frac{\ln T}{n_i(t)}}, where \hat\mu_i(t) and n_i(t) are the empirical mean and the number of pulls of arm i before round t.

The index is an upper confidence bound: the algorithm acts as if each arm were as good as plausible. A bad arm keeps a high index only while it has been pulled few times.

Theorem 5.3 — Logarithmic regret of UCB For every instance, R_T \leq \sum_{i : \Delta_i > 0} \Big( \Delta_i + \frac{4 \ln T}{\Delta_i} \Big) + 2 N .

Proof.

  1. Confidence. Let c(n) be the square root of \ln T / n. By Hoeffding’s inequality, after n pulls the empirical mean deviates from \mu_i by c(n) or more on each side with probability at most 1/T^2.

  2. Good event. Let \mathcal{G} be the event that no such deviation occurs, for any arm and any n \leq T. A union bound gives \mathbb{P}(\mathcal{G}^c) \leq 2 N / T.

  3. On \mathcal{G}. If a suboptimal arm i with n pulls is chosen, its index beats that of the best arm, which exceeds \mu^\star. Its own index is below \mu_i + 2 c(n).

    Hence \Delta_i < 2 c(n), that is n < 4 \ln T / \Delta_i^2.

  4. Conclusion. On \mathcal{G}, arm i is pulled at most 1 + 4 \ln T/\Delta_i^2 times; off \mathcal{G} the regret is at most T. Proposition 5.1 concludes. ∎

Splitting the arms by whether \Delta_i exceeds 2\sqrt{N \ln T / T} gives a bound free of the gaps, R_T \leq 4 \sqrt{N T \ln T} + 3 N .

5.3 The lower bound and optimal algorithms

Theorem 5.4 — Lai and Robbins (1985) Consider Bernoulli arms and an algorithm whose regret is o(T^a) for every a > 0 on every Bernoulli instance. Then every suboptimal arm satisfies \liminf_{T \to \infty} \frac{\mathbb{E}[n_i(T)]}{\ln T} \geq \frac{1}{\mathrm{kl}(\mu_i, \mu^\star)}, \quad \text{hence} \quad \liminf_{T \to \infty} \frac{R_T}{\ln T} \geq \sum_{i : \Delta_i > 0} \frac{\Delta_i}{\mathrm{kl}(\mu_i, \mu^\star)} . The proof, by change of measure, is in ch. 9.1.

By Pinsker’s inequality, the constant \Delta_i / \mathrm{kl}(\mu_i, \mu^\star) is at most 1/(2\Delta_i). In the other direction, the divergence is at most the chi-square distance, so the constant is at least \frac{\Delta_i}{\mathrm{kl}(\mu_i, \mu^\star)} \geq \frac{\mu^\star (1 - \mu^\star)}{\Delta_i} . When \mu^\star stays away from 0 and 1, the term 4 / \Delta_i of UCB is therefore optimal up to a constant factor. Two algorithms reach the exact constant.

The block compares explore-then-commit, UCB and Thompson sampling on four Bernoulli arms with means 0.6, 0.5, 0.45 and 0.4, averaged over 100 runs.

import numpy as np
rng = np.random.default_rng(3)
mu = np.array([0.6, 0.5, 0.45, 0.4])         # Bernoulli means, arm 0 is optimal
N, R = len(mu), 100                          # arms, independent runs
gaps = mu.max() - mu

def kl(x, y):                                # Bernoulli Kullback-Leibler divergence
    return x * np.log(x / y) + (1 - x) * np.log((1 - x) / (1 - y))

def run(policy, T):
    n, s = np.zeros((R, N)), np.zeros((R, N))   # pull counts and reward sums
    m = int(np.ceil((T / N) ** (2 / 3)))        # exploration length of ETC
    regret, rows = np.zeros(R), np.arange(R)
    for t in range(T):
        if t < N:
            a = np.full(R, t)                  # pull every arm once
        elif policy == "UCB":
            a = np.argmax(s / n + np.sqrt(np.log(T) / n), axis=1)
        elif policy == "TS":                   # Thompson sampling, Beta(1, 1) prior
            a = np.argmax(rng.beta(1 + s, 1 + n - s), axis=1)
        else:                                  # explore-then-commit
            a = np.full(R, t % N) if t < m * N else np.argmax(s / n, axis=1)
        n[rows, a] += 1
        s[rows, a] += rng.random(R) < mu[a]
        regret += gaps[a]
    return regret.mean()

lr = sum(gaps[i] / kl(mu[i], mu[0]) for i in range(1, N))
for T in [2_000, 20_000]:
    res = {p: run(p, T) for p in ["ETC", "UCB", "TS"]}
    print(f"T = {T:6d}: " + "  ".join(f"{p} {v:6.1f}" for p, v in res.items())
          + f"  | Lai-Robbins {lr:.1f} x ln T = {lr * np.log(T):5.1f}"
          + f"  | UCB bound {sum(g + 4 * np.log(T) / g for g in gaps[1:]) + 2 * N:4.0f}")

From T = 2000 to T = 20{,}000, the regret of explore-then-commit grows from 34.6 to 132.9, like its T^{2/3} exploration length. That of UCB grows from 71.5 to 152.1, and that of Thompson sampling from 30.5 to 52.3. The Lai–Robbins constant is 10.6, so the asymptotic lower bound at T = 20{,}000 is about 105. It is a limit statement: Thompson sampling is below it at this horizon. The UCB bound, 867, is pessimistic but of the right order in T.

Key takeaways — chapter 5

  • The regret of a stochastic bandit is the sum of the gaps weighted by the expected numbers of pulls.
  • UCB pulls each suboptimal arm about \ln T / \Delta_i^2 times, for a regret of order \sum_i \ln T / \Delta_i.
  • Lai and Robbins: no consistent algorithm does better than \sum_i \Delta_i \ln T / \mathrm{kl}(\mu_i, \mu^\star); KL-UCB and Thompson sampling attain it.

6. Games and no-regret dynamics

When several learners play against each other, each one is the environment of the others. This chapter shows that no-regret learners reach equilibria, which gives a short proof of the minimax theorem, a view of boosting, and a route to correlated equilibria.

6.1 Zero-sum games and the minimax theorem

Definition 6.1 — Zero-sum game A matrix A \in [0, 1]^{N \times M} defines a game in which the row player chooses p \in \Delta_N, the column player chooses q \in \Delta_M, and the row player pays p^\top A q to the column player.

A pair (p, q) is an \varepsilon-Nash equilibrium if neither player can gain more than \varepsilon by deviating alone.

Theorem 6.2 — Minimax theorem (von Neumann), proved by regret For every matrix A, \min_{p \in \Delta_N} \max_{q \in \Delta_M} p^\top A q = \max_{q \in \Delta_M} \min_{p \in \Delta_N} p^\top A q .

Proof. The inequality \geq holds for any function. For the converse, follow Freund and Schapire (1999).

  1. The row player runs Hedge on the loss vectors A q_t; the column player best-responds, with q_t maximizing p_t^\top A q. Let \bar p and \bar q be the averages.
  2. Upper side. By convexity of the maximum, \min_p \max_q p^\top A q \leq \max_q \bar p^\top A q \leq \frac{1}{T} \sum_{t} \max_q p_t^\top A q = \frac{1}{T} \sum_t p_t^\top A q_t .
  3. Lower side. By Theorem 2.2, the average loss of the row player is at most that of the best fixed p plus the regret: \frac{1}{T} \sum_t p_t^\top A q_t \leq \min_p p^\top A \bar q + \sqrt{\frac{\ln N}{2T}} \leq \max_q \min_p p^\top A q + \sqrt{\frac{\ln N}{2T}} .
  4. Let T \to \infty. ∎

Corollary 6.3 — Self-play reaches equilibrium If the two players use algorithms with regrets R^1_T and R^2_T, the averaged strategies (\bar p, \bar q) form an \varepsilon-Nash equilibrium with \varepsilon = (R^1_T + R^2_T)/T.

Proof. The regret of the column player gives a maximum of \bar p^\top A q at most the average payoff plus R^2_T/T. The regret of the row player gives a minimum of p^\top A \bar q at least the average payoff minus R^1_T/T. Subtract.

The block lets two Hedge players face each other on a random 6 \times 4 game and compares with the value computed by linear programming.

import numpy as np
from scipy.optimize import linprog
rng = np.random.default_rng(4)
N, M = 6, 4
A = rng.random((N, M))       # row player pays A[i, j] to the column player

# Value of the game by linear programming: min v s.t. (p^T A)_j <= v, p in simplex
res = linprog(c=np.r_[np.zeros(N), 1], A_ub=np.c_[A.T, -np.ones(M)], b_ub=np.zeros(M),
              A_eq=[np.r_[np.ones(N), 0]], b_eq=[1], bounds=[(0, None)] * N + [(None, None)])
print(f"value of the game (LP): {res.fun:.4f}")

def softmax(x):
    w = np.exp(x - x.max()); return w / w.sum()

for T in [100, 1_000, 10_000]:
    eta_r, eta_c = np.sqrt(8 * np.log(N) / T), np.sqrt(8 * np.log(M) / T)
    Lr, Gc = np.zeros(N), np.zeros(M)           # cumulative losses / gains
    p_bar, q_bar = np.zeros(N), np.zeros(M)
    for t in range(T):
        p, q = softmax(-eta_r * Lr), softmax(eta_c * Gc)   # both players run Hedge
        Lr += A @ q
        Gc += A.T @ p
        p_bar += p / T
        q_bar += q / T
    gap = (p_bar @ A).max() - (A @ q_bar).min()          # duality gap of the averages
    bound = np.sqrt(np.log(N) / (2 * T)) + np.sqrt(np.log(M) / (2 * T))
    print(f"T = {T:5d}: p_bar A q_bar = {p_bar @ A @ q_bar:.4f}, "
          f"duality gap {gap:.4f} <= {bound:.4f}")

The value of the game is 0.6655. The duality gap of the averaged strategies falls from 0.0618 at T = 100 to 0.0155 at T = 1000 and 0.0046 at T = 10{,}000, each time below the bound of Corollary 6.3.

6.2 Boosting as a game

Boosting combines weak classifiers, each barely better than chance, into an accurate one. Freund and Schapire (1997, 1999) read it as a zero-sum game between a distribution on the training examples and a weak learner.

Theorem 6.4 — Boosting by exponential weights Let (x_j, y_j)_{j \leq m} be a training set. Assume a weak learner that, for every distribution D on the examples, returns a classifier h whose D-weighted accuracy is at least 1/2 + \gamma.

Run Hedge over the examples, where example j suffers loss 1 at round t when h_t classifies it correctly, and h_t is the answer of the weak learner to the current weights. If T > \ln m / (2 \gamma^2), the majority vote of h_1, \dots, h_T classifies every training example correctly.

Proof. By weak learning, the weighted loss \langle D_t, \ell_t \rangle is at least 1/2 + \gamma at every round. By Theorem 2.2 with m experts, every example j satisfies \sum_{t=1}^T \ell_t(j) \geq \Big( \frac{1}{2} + \gamma \Big) T - \sqrt{\frac{T}{2} \ln m} > \frac{T}{2} . So each example is classified correctly by more than half of the h_t. ∎

Hard examples gain weight, easy ones lose it. AdaBoost adapts the learning rate to the accuracy of each h_t (Freund and Schapire, 1997).

6.3 General games, correlated equilibria and swap regret

Definition 6.5 — Correlated equilibria In a game with players k = 1, \dots, K, finite action sets \mathcal{A}_k and losses \ell_k(a), a distribution \pi on action profiles is

  • a coarse correlated equilibrium (CCE) if no player gains by replacing her action with a fixed action a'_k: the expected loss of \ell_k(a) under \pi is at most that of \ell_k(a'_k, a_{-k});
  • a correlated equilibrium (CE) if no player gains by applying a fixed map \varphi : \mathcal{A}_k \to \mathcal{A}_k to her action.

A Nash equilibrium is a CE that is a product distribution, so Nash \subset CE \subset CCE.

A CE is what a mediator can recommend: each player hears only her own action, and obeying is a best response.

Definition 6.6 — Swap regret A learner who plays p_t \in \Delta_N against loss vectors \ell_t has swap regret R^{\mathrm{swap}}_T = \max_{\varphi : [N] \to [N]} \sum_{t=1}^T \sum_{i=1}^N p_t(i) \big( \ell_t(i) - \ell_t(\varphi(i)) \big) . External regret is the special case of constant maps \varphi.

Theorem 6.7 — No-regret play reaches correlated equilibria If every player’s external regret, computed on the realized actions of the others, is at most R_T, the empirical distribution of the profiles a_1, \dots, a_T is an (R_T/T)-CCE. With swap regret instead, it is an (R_T/T)-CE.

Proof. Under the empirical distribution, the expected loss of player k is her average loss; the loss after deviating to a'_k (or after applying \varphi) is the average loss of that deviation. Their difference is her regret divided by T.

Theorem 6.8 — From external to swap regret (Blum and Mansour, 2007) Run N copies of an algorithm with external regret at most R(T).

At round t, let q^j_t be the distribution proposed by copy j, let Q_t be the stochastic matrix with rows q^j_t, and play a stationary distribution, p_t = p_t Q_t.

Copy j receives the loss vector p_t(j)\, \ell_t. Then R^{\mathrm{swap}}_T \leq N\, R(T) .

Proof.

  1. Stationarity. The learner’s loss splits along the copies: \langle p_t, \ell_t \rangle = \sum_{j} p_t(j) \langle q^j_t, \ell_t \rangle .
  2. Each copy. For every map \varphi, the regret of copy j against the action \varphi(j) gives \sum_t p_t(j) \langle q^j_t, \ell_t \rangle \leq \sum_t p_t(j)\, \ell_t(\varphi(j)) + R(T) .
  3. Sum over j. ∎

With Hedge copies, the swap regret is at most N \sqrt{(T/2) \ln N}; a finer analysis gives order \sqrt{N T \ln N} (Blum and Mansour, 2007).

Example 6.9 — Bidding in repeated first-price auctions A bidder of value 1 bids b in the grid \{0, 1/K, \dots, 1\} and wins when b exceeds the highest competing bid m_t. Her gain is g_t(b) = (1 - b)\, \mathbf{1}\{b > m_t\} \in [0, 1] . If m_t is published after each auction, the gain of every bid is known: this is prediction with K + 1 experts, and Hedge has regret at most \sqrt{(T/2) \ln(K + 1)} against the best grid bid.

Rounding a bid up to the grid keeps every win and costs at most 1/K per auction. With T = 10{,}000 and K = 100, the regret against every bid in [0, 1] is at most \sqrt{5000 \ln 101} + 100 \approx 251.9 . When all bidders learn this way, their empirical play approaches a CCE (Theorem 6.7), and efficiency guarantees proved for all CCE apply to it (Roughgarden, 2015). If only the win is observed, the feedback is partial (ch. 8.1).

Key takeaways — chapter 6

  • Two no-regret learners in a zero-sum game converge, in average, to a Nash equilibrium; this proves the minimax theorem.
  • Boosting is Hedge over the training examples against a weak learner.
  • External regret leads to coarse correlated equilibria, swap regret to correlated equilibria.
  • Any external-regret algorithm becomes a swap-regret algorithm through stationary distributions.

7. Blackwell approachability and calibration

Some goals are not a single number to minimize but a set to reach, such as “all regrets non-positive” or “forecasts that match frequencies”. Blackwell’s approachability theorem handles such goals in games with vector payoffs, and calibration is its best-known application.

7.1 Games with vector payoffs

Definition 7.1 — Approachability A game with vector payoffs gives r(i, j) \in \mathbb{R}^d when the player chooses i \in [N] and nature chooses j \in [M]; write r(p, j) for the average over i \sim p.

A closed set S is approachable if the player has a strategy such that, for every strategy of nature, the distance from the average payoff \bar r_T to S tends to 0.

Theorem 7.2 — Blackwell’s approachability theorem (Blackwell, 1956) Let S be closed and convex. Assume Blackwell’s condition: for every x \notin S, with \pi = \Pi_S(x), some p \in \Delta_N satisfies \langle x - \pi,\ r(p, j) - \pi \rangle \leq 0 \quad \text{for every } j . Play such a p_t for x = \bar r_{t-1}, the average of the expected payoffs r_s = r(p_s, j_s). If K bounds the distances \|r_t - \Pi_S(\bar r_{t-1})\|, then

Key result — the rate of approachability d(\bar r_T, S) \leq \frac{K}{\sqrt{T}} .

Proof. Let D_t = d(\bar r_t, S) and \pi_{t-1} = \Pi_S(\bar r_{t-1}). Since \pi_{t-1} \in S, D_t is at most the distance from \bar r_t to \pi_{t-1}.

  1. Decomposition. By definition of the averages, t\, (\bar r_t - \pi_{t-1}) = (t - 1)(\bar r_{t-1} - \pi_{t-1}) + (r_t - \pi_{t-1}) .
  2. Square. The cross term is non-positive by the choice of p_t, so t^2 D_t^2 \leq (t - 1)^2 D_{t-1}^2 + K^2 .
  3. Induction. t^2 D_t^2 \leq t K^2. ∎

By the minimax theorem applied to the scalar game in the condition, Blackwell’s condition holds exactly when, for every mixed action q of nature, some p gives r(p, q) \in S. A convex set is therefore approachable if and only if every mixed action of nature can be answered inside S. With realized instead of expected payoffs, Theorem 0.4 adds a term of order \sqrt{\ln(1/\delta)/T}.

7.2 Regret matching

Take the regret vector r(p, \ell) \in \mathbb{R}^N, with components \langle p, \ell \rangle - \ell(k). No regret means that the average approaches the negative orthant. The projection of x onto the orthant leaves x - \pi = x_+, the positive part, so Blackwell’s condition asks that \langle x_+, r(p, \ell) \rangle \leq 0 for every \ell.

Proposition 7.3 — Regret matching (Hart and Mas-Colell, 2000) Let R_{t-1} be the vector of cumulative regrets. Playing p_t proportional to its positive part (uniform if it vanishes) gives, for losses in [0, 1], \max_{k} R_T(k) \leq \sqrt{N T} .

Proof. With p_t proportional to (R_{t-1})_+, the inner product of (R_{t-1})_+ with r_t vanishes, since both terms equal the total positive regret times \langle p_t, \ell_t \rangle.

For real numbers, the square of (x + y)_+ is at most x_+^2 + 2 x_+ y + y^2. Summing over coordinates, the squared norm of the positive regrets increases by at most \|r_t\|^2 \leq N per round. Hence it is at most N T at time T. ∎

Regret matching needs no learning rate, at the price of \sqrt{N} instead of \sqrt{\ln N}. Its version on internal regrets leads to correlated equilibria (Theorem 6.7).

7.3 Calibration

A weather forecaster announces each evening a probability of rain for the next day. She is calibrated if, among the days announced with probability 30 %, it rained on about 30 % of them.

Definition 7.4 — Calibration score The forecaster announces p_t in the grid \{0, 1/N, \dots, 1\} and then observes y_t \in \{0, 1\}.

The deficit B_T(k) of bin k is the sum of y_t - k/N over the rounds with p_t = k/N. The calibration score is C_T = \frac{1}{T} \sum_{k=0}^N \big| B_T(k) \big| = \sum_{k=0}^N \frac{n_T(k)}{T}\, \big| \rho_T(k) - \tfrac{k}{N} \big|, where n_T(k) is the number of rounds with forecast k/N and \rho_T(k) the frequency of ones among them. The forecaster is \varepsilon-calibrated if the limit superior of C_T is at most \varepsilon.

Proposition 7.5 — Deterministic forecasters are not calibrated (Oakes, 1985) Against every deterministic forecaster, some sequence of outcomes gives C_T \geq 1/2 for every T.

Proof. Let y_t = 1 if p_t < 1/2 and y_t = 0 otherwise. Every bin with k/N < 1/2 contains only ones, and every other bin only zeros. In both cases |\rho_T(k) - k/N| \geq 1/2. ∎

Theorem 7.6 — A calibrated randomized forecaster (after Foster and Vohra, 1998) Forecast as follows, from the current deficits B(k).

  • If B(0) \leq 0, forecast 0; else, if B(N) \geq 0, forecast 1.
  • Otherwise pick k with B(k) > 0 \geq B(k+1), and forecast k/N or (k+1)/N with the probabilities that make the expected deficit-weighted outcome independent of y.

Against any adaptive opponent who does not see the forecaster’s coin, \mathbb{E}[C_T] \leq \sqrt{\frac{N + 1}{T}} + \frac{\sqrt{N + 1}}{2 \sqrt{2}\, N} .

Proof. Let \Phi_t be the sum of the squares B_t(k)^2, and J the index forecast at round t.

  1. Increment. \Phi_t - \Phi_{t-1} = 2 B(J)(y_t - J/N) + (y_t - J/N)^2, and the last term is at most 1.
  2. Cross term. In the first two cases it is non-positive. In the third, with a = B(k) and b = -B(k+1), a direct computation gives the expectation 2ab/((a + b)N), at most \sqrt{\Phi_{t-1}}/(\sqrt{2} N).
  3. Recursion. By Jensen’s inequality, u_t = \mathbb{E}[\Phi_t] satisfies u_t \leq u_{t-1} + \sqrt{u_{t-1}}/(\sqrt{2} N) + 1, and an induction gives \sqrt{u_T} \leq \sqrt{T} + \frac{T}{2\sqrt{2}\, N} .
  4. Score. By Cauchy–Schwarz, T C_T \leq \sqrt{(N + 1)\, \Phi_T}. ∎

For large T the guarantee is about 0.35/\sqrt{N}: refining the grid improves calibration. The potential \Phi is Blackwell’s squared distance to the target \{0\}, which is approachable only up to the grid error.

import numpy as np
rng = np.random.default_rng(5)
N, T = 20, 100_000                    # grid {0, 1/N, ..., 1} and horizon

def calibrated_mix(B):
    """Forecast of Theorem 7.6 from the deficits B(k): two grid points and a weight."""
    if B[0] <= 0: return 0, 0, 1.0
    if B[N] >= 0: return N, N, 1.0
    k = np.flatnonzero((B[:-1] > 0) & (B[1:] <= 0))[0]     # sign change k -> k+1
    return k, k + 1, -B[k + 1] / (B[k] - B[k + 1])        # P(forecast k/N) = q

def score(B, t):                      # calibration score (1/t) sum_k |B(k)|
    return np.abs(B).sum() / t

for adversary in ["adaptive", "i.i.d. 0.3"]:
    B = np.zeros(N + 1)
    for t in range(T):
        k0, k1, q = calibrated_mix(B)
        if adversary == "adaptive":   # sees the mixed forecast, not the coin
            y = float((q * k0 + (1 - q) * k1) / N < 0.5)
        else:
            y = float(rng.random() < 0.3)
        k = k0 if rng.random() < q else k1        # the forecaster's private coin
        B[k] += y - k / N
    bound = np.sqrt((N + 1) / T) + np.sqrt(N + 1) / (2 * np.sqrt(2) * N)
    print(f"{adversary:10s}: calibration score {score(B, T):.4f} (bound {bound:.4f})")

# A deterministic forecaster (running frequency) against y_t = 1{p_t < 1/2}
B, ones = np.zeros(N + 1), 0
for t in range(T):
    k = int(round(N * ones / max(t, 1)))
    y = float(k / N < 0.5)
    ones += y
    B[k] += y - k / N
print(f"deterministic forecaster: calibration score {score(B, T):.4f}")

With N = 20 and T = 100{,}000, the randomized forecaster has score 0.0017 against the adaptive opponent and 0.0097 on i.i.d. outcomes of mean 0.3, both below the bound 0.0955. The deterministic forecaster scores 0.5238, as Proposition 7.5 predicts.

7.4 Calibration, regret and equilibria

If every player best-responds to calibrated forecasts of the others’ actions, the empirical distribution of play converges to the set of correlated equilibria (Foster and Vohra, 1997). Perchet (2014) surveys how approachability, internal regret and calibration can each be derived from the others.

Key takeaways — chapter 7

  • A convex set is approachable when every mixed action of nature can be answered inside it; the distance then decreases like 1/\sqrt{T}.
  • Regret matching is Blackwell’s strategy for the negative orthant of regrets.
  • No deterministic forecaster is calibrated; a randomized one, built on a squared-deficit potential, is.
  • Calibrated forecasts and best responses lead to correlated equilibria.

8. Partial monitoring

Between full information and bandits lie games where the feedback is some other function of the action and the outcome. This chapter defines partial monitoring, proves a regret of order T^{2/3} for a game where information must be bought, and states the classification of finite games.

8.1 Loss and feedback matrices

Definition 8.1 — Finite partial-monitoring game A game is given by a loss matrix L \in [0, 1]^{N \times M} and a feedback matrix H whose entries are signals. At each round the environment picks an outcome j_t, the learner picks an action I_t, suffers L(I_t, j_t), and observes only the signal H(I_t, j_t). The regret is measured against the best fixed action.

The previous chapters are special cases, and the applications of the course description give new ones.

8.2 Buying information: the rate T^{2/3}

Theorem 8.2 — Regret in the revealing-action game Let N ordinary actions give no signal, and let a revealing action of loss 1 reveal j_t. Each round, with probability \gamma, play the revealing action; otherwise draw I_t from exponential weights run on the estimates \hat\ell_t(i) = \frac{L(i, j_t)}{\gamma}\, \mathbf{1}\{\text{revealed at } t\} . Against an oblivious environment, with \gamma = (\ln N / (2T))^{1/3} and \eta the square root of 2 \gamma \ln N / T, \bar R_T \leq 3 \cdot 2^{-1/3}\, T^{2/3} (\ln N)^{1/3} \approx 2.38\, T^{2/3} (\ln N)^{1/3} .

Proof.

  1. Cost of information. The expected loss at round t is at most \gamma + \langle p_t, \ell_t \rangle.
  2. Estimates. They are unbiased, and the weighted second moment is at most 1/\gamma. Lemma 2.5, in expectation, gives \sum_t \mathbb{E} \langle p_t, \ell_t \rangle - \sum_t L(i, j_t) \leq \frac{\ln N}{\eta} + \frac{\eta T}{2 \gamma} .
  3. Tuning. The regret is at most \gamma T + \sqrt{2 T \ln N / \gamma} for the best \eta; minimizing in \gamma gives the constant. ∎

Exploration is now separated from exploitation: the informative action is never a good one, so its use must be rationed. Cesa-Bianchi, Lugosi and Stoltz (2006) show that the order T^{2/3} cannot be improved in such games.

import numpy as np
rng = np.random.default_rng(6)
N, M = 8, 5                                   # ordinary actions, outcomes
L = rng.random((N, M))                        # loss matrix; the revealing action costs 1

def play(T, rng):
    gamma = (np.log(N) / (2 * T)) ** (1 / 3)  # exploration rate of Theorem 8.2
    eta = np.sqrt(2 * gamma * np.log(N) / T)
    J = rng.choice(M, size=T, p=[0.4, 0.1, 0.1, 0.1, 0.3])   # oblivious outcomes
    Lhat, total = np.zeros(N), 0.0
    for t in range(T):
        if rng.random() < gamma:              # reveal: pay 1, see the whole loss vector
            total += 1.0
            Lhat += L[:, J[t]] / gamma        # unbiased estimate of the loss vector
        else:                                 # exploit: exponential weights, no feedback
            w = np.exp(-eta * (Lhat - Lhat.min()))
            i = min(np.searchsorted(np.cumsum(w / w.sum()), rng.random()), N - 1)
            total += L[i, J[t]]
    return total - L[:, J].sum(axis=1).min()  # regret against the best ordinary action

for T in [1_000, 10_000, 100_000]:
    reg = np.mean([play(T, np.random.default_rng(s)) for s in range(3)])
    bound = 3 * 2 ** (-1 / 3) * T ** (2 / 3) * np.log(N) ** (1 / 3)
    print(f"T = {T:6d}: regret {reg:7.1f}, regret / T^(2/3) = {reg / T ** (2 / 3):.3f}"
          f", bound {bound:7.1f}")

From T = 1000 to T = 100{,}000 the regret grows from 111.1 to 2376.7, while the ratio to T^{2/3} stays near 1.1, below the bound constant of about 3.0 for N = 8.

8.3 The classification of finite games

Whether a game is learnable at rate \sqrt{T} depends on what the signals reveal about the differences of losses.

Theorem 8.3 — Classification of finite games Up to logarithmic factors, the minimax regret of every finite partial-monitoring game is of one of four orders: 0, \qquad \sqrt{T}, \qquad T^{2/3}, \qquad T, for games that are trivial (one action is always optimal), locally observable, globally but not locally observable, and not globally observable.

Bartók, Foster, Pál, Rakhlin and Szepesvári (2014) proved it against stochastic environments, and Lattimore and Szepesvári (2019) completed the adversarial case. Bandits are locally observable; the revealing-action game is globally but not locally observable.

Key takeaways — chapter 8

  • Partial monitoring separates the loss of an action from what it reveals.
  • When information must be bought from a costly action, rationing it gives regret of order T^{2/3}, and no better.
  • Finite games fall into four classes, with regret of order 0, \sqrt{T}, T^{2/3} or T, decided by local and global observability.

9. Complements: lower bounds, adaptivity and structured bandits

This self-study chapter completes the course in four directions: the proof of the Lai–Robbins bound, regret bounds that adapt to easy data, bandits whose arms have features, and bandits whose goal is to identify the best arm rather than to earn rewards.

9.1 Change of measure and the Lai–Robbins bound

Lower bounds for bandits compare two instances that the algorithm cannot easily tell apart. Two lemmas make this precise.

Lemma 9.1 — Divergence decomposition Fix an algorithm and two bandit instances \nu and \nu', with arm distributions \nu_i and \nu'_i.

The laws \mathbb{P} and \mathbb{P}' of the history up to time T satisfy \mathrm{KL}(\mathbb{P}, \mathbb{P}') = \sum_{i=1}^N \mathbb{E}_\nu\big[ n_i(T) \big]\, \mathrm{KL}(\nu_i, \nu'_i) .

Proof. Apply the chain rule of the divergence round by round. Given the past, the algorithm chooses its arm with the same law under both instances, so the choice contributes nothing. The reward of arm I_t contributes \mathrm{KL}(\nu_{I_t}, \nu'_{I_t}); taking expectations and grouping the rounds by arm gives the formula. ∎

Lemma 9.2 — Data processing (Garivier, Ménard and Stoltz, 2019) For every random variable Z \in [0, 1] that is a function of the history, \mathrm{kl}\big( \mathbb{E}_\nu[Z],\ \mathbb{E}_{\nu'}[Z] \big) \leq \mathrm{KL}(\mathbb{P}, \mathbb{P}') .

Proof of Theorem 5.4. Fix a suboptimal arm i and \varepsilon > 0.

Let \nu' be \nu with arm i replaced by a Bernoulli arm of mean \mu^\star + \varepsilon, so that i is the only optimal arm of \nu'.

  1. Two expectations. Take Z = n_i(T)/T. The algorithm is consistent on both instances, so \mathbb{E}_\nu[Z] \to 0, and 1 - \mathbb{E}_{\nu'}[Z] is o(T^{a - 1}) for every a > 0.
  2. Lower bound on kl. For all x, y, \mathrm{kl}(x, y) \geq (1 - x) \ln \frac{1}{1 - y} - \ln 2. With step 1, the right-hand side is at least (1 - a) \ln T\, (1 - o(1)).
  3. Upper bound. By the two lemmas, since only arm i differs, the left-hand side is at most \mathbb{E}_\nu[n_i(T)]\, \mathrm{kl}(\mu_i, \mu^\star + \varepsilon) .
  4. Divide by \ln T, let T \to \infty, then a \to 0 and \varepsilon \to 0. ∎

The same two lemmas, with Pinsker’s inequality, give the \sqrt{N T} lower bound of Theorem 4.5 and the bounds of best-arm identification below.

9.2 Adapting to easy data

The bound \sqrt{(T/2) \ln N} is a worst case. When the best expert has a small cumulative loss L^\star, exponential weights do much better.

Proposition 9.3 — Small-loss bound For losses in [0, 1] and every \eta > 0, exponential weights satisfy \sum_{t=1}^T \langle p_t, \ell_t \rangle \leq \frac{\eta L^\star + \ln N}{1 - e^{-\eta}} .

Proof. By convexity of x \mapsto e^{-\eta x} on [0, 1], e^{-\eta x} \leq 1 - (1 - e^{-\eta}) x. Hence the potential ratio W_t / W_{t-1} is at most 1 - (1 - e^{-\eta}) \langle p_t, \ell_t \rangle, which is at most the exponential of minus the same product.

Summing the logarithms and using \ln W_T \geq -\eta L^\star gives the claim. ∎

A tuning of \eta in terms of L^\star gives a regret of order \sqrt{L^\star \ln N} + \ln N (Cesa-Bianchi and Lugosi, 2006, ch. 2). Since L^\star is unknown, adaptive algorithms tune themselves online.

9.3 Linear and contextual bandits

An ad server knows features of the user and of each ad. In a linear bandit, each round offers a set of feature vectors a \in \mathbb{R}^d, and the reward of a is \langle \theta^\star, a \rangle plus noise. The unknown parameter is shared by all arms, so information on one arm informs the others.

Algorithm 9.4 — LinUCB / OFUL Maintain the ridge statistics V_t = \lambda I + \sum_{s < t} a_s a_s^\top and the estimate \hat\theta_t = V_t^{-1} \sum_{s < t} r_s a_s. Play the optimistic choice a_t \in \operatorname*{arg\,max}_{a} \Big( \langle \hat\theta_t, a \rangle + \beta_t \sqrt{a^\top V_t^{-1} a} \Big), where \beta_t is the radius of a confidence ellipsoid for \theta^\star.

Abbasi-Yadkori, Pál and Szepesvári (2011) build this ellipsoid with a self-normalized martingale inequality and prove a regret of order d \sqrt{T} up to logarithmic factors, whatever the number of arms. Li, Chu, Langford and Schapire (2010) applied a version of LinUCB to news article recommendation.

import numpy as np
rng = np.random.default_rng(7)
d, K, T, lam, sigma = 5, 20, 5000, 1.0, 0.3     # dimension, ads per round, horizon
theta = rng.normal(size=d); theta /= np.linalg.norm(theta)

V, b = lam * np.eye(d), np.zeros(d)              # ridge statistics
reg_lin, reg_rand = 0.0, 0.0
for t in range(1, T + 1):
    A = rng.normal(size=(K, d)) / np.sqrt(d)     # features of the K ads shown to user t
    Vinv = np.linalg.inv(V)
    theta_hat = Vinv @ b
    beta = sigma * np.sqrt(d * np.log(1 + t / (lam * d)) + 2 * np.log(T)) + np.sqrt(lam)
    width = np.sqrt(np.einsum("kd,de,ke->k", A, Vinv, A))     # ||a|| in the V^{-1} norm
    a = A[np.argmax(A @ theta_hat + beta * width)]            # optimistic choice
    r = a @ theta + sigma * rng.normal()                      # noisy reward
    V += np.outer(a, a)
    b += r * a
    best = (A @ theta).max()
    reg_lin += best - a @ theta
    reg_rand += best - A[rng.integers(K)] @ theta
print(f"LinUCB regret {reg_lin:.1f}, random ads {reg_rand:.1f}, "
      f"estimation error {np.linalg.norm(theta_hat - theta):.3f}")

With 20 new ads per round in dimension 5, LinUCB has regret 30.6 over 5000 rounds, against 4149.7 for random ads, and its estimate of \theta^\star is within 0.015 of the truth.

9.4 Pure exploration: identifying the best arm

In an A/B test, the goal is to find the best arm with confidence 1 - \delta using as few samples as possible, not to earn rewards along the way. The Reinforcement Learning course devotes a lecture to such bandit methods for pure exploration.

Theorem 9.5 — Sample complexity of best-arm identification (Garivier and Kaufmann, 2016) For every algorithm that stops at time \tau and returns the best arm with probability at least 1 - \delta on every instance, \mathbb{E}_\mu[\tau] \geq T^\star(\mu)\, \mathrm{kl}(\delta, 1 - \delta), \qquad \frac{1}{T^\star(\mu)} = \sup_{w \in \Delta_N} \inf_{\lambda \in \mathrm{Alt}(\mu)} \sum_{i=1}^N w_i\, \mathrm{kl}(\mu_i, \lambda_i), where \mathrm{Alt}(\mu) is the set of instances whose best arm differs from that of \mu. Their Track-and-Stop algorithm attains this bound as \delta \to 0.

The proof is Lemmas 9.1 and 9.2 again. The optimal proportions w solve a zero-sum game between the sampler and a nature that picks the most confusing alternative. Degenne, Koolen and Ménard (2019) exploit this game with the no-regret learners of ch. 6.

Key takeaways — chapter 9

  • Lower bounds in bandits come from changing the distribution of one arm and counting the information gathered on it.
  • Exponential weights adapt to a small best loss; modern algorithms tune themselves to easy data.
  • Linear bandits share information across arms through a parameter, with regret of order d \sqrt{T}.
  • Best-arm identification has its own lower bound, a game between the sampler and nature.

10. Research directions and open problems

This self-study chapter points to active questions in the topics of the course. The papers cited are entry points, not a complete survey.

10.1 Best of both worlds

Algorithms are usually designed either for stochastic or for adversarial bandits. Bubeck and Slivkins (2012) showed that a single algorithm can have polylogarithmic regret on stochastic instances and regret of order \sqrt{T}, up to logarithms, against adversaries. Zimmert and Seldin (2021) obtained optimal rates in both regimes with a plain FTRL algorithm and a Tsallis-entropy regularizer. Extending such guarantees to structured settings (linear bandits, partial monitoring, reinforcement learning) is an active direction.

10.2 Faster learning in games

In self-play, Hedge reaches an \varepsilon-equilibrium after about 1/\varepsilon^2 rounds. Optimistic variants, which use the last loss as a prediction of the next one, go faster: Rakhlin and Sridharan (2013) in zero-sum games, Syrgkanis, Agarwal, Luo and Schapire (2015) in general games. Daskalakis, Fishelson and Golowich (2021) proved that optimistic Hedge has regret polylogarithmic in T when all players use it.

Open questions concern the convergence of the last iterate rather than of averages, and the complexity of reaching correlated equilibria in games with many players or large action sets.

10.3 Calibration

The rate of the calibration error is not settled. When the forecasts may take any value in [0, 1], the unnormalized error T C_T of the forecaster of Foster and Vohra (1998) is of order at most T^{2/3}, and random outcomes force at least \sqrt{T}.

Qiao and Valiant (2021) raised the lower exponent strictly above 1/2. Dagan, Daskalakis, Fishelson, Golowich, Kleinberg and Okoroafor (2025) then brought the upper exponent strictly below 2/3. The optimal exponent remains open.

Calibration has also come back in machine learning: neural network classifiers are often miscalibrated (Guo, Pleiss, Sun and Weinberger, 2017), and multicalibration requires calibration on many subpopulations at once (Hébert-Johnson, Kim, Reingold and Rothblum, 2018).

10.4 Partial monitoring and information

The classification of ch. 8 holds up to logarithmic factors and to constants that depend on the game; how the regret scales with the numbers of actions and outcomes is much less understood. Information-directed sampling (Russo and Van Roy, 2018) chooses actions by trading off expected regret against information gain, and applies to feedback structures beyond bandits. Lattimore and Szepesvári (COLT 2019) used an information-theoretic analysis of this kind to bound the minimax regret of finite partial-monitoring games. Making such algorithms efficient for large games is an open direction.

10.5 Online aggregation in practice

Expert aggregation is used for operational forecasting. Devaine, Gaillard, Goude and Stoltz (2013) aggregate specialized forecasters of electricity consumption, and adaptive algorithms such as those of ch. 9.2 are designed for this use. Open questions include aggregation under distribution shift, with delayed feedback, and with probabilistic rather than point forecasts.

Key takeaways — chapter 10

  • Best-of-both-worlds algorithms adapt to stochastic and adversarial environments without knowing which one they face.
  • Optimistic learners converge to equilibria much faster than plain Hedge.
  • The optimal rate of online calibration is open.
  • Information-directed sampling unifies exploration in bandits and partial monitoring.

Exercises

Exercises are sorted by level: ★ applies the course, ★★ combines results or asks for a short proof, ★★★ is open-ended or research-flavoured. The session plan says which exercises follow which session.

  1. ★ The size of a random walk. Let X_1, \dots, X_T be independent and uniform on \{-1, 1\}, with T = 2500. Use Theorem 0.4 to find a level \varepsilon such that the sum exceeds \varepsilon with probability at most 0.01, and compare with the normal approximation.

    Solution: the range of each X_t has length 2, so the bound is \exp(-2\varepsilon^2 / (4T)). Setting it to 0.01 gives \varepsilon = \sqrt{2 T \ln 100} = \sqrt{5000 \times 4.605} \approx 151.7 . The sum has standard deviation \sqrt{T} = 50, and the normal 1 % quantile gives 2.326 \times 50 \approx 116.3: the inequality is conservative by a factor of about 1.3, but has the right order.

  2. ★ Cover’s adversary and the halving algorithm. (a) A deterministic learner predicts the majority of the past outcomes, and 1 on ties. Run Cover’s adversary for T = 6 rounds and compute the regret against the two constant experts. (b) With N = 64 experts, one of them perfect, how many mistakes can the halving algorithm make? Show that the bound can be attained.

    Solution: (a) The predictions are 1, 0, 1, 0, 1, 0, and the adversary answers 0, 1, 0, 1, 0, 1. The learner makes 6 mistakes, each constant expert 3: the regret is 3 = T/2.

    (b) At most \log_2 64 = 6. Let expert k predict at round t the t-th bit of k. At every round the surviving experts split evenly, the adversary contradicts the majority, and exactly one expert survives after 6 rounds.

  3. ★ Follow the leader by hand. On the sequence of Example 1.5 with T = 9, ties broken toward action 1, list the actions of follow-the-leader, its total loss and the losses of the two actions. Count the leader changes and compare with the regret.

    Solution: FTL plays 1, 2, 1, 2, 1, 2, 1, 2, 1 and loses 0.5 + 8 = 8.5. Action 1 loses 4.5 and action 2 loses 4, so the regret is 4.5.

    The leader changes 8 times. In general the regret of FTL is at most the number of leader changes for losses in [0, 1]: this follows from step 1 of Theorem 3.5 with no regularizer.

  4. ★ Tuning exponential weights. Take N = 16 experts and T = 1000 rounds. (a) Compute the learning rate and the bound of Theorem 2.2. (b) Compute the bound of the doubling trick. (c) Compute the bound of Theorem 2.9 for the square loss on [0, 1].

    Solution: (a) \ln 16 = 2.773, so \eta = \sqrt{8 \times 2.773 / 1000} \approx 0.149, and the bound is \sqrt{500 \times 2.773} \approx 37.2.

    (b) 3.414 \times 37.2 \approx 127.1. (c) The square loss is 1/2-exp-concave, so the regret is at most 2 \ln 16 \approx 5.5, whatever T.

  5. ★ Online gradient descent by hand. On K = [-1, 1], the losses are f_t(x) = (x - y_t)^2/2 with y = (1, 1, -1, 1). Run OGD from x_1 = 0 with constant step \eta = 0.5, compute its total loss and its regret, and compare with Theorems 3.2 and 3.3.

    Solution: the gradients are x_t - y_t. The iterates are 0, 0.5, 0.75, -0.125, with losses 0.5, 0.125, 1.531 and 0.633: total 2.789.

    The best fixed point is the mean 0.5, with total loss 1.5, so the regret is 1.289. Theorem 3.2 with D = G = 2 gives 4 + 4 = 8. The losses are 1-strongly convex, and Theorem 3.3 gives 2(1 + \ln 4) \approx 4.77 with the steps 1/t.

  6. ★ Explore-then-commit with a known gap. Two arms have rewards in [0, 1] and gap \Delta. Explore-then-commit pulls each arm m times, then commits to the best empirical mean. (a) Show that R_T \leq m \Delta + T \Delta\, e^{-m \Delta^2 / 2} . (b) Choose m for \Delta = 0.1 and T = 10^4, and compute the bound. (c) What is left of the guarantee if the true gap is 0.02?

    Solution: (a) Exploration costs m\Delta. The commitment is wrong only if the sum of the m differences of paired rewards, each in [-1, 1] with mean -\Delta, is non-negative; Hoeffding bounds this probability by e^{-m\Delta^2/2}.

    (b) Setting the derivative to zero gives m = (2/\Delta^2) \ln(T \Delta^2 / 2) = 200 \ln 50 \approx 783, and the bound is 78.3 + 2/\Delta = 98.3. (c) With m = 783 and \Delta = 0.02, the failure bound is e^{-0.157} \approx 0.86: no protection. The tuning needed the unknown gap, which UCB does not need.

  7. ★ UCB indices. With T = 1000, after 30 rounds arm 1 has 20 pulls and mean 0.6, arm 2 has 6 pulls and mean 0.5, arm 3 has 4 pulls and mean 0.3. Compute the indices of Algorithm 5.2, the next arm, and the maximal number of pulls of an arm of gap 0.2 on the good event of Theorem 5.3.

    Solution: \ln T = 6.908. The indices are 0.6 + 0.588 = 1.188, 0.5 + 1.073 = 1.573 and 0.3 + 1.314 = 1.614: UCB pulls arm 3, the least explored.

    An arm of gap 0.2 is pulled at most 1 + 4 \times 6.908 / 0.04 \approx 692 times. The bound is pessimistic: with this width, UCB explores a lot at small horizons.

  8. ★ A 2 × 2 zero-sum game. The row player pays A = \begin{pmatrix} 0.2 & 0.8 \\ 0.7 & 0.4 \end{pmatrix}. Find the value and the optimal strategies, and the bound on the duality gap of Hedge self-play after T = 10^4 rounds.

    Solution: with probability p on row 1, the two columns cost 0.7 - 0.5 p and 0.4 + 0.4 p; they are equal at p = 1/3.

    With probability q on column 1, the two rows cost 0.8 - 0.6 q and 0.4 + 0.3 q, equal at q = 4/9. The value is 8/15 \approx 0.533.

    By Corollary 6.3, the gap is at most 2 \sqrt{\ln 2 / (2T)} \approx 0.0118.

  9. ★ A calibration score by hand. With the grid of step 1/4, a forecaster announces 0.25 four times (outcomes 0, 0, 1, 0), 0.75 four times (outcomes 1, 1, 0, 1) and 0.5 twice (outcomes 1, 0). Compute its calibration score and its mean squared error, and compare with the forecaster that always announces 0.5.

    Solution: each bin has the right frequency (1/4, 3/4 and 1/2), so C_{10} = 0. Its mean squared error is 2.0/10 = 0.20.

    The constant forecaster is also perfectly calibrated, since the overall frequency is 1/2, but its mean squared error is 0.25. Calibration is necessary for good probability forecasts, not sufficient: the first forecaster is also more refined.

  10. ★★ Exp-concave losses. (a) Show that the square loss on [0, 1] is \eta-exp-concave if and only if \eta \leq 1/2. (b) Show that the logarithmic loss is 1-exp-concave, that exponential weights with \eta = 1 predict with the Bayesian posterior mixture, and deduce the regret bound \ln N directly.

    Solution: (a) For h(f) = e^{-\eta (f - y)^2}, the second derivative is (4\eta^2 (f - y)^2 - 2\eta)\, h(f). It is non-positive for all f, y \in [0, 1] if and only if 2\eta \leq 1, since |f - y| can reach 1.

    (b) e^{-\lambda} is the predicted probability of the outcome, which is linear in the forecast. The weights are proportional to the likelihoods, so they form the posterior of a uniform prior. The cumulative loss of the mixture is minus the log of the average likelihood, which is at most that of the best expert plus \ln N.

  11. ★★ Anytime learning rates (Python). Rerun the block of ch. 2 with three versions of exponential weights: the tuned rate, the rate \eta_t = \sqrt{8 \ln N / t}, and the doubling trick. Compare the regrets with the bounds.

    Hints and expected result: on the unstable sequence the regrets are about 29.7 (tuned), 58.3 (anytime) and 69.2 (doubling). On the stochastic experts they are about 111.2, 89.9 and 189.9.

    The anytime rate costs at most a constant factor, and the restarts of the doubling trick waste information; both stay well below the bound 3.41 \sqrt{(T/2) \ln N} of Proposition 2.6.

  12. ★★ Follow the leader on quadratic losses. Let f_t(x) = (x - y_t)^2 with y_t \in [0, 1] on K = [0, 1]. Show that follow-the-leader plays the running mean of the past outcomes and that its regret is at most 2(1 + \ln T).

    Solution: the minimizer of a sum of squares is the mean, so x_{t+1} - x_t = (y_t - x_t)/t. By the be-the-leader inequality (step 1 of Theorem 3.5 with \psi = 0), the regret is at most the sum of f_t(x_t) - f_t(x_{t+1}).

    Each term equals (x_t - x_{t+1})(x_t + x_{t+1} - 2 y_t), of absolute value at most (1/t) \times 2. Summing the harmonic series gives the claim. Strong convexity makes the leader stable.

  13. ★★ UCB against an adversary (Python). With two arms and T = 20{,}000, build the reward sequence that gives reward 0 to the arm UCB pulls and 1 to the other. (a) Show that UCB has regret at least T/2 on it. (b) Run EXP3 on the same, now fixed, sequence.

    Hints and expected result: (a) UCB is deterministic, so the sequence is well defined in advance. UCB earns 0, and the two arms earn T in total, so the better one earns at least T/2.

    (b) In a run, each arm earns 10,000, so UCB’s regret is exactly 10,000. EXP3 has regrets between -42 and 66 over five seeds, below its bound \sqrt{2 N T \ln N} \approx 235. Randomization protects EXP3; optimism assumes stationarity.

  14. ★★ Equilibria in the game of chicken. Two drivers choose Dare or Chicken, with gains (row, column): (D, D) = (0, 0), (D, C) = (7, 2), (C, D) = (2, 7), (C, C) = (6, 6). (a) Show that the uniform distribution on (C, C), (D, C), (C, D) is a correlated equilibrium. (b) Find the mixed Nash equilibrium and compare the gains. (c) Show Nash \subset CE \subset CCE in general.

    Solution: (a) Told C, a driver faces C or D with probability 1/2 each: obeying gives 4, daring gives 3.5. Told D, she faces C for sure: daring gives 7, against 6 for C.

    (b) Indifference gives the probability 1/3 of daring, for a gain of 14/3 ≈ 4.67 each, against 5 in the correlated equilibrium. (c) A product distribution satisfies the CE constraints exactly when each action in its support is a best response; constant maps are particular maps.

  15. ★★ Regret matching from Blackwell’s theorem. (a) Show that the projection onto the negative orthant is the coordinatewise minimum with 0, so that x - \pi = x_+. (b) Show that p proportional to x_+ satisfies Blackwell’s condition with equality. (c) Apply Theorem 7.2 to losses in [0, 1] and compare with Proposition 7.3.

    Solution: (a) The orthant is a product of half-lines, so the projection acts coordinatewise. (b) The inner product \langle x_+, \pi \rangle vanishes, and \langle x_+, r(p, \ell) \rangle = 0 for this p, as in the proof of Proposition 7.3.

    (c) The regrets lie in [-1, 1] and the projections in [-1, 0], so K \leq 2 \sqrt{N} and the distance is at most 2\sqrt{N/T}. The direct analysis gains a factor 2: the positive regrets are at most \sqrt{N T}.

  16. ★★ Rationing information. In Theorem 8.2, (a) show that for a fixed exploration rate the best learning rate gives regret at most \gamma T + \sqrt{2 T \ln N / \gamma} ; (b) minimize in \gamma and recover the constant 3 \cdot 2^{-1/3}; (c) compute \gamma, the expected number of revealing rounds and the bound for N = 8 and T = 10^5.

    Solution: (a) \ln N/\eta + \eta T/(2\gamma) is minimal at \eta = \sqrt{2 \gamma \ln N / T}, with value \sqrt{2 T \ln N / \gamma}.

    (b) The derivative vanishes at \gamma = (\ln N / (2T))^{1/3}; the two terms are then 2^{-1/3} and 2^{2/3} times T^{2/3} (\ln N)^{1/3}.

    (c) \gamma = (2.079 / 200{,}000)^{1/3} \approx 0.0218, so about 2180 revealing rounds, and the bound is about 6548. The block of ch. 8 measures a regret of about 2377.

  17. ★★ Choosing the grid of a calibrated forecaster. Using Theorem 7.6, choose the grid size N as a function of a known horizon T to minimize the bound, and give the resulting rate. Compute it for T = 10^6.

    Solution: for large N the bound is about \sqrt{N/T} + 1/(2\sqrt{2N}). The two terms balance at N = \sqrt{T}/(2\sqrt{2}), and the bound becomes 2^{1/4}\, T^{-1/4} \approx 1.19\, T^{-1/4} . For T = 10^6, N \approx 354 and the bound is about 0.038. Sharper analyses reach the order T^{-1/3} (Foster and Vohra, 1998).

  18. ★★★ A two-armed minimax lower bound. Let \nu have Bernoulli arms of means (1/2 + \Delta, 1/2) and \nu' means (1/2 + \Delta, 1/2 + 2\Delta), with \Delta \leq 1/8.

    Using Lemmas 9.1 and 9.2 and Pinsker’s inequality, show that every algorithm has regret at least \sqrt{T}/44 on one of them when \Delta = 1/\sqrt{T} and T \geq 64.

    Hints and expected result: let a and b be the expectations of n_2(T)/T under the two instances. The regrets satisfy R_\nu \geq T \Delta a, \qquad R_{\nu'} \geq T \Delta (1 - b) .

    Only arm 2 differs, and \mathrm{kl}(1/2, 1/2 + 2\Delta) \leq 22 \Delta^2, so Pinsker gives (b - a)^2 \leq 11 T a \Delta^2.

    If a \geq 1/(44 T \Delta^2), then R_\nu \geq 1/(44\Delta). Otherwise b - a \leq 1/2 and the larger regret is at least T\Delta/4. Conclude with \Delta = 1/\sqrt{T}.

  19. ★★★ Optimistic self-play (Python, research-flavoured). In the block of ch. 6, let both players use optimistic Hedge, which counts the last loss vector twice in the exponent, with the constant rate \eta = 0.5. Compare the duality gap of the averages with tuned Hedge and with Hedge at \eta = 0.5, for T = 100, 1000 and 10,000, and relate to ch. 10.2.

    Hints and expected result: with the same matrix, tuned Hedge gives gaps of about 0.062, 0.016 and 0.0046, the rate 1/\sqrt{T} of the block. Hedge at \eta = 0.5 gives about 0.044, 0.011 and 0.0049, still decreasing like 1/\sqrt{T} (0.0016 at T = 10^5).

    Optimistic Hedge gives about 0.041, 0.0031 and 0.0003: a rate close to 1/T, as predicted by Rakhlin and Sridharan (2013). Try a general-sum game next, and measure the distance to the set of CCE with a linear program.

Projects and assessment

master-mva.com announces a homework (“Devoir Maison”) and a final exam (“Mode de validation”), and the Université Paris-Saclay course detail describes the assessment as “Evaluation Continue non Intégrale” (partial continuous assessment); no weights are displayed. The solo subjects below are sized like a substantial homework or a paper study, in the MVA tradition; the group subjects are larger. The written exam is a proposal in the spirit of a blackboard course. Each project is evaluated with the rubric at the end of the section.

Solo projects

  1. [Solo · ≈ 20 h] EXP3 and implicit exploration (paper study: Auer, Cesa-Bianchi, Freund and Schapire, 2002; Neu, 2015). How heavy is the tail of the realized regret of EXP3, and how much does implicit exploration help?
    • Implement: EXP3 (Algorithm 4.3) and EXP3-IX, whose estimator adds a small constant to the denominator (ch. 2, 4).
    • Data: synthetic oblivious sequences, including drifting losses and the sequence of Exercise 13.
    • Deliverables: code, a 4–6 page report, a 10-minute talk.
    • Success criterion: histograms of the realized regret over at least 200 seeds, with the 99 % quantile of EXP3-IX below the high-probability bound of Neu (2015), and a comparison with EXP3.
  2. [Solo · ≈ 20 h] Calibrated forecasting (paper study: Foster and Vohra, 1998; Foster, 1999). How fast can a forecaster become calibrated against an adaptive opponent?
    • Implement: the forecaster of Theorem 7.6, a deterministic forecaster, and an opponent that maximizes the current calibration deficit (ch. 7).
    • Prove: the rate of Exercise 17, and the inequality of step 3 of Theorem 7.6 in full.
    • Deliverables: code, a 4–6 page report with the proofs, a 10-minute talk.
    • Success criterion: a log–log plot of the calibration score against T, with N proportional to \sqrt{T}, of slope at most -1/4, and the deterministic forecaster stuck above 1/2.
  3. [Solo · ≈ 20 h] Towards the Lai–Robbins constant (paper study: Garivier and Cappé, 2011; Kaufmann, Korda and Munos, 2012). How fast do KL-UCB and Thompson sampling approach the asymptotic lower bound?
    • Implement: UCB (Algorithm 5.2), KL-UCB and Thompson sampling, vectorized over runs (ch. 5, 9.1).
    • Data: Bernoulli instances with small and large gaps, including means close to 0 where Pinsker’s inequality is loose.
    • Deliverables: code, a 4–6 page report, a 10-minute talk.
    • Success criterion: curves of R_T / \ln T up to T = 10^6 with confidence bands over at least 100 runs, the Lai–Robbins constant drawn, and a supported conclusion on which algorithms approach it.

Group projects

  1. [Group of 3 · ≈ 30 h each] Online aggregation of load forecasters (paper study: Devaine, Gaillard, Goude and Stoltz, 2013; Gaillard, Stoltz and van Erven, 2014). Can an online mixture of simple forecasters beat the best of them on a series with a regime change?
    • Data: a synthetic hourly load series with daily and weekly cycles, a temperature effect and a level shift after one year.
    • Split: member A builds the experts (seasonal naive, ridge regressions on different features); member B implements exponential weights for the square loss, OGD on the simplex and an adaptive algorithm (ch. 2, 3, 9.2); member C runs the evaluation.
    • Deliverables: shared code, one report of 8–10 pages, a 20-minute talk.
    • Success criterion: an aggregated error below that of the best expert, regret curves against the best expert and the best convex combination, and behaviour across the shift.
  2. [Group of 2–3 · ≈ 30 h each] No-regret dynamics in games and auctions (paper study: Hart and Mas-Colell, 2000; Blum and Mansour, 2007). Which equilibria do Hedge, regret matching and swap-regret learners reach?
    • Data: the game of chicken (Exercise 14), Shapley’s 3 \times 3 game, and a two-bidder first-price auction with values drawn uniformly on a grid of 10 values, one learner per value over a grid of bids (Example 6.9).
    • Split: member A writes linear programs that measure the violation of the CE and CCE constraints; member B implements the learners, including Theorem 6.8; member C runs the auction (ch. 6, 7).
    • Deliverables: shared code, one report of 8–10 pages, a 20-minute talk.
    • Success criterion: CE violations of swap-regret learners below R_T / T, a case where Hedge reaches a CCE that is not a CE, and auction bids compared with the equilibrium bid v/2.
  3. [Group of 3 · ≈ 30 h each] Contextual bandits for ad selection (paper study: Li, Chu, Langford and Schapire, 2010; Abbasi-Yadkori, Pál and Szepesvári, 2011). How much do features help, and what happens when the click model is not linear?
    • Data: a synthetic click model with user and ad features, linear and logistic versions, and a log of random displays.
    • Split: member A implements LinUCB (Algorithm 9.4) and a linear Thompson sampling; member B the non-contextual baselines EXP3 and UCB; member C the offline replay evaluation on the random log (ch. 4, 5, 9.3).
    • Deliverables: shared code, one report of 8–10 pages, a 20-minute talk.
    • Success criterion: regret curves of all algorithms, a replay estimate within the confidence interval of the online click rate, and an analysis of the misspecified logistic case.

Written exam (proposal)

Format (proposal): 3 hours, one handwritten A4 sheet allowed, no electronic device, four exercises.

  1. Question (4 points). Define the regret of a randomized learner, and the difference between oblivious and adaptive environments. Prove that every deterministic learner has regret at least T/2 in binary prediction with two constant experts, and explain the two remedies used in the course.

    Expected: Definitions 1.1–1.2; Proposition 1.3 with the adversary that contradicts the learner; randomization (linear expected loss) and convexity (averaging the advice).

  2. Computation (6 points). (a) Compute the learning rate and the regret bound of EXP3 for N = 5 arms and T = 10^4, and compare with full information. (b) With T = 10^4, arm 1 has 40 pulls and mean 0.55, arm 2 has 10 pulls and mean 0.40: compute the UCB indices and the bound of Theorem 5.3 if the gap is 0.15. (c) Find the value and the optimal strategies of the game where the row player pays \begin{pmatrix} 0.1 & 0.6 \\ 0.5 & 0.2 \end{pmatrix}.

    Expected: (a) \eta \approx 0.0080 and a bound of about 401, against 89.7 with full information: a factor \sqrt{4N} \approx 4.5. (b) The indices are 1.030 and 1.360, so arm 2 is pulled; the bound is about 250. (c) p = 3/8 on row 1, q = 1/2 on column 1, value 0.35.

  3. Short proof (5 points). Prove the regret bound of exponential weights for losses in [0, 1], admitting Hoeffding’s lemma, and deduce the bound for the aggregation of forecasters with a convex loss.

    Expected: the potential proof of Theorem 2.2 in its three steps, the tuning of \eta, and Corollary 2.3 by Jensen’s inequality.

  4. Problem (5 points). (a) State Blackwell’s condition and prove the rate of Theorem 7.2. (b) Derive regret matching from it and prove its \sqrt{N T} bound. (c) Show that no deterministic forecaster is calibrated.

    Expected: (a) the decomposition and the induction of Theorem 7.2. (b) The positive part as the direction to the orthant, Proposition 7.3. (c) Proposition 7.5.

Grading rubric (proposal)

Criterion Weight What earns the marks
Mathematical correctness 30 % Precise statements, complete proofs or clearly flagged gaps, regret measured against the right benchmark
Implementation and reproducibility 25 % Runnable code with fixed seeds, benchmarks computed exactly (best expert, best arm, LP values), results regenerated by one script
Experimental design 20 % Adversarial as well as stochastic sequences, several seeds with confidence bands, every number compared with the proven bound
Understanding of the paper 15 % The main result restated precisely, what was reproduced and what was not, links with the chapters of the course
Report and talk 10 % A clear report within the page limit, captioned figures, a talk within time, precise answers to questions

References

Official references (master-mva.com, “Références”)

Books and surveys

Experts and exponential weights (ch. 1–2)

Online convex optimization and stochastic optimization (ch. 3)

Bandits (ch. 4, 5, 9)

Games, approachability and calibration (ch. 6–7)

Partial monitoring (ch. 8)

Adaptivity and research directions (ch. 9–10)