Skip to content
Turnstone
← Research

How poker solvers work: CFR explained

Published

Three bars for bet, check and fold regret, with the resulting 75% bet and 25% check strategy

Almost every modern poker solver runs some version of counterfactual regret minimization, or CFR. It plays a game against itself millions of times, keeps score of what it wishes it had done, and shifts toward those actions.

What a solver is looking for

A solver looks for a Nash equilibrium: a pair of strategies where neither player can gain by changing theirs alone. In a two-player zero-sum game like heads-up poker, an equilibrium strategy can’t be beaten over the long run by any counter-strategy, and its Exploitability is zero. That is what people mean by a GTO strategy.

It isn’t the strategy that wins the most against a particular opponent. It’s the one that loses the least to the best possible opponent. Against someone who folds too much, a different strategy makes more money, and finding it means changing the opponent’s model, not the solver’s method.

Regret, in one decision

Regret is how much better an action would have done than the strategy you actually played. Suppose that across many past iterations at one decision, betting would have earned 6 chips more than the mix actually played, checking 2 chips more, and folding 3 chips less.

Regret matching plays each action in proportion to its positive regret. Betting gets 6 of the 8 positive points and checking gets 2, so the next strategy bets 75% and checks 25%. Folding has negative regret and gets nothing. Play another round, update the totals and repeat. Actions that keep looking better gain weight, and actions that keep losing fade out.

The counterfactual part

Poker hides cards, so a player can’t know which exact position they’re in, only what they’ve seen. The decision points that look the same to a player are grouped together, and CFR keeps a separate regret table for each one.

When it scores an action at one of those points, CFR weights the outcome by how likely the opponent and the deck were to reach it, as if the player had tried to get there. That is the counterfactual value. Zinkevich and co-authors showed in 2007 that minimizing regret this way at every decision point separately is enough to drive the whole strategy toward equilibrium in two-player zero-sum games.

Why the average strategy counts

The strategy CFR plays on any one iteration can keep swinging. In rock-paper-scissors played this way, each player chases the other’s last move and the current strategies cycle. What converges is the average of all the strategies played so far, and that average is what a solver reports.

This is also why solvers report a convergence number. After each batch of iterations, a solver can compute how much a perfect counter-strategy would win against the current average. As that number falls, the average gets closer to equilibrium. Solvers stop at a target Solve tolerance, often stated as a percentage of the pot, and that figure applies only to the game tree they were given.

CFR+, discounted CFR and the big results

CFR+, introduced by Oskari Tammelin in 2014, resets negative regret to zero instead of letting it pile up, and weights later iterations more heavily in the average. Tammelin reported it typically ran ten or more times faster than earlier CFR versions, and a team at the University of Alberta used it to solve heads-up limit Hold’em closely enough that a lifetime of play couldn’t reliably tell the difference.

Discounted CFR, published by Noam Brown and Tuomas Sandholm in 2019, goes further. It shrinks the weight of early iterations, which were played while the strategy was still poor. In their paper, one discounted variant beat CFR+ in every game they tested. Two years earlier, their program Libratus had beaten top professionals at heads-up no-limit.

What the method can’t fix

CFR solves the game it’s given. Ranges, stack depths and the bet sizes allowed in the tree are all inputs, and a size left out of the tree never gets a strategy. A tighter tolerance makes the answer closer to that tree’s equilibrium; it doesn’t add the missing sizes. What a solver result can tell you goes through those limits.

Full no-limit Hold’em is too big to solve this way end to end, so programs cut it down. DeepStack and Libratus cut it down in different ways, and Turnstone has its own. How Turnstone works explains its version: it solves turns and rivers with discounted CFR, and on the flop it stops at the turn and asks a trained network for the values.

Sources

  1. Zinkevich et al.: Regret minimization in games with incomplete information (2007)checked
  2. Tammelin: Solving large imperfect information games using CFR+ (2014)checked
  3. Bowling et al.: Heads-up limit hold’em poker is solved (Science, 2015)checked
  4. Brown and Sandholm: Superhuman AI for heads-up no-limit poker (Science, 2018)checked
  5. Brown and Sandholm: Solving imperfect-information games via discounted regret minimization (2019)checked