TL;DR
In online learning you make a choice each round, then see how well it did. A no-regret learner is one whose total loss, over many rounds, ends up close to the total loss of the single best fixed choice you could have made in hindsight. The gap between the two is called regret. The guarantee holds even when the losses are picked by an adversary, so no assumption about the world's pattern is needed. The gap grows more slowly than the number of rounds, so the average regret goes to zero.
Where you'll see it: in online advertising and bidding, in the analysis of imitation learning (the DAgger algorithm), in the bandit algorithms behind exploration, and in the proof that two learners playing a zero-sum game converge to its minimax strategies.
Intuition
Choosing before you know
Suppose each morning you pick one of several routes to work. You do not know the traffic in advance. After the commute you learn how long each route would have taken. The next day you choose again, using everything you have seen so far.
No route is best every day, and an adversary could make your favourite route the worst one tomorrow. So the question is not "did I always pick the best route?", which may be impossible. It is "how much worse was I than the single route I would have been best off sticking to, over the whole period?" That comparison is regret.
Why the best fixed choice is the right yardstick
Regret compares you to a fixed choice that you could have made knowing all the losses ahead of time. It is a demanding standard because the comparison has hindsight, yet it is achievable. A learner who reacts to each loss with a small, careful adjustment can keep up with the best fixed strategy without knowing in advance which one that is.
The key quantity is the average regret, the total regret divided by the number of rounds. If it goes to zero, the learner's average performance matches the best fixed choice in the long run, whatever the sequence of losses turned out to be.
flowchart LR A[Learner picks an action x_t] --> B[Environment reveals loss for x_t] B --> C[Learner updates its strategy] C --> A B --> D[Regret compares total loss with the best fixed action in hindsight]
- average regret bound, D G over the square root of T
The math
Setup
The learner works over a convex set of possible actions. In round :
- The learner picks without knowing the loss of this round.
- The environment reveals a loss function , and the learner pays .
The environment may be adversarial: can depend on the learner's past choices, but the learner does not know it in advance.
After rounds, the regret of a sequence of choices against a fixed action is
The worst-case regret is . The learner is no-regret if as grows, for every sequence of losses.
Here is the total loss the fixed action would have paid. The maximum over picks the best fixed action in hindsight. Regret is zero if the learner matched it, and positive if it did worse.
Online gradient descent
The standard no-regret algorithm for convex losses is online gradient descent (Zinkevich, 2003). Let be a gradient of at . Update with the same rule as Gradient Descent, then project back into the set:
where is the point of closest to , and is the step size. Projection is needed because the step can leave the set. Projecting onto a convex set never moves you farther from any point of the set, which is what the proof uses.
The regret bound
Assume the losses are convex, the set has diameter at most (any two points are within of each other), and the gradients have length at most . With the constant step , the regret against any satisfies
The proof uses two facts. First, convexity gives . Second, the squared distance to shrinks by at least each round, minus a term of size . Adding the rounds telescopes the distances and leaves the bound.
Choosing balances the two terms and gives
So the total regret grows like , and the average regret goes to zero. This is the defining property of a no-regret algorithm.
Hedge: no-regret over a finite set of experts
Many problems have a finite list of options, called experts. Let there be experts, and let each round the environment reveal a loss for each expert . The Hedge algorithm (Freund and Schapire, 1997) keeps a weight for each expert, starts them at 1, and plays expert with probability
The play probabilities are a Softmax over the cumulative negative losses. Experts that did well gain weight exponentially fast. For losses in and a suitable , the expected regret against the best expert is at most about , which is again sublinear in .
Worked examples
The action set is . Each round the loss is , so . Here and . Use the constant step , start at , and let the losses be .
- Round 1: play and pay . Update .
- Round 2: play and pay . Update .
- Round 3: play and pay . Update .
- Round 4: play and pay .
- Learner's total loss: .
- Best fixed action: the total loss is for every , so the best is 0.
- Regret: .
- Bound check: . The actual regret, , is below the bound.
Interpretation: the algorithm oscillates between 0.25 and 0.5, and each pair of rounds adds 0.25 to the regret. With a constant step, the regret grows linearly in , which is consistent with the bound (it is here) but gives no no-regret guarantee. That is why the step must shrink with , as the result requires.
There are two experts, A and B, so . Use and the losses below, for rounds.
| round | loss of A | loss of B |
|---|---|---|
| 1 | 0 | 1 |
| 2 | 0 | 1 |
| 3 | 1 | 0 |
- Round 1: weights , so . Expected loss . Update: , .
- Round 2: and . Expected loss . Update: .
- Round 3: and . Expected loss .
- The learner's total expected loss is .
- Totals for the fixed experts: A pays , and B pays . The best is A with 1.
- Regret against the best expert: .
- Bound check: . The regret is below it.
Interpretation: the algorithm moved weight toward A after the first round, but it still put 38% of its probability on B in round 2 and 27% in round 3, and those hedged bets are where the 0.61 of regret comes from. The total regret is small compared with the number of rounds, which is what the bound promises.
Tradeoffs and failure modes
No-regret is a strong guarantee, and it is easy to misread.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Comparing to the best fixed action when the world changes over time | Regret can be tiny while the learner loses badly in absolute terms | Use a regret against a sequence of experts, or a tracking-regret bound |
| Only the chosen action's loss is revealed (a bandit) | Full-information algorithms such as Hedge cannot be used | EXP3 and related bandit algorithms, which pay a cost in the bound |
| The step size needs the horizon | Constant tuned for one is wrong for another | Use a step size that shrinks with , such as , or the doubling trick |
| The losses are not convex | The clean bound from projection and convexity does not hold | Use a method designed for the case, or a weaker guarantee |
| Experts are very many | Hedge's term is fine, but the weights become impractical | Structured or sampled expert sets |
The guarantee is also about the sequence, not the future. A learner with no regret against a stream of losses can still be exploited by a strategy that anticipates its next move, which is why results about games need the learners to be playing against other no-regret learners, as in the minimax result in the history section.
History
In the 1950s, David Blackwell (1956) developed approachability theory for repeated games, and James Hannan (1957) showed that a player who responds to the history of play can, in the long run, do as well as the best fixed strategy in hindsight. In the 1990s, Nick Littlestone and Manfred Warmuth (1994) introduced the weighted majority algorithm, and Yoav Freund and Robert Schapire (1997) developed Hedge, the same exponential-weight rule, in their analysis of boosting. Freund and Schapire later (1999) showed that when two players both run no-regret learners in a zero-sum game, their time-averaged strategies converge to a minimax equilibrium, which connects the idea to the minimax theorem of von Neumann.
Martin Zinkevich (2003) gave the online gradient descent algorithm and its bound for convex losses, which made the idea usable for continuous action sets. Peter Auer and colleagues (2002) gave EXP3, the no-regret algorithm when only the chosen action's loss is observed, which led to the bandit literature. Stéphane Ross, Geoffrey Gordon and Drew Bagnell (2011) reduced imitation learning to a sequence of supervised learning problems handled by a no-regret learner, the DAgger algorithm.
Check yourself
QuestionRecall: what is the regret of a sequence of choices against a fixed action ?Show answer
It is the learner's total loss, , minus the total loss that the fixed action would have paid. A positive value means the learner did worse than would have.
QuestionComputation: with , and , the bound for online gradient descent is . What is the bound after rounds, and what is the average regret bound per round?Show answer
Here , so . The average per round is . This is above the optimal-step value , because is not the optimal step for , which is .
QuestionWhy: why does online gradient descent project back onto after each step, and why does projection not hurt the proof?Show answer
A gradient step can leave the action set, and the learner must play inside it. Projection moves the point to the nearest point of the set. For a convex set and any point in the set, projection never increases the distance to , so the distance argument still holds after projecting. That property is exactly what the telescoping step in the proof needs.
QuestionApplied: a bidding system must choose one of several bid levels each auction, and only learns the revenue of the bid it actually placed. Which family of algorithms fits, and what does the regret bound cost compared with seeing every bid's revenue?Show answer
It is a bandit problem, because only the chosen action's outcome is observed. An algorithm such as EXP3 is the no-regret choice. Its regret bound is worse than the full-information bound, of order for bid levels instead of order , because the learner must explore to learn the other bids' revenues.