Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

Double Oracle & PSRO

Growing a population of best responses toward an equilibrium.

Self-play must decide which past selves to train against. Double oracle and PSRO answer with game theory: keep a population of policies, solve the small game among them exactly, and add a best response to that solution. This lesson proves that double oracle converges to an exact equilibrium of a finite zero-sum game while certifying its progress, generalizes it to PSRO with deep-RL best responses and a choice of meta-solver, and covers the variants built to scale it: α-PSRO for many-player general-sum games, pipeline PSRO for parallel training, and double oracle for extensive-form games.

What you’ll learn

  • State the double oracle algorithm and prove that it terminates with an exact equilibrium of a finite two-player zero-sum game, with an anytime bracket on the game's value.
  • Run double oracle by hand on rock–paper–scissors, compute the certificate of a restricted solution, and explain when the method needs few iterations and when it needs every strategy.
  • Describe PSRO's empirical meta-game and meta-strategy solvers, and identify the solvers that recover iterated best response, fictitious play and double oracle.
  • Explain α-PSRO, pipeline PSRO, extensive-form double oracle and anytime variants, and what best responses and meta-game estimation cost.

Double oracle

Take a two-player zero-sum game whose pure strategy sets Π1,Π2\Pi_1,\Pi_2 are finite but enormous, such as all deterministic policies of a board game, with payoff A(a,b)A(a,b) to player 1. Solving it by linear programming is hopeless, but suppose a best-response oracle is available: given a mixed strategy of the opponent, it returns a pure best response from the full set. The double oracle algorithm (McMahan, Gordon & Blum, 2003) builds the equilibrium from the outside in.

text
S₁ ← {a₀},  S₂ ← {b₀}                       # small restricted strategy sets
repeat:
    (x, y), v_S ← equilibrium and value of the restricted game S₁ × S₂     (an LP)
    a* ← BestResponse₁(y) over all of Π₁;   upper ← A(a*, y)
    b* ← BestResponse₂(x) over all of Π₂;   lower ← A(x, b*)
    if upper − lower ≤ ε: return (x, y)        # ε = 0 gives an exact equilibrium
    S₁ ← S₁ ∪ {a*},  S₂ ← S₂ ∪ {b*}

The restricted equilibrium (x,y)(\mathbf x,\mathbf y) is a mixed strategy over the restricted sets, which is also a mixed strategy of the full game.

DerivationProof
  1. lower=min⁡b∈Π2A(x,b) ≤ v⋆ ≤ max⁡a∈Π1A(a,y)=upper\text{lower}=\min_{b\in\Pi_2}A(\mathbf x,b)\ \le\ v^\star\ \le\ \max_{a\in\Pi_1}A(a,\mathbf y)=\text{upper}

    The bracket. Any mixed strategy of player 1 guarantees at most the value, and any mixed strategy of player 2 concedes at least it (the minimax theorem). Applied to the restricted solution:

  2. upper=lower⟹max⁡a∈Π1A(a,y)=vS=min⁡b∈Π2A(x,b)\text{upper}=\text{lower}\quad\Longrightarrow\quad\max_{a\in\Pi_1}A(a,\mathbf y)=v_S=\min_{b\in\Pi_2}A(\mathbf x,b)

    Stopping means equilibrium. Since (x,y)(\mathbf x,\mathbf y) solves the restricted game, max⁡a∈S1A(a,y)=vS=min⁡b∈S2A(x,b)\max_{a\in S_1}A(a,\mathbf y)=v_S=\min_{b\in S_2}A(\mathbf x,b). If upper = lower, then max⁡a∈Π1A(a,y)=vS=min⁡b∈Π2A(x,b)\max_{a\in\Pi_1}A(a,\mathbf y)=v_S=\min_{b\in\Pi_2}A(\mathbf x,b): neither player can gain by deviating anywhere in the full game, so (x,y)(\mathbf x,\mathbf y) is a Nash equilibrium and v⋆=vSv^\star=v_S.

  3. Progress. If upper > lower, then upper > vSv_S or lower < vSv_S. In the first case a⋆a^\star earns strictly more against y\mathbf y than every strategy in S1S_1, so a⋆∉S1a^\star\notin S_1; in the second, b⋆∉S2b^\star\notin S_2. Every non-final iteration therefore adds at least one new pure strategy, and the sets only grow, so there are at most ∣Π1∣+∣Π2∣\abs{\Pi_1}+\abs{\Pi_2} iterations. ■\blacksquare

  4. The bound is a worst case. Double oracle is fast when the game has an equilibrium with small support and the best responses find its strategies early: the restricted games then stay tiny while Π1\Pi_1 and Π2\Pi_2 may be astronomically large.

DerivationDouble oracle on rock–paper–scissors
  1. S1=S2={R,P}:paper dominates rock, so (x,y)=(P,P), vS=0S_1=S_2=\{\mathrm R,\mathrm P\}:\quad\text{paper dominates rock, so }(\mathbf x,\mathbf y)=(\mathrm P,\mathrm P),\ v_S=0

    Start with S1=S2={R}S_1=S_2=\{\mathrm R\}. The restricted game is the single cell (R, R), value 0. Each player's best response to rock is paper, worth +1+1, so the bracket is [−1,+1][-1,+1] and both sets grow:

  2. S1=S2={R,P,S}:x=y=(13,13,13),upper=lower=0S_1=S_2=\{\mathrm R,\mathrm P,\mathrm S\}:\quad\mathbf x=\mathbf y=\big(\tfrac13,\tfrac13,\tfrac13\big),\quad\text{upper}=\text{lower}=0

    The best response to paper is scissors, again worth +1+1: the bracket is still [−1,+1][-1,+1]. Adding scissors gives the full game, whose equilibrium is uniform, with bracket [0,0][0,0]:

  3. Double oracle needed every strategy: in a fully cyclic game, every strategy is in the equilibrium's support, and no restricted game short of the full one is safe. In mostly transitive games, by contrast, the best responses climb the ladder and most strategies are never needed.

Predict before you look

In the middle of that run, the restricted solution is (paper, paper). What is its duality gap, upper − lower, in the full rock–paper–scissors game (payoffs +1, 0, −1)?

Show the answer

2

Against y\mathbf y = paper, player 1's best response (scissors) earns upper =+1=+1; against x\mathbf x = paper, player 2's best response (scissors) holds player 1 to lower =−1=-1. The gap is 2, the largest possible in this game, although the restricted game's value, 0, happens to equal the true value. A restricted value alone certifies nothing; the bracket does.

PSRO: double oracle with learned best responses

Policy-space response oracles (PSRO; Lanctot et al., 2017) make double oracle practical for multi-agent RL. The "pure strategies" are policies, usually neural networks. The restricted game becomes an empirical meta-game: its payoff entries are estimated by simulating matches between the population's policies. The best-response oracle is a deep-RL training run against the opponents' current mixture. And because an exact Nash equilibrium of the meta-game is not always the best target, a meta-strategy solver (MSS) chooses the mixture to respond to.

text
populations Π₁ = {π₁⁰}, Π₂ = {π₂⁰}
repeat:
    M ← estimate the meta-game: average payoff of every pair (π₁ⁱ, π₂ʲ) by simulation
    (σ₁, σ₂) ← MetaSolver(M)                         # a mixture over each population
    π₁′ ← RL best response to opponents sampled from σ₂
    π₂′ ← RL best response to opponents sampled from σ₁
    add π₁′ to Π₁ and π₂′ to Π₂
output the meta-strategies (σ₁, σ₂) over the final populations

In a symmetric game one population suffices. Each iteration costs a full RL training run plus a row and a column of new meta-game entries, each averaged over many episodes.

Meta-strategy solverMixture it responds toPSRO becomes
"Last"All weight on the newest policyIterated best response: naive self-play
UniformEqual weight on every policy so farFictitious play (fictitious self-play)
NashAn equilibrium of the meta-gameDouble oracle
Projected replicator dynamicsAn approximate equilibrium that keeps a minimum probability on every policyAn exploratory, smoothed double oracle
α-RankThe stationary distribution of an evolutionary processα-PSRO (next step)
One framework, many algorithms: Lanctot et al. showed that the choice of solver recovers independent RL, iterated best response, fictitious play and double oracle as special cases.

The same paper introduced joint-policy correlation, a diagnostic for why plain independent RL is fragile: train several independent pairs of policies, then evaluate each policy with partners from other runs. Performance drops when policies have overfit to the particular partner they trained with, a failure that training against mixtures of many partners is meant to cure. For parallel hardware it also proposed deep cognitive hierarchies, which train a fixed number of levels concurrently, each responding to a mixture of the levels below.

Progress is measured by the exploitability of the meta-strategy, NashConv(σ)=∑i[ui(BRi(σ−i),σ−i)−ui(σ)]\mathrm{NashConv}(\sigma)=\sum_i\big[u_i(\mathrm{BR}_i(\sigma_{-i}),\sigma_{-i})-u_i(\sigma)\big], the bracket width of the theorem. In small games such as Kuhn and Leduc poker best responses can be computed exactly; in large games they are trained by RL, so measured exploitability is only a lower bound on the truth.

Check your understanding

Which meta-strategy solver makes PSRO behave like fictitious play?

  1. A Nash equilibrium solver for the meta-game
  2. The uniform distribution over all policies found so far
  3. All weight on the most recent policy
  4. The policy with the highest average payoff in the meta-game
Show the answer

B. The uniform distribution over all policies found so far

Fictitious play best-responds to the empirical average of past play, which in PSRO is the uniform mixture over the population, since each iteration adds one best response. A Nash solver gives double oracle, and all weight on the newest policy gives iterated best response.

Many players and general sums: α-Rank and α-PSRO

Double oracle's guarantee is for two-player zero-sum games. With more players or general-sum payoffs, a Nash meta-solver is both intractable (PPAD-hard) and ambiguous: the meta-game may have many equilibria with different payoffs, and PSRO must pick one. α-Rank (Omidshafiei et al., 2019) replaces the static fixed point by a dynamical one. Picture a population behind each player slot. Occasionally a "mutant" strategy appears in one slot and takes over that population with a probability that increases with its payoff advantage, more sharply for a larger ranking intensity α\alpha. Single-slot takeovers define a Markov chain on pure-strategy profiles, and its stationary distribution ranks profiles and strategies.

For finite α\alpha the stationary distribution is unique, and computing it costs time polynomial in the number of pure profiles (itself exponential in the number of players). As α→∞\alpha\to\infty the mass concentrates on the sink strongly connected components of the game's response graph, the directed graph whose edges are weakly improving single-player deviations. These sinks are the Markov–Conley chains that give α-Rank its game-theoretic footing: sets of profiles that improving deviations can enter but never leave.

Think first What does α-Rank (with large α\alpha) put its mass on in rock–paper–scissors, and in the prisoner's dilemma?

In rock–paper–scissors, viewed as a single population, the improving switches form one cycle, rock → paper → scissors → rock, which is itself the only sink component, and by symmetry the stationary distribution is uniform, matching the Nash equilibrium. In the prisoner's dilemma every improving deviation is a switch to defect, so all paths lead to (Defect, Defect), a sink with no way out, and α-Rank puts its mass there, again agreeing with the unique Nash equilibrium. The two concepts part ways in games where the sink components are cycles through several profiles: α-Rank then reports the cycle, while Nash reports a mixed point that the dynamics may never visit.

α-PSRO (Muller et al., 2020) uses α-Rank as PSRO's meta-solver. A payoff-maximizing best response to the α-Rank mixture is not the right oracle for this target, so they pair it with a preference-based best response, a policy chosen to be preferred by the ranking's dynamics over the current mixture, and prove convergence to α-Rank's sink components in several classes of games. Empirically it was competitive with Nash-based PSRO in two-player Kuhn and Leduc poker, matched the approximate-Nash solver (projected replicator dynamics) in three- to five-player Kuhn poker, and converged fastest in three-player Leduc poker.

Making PSRO scale

Each PSRO iteration trains a full RL policy and then adds a row and a column to the meta-game, each entry an average over many simulated matches, so the meta-game costs grow quadratically with the population and its entries are noisy. The variants below attack the three bottlenecks: sequential training, the shape of the restricted game, and non-monotone progress.

VariantIdeaWhat it buys
Pipeline PSRO (McAleer, Lanier, Fox & Baldi, 2020)A hierarchy of workers trains in parallel; each trains against the meta-Nash of the policies below it, and the lowest one is frozen and replaced when it plateausParallel speed-up while keeping PSRO's convergence guarantee; the authors show deep cognitive hierarchies and rectified PSRO can fail to converge even in small games; state of the art in Barrage Stratego
XDO (McAleer, Lanier, Wang, Baldi & Fox, 2021)Extensive-form double oracle: solve the restricted extensive-form game, so best responses can be mixed at every information set, not just at the rootIterations linear in the number of information sets, where PSRO may need exponentially many; an order of magnitude fewer iterations on Leduc poker
Anytime PSRO (McAleer et al., 2022)Choose each restricted distribution to minimize exploitability against the full game, computed by regret minimization against best responsesExploitability that decreases monotonically, where double oracle's can rise from one iteration to the next
Why PSRO can need exponentially many iterations in sequential games: a pure policy fixes an action at every information set, so an equilibrium that randomizes independently at many information sets is a mixture over exponentially many combinations of pure policies.

Key takeaways

  • Double oracle grows restricted strategy sets with best responses to the restricted equilibrium; in finite zero-sum games it stops after at most ∣Π1∣+∣Π2∣\abs{\Pi_1}+\abs{\Pi_2} iterations with an exact equilibrium, and at every iteration the best-response values bracket the game's value.
  • It is fast when an equilibrium has small support and slow when every strategy is needed, as in rock–paper–scissors.
  • PSRO replaces pure strategies by policies, the restricted game by an empirical meta-game and the oracle by deep RL; the meta-strategy solver recovers naive self-play (last), fictitious play (uniform) and double oracle (Nash).
  • For many players and general sums, α-Rank's stationary distribution (concentrating on sink components of the response graph) gives a unique, computable meta-solver, used by α-PSRO.
  • Pipeline PSRO parallelizes training with guarantees, XDO mixes at every information set to avoid exponentially many iterations, and anytime variants make exploitability decrease monotonically; with learned best responses, measured exploitability is only a lower bound.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Why does double oracle, run with exact best responses on a finite two-player zero-sum game, always terminate?

  1. Because the restricted game's value increases strictly at every iteration
  2. Because the restricted game is solved by linear programming
  3. Because the best-response oracle is randomized
  4. Because whenever it does not stop, at least one best response beats everything in its player's restricted set, so it is a new strategy, and there are only finitely many
Show the answer

D. Because whenever it does not stop, at least one best response beats everything in its player's restricted set, so it is a new strategy, and there are only finitely many

If the bracket upper − lower is positive, one player's best response strictly improves on the restricted value and therefore lies outside the restricted set. Sets only grow, so after at most ∣Π1∣+∣Π2∣\abs{\Pi_1}+\abs{\Pi_2} iterations the algorithm must stop, and stopping means the restricted equilibrium is an equilibrium of the full game.

Question 2

At some double-oracle iteration, player 1's best response to y\mathbf y earns 0.3 and player 2's best response to x\mathbf x holds player 1 to 0.1. What do you know about the value v⋆v^\star of the full game?

  1. 0.1≤v⋆≤0.30.1\le v^\star\le0.3, and the restricted solution's duality gap is 0.2
  2. v⋆=0.2v^\star=0.2
  3. v⋆≥0.3v^\star\ge0.3
  4. Nothing until the algorithm stops
Show the answer

A. 0.1≤v⋆≤0.30.1\le v^\star\le0.3, and the restricted solution's duality gap is 0.2

Player 1's mixed strategy x\mathbf x guarantees at least 0.1, so v⋆≥0.1v^\star\ge0.1; player 2's y\mathbf y concedes at most 0.3, so v⋆≤0.3v^\star\le0.3. The width of the bracket is the exploitability (NashConv) of the current solution, an anytime certificate.

Question 3

Why can PSRO need exponentially many iterations in an extensive-form game such as poker, and how does XDO avoid this?

  1. Because poker's payoffs are stochastic; XDO averages more hands per meta-game entry
  2. Because the meta-game is solved by linear programming; XDO uses fictitious play instead
  3. Because deep-RL best responses are inaccurate; XDO computes exact best responses
  4. Because PSRO mixes whole policies only at the root, so an equilibrium that randomizes independently at many information sets needs exponentially many pure policies; XDO solves the restricted extensive-form game and mixes at every information set
Show the answer

D. Because PSRO mixes whole policies only at the root, so an equilibrium that randomizes independently at many information sets needs exponentially many pure policies; XDO solves the restricted extensive-form game and mixes at every information set

A pure policy commits to an action at every information set, and a mixture of whole policies can express independent randomization at many information sets only by including every needed combination. XDO's restricted game is itself an extensive-form game whose equilibrium can mix locally, so it needs a number of iterations linear in the number of information sets.

Question 4

In a large game you estimate the exploitability of a PSRO meta-strategy by training a deep-RL best response against it. What does the resulting number tell you?

  1. The exact exploitability
  2. An upper bound: the true exploitability can only be smaller
  3. A lower bound: a stronger best response might exploit the meta-strategy more
  4. Nothing, because exploitability is only defined for exact best responses
Show the answer

C. A lower bound: a stronger best response might exploit the meta-strategy more

Exploitability is the gain of the best response; any trained policy achieves at most that gain, so its measured gain is a lower bound. A strategy that looks unexploitable against learned attackers can still have holes, as adversarial policies against superhuman Go programs showed.

Further reading

  • H. B. McMahan, G. J. Gordon & A. Blum, "Planning in the presence of cost functions controlled by an adversary," ICML (2003).
  • M. Lanctot, V. Zambaldi, A. Gruslys, A. Lazaridou, K. Tuyls, J. Pérolat, D. Silver & T. Graepel, "A unified game-theoretic approach to multiagent reinforcement learning," NeurIPS (2017).
  • P. Muller et al., "A generalized training approach for multiagent learning," ICLR (2020).
  • S. McAleer, J. Lanier, R. Fox & P. Baldi, "Pipeline PSRO: A scalable approach for finding approximate Nash equilibria in large games," NeurIPS (2020).
  • S. McAleer, J. Lanier, K. Wang, P. Baldi & R. Fox, "XDO: A double oracle algorithm for extensive-form games," NeurIPS (2021).