Learning, Regret Minimization, and Equilibria
External, internal and swap regret; greedy, randomized greedy, RWM and Polynomial Weights; the minimax theorem from regret; convergence to correlated equilibrium; the external-to-swap reduction; the bandit reduction; and Wardrop routing
Motivation: deciding repeatedly under uncertainty
Many situations involve repeatedly making decisions in an uncertain environment: which route to drive to work each day, or repeated play of a game against an opponent whose strategy is unknown.
The basic setting: a space of actions — the routes, or the rows of a matrix game like . At each time step the algorithm probabilistically chooses an action, the environment makes its “move” (setting the day’s road congestion), and the algorithm incurs the loss for the action it chose. Then the process repeats.
We want two things: adaptive algorithms that perform well in such settings, and an understanding of the dynamics when many players are all adjusting simultaneously.
IntuitionWhat “regret” means, and why it is the right question
Imagine we design a sophisticated online algorithm, sell it to a client, and it runs for a while incurring some loss. We want to avoid the embarrassment of the client returning to say that in retrospect a much lower loss was available under his simple alternative policy . The regret of our algorithm is the difference between its loss and the loss under .
Different notions of regret differ in what counts as a “simple” alternative. That single choice organizes the whole chapter.
| Notion | Alternative policy it competes against |
|---|---|
| External regret (combining expert advice) | The best single action in retrospect — the alternative plays the same action at every step |
| Internal regret | Modify the online sequence by replacing every occurrence of one action by another action |
| Swap regret | Modify by any map — up to a factor larger than internal regret |
ImportantWhy each matters
External regret provides a general methodology for making an online algorithm match an optimal static offline algorithm, by modelling the possible static solutions as actions. In machine learning it yields performance comparable to the best prediction rule from a large hypothesis class.
Swap regret matters because of its tight connection to correlated equilibrium: one way to think of a correlated equilibrium is as a distribution over the joint action space such that every player would have zero internal (or swap) regret when playing it.
Model and preliminaries
DefinitionThe online model
An adversarial online model with actions . At each step the algorithm selects a distribution over actions; then the adversary selects a loss vector .
- Full information model: receives all of and suffers — the expected loss of drawing .
- Partial information (bandit) model: receives only with , and suffers .
Cumulative losses: and .
DefinitionExternal regret
Given a comparison class of algorithms, the external regret is where . We take , the single actions, so with ,
DefinitionModification rules and general regret
A modification rule takes the history and the currently selected action and outputs a (possibly different) action; denotes it at time . Given the algorithm’s distributions , it induces
— at time , shifts the probability assigned to over to , so the modified distribution depends on . For a finite set of memoryless rules,
FormulaThe three regrets as classes of modification rules
- External: has rules , each always outputting .
- Internal: has rules with and otherwise, giving
- Swap: has all functions, giving
Since and , swap regret upper-bounds both.
IntuitionInternal versus swap, concretely
Internal regret answers “every time you bought IBM, you should have bought Microsoft instead” — one substitution. Swap regret allows all actions to be remapped simultaneously, and is at most a factor larger.
External regret minimization
Why the comparison class must be restricted
TheoremNo algorithm can compete with the best sequence
Let be all functions from times to actions. For any online algorithm there is a loss sequence with .
ProofPunish the action the algorithm is least likely to play
At each , give loss 0 to the action of lowest probability and loss 1 to all others. Since , the algorithm’s loss is at least . Meanwhile lies in and has total loss 0.
∎
So we compare against — the best single action.
Warmup: Greedy and Randomized Greedy
(In this subsection losses are rather than , which simplifies notation; everything extends.)
AlgorithmGreedy
Initially . At time : let and ; play .
TheoremGreedy
.
ProofCount actions eliminated between increments of the minimum
Each time Greedy incurs loss 1 while does not increase, at least one action leaves . This can happen at most times before rises by 1, so Greedy loses at most between successive increments. Formally, by induction .
∎
WarningThe factor is not Greedy’s fault — it is determinism’s
For any deterministic algorithm there is a loss sequence with and .
Proof: give loss 1 to whichever action selects and 0 to all others, so . Since only selected actions ever have loss, and some action is selected at most times, .
This implies — almost matching the upper bound for Greedy, so randomization is essential.
AlgorithmRandomized Greedy (RG)
. At time : put for and 0 otherwise — uniform over all currently best actions, removing the deterministic tie-breaker.
TheoremRandomized Greedy
.
ProofA harmonic sum between successive increments
Let be the step at which first reaches ; we bound the loss in . At any , . If at time the set shrinks by from size to , RG’s loss is — each such action carries weight — and
So over the whole interval the loss is at most . Formally, .
∎
IntuitionWhere RG still loses, and the fix
The losses are greatest when is small, since the online loss is proportional to . The remedy is to give some weight to actions that are currently near best, letting probability mass decay gracefully with distance from optimality rather than dropping to zero.
Randomized Weighted Majority
AlgorithmRandomized Weighted Majority (RWM)
Give action with cumulative loss the weight and play proportionally: . Concretely, , ; at time , if then , else ; and with .
Think of as a small constant, say . (Losses in are handled by the update .)
TheoremRWM
For and binary losses,
Setting gives .
ProofTrack the total weight
The key idea: whenever the algorithm has significant expected loss, the total weight must drop substantially; combine this with the fact that the weight of the best action gives a floor, .
Step 1: the weight drop equals the loss. Let , which is exactly RWM’s expected loss at time . Each action with loss 1 has its weight multiplied by and the rest are unchanged, so
The proportion of weight removed is exactly proportional to the expected loss.
Step 2: sandwich. With ,
Step 3: take logarithms and use :
Step 4: rearrange and use for :
∎
NoteTuning without knowing
The second bound assumes is known in advance; otherwise a guess and double approach costs only a constant factor. One can in fact get the potentially better by setting .
Polynomial Weights
AlgorithmPolynomial Weights (PW)
, . At time : and .
NoteThe only change, and what it buys
PW differs from RWM only in the update, and extends naturally to losses in (even to both losses and gains) while keeping the same proof structure — and it performs especially well in the case of small losses.
It is no longer true that an action of total loss has weight . What is preserved is the invariant that if PW’s loss at time is , then exactly an fraction of the total weight is removed: with .
TheoremPolynomial Weights
For , any -valued loss sequence and any ,
Setting and noting gives .
ProofUpper and lower bounds on
Upper, exactly as for RWM:
Lower, from the recursive definition of the weights and for :
Combining, .
∎
IntuitionThe quadratic term is a feature
is the sum of squared losses of the comparison action. When the best action’s losses are small, and the bound is correspondingly sharper — this is a second-order bound, versus the zero-order .
Lower bounds
TheoremSublinear regret is impossible when
There is a stochastic loss generation such that any algorithm has while .
ProofHalve the surviving set each step
At a random half of the actions get loss 0 and the rest 1; at a random half of those get 0 and everything else (including all previous losers) gets 1; and so on. At every step the expected probability mass on zero-loss actions is at most , so the algorithm loses per step. Yet for some action still has total loss 0.
∎
Theorem even with
There is a stochastic loss generation with .
ProofRandom walk deviation
Flip a fair coin each step, setting or with probability each. Any distribution has expected loss exactly , so any algorithm has expected loss . Given losses of the first kind and of the second, . The probability of a given is , which by Stirling is — so with constant probability .
∎
Regret minimization and game theory
DefinitionGame-theoretic setup
with players; player has actions and loss function .
Player plays for steps using procedure ON, playing mixed action while the others play . Its loss is . The loss vector is — the loss player would have observed had it played at time .
Constant-sum games: reaching the value
TheoremExternal regret suffices against the game value
Let be a constant-sum game with value . If player plays for steps with external regret , its average loss is at most .
ProofThe empirical opponent strategy has a good response
Let be the mixed strategy given by the observed frequencies of player 2’s actions, . By the theory of constant-sum games there is an action with — so had player 1 always played , its loss would be at most . Hence , and .
∎
NoteWhat the rate is
Using a procedure with guarantees average loss at most .
ImportantRegret algorithms prove the minimax theorem
Define — the best loss player 1 can guarantee knowing player 2’s mixed action in advance — and , the best it can guarantee going first. The minimax theorem says .
ProofMinimax from external regret
Suppose for contradiction with (clearly ). Have both players run regret-minimizing algorithms for steps with regret at most , where . Let be player 1’s loss, so is player 2’s.
With the empirical frequency strategies, (we pick the best action against the specific mixed action ), and similarly . The regret guarantees give and . Chaining,
so — a contradiction.
∎
NoteA third proof of minimax
The LP treatment gave two: via Nash’s theorem, and via linear programming duality. This is a third, purely algorithmic one — no fixpoint theorem, no duality, just two learners playing each other.
Correlated equilibrium from swap regret
DefinitionSwitch functions and per-player regret
For let be if and otherwise. For a modification function ,
DefinitionCorrelated and -correlated equilibrium
over is a correlated equilibrium if for every player and any ,
Equivalently — and this is the form that extends to approximation — for any , . And is an -correlated equilibrium if for every and every ,
TheoremSwap regret bounds the distance to correlated equilibrium
If for steps every player follows a strategy with swap regret at most , then the empirical distribution of the joint actions played is an -correlated equilibrium.
ProofThe regret difference is the deviation incentive
assigns probability to each . Fix ; swap regret gives . By definition of the regret function,
so .
∎
ImportantThe headline dynamic result
If the average swap regret vanishes, the empirical play converges to the set of correlated equilibria. Note the contrast with best-response dynamics, which cycle in matching pennies and in general converge to nothing. Learning converges — but to the correlated equilibrium polytope, not to Nash.
Dominated strategies
Definition-dominated
is -dominated by if for all ; likewise by a mixed action with on the right.
TheoremLow swap regret means rarely playing dominated actions
If player uses a procedure with swap regret for steps, the average weight it puts on the set of -dominated actions is at most .
ProofThe dominating actions witness the regret
If is -dominated by then for every . Let be the dominated set and its time-average weight. Replacing each dominated action by its dominator shows the swap regret is at least , so .
∎
NoteExternal regret is not enough in general
Low external regret does not by itself give this guarantee — though RWM and PW happen to.
From external to swap regret: a generic reduction
ImportantThe construction
Instantiate copies of an external-regret procedure. At each step each outputs a distribution , with its weight on action . We choose our own distribution to satisfy
— is a stationary distribution of the Markov process defined by , which exists and is efficiently computable. When the loss vector arrives, we hand the scaled vector , so believes action costs — exactly what we would incur by putting ‘s probability mass on . Procedure becomes responsible for regret of the variety.
IntuitionTwo equivalent readings of
Either draw action directly with probability , or draw procedure with probability and let it choose the action — producing exactly . The fixed-point condition is what makes these agree.
TheoremThe reduction
Given an external regret procedure, the master procedure satisfies, for every ,
i.e. the swap regret of is at most .
ProofThe perceived losses sum to the true loss
experiences loss , so its external regret guarantee gives, for any ,
The key step: summing the procedures’ losses at time gives by design of — the perceived losses total exactly our actual loss. So summing the displayed inequality over all , the left side is , and choosing on the right gives .
∎
CorollaryEfficient swap regret
There is an online algorithm with swap regret . (This can be improved to .)
NoteWhy bother with a reduction
Low-internal-regret algorithms have also been developed from first principles, but this procedure gives the best bounds known for efficient algorithms — and it is a black box, inheriting any future improvement in external regret.
The partial information (bandit) model
The problem. In the bandit model the algorithm observes only the loss of the action it actually performed — you learn the travel time of the route you drove, not of the ones you didn’t. This forces an exploration versus exploitation trade-off: essentially any procedure must somehow explore to estimate losses.
ImportantThe reduction in outline
Partition the steps into blocks. Within a block the procedure uses a single distribution, except that it also samples each action once (the exploration steps). The partial-information procedure MAB passes the vector of losses gathered from exploration to a full-information procedure FIB, which returns a new distribution. The work is in relating FIB’s loss on the sequence it observes to MAB’s loss on the real sequence.
DerivationStep 1: a block-based full-information procedure
Blocks (assume ). Let FIB be an external regret procedure over steps, updating at the end of each block using the average loss vector . With and , since FIB uses a single throughout each block,
A tempting dead end: with the regret is , minimized at — one step per block. But the sampling cost, added next, will force .
DerivationStep 2: unbiased estimates instead of true averages
Feed FIB a random vector with . Then for any block and any ,
— the true loss of in the block equals its expected loss under . The are random, so the are random too (depending on ); still, for any realized sequence , and since and ,
Both FIB and MAB use the same on the same realized sequence, so .
DerivationStep 3: the estimates, and the price of getting them
For each action and block , choose a random exploration time (these need not be independent across actions, so collisions are avoidable). At , MAB plays action outright, observes , and sets — giving as required.
The cost: losses are at most 1 and there are exploration steps in each of blocks, so exploration costs at most overall. Hence
TheoremFull information to bandit
Given an external regret procedure FIB, there is a partial information procedure MAB with
obtained by setting , which balances the exploration cost against the block-granularity cost .
NoteNot the best bounds
This reduction is particularly simple and generic but does not produce the best known bandit bounds; sharper direct algorithms exist.
Convergence to Nash equilibrium in routing games
The setting. Online routing is a natural home for these algorithms: choose among routes daily and perform nearly as well as the best fixed route in hindsight, even if traffic changes arbitrarily. Even when the number of paths in a graph is exponential in , there are external-regret algorithms whose running time and regret are polynomial in the graph size — and extensions handle the partial-information case where only the traversed path’s cost is revealed.
DefinitionThe Wardrop model (single commodity)
A directed network with one unit of flow — a large population of infinitesimal users — travelling from to . Each edge has a nondecreasing latency function of the flow on it. The cost of a path is and the average travel time is . A flow is at Nash equilibrium if all flow-carrying paths are minimum-latency given .
IntuitionWhy the result is natural, and why it is not automatic
A Nash equilibrium is precisely a set of static strategies that are all no-regret with respect to each other, so convergence seems plausible. But there are many simple games where regret-minimizing algorithms do not approach Nash and can perform much worse than any Nash equilibrium. Routing is special.
WarningA nonstandard notion of convergence — and why it must be
The general result says: if each user has regret — or even if just the average regret over users is — then a fraction of days have the property that a fraction of users experience travel time at most above the best path that day, with shrinking polynomially in the graph size, the regret bounds, and the maximum latency slope.
Usually an “-approximate equilibrium” requires all participants to have at most incentive to deviate. But low-regret algorithms are allowed to occasionally take long paths — and bandit algorithms must occasionally explore paths untried for a while, to avoid regret if they have improved. The multiple levels of hedging are genuinely necessary.
Definition-Nash flow and the regret timescale
With the simple paths and the flow on day , a flow is -Nash if — the average deviation incentive is at most . Let be the average regret over users,
and let be the number of steps after which for all . RWM and PW achieve with .
TheoremTime-average flow is approximately Nash
Suppose the latency functions are linear. Then for , the average flow is -Nash.
ProofLinearity, then convexity, then the regret bound
Linearity gives for every . Since is a convex function of the flow,
Summing over all edges and applying the definition of , then linearity once more,
∎
ImportantFrom the time-average to most individual days
This bounds the time-average flow. It can then be used to show most are themselves approximately Nash. The key idea: if an edge’s cost fluctuated wildly, most of its users would experience latency substantially above the edge’s average cost — because more users are on the edge when it is congested than when it is not — which in turn implies substantial regret. These arguments carry over to general nonlinear latencies.
NoteWhy this motivates price of anarchy
routing-games and inefficiency-of-equilibria-introduction analyze the gap between Nash and optimal flows. This section says those results apply to participants using well-motivated self-interested adaptive behavior, not merely to an equilibrium assumed by fiat.
Current research directions
NoteRefined regret bounds
The bounds above are zero-order: they depend on alone. First-order bounds depend on the best action’s loss, second-order bounds on the sum of squares (like in the PW theorem). An open problem is external regret proportional to the empirical variance of the best action. A second challenge is reducing the prior information the algorithm needs — ideally it should learn and adapt to parameters such as the maximum and minimum loss.
NoteLarge action spaces
We assumed is small enough to enumerate, with running time proportional to . But is often exponential in the natural parameters: all simple – paths in an -node graph, or all binary search trees on . Since the full-information bounds are only logarithmic in , polynomial regret is information-theoretically available — the challenge is computational efficiency.
Kalai and Vempala give an efficient algorithm whenever (a) the actions form a subset of , (b) the loss vectors are linear functions over , and (c) the offline problem is efficiently solvable — covering both examples above. (Search trees add a rotation cost for changing action between steps, also addressed there.) Zinkevich extends this to convex loss functions given a projection oracle.
NoteDynamics
The classical example is swap regret, where all players minimizing it drives the empirical distribution to the set of correlated equilibria. We also saw convergence to the minimax value in two-player zero-sum games, and to Nash in a Wardrop routing game. Further convergence results in other settings would be of substantial interest: understanding these dynamics is what reveals the strengths and weaknesses of using such procedures.
Quick reference
| Object | Statement | Bound |
|---|---|---|
| Best sequence in hindsight | Regret for any algorithm | Impossible — hence restrict the class |
| Greedy | factor | |
| Any deterministic algorithm | , | factor is forced |
| Randomized Greedy | factor | |
| RWM | ||
| Polynomial Weights | second-order; handles | |
| Lower bound () | , | no sublinear regret |
| Lower bound () | is unavoidable | |
| External → swap | swap regret | , improvable to |
| Full info → bandit | at | |
| Constant-sum | average loss | also proves minimax |
| Swap regret for all players | empirical joint distribution is -correlated equilibrium | converges to the CE polytope |
| -dominated actions | average weight | vanishes for sublinear |
| Wardrop, linear latencies | is -Nash for |
Facts to keep to hand:
- , so swap regret dominates both; internal-to-swap costs at most a factor .
- Every weight-based proof here has the same skeleton: the fraction of total weight removed per step equals the algorithm’s expected loss, then sandwich between above and the best action’s weight below.
- The three equilibrium consequences pair with three regret notions: external → game value and minimax, swap → correlated equilibrium, swap → avoid dominated actions.
- Learning converges to correlated, not Nash, equilibria in general — matching the fact that correlated equilibria are LP-easy while Nash is PPAD-complete.
- The swap reduction works because is chosen as the stationary distribution of , which is exactly what makes the subroutines’ perceived losses sum to the true loss.
- The bandit reduction balances two costs pulling opposite ways: exploration wants small, block granularity wants large.
- Routing is a special case: regret minimization converges to Nash there, but not in general games.
References
- [[lit/algorithmic-game-theory|Nisan, Roughgarden, Tardos & Vazirani, Algorithmic Game Theory]] — chapter 4 (Blum & Mansour)
- Cesa-Bianchi & Lugosi, Prediction, Learning, and Games — thorough coverage of most topics here