Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Learning while the game is played
Every morning you must guess whether it will rain, and you have three weather apps whose advice you can follow. Each evening you learn who was right. You don’t know in advance which app is best, and the weather owes you nothing. How should you combine their advice? Online learning studies exactly this: decisions made one at a time, with feedback after each one. The goal isn’t to be perfect. It’s to do almost as well as the best app in hindsight. The gap is called regret, and good algorithms keep it growing much slower than the number of days.
Online learning powers adaptive systems that can’t wait for a dataset: combining several fault detectors on a spacecraft, choosing among motion planners as terrain changes, adapting a controller’s gains in flight, and routing in communication networks. Regret guarantees hold even when conditions shift unpredictably.
- 1. Regret compares your total loss with…
- 2. A good online learner's regret grows…
- 3. Online learning can handle data chosen by…
Level 1: Beginner
★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.The protocol
For t = 1, …, T: the learner picks a decision (or a distribution over N experts), the environment reveals a loss , and the learner suffers . Regret against a comparator class:
Sublinear regret, , means the average loss approaches that of the best fixed choice.
Experts: FTL and Hedge
- Follow-the-Leader (FTL): pick the expert with the smallest cumulative loss. It can be forced to regret about T/2: with losses alternating (0, 1), (1, 0), …, the leader flips every round and FTL always picks the loser.
- Hedge (multiplicative weights): , with the cumulative losses. With and losses in [0, 1],
- 1. Hedge's bound for T = 200, N = e⁴:
- 2. FTL's regret on the alternating sequence after T rounds:
- 3. Hedge weights for cumulative losses (0, 1) with η = ln 3:
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Online convex optimization (OCO)
Decisions live in a convex set K of diameter D, and losses are convex with . Online gradient descent (Zinkevich, 2003):
If every is μ-strongly convex, the step gives (Hazan, Agarwal and Kale, 2007).
Lower bounds
For linear losses on a ball, any algorithm suffers against random ±1 gradients. For experts, regret is . So OGD and Hedge are minimax-optimal up to constants.
Online-to-batch
If data are i.i.d., the average iterate has excess risk at most in expectation. Regret bounds give generalization bounds, and SGD analysis is often done this way.
- 1. OGD's regret with η_t = D/(G√t) is…
- 2. For μ-strongly convex losses with η_t = 1/(μt), regret is…
- 3. Online-to-batch: the average iterate's excess risk is at most…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Proof of the Hedge bound (sketch)
Let . Then by Hoeffding’s lemma. Summing gives , while . Rearranging, , minimized at . ∎
Proof of the OGD bound (sketch)
By convexity, . Expanding (projection is non-expansive) gives . Telescoping with and gives . With strong convexity the extra term cancels the telescoping residue for . ∎
Unifying view: FTRL and mirror descent
Follow-the-regularized-leader chooses . With an entropy regularizer on the simplex it is Hedge; with it is (lazy) OGD. The regularizer is what stops FTL from being whipsawed.
- 1. The key inequality in the Hedge proof is…
- 2. FTRL with an entropy regularizer on the simplex is…
- 3. Hedge's regret before tuning η is at most…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Regret, measured
Exercise 1. On the alternating sequence, FTL’s regret is exactly T/2: 50, 500 and 5000 for T = 100, 1000 and 10 000. Hedge’s is 3.2, 9.5 and 29.7, about half its bound (5.9, 18.6, 58.9) and growing like √T. On stochastic losses (T = 2000) Hedge’s regret is 14.5, 32.6 and 54.9 for N = 2, 10 and 100, all under the bound. Here FTL does as well or better (0, 22, 46): FTL is fine when the world is benign, and Hedge is insurance against when it isn’t.
Exercise 2: growth rates. Mean regret at T = 100, 400, 1600 and 6400:
| setting | regret | growth exponent |
|---|---|---|
| OGD on linear losses | 8.2, 16.0, 26.6, 64.2 | 0.48 (√T) |
| quadratic losses, η = 1/√t | 6.4, 10.9, 23.2, 41.3 | 0.46 (√T) |
| quadratic losses, η = 1/t | 3.3, 3.9, 4.3, 5.4 | 0.12 (log T) |
The log-regret prediction ½·d·Var(z)·(1 + ln T) = 2.8, 3.5, 4.2, 4.9 is close. With strong convexity, matching the step size to the curvature turns √T into log T.
Online learning in AI, robotics and aerospace
- Sensor and detector fusion: weight several fault detectors or estimators by their recent performance with exponential weights.
- Adaptive control and planning: online convex optimization for adapting gains or choosing among planners as conditions drift.
- Boosting and game solving: AdaBoost and many equilibrium solvers are multiplicative-weights algorithms.
- Online-to-batch analyses of SGD underpin many training guarantees.
References
- N. Cesa-Bianchi, G. Lugosi (2006). Prediction, Learning, and Games. Cambridge University Press.
- Y. Freund, R. E. Schapire (1997). “A decision-theoretic generalization of on-line learning and an application to boosting.” Journal of Computer and System Sciences, 55.
- M. Zinkevich (2003). “Online convex programming and generalized infinitesimal gradient ascent.” ICML.
- E. Hazan, A. Agarwal, S. Kale (2007). “Logarithmic regret algorithms for online convex optimization.” Machine Learning, 69.
- E. Hazan (2016). “Introduction to online convex optimization.” Foundations and Trends in Optimization, 2(3–4).
- S. Shalev-Shwartz (2012). “Online learning and online convex optimization.” Foundations and Trends in Machine Learning, 4(2).