Search

Search papers and lessons

Continual Re-Solving

Level 4 · 10 min read

Continual re-solving plays an imperfect-information game by recomputing a strategy for the current subgame at every decision, using the opponent's observed actions to update beliefs about its hand.

On this page

  • Colour = topic mix
  • Discrete math
  • Probability
  • Game theory
  • Calculus
  • Reinforcement learning
  • Linear algebra
  • ReadReady to readNot yet

TL;DR

Re-solving handles a game where the other player's cards are hidden (asymmetric information) by solving the current situation afresh at each decision, rather than looking up a fixed table of answers for every possible situation. It starts from the opponent's observed actions, works out what hands they could still hold, and computes a strategy for the rest of the game from that point. Continual re-solving repeats this at every decision, and depth-limited re-solving stops the search early and estimates the value of positions beyond the horizon.

Builds on: Counterfactual Regret Minimization, Value Function · Leads to: Best Response

Where it's used

DeepStack. In 2017 a team reported DeepStack in Science, an agent that beat professional players at heads-up no-limit Texas hold'em. It re-solved a small lookahead at each decision, and it used a learned value function in place of the rest of the game tree.

Libratus. Libratus, which beat professionals in January 2017, used a method called safe subgame solving. When the agent reached a part of the game it had not planned for, it re-solved that part, with a constraint that the opponent could not earn more than under the strategy it had already computed. The constraint is what makes the re-solving safe to trust.

Long card games with many hidden hands. Before the flop in Texas hold'em, a player who holds two cards knows the opponent holds one of (502)=1225\binom{50}{2} = 1225 possible pairs. After a flop with three board cards are revealed, the count drops to (472)=1081\binom{47}{2} = 1081. Re-solving has to track a belief over every one of these hands, which is why the method works on the subgame, not on the whole game.

How it works

Take one decision in a tiny hidden-card game. The opponent holds either a strong hand or a weak hand, with equal chance, and you cannot see which. If you call a bet, you win 3 against a weak hand and lose 2 against a strong hand. Folding is worth 0 either way.

  1. Start from a blueprint. A blueprint is a strategy computed earlier for the whole game, aiming at a Nash equilibrium. Here it says that a strong hand always bets, and a weak hand bets half the time. Check: the blueprint gives a probability of betting for each hand.
  2. Observe the action. The opponent bets. You now know the bet, but not the hand. The hands that fit what you have seen form your information set. Check: the bet is evidence about the hand, so the belief must change.
  3. Update the range. The range is your belief over the opponent's hands. Strong starts at 0.5 and always bets, so it contributes 0.5⋅1=0.50.5 \cdot 1 = 0.5 to the chance of seeing a bet. Weak starts at 0.5 and bets half the time, so it contributes 0.5⋅0.5=0.250.5 \cdot 0.5 = 0.25. Normalise: strong is 0.5/0.75=2/30.5 / 0.75 = 2/3 and weak is 1/31/3. Check: the two posterior weights add to 1.
  4. Re-solve the decision. With the new range, calling has expected value (2/3)⋅(−2)+(1/3)⋅3=−1/3(2/3) \cdot (-2) + (1/3) \cdot 3 = -1/3, and folding is worth 0. Check: with the original range of one half each, calling would have been worth 0.50.5, a positive value.
  5. Play the re-solved action. Fold, because the updated range makes calling a loss. Check: the action comes from the new range, not from the blueprint's table of answers.
  6. Repeat at the next decision. At each new decision, the range is updated again from the blueprint and the newest action, and the subgame below the current point is re-solved.
flowchart LR
  A["Blueprint strategy for the whole game"] --> B["Opponent acts"]
  B --> C["Bayes update of the range"]
  C --> D["Re-solve the current subgame"]
  D --> E["Play the re-solved action"]
  E --> B
  D --> F["Depth limit: estimate leaf values"]
  F --> D

The math

Setup

Let HH be the history of public actions so far. The opponent has private hands hh, and the blueprint gives the probability πoppσˉ(H∣h)\pi^{\bar\sigma}_{\text{opp}}(H \mid h) that the opponent takes the observed actions when holding hh. Let r0(h)r_0(h) be the opening range, the prior probability of each hand.

Definition: Range

The range after history HH is the posterior probability of each opponent hand given the observed actions:

r(h∣H)=r0(h) πoppσˉ(H∣h)∑h′r0(h′) πoppσˉ(H∣h′).r(h \mid H) = \frac{r_0(h) \, \pi^{\bar\sigma}_{\text{opp}}(H \mid h)}{\sum_{h'} r_0(h') \, \pi^{\bar\sigma}_{\text{opp}}(H \mid h')}.

The numerator multiplies the prior by the likelihood of the observed actions, and the denominator makes the ranges sum to 1.

Here hh and h′h' name opponent hands, r0r_0 is the prior, and the denominator is the sum over every hand the opponent could hold.

Step 3 in symbols: the Bayes update

With the blueprint's bet probabilities, π(bet∣strong)=1\pi(\text{bet} \mid \text{strong}) = 1 and π(bet∣weak)=0.5\pi(\text{bet} \mid \text{weak}) = 0.5, and prior r0=(0.5,0.5)r_0 = (0.5, 0.5), Bayes' rule gives the posterior

r(strong∣bet)=0.5⋅10.5⋅1+0.5⋅0.5=23.r(\text{strong} \mid \text{bet}) = \frac{0.5 \cdot 1}{0.5 \cdot 1 + 0.5 \cdot 0.5} = \frac{2}{3}.

Step 4 in symbols: the value of an action

Let u(a,h)u(a, h) be your payoff from action aa against hand hh. The expected value of an action under the range is

EV(a)=∑hr(h∣H) u(a,h).\mathrm{EV}(a) = \sum_{h} r(h \mid H) \, u(a, h).

With u(call,strong)=−2u(\text{call}, \text{strong}) = -2, u(call,weak)=3u(\text{call}, \text{weak}) = 3 and u(fold,⋅)=0u(\text{fold}, \cdot) = 0, this gives EV(call)=−1/3\mathrm{EV}(\text{call}) = -1/3 at the posterior.

Depth limit in symbols

If the subgame is cut off at a depth dd, the leaves of the cut carry an estimate v^(s)\hat{v}(s) of the value of state ss, from a learned value function, in place of playing out the rest of the game. The re-solved strategy is then exact only up to the error of v^\hat{v}.

Worked examples

Example
1. Tiny: a range update with different bet frequencies

Keep the prior at 0.5 for each hand, but let the blueprint bet with a weak hand only 0.2 of the time.

  1. Joint weight of strong and bet: 0.5⋅1=0.50.5 \cdot 1 = 0.5.
  2. Joint weight of weak and bet: 0.5⋅0.2=0.10.5 \cdot 0.2 = 0.1.
  3. Total weight of a bet: 0.5+0.1=0.60.5 + 0.1 = 0.6.
  4. Posterior of strong: 0.5/0.6=5/6≈0.8330.5 / 0.6 = 5/6 \approx 0.833.
  5. Posterior of weak: 0.1/0.6=1/60.1 / 0.6 = 1/6.
  6. Check: 5/6+1/6=15/6 + 1/6 = 1.

Interpretation: the less often a weak hand bets, the more a bet points to a strong hand, so the range moves further toward strong.

Example
2. Standard: the same action flips with the range

Use the payoffs from the walkthrough: calling is worth −2-2 against strong and 33 against weak, and folding is worth 0. Calling is worth p⋅(−2)+(1−p)⋅3p \cdot (-2) + (1 - p) \cdot 3 when pp is the probability of strong.

  1. Find the indifference point, where calling and folding are worth the same: −2p+3−3p=0-2p + 3 - 3p = 0, so 5p=35p = 3 and p=0.6p = 0.6.
  2. Under the opening range p=0.5p = 0.5, calling is worth 0.5⋅(−2)+0.5⋅3=0.50.5 \cdot (-2) + 0.5 \cdot 3 = 0.5, which is greater than 0, so call.
  3. Under the posterior p=5/6p = 5/6 from Example 1, calling is worth (5/6)(−2)+(1/6)(3)=−7/6(5/6)(-2) + (1/6)(3) = -7/6, which is less than 0, so fold.
  4. Check: the threshold lies between the two cases, since 0.5<0.6<5/60.5 < 0.6 < 5/6.

Interpretation: the range decides which action is right. A player who ignored the bet, and kept using the opening range, would call and lose money against a strong hand that bets.

Example
3. Realistic: tracking the hands that remain

In a hold'em hand, you hold two cards, so the 50 unseen cards give (502)=1225\binom{50}{2} = 1225 possible two-card hands for the opponent.

  1. Count the hands before the flop: (502)=50⋅492=1225\binom{50}{2} = \frac{50 \cdot 49}{2} = 1225.
  2. A flop shows three board cards, which removes three more unseen cards, leaving 47.
  3. Count the hands after the flop: (472)=47⋅462=1081\binom{47}{2} = \frac{47 \cdot 46}{2} = 1081.
  4. Check: each of the 1081 hands has a weight in the range, and the weights sum to 1.
  5. After each opponent action, the blueprint's probability of that action for each hand multiplies its weight, and the 1081 weights are normalised again.

Interpretation: the range is a vector of over a thousand weights, updated after every action, so re-solving has to be efficient enough to handle it at every decision.

Try it: suppose the blueprint bets with probability 0.5 for every one of the 1081 hands, and the opponent bets. What is each hand's posterior weight? Answer: each weight is multiplied by 0.5, and the normalisation returns each hand to 1/10811/1081, so the range does not change. An action that does not depend on the hand gives no information.

Common mistakes and tradeoffs

It is tempting to think that re-solving means solving the whole game again. In fact only the subgame below the current point is solved, and the blueprint supplies the range that the subgame starts from.

It is tempting to think that the opponent's earlier actions can be ignored. In fact they change the range, and a re-solved strategy that ignores them plays against the wrong opponent. The worked example shows the same action flipping from call to fold.

It is tempting to think that depth-limited solving is exact. In fact the leaf estimates are approximations, and errors in the learned value function carry into the strategy. The guarantee holds only as far as the estimates are accurate.

When to use re-solving: when the game is too large to store a full strategy, but a decision can be re-computed in the time available, and the opponent's play before the current point is known. When not to use it: when the full game is small enough to solve in advance, or when the game is perfect-information, where search from the actual position is simpler. Alternatives: storing a complete blueprint, which costs memory, and real-time search with learned values, which costs accuracy.

History

Re-solving grew out of work on decomposing large imperfect-information games into subgames that can be solved separately, in the mid-2010s. Noam Brown and Tuomas Sandholm developed safe and nested subgame solving, which gave the constraint used in Libratus in 2017. DeepStack, reported in Science in 2017, showed that continual re-solving with a learned value function could beat professional players without storing a complete strategy for the game. Later work on depth-limited solving studied how the quality of the leaf estimates limits the quality of the strategy.

Recap

  • Re-solving computes a strategy for the current subgame from the opponent's observed actions and a blueprint.
  • The range is the posterior over the opponent's hands, updated by Bayes' rule after each action.
  • The right action can change when the range changes, so re-solving must use the current range.
  • Depth limits trade accuracy for speed, with a learned value function estimating the cut-off positions.
  • Read next: Best Response, since re-solving approximates the best reply to the opponent's range, and Value Function for how the leaf estimates are learned.

Check yourself

QuestionRecall: what is the range, and when does it change?Show answer
The range is the posterior probability of each opponent hand given the public actions so far. It changes after every observed action, through a Bayes update that multiplies each hand's weight by how likely the blueprint says that action is for that hand, and then normalises.
QuestionComputation: the opening range is 0.5 for strong and 0.5 for weak. The blueprint bets with probability 1 for strong and 0.25 for weak, and the opponent bets. What is the posterior probability of strong?Show answer
The joint weights are 0.5⋅1=0.50.5 \cdot 1 = 0.5 for strong and 0.5⋅0.25=0.1250.5 \cdot 0.25 = 0.125 for weak. The total is 0.6250.625, so the posterior of strong is 0.5/0.625=0.80.5 / 0.625 = 0.8.
QuestionWhy: why must re-solving use the current range instead of the opening range?Show answer
The best action depends on what the opponent is likely to hold. With the opening range, calling against a bet looks profitable, but after the bet the range moves toward strong hands, and calling becomes a loss. Re-solving with the opening range would play against an opponent who does not exist.
QuestionApplied: a player uses depth-limited re-solving, and the learned value function overestimates positions where the opponent holds strong hands. What is the effect on the chosen strategy?Show answer
The leaf estimates are inflated in those positions, so the re-solved strategy will overvalue lines that reach them, and it may take actions that are worse than they look. The strategy is exact only as far as the value estimates are accurate, so the error has to be measured or bounded before the strategy can be trusted.

Sources