Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

Subgame Solving: Libratus & Pluribus

Safe and depth-limited subgame solving for no-limit hold’em.

A precomputed strategy for no-limit hold'em must squeeze more than 1016010^{160} decision points into an abstraction a computer can solve, and then play every hand from that coarse map. Libratus and Pluribus instead re-solve, during play, the part of the game they are actually in. The obstacle is the one Kuhn poker exposed: a subgame cannot be solved alone. This lesson covers abstraction and its pathologies, the gadget games that make re-solving safe, the refinements behind Libratus, and the depth-limited search that let Pluribus play six-player poker on two CPUs.

What you’ll learn

  • Explain card and bet abstraction and action translation, and state what is known about abstraction pathologies.
  • Solve the Coin Toss game, show that a subgame's solution depends on payoffs outside it, and compute what unsafe subgame solving loses.
  • Construct the re-solving gadget, prove that its solutions cannot increase exploitability, and explain maxmargin, reach and estimated variants.
  • Describe Libratus's three modules and Pluribus's depth-limited search with several continuation strategies, with their reported compute and results.
  • Explain why no equilibrium guarantee exists for six-player poker, and what that implies for reading Pluribus's results.

Abstraction and its pathologies

Until 2017 every strong no-limit program played a blueprint: an equilibrium of an abstraction of the game. Card abstraction merges hands that play alike into buckets, typically by clustering hands by their distribution of equity against random opponent hands. Action abstraction allows a few bet sizes, such as fractions of the pot and all-in. The abstract game is solved with CFR or Monte Carlo CFR, and its strategy is mapped back. When an opponent bets a size the abstraction lacks, action translation maps it to nearby abstract sizes, which an opponent can probe for holes.

Is a finer abstraction always better? Not necessarily.

Measurements are more reassuring and more sobering at once. With exact best responses for limit hold'em, Johanson, Waugh, Bowling & Zinkevich (2011) found that larger abstractions were less exploitable in all four comparisons they ran, so pathologies seem rare there. But head-to-head results and exploitability diverged: four agents of the 2010 Annual Computer Poker Competition lost at most 9 mb/g head-to-head against the top-ranked agent, Rockhopper, yet they and Rockhopper were exploitable by 135 to 399 mb/g. And CFR overfits an abstraction: run long enough, the strategy keeps improving in the abstract game while its exploitability in the real game rises. In no-limit, exploitability cannot be computed exactly, but a local best response showed several top bots exploitable by more than 3,000 mbb/g (Lisý & Bowling, 2017). Abstraction alone was not going to reach expert level.

Check your understanding

A team doubles the number of card buckets in its abstraction and re-solves. What can be said about the new strategy's exploitability in the real game?

  1. It must decrease, since the abstraction is closer to the real game
  2. It can increase in principle; in limit hold'em larger abstractions were less exploitable in practice
  3. It can increase only if the opponent is left unabstracted
  4. It equals the drop in head-to-head win rate against the old strategy
Show the answer

B. It can increase in principle; in limit hold'em larger abstractions were less exploitable in practice

Waugh et al. (2009) showed that refinement can backfire, so no monotonicity holds; Johanson et al. (2011) found that it did not happen in their limit hold'em comparisons. The guarantee runs the other way: with the opponent unabstracted, refining your own abstraction cannot hurt.

Coin Toss: a subgame needs the rest of the game

Brown and Sandholm (2017) isolate the problem in a game they call Coin Toss. A fair coin is flipped and only P1 sees it. P1 either Sells the coin, which leads to a subgame worth +0.50+0.50 to P1 if the coin is Heads and −0.50-0.50 if Tails, or Plays, after which P2 guesses the coin. A correct guess pays P1 −1-1, a wrong one +1+1. (P2 may also forfeit, which it should never do.) What should P2 do in the Play subgame?

DerivationP2's optimal guess depends on the Sell payoffs
  1. V1(g)=12max⁡(0.5, 1−2g)+12max⁡(−0.5, 2g−1)V_1(g)=\tfrac12\max\big(0.5,\ 1-2g\big)+\tfrac12\max\big(-0.5,\ 2g-1\big)

    Let P2 guess Heads with probability gg. Playing earns P1 1−2g1-2g with Heads and 2g−12g-1 with Tails, and P1, who knows the coin, picks the better of Sell and Play each time:

  2. V1(14)=12(0.5)+12(−0.5)=0,V1(1)=12(0.5)+12(1)=0.75,V1(0)=12(1)+12(−0.5)=0.25V_1(\tfrac14)=\tfrac12(0.5)+\tfrac12(-0.5)=0,\qquad V_1(1)=\tfrac12(0.5)+\tfrac12(1)=0.75,\qquad V_1(0)=\tfrac12(1)+\tfrac12(-0.5)=0.25

    Both maxima are smallest at g=14g=\tfrac14, where Play is worth exactly what Sell is worth for either coin, and P1 gets 0. P1 can guarantee 0 by always selling, so P2 can do no better: guessing Heads a quarter of the time is optimal. Guessing always Heads or always Tails is worse:

  3. Now make Tails the lucky coin: Sell pays −0.50-0.50 with Heads and +0.50+0.50 with Tails. The same argument gives g=34g=\tfrac34. Nothing inside the Play subgame changed, yet its solution moved, because payoffs in a subgame that play never enters moved. And at equilibrium P1 plays equally often with either coin, so P2's posterior after Play is 12\tfrac12: the right guess is not the posterior-optimal one, it is the one that keeps P1 from switching between Sell and Play.

Predict before you look

P2 guesses Heads with probability 12\tfrac12 in the Play subgame, which looks neutral. How much can P1 earn per game against it?

Show the answer

0.25

At g=12g=\tfrac12 playing is worth 0 for either coin, so P1 sells Heads (0.5) and plays Tails (0): V1=12(0.5)+12(0)=0.25V_1=\tfrac12(0.5)+\tfrac12(0)=0.25, against 0 at g=14g=\tfrac14. The neutral-looking strategy ignores what P1 gives up by not selling, and pays for it.

Unsafe subgame solving (as in Ganzfried & Sandholm, 2015) assumes both players reached the subgame by playing the blueprint, computes the distribution over the subgame's starting histories by Bayes' rule, and solves the subgame for that distribution. Suppose the blueprint has P1 play with probability 34\tfrac34 holding Heads and 12\tfrac12 holding Tails. Then the posterior after Play is Pr⁡(Heads∣Play)=0.375/0.625=0.6\Pr(\text{Heads}\mid\text{Play})=0.375/0.625=0.6, the unsafe solution is to guess Heads always, and P1 answers by playing only with Tails: V1=0.75V_1=0.75. Unsafe solving often works well against opponents who do not adapt, which is why it was popular, but it has no guarantee: in Brown and Sandholm's experiments on a large poker endgame it raised the blueprint's exploitability almost tenfold.

Safe subgame solving: gadgets and margins

Take the view of P2, who holds a blueprint σ2\sigma_2 and wants a better strategy for a subgame SS. Let StopS_{\text{top}} be P1's information sets at the root of SS (in poker, P1's possible hands at the start of the subgame). For each I1∈StopI_1\in S_{\text{top}}, the counterfactual best-response value CBVσ2(I1)\mathrm{CBV}^{\sigma_2}(I_1) is the counterfactual value P1 obtains from I1I_1 onward by best-responding to σ2\sigma_2. Outside SS nothing changes, so these numbers are all that SS contributes to P1's best response.

DerivationWhy the gadget is safe
  1. CBVσ2S(I1)≤CBVσ2(I1)  ∀I1∈Stop⟹max⁡σ1u1(σ1,σ2′)≤max⁡σ1u1(σ1,σ2)\mathrm{CBV}^{\sigma_2^S}(I_1)\le\mathrm{CBV}^{\sigma_2}(I_1)\ \ \forall I_1\in S_{\text{top}}\quad\Longrightarrow\quad\max_{\sigma_1}u_1(\sigma_1,\sigma_2')\le\max_{\sigma_1}u_1(\sigma_1,\sigma_2)

    Root values decide exploitability. P1's best response to the combined strategy chooses how to reach each I1∈StopI_1\in S_{\text{top}} and then collects CBV(I1)\mathrm{CBV}(I_1) there; everything outside SS is unchanged. Its value is increasing in each CBV(I1)\mathrm{CBV}(I_1), so nonnegative margins everywhere imply

  2. Here σ2′\sigma_2' plays σ2S\sigma_2^S in SS and σ2\sigma_2 elsewhere. In a two-player zero-sum game P2's exploitability is P1's best-response value minus the game value, so it cannot rise.

  3. min⁡σ2S ∑I1p(I1)max⁡(T(I1),F(I1))=∑I1p(I1) T(I1)■\min_{\sigma_2^S}\ \sum_{I_1}p(I_1)\max\big(T(I_1),F(I_1)\big)=\sum_{I_1}p(I_1)\,T(I_1)\qquad\blacksquare

    An equilibrium of the gadget has nonnegative margins. P1's best-response value in the gadget is ∑I1p(I1)max⁡(T(I1),F(I1))\sum_{I_1}p(I_1)\max\big(T(I_1),F(I_1)\big), with TT the Terminate payoff and FF the value of following. Playing the blueprint in SS makes F=TF=T everywhere, so P2 can hold P1 to ∑p T\sum p\,T; since max⁡(T,F)≥T\max(T,F)\ge T, nothing lower is possible. Every P2 equilibrium strategy therefore attains ∑p T\sum p\,T, which forces F(I1)≤T(I1)F(I_1)\le T(I_1) wherever p(I1)>0p(I_1)>0:

This is Resolve (Burch, Johanson & Bowling, 2014, who also bound the increase in exploitability by the solving errors when the solutions are approximate). Safety alone does not ask for improvement: many equilibria of the gadget have margins of zero and are no better than the blueprint. Three refinements push further.

  • Maxmargin (Moravčík, Schmid, Ha, Hladík & Gaukrodger, 2016) picks the re-solved strategy that maximizes the smallest margin over StopS_{\text{top}}.
  • Reach (Brown & Sandholm, 2017) notices that P1 may already have given up value on the way to SS by playing worse than a best response, a gift. A lower bound on the gift can be added to the Terminate payoff of the affected hands, relaxing their constraint while keeping safety; Reach-Maxmargin is the combination.
  • Estimate replaces the blueprint's best-response values by estimates of the equilibrium values. Safety is no longer guaranteed, but Libratus's version, Estimated-Maxmargin, comes with a bound: if the estimates of the opponent's values are off by at most δ\delta, the result is at most 2δ2\delta more exploitable than the least exploitable strategy that differs from the blueprint only in the re-solved subgames.
MethodExploitability (mbb/hand)
Blueprint from the abstraction41.41
Unsafe subgame solving396.8
Resolve23.11
Reach-Maxmargin18.80
Re-solving in one of Brown and Sandholm's (2017) large poker test games, with a blueprint abstraction of 30,000 card buckets; the best variant in their table reached 8.78. Safe methods roughly halve the blueprint's exploitability, while the unsafe one makes it almost ten times worse, although unsafe solving can still look strong against opponents who do not adapt.

Nested solving and Libratus

Re-solving also fixes action translation. When the opponent bets a size the abstraction lacks, nested subgame solving builds a new subgame that contains the actual bet and re-solves it safely, and it repeats this every time the opponent acts. In Brown and Sandholm's (2017) test, a strategy using the randomized pseudo-harmonic action translation was exploitable by 1,465 mbb/hand; nested solving brought this to 150.2 with Resolve, 122.0 with Maxmargin and 119.1 with Reach-Maxmargin.

The match, "Brains vs. Artificial Intelligence: Upping the Ante", ran over 20 days in January 2017 at Rivers Casino in Pittsburgh: 120,000 hands against four heads-up specialists, Jason Les, Dong Kim, Daniel McAulay and Jimmy Chou. Libratus won by 147 mbb/game, significant at 99.98% if the hands are treated as independent, and beat each player individually. It ran on the Pittsburgh Supercomputing Center's Bridges computer, using on the order of 20 million core hours in total by the center's and the authors' accounts. Weeks earlier, DeepStack had beaten a broader pool of self-identified professionals with a different form of re-solving (Search with Imperfect Information: DeepStack & ReBeL).

Depth-limited solving and Pluribus

Early in a no-limit hand the remaining game is far too large to re-solve to the end. Perfect-information search would stop at a depth limit and score the leaves with a value function. In an imperfect-information game a leaf has no single value: what a position is worth depends on how both players will play from it, and the opponent's future play can adapt to the strategy being searched for. Scoring leaves with fixed values hands the opponent a free exploit.

If the opponent could choose any continuation, the leaf values would be its best-response values and nothing would be lost relative to solving to the end; a handful of well-chosen continuations approximates that, and the approximation is justified by experiments rather than a bound. It is cheap. The authors' bot Modicum ran on a 4-core CPU with 16 GB of memory after a 700-core-hour blueprint, and beat Baby Tartanian8 (winner of the 2016 Annual Computer Poker Competition) by 6±56\pm5 and Slumbot (winner in 2018) by 11±911\pm9 mbb/hand (95% confidence intervals).

Predict before you look

Pluribus's 48 mbb/game over 10,000 hands came with a standard error of 25. How many hands would a standard error of 5 mbb/game take, with the same variance reduction?

Show the answer

250000

The standard error falls like 1/n1/\sqrt n, so a fivefold reduction needs 2525 times the hands: 250,000, more than a year of play for a human professional. That is why variance-reduction estimators such as AIVAT, which remove the luck of the cards from each hand's result, are essential for evaluating poker AI.

Key takeaways

  • Blueprints solve an abstraction of the game; refining an abstraction can in principle increase exploitability (pathologies), and head-to-head strength says little about exploitability.
  • In Coin Toss, P2's optimal guess (Heads with probability 14\tfrac14) is set by the payoffs of a subgame that play never enters; unsafe subgame solving, which fixes the opponent's arrival probabilities, can be exploited badly.
  • The re-solving gadget lets the opponent's root hands Terminate at their blueprint best-response values, so its equilibria cannot increase exploitability; maxmargin, reach (gifts) and estimated values push for improvement.
  • Libratus combined a blueprint, nested safe re-solving with Estimated-Maxmargin (also for bets outside its abstraction) and nightly self-improvement, and beat four heads-up specialists by 147 mbb/game over 120,000 hands in January 2017.
  • Depth-limited solving scores leaves by letting the opponent (in Pluribus, every player) choose among several continuation strategies. It let Pluribus search in real time on two CPUs after a 12,400-core-hour blueprint and beat professionals at six-player no-limit, where no equilibrium guarantee exists.

Check yourself

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

Question 1

In Coin Toss, P1 plays equally often with either coin at equilibrium, so after Play the coin is Heads with probability 12\tfrac12. Why is guessing Heads with probability 14\tfrac14, not 12\tfrac12, optimal for P2?

  1. Because P2 should always lean toward the less likely coin
  2. Because P2's guessing strategy must keep P1 from gaining by switching between Sell and Play, and that depends on the Sell payoffs
  3. Because the posterior after Play is actually 14\tfrac14
  4. Because guessing 12\tfrac12 would let P1 gain by forfeiting
Show the answer

B. Because P2's guessing strategy must keep P1 from gaining by switching between Sell and Play, and that depends on the Sell payoffs

At g=14g=\tfrac14 Play is worth exactly what Sell is worth for both coins (0.5 and −0.5-0.5), so P1 gains nothing by deviating from any mix of the two. At g=12g=\tfrac12, P1 sells Heads and plays Tails for 0.25 per game. The guess is pinned down by payoffs outside the subgame, which is why the subgame cannot be solved alone.

Question 2

Why can re-solving a subgame with the Resolve gadget not increase P2's exploitability?

  1. Because the gadget is solved with more iterations than the blueprint
  2. Because the gadget assumes P1 reached the subgame with the blueprint's probabilities
  3. Because the re-solved strategy is always identical to the blueprint
  4. Because P1 can take Terminate and collect its blueprint best-response value at every root hand, so in an equilibrium of the gadget no hand of P1 gets more than against the blueprint
Show the answer

D. Because P1 can take Terminate and collect its blueprint best-response value at every root hand, so in an equilibrium of the gadget no hand of P1 gets more than against the blueprint

The Terminate option makes the blueprint's best-response values upper bounds that P2 must respect: P2 can match them by replaying the blueprint, so any equilibrium of the gadget keeps every root hand's value at or below them, and P1's best response to the full strategy cannot improve.

Question 3

Why does depth-limited solving in imperfect-information games let players choose among several continuation strategies at the leaves, instead of scoring each leaf with one fixed value?

  1. Because neural networks cannot estimate leaf values in poker
  2. Because four continuation strategies can represent any opponent exactly
  3. Because the searcher must randomize among its own continuations to stay unpredictable
  4. Because a leaf's value depends on how the opponent will play beyond it, which can adapt to the searched strategy; a fixed value would assume that adaptation away
Show the answer

D. Because a leaf's value depends on how the opponent will play beyond it, which can adapt to the searched strategy; a fixed value would assume that adaptation away

A fixed leaf value presumes one way of playing the rest of the game. Letting the opponent pick, hand by hand, among several continuations forces the searched strategy to be robust to its adaptation; with all continuations allowed the leaf values would be best-response values and nothing would be lost.

Question 4

Why is "compute a Nash equilibrium and play it" not a safe recipe in six-player poker, as it is in heads-up poker?

  1. Equilibria are not interchangeable, so strategies taken from different equilibria need not form one and even an equilibrium player can lose; and no known algorithm finds one at this scale
  2. Six-player poker has no Nash equilibrium
  3. The game stops being zero-sum when there are more than two players
  4. Professional players never play equilibrium strategies
Show the answer

A. Equilibria are not interchangeable, so strategies taken from different equilibria need not form one and even an equilibrium player can lose; and no known algorithm finds one at this scale

Every finite game has an equilibrium, but with more than two players an equilibrium strategy guarantees nothing when the others play strategies from other equilibria, as the Lemonade Stand game shows; CFR's convergence guarantee also disappears. Pluribus's strength is established by experiment.

Further reading

  • N. Burch, M. Johanson & M. Bowling, "Solving imperfect information games using decomposition," Proceedings of the AAAI Conference on Artificial Intelligence 28, 602–608 (2014).
  • N. Brown & T. Sandholm, "Safe and nested subgame solving for imperfect-information games," Advances in Neural Information Processing Systems 30, 689–699 (2017).
  • N. Brown & T. Sandholm, "Superhuman AI for heads-up no-limit poker: Libratus beats top professionals," Science 359(6374), 418–424 (2018).
  • N. Brown, T. Sandholm & B. Amos, "Depth-limited solving for imperfect-information games," Advances in Neural Information Processing Systems 31, 7663–7674 (2018).
  • N. Brown & T. Sandholm, "Superhuman AI for multiplayer poker," Science 365(6456), 885–890 (2019).