S AFE O PPONENT -E XPLOITATION S UBGAME R EFINEMENT
A BSTRACT
In zero-sum games, an NE strategy tends to be overly conservative confronted with opponents of limited rationality, because it does not actively exploit their weaknesses.
From another perspective, best responding to an estimated opponent model is vulnerable to estimation errors and lacks safety guarantees.
Inspired by the recent success of real-time search algorithms in developing superhuman
AI, we investigate the dilemma of safety and opponent exploitation and present a novel real-time search framework, called Safe Exploitation Search (SES), which smoothly interpolates between the two extremes of online strategy refinement.
We provide SES with a theoretically upper-bounded exploitability and a lowerbounded evaluation performance.
Additionally, SES enables computationally efficient online adaptation to a possibly updating opponent model, while previous safe exploitation methods have to recompute for the whole game.
Empirical results show that SES significantly outperforms NE baselines and previous algorithms while keeping exploitability low at the same time.
I NTRODUCTION
Behind the recent breakthroughs of superhuman AIs in Go (Silver et al., 2016; 2017; Schrittwieser et al., 2020), heads-up no-limit Texas hold’em (HUNL) (Brown et al., 2018; Moravc´ık et al., 2017;
Brown & Sandholm, 2019; Brown et al., 2020), and Hanabi (Lerer et al., 2020), search plays a vital role.
In perfect information games, Monte Carlo tree search (MCTS) is widely applied to improve policy’s strength.
In zero-sum imperfect information games such as poker, search algorithms are used to find a Nash equilibrium (NE) approximation in subgames encountered in real time (Brown &
Sandholm, 2017; Burch et al., 2014).
They are both theoretically sounded and empirically powerful.
In zero-sum games, NE-based search algorithms (Burch et al., 2014; Moravcik et al., 2016; Brown &
Sandholm, 2017; Brown et al., 2018) find safe strategies with low exploitability and produce strong baselines against all opponents (Brown & Sandholm, 2019).
However, it may be overly conservative confronted with opponents with limited rationality, and fail to take advantage of their weaknesses to obtain higher rewards (McCracken & Bowling, 2004; Johanson et al., 2007; Li & Miikkulainen, 2018).
From another perspective, there have been extensive studies on opponent exploitation to address the problem.
Some typical works (Carmel & Markovitch, 1996; Billings et al., 2003; Gilpin & Sandholm, 2006; Li & Miikkulainen, 2018) model the opponent’s strategy based on previous observations and then search for a new strategy to exploit this model.
However, these methods often neglect the significance of the strategy safety, thus being highly exploitable.
Few exceptions including Johanson et al.
and Ganzfried & Sandholm (2015a) aim to search for safe and robust counter-strategies.
Ganzfried & Sandholm (2015a) provides a characterization of safe deviations from NE in repeated games.
Restricted Nash response (RNR) (Johanson et al., 2007) finds a Pareto optimal strategy with respect to safety and exploitation in the full game.
However, it is computationally inefficient because it needs to recompute a strategy for the whole game whenever the opponent model is updated.
This can be even infeasible in an online setting where the opponent model is being updated continuously with streamed data.
In this paper, we study the dilemma of safety and opponent exploitation and present a new scalable real-time search framework Safe Exploitation Search (SES) that smoothly interpolates between the two extremes of strategy search, hence unifying safe search and opponent exploitation.
It enables computationally efficient online adaptations to a continuously changing opponent model, which is hard to address by previous safe exploitation algorithms.
The safety criterion requires the refined strategy to stay close to NE, formally speaking, to expose limited exploitability against any opponents, while the opponent exploitation criterion requires the strategy to adapt to its specific opponent and to exploit its weaknesses.
We propose a novel maximization objective in the subgame search framework which combines the safety objective and exploitation, controlled by the exploitation level α .
We construct a new gadget game to optimize this objective, which enables our method’s scalability to large games such as Texas Hold’em.
Theoretically, we prove that SES is guaranteed to outperform NE at the cost of some constant increase in its own exploitability confronted with non-NE opponents.
Empirically, we evaluate the effectiveness of our search algorithm in 1 didactic matrix game 2 poker games: Leduc Hold’em (Southey et al., 2005) and
Flop Hold’em Poker (FHP)(Brown et al., 2019).
The experiment results demonstrate that our algorithm significantly outperforms NE baselines against non-NE opponents and keeps low exploitability at the same time.
Additionally, we show that SES is not only much more computationally efficient than previous safe exploitation methods but also more robust to estimation errors in opponent models.
R ELATED WORK
This paper investigates the problem of safe opponent exploitation in two-player zero-sum imperfect information games.
We propose a novel search algorithm that balances between NE and exploiting opponents.
Two major relevant research areas are search algorithms in imperfect information games and opponent exploitation.
Search in imperfect information games.
In recent literature, search techniques are witnessed to be important in developing strong AI strategies in both perfect and imperfect information games (Burch et al., 2014; Moravcik et al., 2016; Brown & Sandholm, 2017).
Texas hold ’em poker is widely employed as a benchmark for imperfect information games.
A primary part of the longterm research on Texas hold’em poker is the evolution of subgame solving algorithms, which aim at achieving a more accurate Nash equilibrium approximation in the subgame encountered given a pre-computed strategy for the full game which we refer to as the blueprint strategy.
Unsafe search (Billings et al., 2003; Ganzfried & Sandholm, 2015b; Gilpin & Sandholm, 2006; 2007) estimates the subgame reach probability assuming the opponent follows blueprint, and searches for a refined subgame strategy.
Subgame resolving (Burch et al., 2014) and maxmargin search (Moravcik et al., 2016) are theoretically sounded safe search algorithms which ensure that the subgame strategy obtained is no worse than the blueprint.
They search in a gadget game and achieve safety by providing the opponent with the option not entering the current subgame.
DeepStack (Moravc´ık et al., 2017) and Libratus (Brown et al., 2018) build strong poker AIs with the aid of search.
Beyond poker, search algorithms for subgame refinement have also shown promise in improving joint strategies in cooperative imperfect information games such as Hanabi (Lerer et al., 2020) and the bidding phase of contract bridge (Tian et al., 2020).
The purpose of our search algorithm is different from previous methods in poker literature.
We seek to exploit opponents while keeping exploitability low, rather than simply approximating NE.
Opponent exploitation.
Most previous opponent exploitation researches (Carmel & Markovitch, 1996; Billings et al., 2003; Gilpin & Sandholm, 2006; Li & Miikkulainen, 2018) typically model the opponent’s strategy based on previous observations and then search for a new strategy to exploit this model, but put little emphasis on safety.
One similar work is Johanson et al.
(2007) which proposes p -restricted Nash response (RNR) to find a safe exploitation strategy to the estimated opponent’s strategy.
It calculates a Nash equilibrium for the whole game restricting that the opponent plays the estimated strategy σ fix with probability p , and any strategy with probability 1 − p .
In that paper, Johanson et al.
(2007) prove that a p -RNR to σ fix is Pareto optimal with respect to exploitation and safety.
However, it does not provide an explicit bound.
Additionally, whenever the estimated opponent model changes or we want to use a different p to balance between safety and exploitation, the original p -RNR has to recompute the strategy for the whole game.
It is computationally inefficient in an online setting, where the opponent model is updated after every round with new game data.
Our algorithm instead takes modeling error into account and provides explicit bounds for both safety and exploitation.
With the aid of real-time search, it only searches for strategies in subgames encountered instead of the whole game.
Our experiments show that it is more efficient than Johanson et al.
Ganzfried & Sandholm (2015a) studies safe exploitation strategies in repeated games, which is a different setting from this paper.
Intuitively, it achieves safety by risking in exploitability at most what it has earned over NE in expectation in previous rounds.
Therefore, its expected value in the whole repeated game is never worse than the NE.
In contrast, this paper focuses on the safety of stage game strategies.
Furthermore, our algorithm is complementary to Ganzfried & Sandholm (2015a).
Ganzfried & Sandholm (2015a) calculate an ε -safe best response for the whole game at each iteration with LP.
This procedure is one of the main limitations on the algorithm’s scalability.
Our algorithm, which only refines strategies in subgames in real-time, can be a possible substitute for LP.
And Moravc ´ ık et al.
(2017) uses a similar mixing distribution technique but it differs from ours in two aspects.
Firstly, the motivation of Moravc ´ ık et al.
(2017) is to speed-up resolving procedure for an accurate NE by fixing the distribution of infosets on top of the subgame.
And it means that their predicted distribution is not a prediction of their opponnent but a prediction of some unknown NE strategy.
Secondly, the theory of Moravc ´ ık et al.
neither provides a safety nor an exploitation theoretical bound on this mixing algorithm unlike us.
To our knowledge, we are the first paper to investigate the safe opponent exploitation problem in subgame resolving schemes.
Subgame resolving enables online adaptations to a continuously changing opponent model, eliminating the need to recompute a whole game strategy.
It offers computational benefits in practical opponent exploitation circumstances.
Our experiments in section 5 demonstrate its efficiency and robustness.
There is extensive research (Albrecht & Stone, 2018) on agent modeling.
However, this paper only focuses on the safe exploitation algorithm, but not the agent modeling techniques.
We can use off-the-shelf agent modeling algorithms to estimate the opponent’s strategies.
N OTATIONS AND BACKGROUND
An extensive-form imperfect information game G =
( P, H, Z, A, χ, ρ, · , σ c , u, I ) describes sequential interactions among agents, where agents have private information.
A finite set P consists of n players and a chance node c which represents the stochastic nature of the environment.
The set of non-terminal decision nodes is denoted as H , and Z is a set of terminal nodes or leaves.
The set of possible actions is A , and χ : H → 2 | A | is a function which assigns to each decision node h ∈ H a set of legal actions.
A player function ρ : H → P assigns to each decision node a player p ∈ P who acts at that node.
If action a leads from h to h ′ , we write h · a = h ′ .
If there exists a sequence of actions leading from h to h ′ , we write h ⊑ h ′ .
At each node h ∈ H , the acting player p = ρ ( h ) picks an action from legal actions a ∈ χ ( h ) , and leads node h into its child h · a .
The chance node always samples an action from its own distribution σ c , which is common knowledge to all players.
Utility functions are u = ( u 1 , u 2 , . . .
, u n ) , where u
i : Z → R defines the utility of player i at terminal node z ∈ Z .
The nature of imperfect information is characterized by infosets I =
( I 1 , I 2 , . .
, I n ) ,
where I i =
( I i, 1 , . . .
, I i,k i ) is a partition of H for player i .
Two states in the same infoset must have the same acting player and the same legal action sets.
We use I ( h ) to denote the infoset that h belongs to.
A player p cannot distinguish between states
h 1 and h 2 if I ( h 1 ) =
I ( h 2 ) , and thus should behave identically on all states in the same infoset.
The strategy of a player p is σ p : I p ×
A → R , where σ p ( I, a ) is a distribution over valid actions on infoset I .
For simplicity, we also use σ p ( h, a ) to denote σ p ( I ( h ) , a ) .
We use π σ ( h ) to denote the probability of reaching state h from the root when agents choose a strategy profile σ = ⟨ σ 1 , σ 2 , . . .
, σ n ⟩ .
Formally, π σ ( h ) =
(cid:81) h ′ · a ⊑ h σ ρ ( h ′ ) ( h ′ , a ) .
We use π σ − p ( h ) =
(cid:81) h ′ · a ⊑ h
∧ ρ ( h ′ ) ̸
= p σ ρ ( h ′ )
( h ′ , a ) to denote the probability of reaching h when player p always chooses the action that leads to h whenever possible.
π σ ( h, h ′ ) is the reaching probability of h ′ from h .
π σ ( h · a, h ′ ) is the the probability of reaching h ′ from h if action a is taken at h .
These probabilities can be formally defined in a similar manner.
The expected utility of player p given strategy profile σ is u σp = (cid:80) z
∈
Z π σ ( z ) u p ( z ) .
The counterfactual value v σp ( I, a ) is the expected utility that player p will obtain after taking action a at infoset
I , given the joint policy profile is σ .
Mathematically, it is the weighted sum of expected values at all states h ∈
I .
[Equation]
In the rest of the paper, we focus on two-player zero-sum games with perfect recall.
Zero-sum means ∀ z ∈ Z, u 1 ( z ) + u 2 ( z ) = 0 .
Perfect recall means that no player will forget the information which has been obtained previously in the game.
This is a common assumption in related literature.
A best response strategy [Equation]
for player p is the strategy that maximize his own expected utility against fixed opponent strategy σ − p .
The exploitability of strategy σ p is [Equation]
where σ ∗ is the optimal strategy, and is an NE in two-player zero-sum games.
It measures the performance of σ p against its best response comparing with the
NE.
A counterfactual best response CBR p ( σ − p ) is a strategy where σ p ( I, a ) >
if and only if v σp ( I, a ) ≥ max b v σp ( I, b ) .
Counterfactual best response is a best response, but not vice versa.
The counterfactual best response value CBV
[Equation]
is the expected utility of the counterfactual best response policy.
Since we focus on two-player zero-sum games, we will use
CBV σ p ( I ) as a shorthand notation for CBV σ p − p ( I ) .
We follow the imperfect information subgame definition as in Burch et al.
An augmented infoset contains states which cannot be distinguished by the remaining players.
Definition 3.1.
An imperfect information subgame S is a forest of trees, closed under both the descendant relation and membership within augmented infosets for any player.
Let S top be the set of nodes which are roots of each tree in S .
M ETHOD
In this section, we introduce our novel search algorithm called safe exploitation search (SES), which exploits the weaknesses of the opponent while ensuring a bounded exploitability efficiently.
Let σ be the pre-computed blueprint strategy.
Without loss of generality, assume we search for player 2’s refined strategy σ S 2 by applying SES to all subgames S ∈ S .
Finally, the refined strategy for P2 after search is σ ′ 2 , which is the same as σ 2 in { I i 2 |∀ S ∈ S , I i 2 / ∈ S } and is replaced with σ S 2 in S ∈ S .
4. S AFE E XPLOITATION S EARCH
Our algorithm offers a unified approach to balance these two demands with theoretical guarantees.
The objective of our search algorithm is to find a new subgame strategy σ S 2 for S ∈ S which [Table]
[Equation]
where α ∈ [0 , 1] is a hyper-parameter controlling the exploitation level, and ˆ p ( I j 1 ) is the estimated probability of player 1 entering infoset I j 1 ∈ S top .
Given P2’s strategy (which is the blueprint σ 2 ) and P1’s actual strategy (which does not have to be the blueprint σ 1 ), the real probability of player 1 entering infoset I j 1 ∈ S top (which we denote as p ( I j 1 ) ) is determined.
ˆ p ( I j 1 ) is an estimation of p ( I j 1 ) .
For instance, in poker, it is the estimated distribution of private cards player 1 holds.
Both theoretically and empirically, such estimation does not have to be fully accurate.
It can be done with off-the-shelf opponent modeling techniques, which lies beyond the focus of this paper.
Intuitively, the maximization objective achieves a balance between opponent exploitation and safety , controlled by exploitation level α .
The first part of the objective is maximized when (cid:80)
[Equation]
p
[Equation]
) CBV
[Equation]
1 ( I j 1 ) is minimized.
It aims at finding a strategy σ S 2 which results in the lowest value for P1 under the assumption that the reach probabilities is ˆ p .
It can be interpreted as exploiting the estimated P1’s strategy.
The second part of the objective demands the resolved strategy to behave well against any reach probability distribution.
We use the subgame margin min
[Equation]
., 2016) which can be regarded as the worstcase utility increase for P2.
Our search objective is a convex combination of exploitation and safety, which is closely related to previous safe exploitation research (McCracken & Bowling, 2004; Johanson et al., 2007).
RNR (Johanson et al., 2007) calculates an exploitation strategy by computing an NE in the full game, restricting the opponent to play its fixed strategy with probability p and any other strategy with 1 − p .
RNR is proved to be Pareto optimal with respect to safety and exploitation.
However, it neither provides an explicit bound on exploitability and performance nor takes modeling errors into account.
Furthermore, without search, RNR has to recompute for the whole game whenever the opponent’s strategy changes, which limits its efficiency.
Experiment section E demonstrates that
SES is much more computationally efficient, and section F shows that, even we augment RNR with search framework, SES is still much more robust to estimation errors in opponent strategy.
By maximizing the objective 2, we provide sound theoretical results for both safety and opponent exploitation.
Additionally, we provide analyses of how (1) exploitation level α , (2) accuracy of opponent modeling, and (3) strength of the blueprint strategy impact the theoretical bound.
By gradually increasing α from 0 to 1, our algorithm tends to exploit rather than keep safe.
Theorem 4.1.
(safety) Let S be a disjoint set of subgames S .
Let σ ∗ = ⟨ σ ∗ 1 , σ ∗ 2 ⟩ be the
NE where P2’s strategy is constrained to be the same with σ 2 outside S .
Define ∆ = max
[Equation]
[Equation] | [Equation] 2 1 ( I i 1 ) − v σ 1 ( I i 1 ) | .
Let ˜ p
( I i 1 ) be the reach probability given by σ ∗ 1 .
Let ˆ p
( I i 1 ) be the estimation of reach probability p
( I i 1 ) given by the real opponent strategy.
Define τ =
[Equation]
) | .
Whenever 1 − (2 τ + 1) α > 0 , we have a bounded exploitability given by:
[Equation]
Recall that σ ′ 2 is the refined strategy after search.
The proof is provided in Appendix A.
This theorem implies that the exploitability of the new strategy is smaller than that of strategy σ ∗ 2 plus a constant value, which is the closest strategy to NE if constrained to differ from σ 2 only in S .
The corresponding theoretical result of maxmargin search (Moravcik et al., 2016), a safe search algorithm with no opponent exploitation abilities, is exp( σ ′ 2 )
≤ exp( σ ∗ 2 ) + 2∆ .
Comparing these two results, we can interpret the term 2 / (1 − (2 τ + 1) α ) as the additional risk introduced by exploiting the opponent.
If exploitation level α = 0 , then our bound is as tight as that of maxmargin search (Moravcik et al., 2016).
The bound also gets tighter if the τ gets smaller, or the blueprint σ 2 is closer to σ ∗ 2 .
Theorem 4.2.
(opponent exploitation) Let ϵ =
∥
ˆ p − p ∥ 1 be the L1 distance of the distribution p
( I i 1 ) and ˆ p ( I i 1 ) .
Let η = min S ∈ S max I j 1 ∈ S top (cid:16) CBV 1 ( I j 1 , σ S 2 ) − CBV 1 ( I j 1 , σ ∗ 2 ) (cid:17) ≥ 0 .
We use
BR [ S ,σ p ] p ( σ ) to denote the strategy for player p which maximizes its utility in subgame S ∈ S against σ − p under the constraint that BR [ S ,σ p ] p ( σ ) and σ p differs only inside S .
By maximizing objective 2, for all S ∈ S , the refined strategy σ ′ 2 satisfies
[Equation]
The proof is provided in Appendix A. Observe that the reach probability p is characterized by P1’s strategy outside S and ˆ p is its estimation.
Because the search algorithm always find a stronger response strategy for P1 in S (which is exactly BR [ S ,σ 1 ]( σ ′ 2 ) ) as well, opponent exploitation refers to adapting to P1’s strategy σ 1 outside S .
This theorem implies that the utility of the new strategy σ ′ 2 is lower bounded by the utility of σ ∗ 2 when both confronted with P1’s unknown strategy outside S .
It provides theoretical guarantees for the opponent exploitation ability of our algorithm.
ϵ can be interpreted as estimation error.
The lower bound increases if the estimation error get smaller or the blueprint σ 2 is closer to σ ∗ 2 .
We show empirically how exploitation level α and estimation error impact both safety and exploitation abilities in section 5. 4. G ADGET G AME [Equation] C
C
C C C [Figure]
− 𝛼 𝛼
In order to find σ S 2 which maximize objective 2, a straight-forward method is to reformulate the maximization problem as a Linear Programming problem (Moravcik et al., 2016).
However, LP solvers (Koller et al., 1994) cannot handle large-scale problems.
Alternatively, inspired by Moravcik et al.
(2016), we create a gadget game and then apply iteration-based NE algorithms such as CFR (Zinkevich et al., 2007;
Tammelin et al., 2015; Lanctot et al., 2009) in the gadget game.
The gadget game is carefully designed such that the NE solution found in it is exactly the solution to the original optimization problem.
As shown in Figure 1, the original subgame is copied into two identical parts S 1 , S 2 in the gadget game.
Player 2’s infosets stretch over both branches, while player 1 can distinguish between the two parts.
The procedure of constructing such gadget game can be summarized into 4 steps: (i).
Create a chance node at the top of the gadget game.
(ii)
For the left part of the gadget game, we construct a
P1 node to let P1 choose an infoset
I i 1 to enter.
The following chance node samples a specific state with probability proportional to π σ − 1 ( h ) for all h ∈
I 1 .
(iii)
For the right part, create a chance node sampling an infoset I i 1 .
The following chance node again samples a specific state with probability proportional to π σ − 1 ( h ) for all h ∈
I 1 .
(iv).
Shift the utility of the gadget game by v σ 1 ( I i 1 ) .
The details are described below.
The chance node at the top goes to the left part with probability 1 − α , and the right part with probability α .
The outcome is visible to P1 but not P2.
Therefore, corresponding nodes in both branches are in the same infosets for P2, and his strategy σ S 2 will be the same for both parts.
Since σ S 1 is the best-response to σ S 2 and the two parts only differ at how to go to each infoset of player 1, player 1 will also keep his strategy the same in both parts. We
subtract u 1 ( z by v σ 1 ( I i 1 ) for all z ⊑ h, h ∈ I i 1 ,
and
add u 2 ( z ) by v σ 1 ( I i 1 ) in order to keep the subgame zero-sum. By doing so,
the objective of a Nash Equilibrium of p 2 will change from maximizing − CBV σ S 2 1 ( I i 1 ) to maximizing v σ 1 ( I i 1 ) − CBV σ S 2 1 ( I i 1 ) .
As for the left part of the gadget game, the P1 node on the second level in Figure 1 enables P to enter an arbitrary infoset I i 1 .
Since this is a zero-sum game, in an NE strategy, he will enter the one with lowest v σ 1 ( I i 1 ) − CBV 1 ( I i 1 , σ ∗ 2 ) which is exactly the minimization in the second term of SE ( σ S 2 ) .
The chance node on the second level of the right part will sample an infoset I i 1 according to reach probability ˆ p
( I i 1 ) .
So that the NE objective of this part is exactly the summation in the first term of SE ( σ S 2 ) .
And here’s the pseudocode of SES where we take poker as the environment for simplicity.
Initialize the game environment
Initialize the private cards distribution p of player 2 as uniform distribution
Initialize the prediction of opponent private cards distribution
Compute a blueprint strategy ⟨ σ 1 , σ 2 ⟩ while Game Not Terminate do
P ← current player if P = P 1 then ▷ Opponent Player
Observe opponent action a
Update the prediction of opponent’s private cards based on a else if P = P 2 then ▷ Resolving Player if Resolve Current Node then
Compute v σ 1 ( I i 1 )
Construct Gadget Game σ S 2 ← CFR ( Gadget Game ) else σ S 2 ← σend if
Sample action a based on σ Sp ( I i 2 ) ← p ( I i 2 ) · σ S 2 ( I i 2 , a )
Normalize p else ▷ Chance Node
Sample public cards C
= { c 1 , c 2 , ..., c k } from current chance node ∀
i = 1 , 2 , ..., k, p c i ←
Normalize p end if end while
E XPERIMENT
Our experiment is done in Leduc Hold’em (Southey et al., 2005) and
Flop Hold’em Poker (FHP) (Brown et al., 2019).
Leduc Hold’em is a smaller-scale poker game and FHP is a larger one.
The rules of these two pokers are provided in Appendix B.
We demonstrate the exploitability and evaluation performance of SES against opponents of various strengths.
The exploitability measures a search algorithm’s safety, while head-to-head evaluation measures the ability of opponent exploita- tion.
We also illustrate how estimation accuracy of opponent’s strategy and the exploitation level α impact the results.
Please refer to Appendix D for implementation details
[Figure] [Figure]
5. O PPONENTS
In our experiments, we test the performance of our algorithm against opponents of various strengths.
For both Leduc Poker and FHP, we create 3 types of opponents with 3 random seeds each.
The first type of opponent is an approximation of NE in the full game, and is regarded as a strong opponent.
It is computed in the same way as the blueprint strategy with a different seed.
For the second and third type of opponents, we enumerate every infoset in the blueprint strategy and shift the action distribution randomly with probability Pr shuffle = 0 .
3 or 0 .
We multiply the probability of each action by a random variable from Uniform (0 , 1) , and then re-normalize the probability distribution.
The procedure is motivated by Brown et al.
(2018), in which such method is applied to create a number of diverse but reasonably strong agents.
Even when Pr shuffle = 0 .
7 , the strategy keeps close to NE with average L1 distance
5. S AFE O PPONENT S EARCH
In Figure 2 & 3, we demonstrate the head-to-head evaluation performances and corresponding exploitability of the refined strategies found by SES against opponents of various strengths, under different exploitation level α and estimation errors of opponent’s strategy.
Different lines in each plot refers to corresponding estimation error ϵ , which is the L1 distance of ˆ p and p .
We evaluate our refined strategy when ϵ = 0 . 0 , 0 . 3 , 0 . 6 , 0 .
Please refer to Appendix D for details of generating opponent estimations.
The blue line is the result of blueprint strategy without conducting any search.
Generally speaking, SES balances between safety and opponent exploitation.
The increase of exploitation level α helps win more chips from opponents, while resulting in the increase of the strategy’s own exploitability.
As can be seen in Figure 2 & 3, the exploitability increases when the exploitation level α grows from 0 to 1 , which is consistent with Theorem 4.1.
One exception is in
FHP when ϵ is small: the exploitability surprisingly keeps decreasing even if SES puts more emphasis on opponent exploitation.
Similar situations have also occurred in previous literature (Brown &
Sandholm, 2017).
The reason is that our opponent is quite close to NE outside the subgame which will make ˆ p close to ˜ p when ϵ is small, which means the τ in Theorem 4.1 is small.
As a result, we will have a low-exploitability resolved strategy when using unsafe search and the exploitability increases as ϵ increases.
When the estimation is completely correct ( ϵ = 0 . 0 , the yellow line), the expected payoff in FHP (Figure 3) increases as the exploitation level α grows higher.
In Leduc poker (Figure 2), since the game is very small, the pre-computed blueprint is very close to NE.
Therefore, when confronted with relatively strong opponents ( Pr shuffle = 0 . 0 , 0 . 3 ) which are also close to NE, actually few things can be done other than sticking with the blueprint.
So the improvement introduced by SES is small.
When facing relatively weak opponent ( Pr shuffle = 0 . 7 ), the improvement margin is slightly larger.
SES relies on an estimation of opponent’s strategy.
In order to test the robustness of our algorithm when the prediction of p ( I i 1 ) is not accurate, we evaluate the performance of our algorithm with different values of estimation error ϵ .
As illustrated in Figure 2 & 3, the exploitability increases and the expected payoff drops when ϵ grows larger.
The result is expected since an accurate estimation always provides benefits.
However, it also demonstrates that SES can still achieve a trade-off between safety and opponent exploitation even when ϵ is considerably high.
For instance, in FHP, ϵ is between 0 and 2, and ϵ = 1 .
2 means that the predicted distribution is almost random.
When ϵ ≤ 0 . 6 , the expected payoff still keeps increasing with respect to α .
In case of a bad estimation, we can always choose smaller α to ensure safety.
In Appendix.
C, E, F, we provides additional experiments against other related algorithms.
In
Appendix.
C, we prove that our algorithm is better than simply mixing a best-response strategy and a NE together.
In Appendix E and Appendix F, we do the ablation study against RNR(Johanson et al., 2007) and its subgame search version which is not mentioned in Johanson et al.
and we call it EXP-STRATEGY.
C ONCLUSION
We propose a novel safe exploitation search (SES) algorithm which unifies both safe search and opponent exploitation.
With the aid of real-time search, SES can make online adaptations to a changing opponent model.
We also prove safety and opponent exploitation guarantees of SES in
Theorem 4.1 and Theorem 4.2.
The experimental results in our designed matrix game confirm the existence of the refined strategy which is both safe and actively exploiting the opponent.
In games of poker, our method outperforms NE baselines while keeping exploitability low.
SES is also much more efficient than previous safe exploitation algorithms without search.
Additionally, SES is more robust to opponent modeling errors.
The exploitation level α is now regarded as a hyperparameter in our algorithm.
However, ideally, α should be learnt automatically from opponents, and should be adaptive to opponent’s strategy change.
We leave this for future work.
A P ROOFS A. P ROOF OF T HEOREM 4.
Theorem 4.1 (safety) Let S be a disjoint set of subgames S .
Let σ ∗ = ⟨ σ ∗ 1 , σ ∗ 2 ⟩ be the
NE where P2’s strategy is constrained to be the same with σ 2 outside S .
Define ∆ = max S ∈ S ,I i 1 ∈ S top | CBV σ
[Equation]
2 1 ( I i 1 ) − v σ 1 ( I i 1 ) | .
Let ˜ p
( I i 1 ) be the reach probability given by σ ∗ 1 .
Let ˆ p
( I i 1 ) be the estimation of reach probability p
( I i 1 ) given by the real opponent strategy.
Define
[Equation]
| .
Whenever 1 − (2 τ + 1) α > 0 , we have a bounded exploitability given by:
[Equation]
Proof:
For simplicity, we will omit the subscript of CBV σ ∗ 2by default.
In order to prove Theorem 1, we will use mathematical induction on the level of the infoset.
The depth L has the same definition as in Brown & Sandholm (2017), i.e.
• For all the infosets which are direct parents of the subgames, we define L ( I ) = 0 .
• For the infosets that are not ancestors of the subgames, we define L ( I ) = 0 .
• For any infosets that are ancestors of the subgames, we define L ( I ) =
max I ′ ∈ succ ( I ) L ( I ′ )
+ 1 .
That is, it has a higher level than any of its successors.
B ASE C ASE OF I NDUCTION
Firstly, we will prove that for any infoset with level 0, the inequality of theorem 1 holds.
For convenience, we consider that theorem 1 in a specific subgame S .
We will prove the infoset at the top of the subgame first.
Since SE ( σ ∗ 2 ) ≥ (1 − α )( − ∆)
+ α (cid:80) i ˆ p
( I i 1 )( − ∆)
= − ∆ , we have
[Equation]
since σ S 2 = arg max ˜ σ 2 SE (˜ σ 2 ) .
Furthermore, we have
[Equation]
7) where the second term (cid:80) i ˜ p
( I i 1 )( CBV σ ∗ 2 ( I i 1 ) − CBV σ S 2 ( I i 1 )) is no larger than 0 because (cid:80) i ˜
p
( I 1 ) CBV σ ∗ 2 ( I i 1 ) is exactly what σ ∗ 2 minimized.
Otherwise, σ ∗ 2 can change the strategy in the subgame so that he will get higher reward against σ ∗ 1 which conflicts the definition of NE.
And we will further decompose I i 1 ∈ S top into two parts, { I i, − 1 } and { I i, + 1 } .
They have the property that CBV σ ∗ 2 ( I i, − 1 ) − CBV σ S
( I i, − 1 ) ≤ 0 and CBV σ ∗ 2 ( I i, + 1 ) − CBV σ S 2 ( I i, + 1 ) > 0 .
And since (cid:80) i ˜ p
[Equation]
I i 1 )
[Equation]
CBV
[Equation]
2 ( I i 1 ) − CBV
[Equation]
S
[Equation]
I i 1 )) ≤ 0 as discussed above, we have
[Equation]
8) which implies that
[Equation]
Then we have
[Equation]
The last inequation holds since min I j 1 (cid:16) CBV σ ∗ 2 ( I j 1 ) − CBV σ S 2 ( I j 1 ) (cid:17) ≤ 0 since σ ∗ 2 is the strategy with lowest exploitability by only changing strategy of σ 2 in the subgames.
Back to Equation
[Equation]
we have
[Equation]
And substitute it into Equation 6,
[Equation]
≥
[Equation]
≥ − ∆
[Equation]
so that
[Equation]
for all I j 1 in the subgame.
And for infoset I out of the subgame with level 0, since the refined strategy σ S 2 and blueprint strategy σ 2 are the same here, the CBV value is exactly the same and the inequality holds.
I NDUCTIVE S TEP
The inductive step mostly follows that of Brown & Sandholm (2017).
Since CBV σ S 2 ( I 1 ) ≤ CBV σ ∗ 2 ( I 1 ) + 2 1 − (2 τ +1)
α ∆ holds for every subgame S , σ ′ 2 will also satisfy this inequation since ∆ and τ are defined as maximum over all subgames.
Now, suppose CBV σ ′ 2 ( I 1 )
≤ CBV
[Equation]
2 ( I 1 ) + 2 1 − (2 τ +1) α ∆ holds for any infoset with level lower or equal to k , we will prove that it also holds for infoset with level k + 1 .
By definition of CBV ( I 1 ) ,
[Equation]
We can swap the two summations above since the game is perfect recall, then
[Equation]
By substituting the definition of CBV ( I ′ 1 ) into the equation above,
[Equation]
And by the induction hypothesis,
[Equation]
Because I 1 is out of the subgame and σ ∗
[Equation]
σ 2 is exactly the same outside the subgame
[Equation]
we will get
[Equation]
Finally, by mathematical induction we get
[Equation]
A. P ROOF OF T HEOREM 4.
Theorem 4.2 (opponent exploitation) Let ϵ =
∥
ˆ p − p ∥ 1 be the L1 distance of the distribution p
( I i 1 ) and ˆ p ( I i 1 ) .
Let η = min S ∈ S max I j 1 ∈ S top (cid:16) CBV 1 ( I j 1 , σ S 2 ) − CBV 1 ( I j 1 , σ ∗ 2 ) (cid:17) ≥ 0 .
We use
BR [ S ,σ p ] p ( σ ) to denote the strategy for player p which maximizes its utility in subgame S ∈ S against σ − p under the constraint that BR [ S ,σ p ] p ( σ ) and σ p differs only inside S .
By maximizing objective 2, for all S ∈ S , the refined strategy σ ′ 2 satisfies
[Equation]
Proof: Still, we only consider a specific subgame S first.
σ S 2 is maximizing
[Equation]
So, we have
[Equation] [Equation]
Therefore,
[Equation]
24) which means
[Equation]
Since η is defined as minimum over all subgames
[Equation]
we have
[Equation]
B P OKER R ULES R ULES OF L EDUC P OKER
Leduc Poker is a two players game.
In Leduc Poker, there are 6 cards in total, three ranks( { J, Q, K } ) with two suits( { a, b } ) each.
And at the beginning, every player should put 2 chip into the pot and then will be dealt with one private card.
Then, two players alternatively bet.
They can call, raise and fold.
If any of them fold, the game ends and all chips in the pot belongs to the other player.
And will
[Table]
when a player call, he has to put chips in the pot to ensure that he contributes equal chips as the other player in the pot.
When a player raise, he has to ensure that he contributes more chips than the other player in the pot.
A betting round ends when a player calls.
Leduc Poker is divided into two betting rounds.
In the first round, a private card is dealt to each player and then two player start to bet.
After the first betting round ends and nobody folds, a public card is dealt on board and the second betting round starts.
When the second round ends, both of the player show their private hands and the stronger hands win.
If a player’s private card has the same rank as the public card, then he wins.
Otherwise, we have J < Q < K and the higher one wins.
And in each betting round, there will be at most two raises in our experiment and each raise should contribute 2 more chip in the first round and 4 more chips in the second round.
R ULES OF F LOP H OLD ’ EM P OKER
The rules of Flop Hold’em Poker is similar to that of Leduc Poker.
In FHP, we use the standard 52card deck.
At the beginning, the first player will contribute 1 chip to the pot and the second player will contribute 2 chips.
And then they will be dealt with 2 private cards each and the first player start to bet.
There are still two betting rounds and the raise sizes are both 2 chips.
At the end of the first betting round, there will be 3 public cards dealt on board.
And the players will show their private card at the end of the second betting round and the larger one wins the game.
In FHP, we have the same rule of card order as a standard Texas hold ’em .
C M ATRIX G AME
In this part, we offer a matrix game as an example to show the necessity of considering safety and expected payoff simultaneously, and to demonstrate the superiority of SES over a simple mixing strategy, which follows a best response to the estimated opponent model with probability α and follows the blueprint with probability 1 − α .
In the matrix game shown in Table 1, let’s consider two specific NEs.
In both NEs, P1 will play L/M with 0 .
5 probability each.
P2 will play U/O with 0 .
5 probability in the first NE and O/D with 0 .probability in the second NE.
Suppose the blueprint strategy is the first NE.
Consider the case when
P1 plays a rather weak strategy that he will only play R. We apply SES to search for P2’s refined strategy.
When the estimation of opponent strategy is accurate such that ˆ p = p , the best response of P2 is always playing F, which is highly exploitable, while SES finds the second NE under proper α .
To give more details, the exploitability and expected payoff of the strategy found by SES and the mixing strategy are shown in Figure 4.
We can see that SES achieves both lower exploitability and better performance than the mixing strategy at almost all α values.
Theoretically, for a mixing strategy mix p ( σ 1 , σ ′ 1 ) which plays σ 1 with probability p , and σ ′ 1 with 1 − p (Johanson et al., 2007), we have the following propositions.
Proposition C.1.
Utility of a mixing strategy: u (mix p ( σ 1 , σ ′ 1 ) , σ 2 ) =
pu ( σ 1 , σ 2 )+(1 − p ) u ( σ ′ 1 , σ 2 ) .
Proposition C.2.
Exploitability of a mixing strategy: exp(mix p ( σ 1 , σ ′ 1 ))
≤ p exp( σ 1 )
+ (1 − p )
exp
( σ ′ 1 ) .
The example in Figure 4 shows that the bound is tight.
Compared with the corresponding theorems 4.1 and 4.2 of SES, we find that the simple mixing strategy cannot provide a safety guarantee and is inferior to SES.
In some circumstances, exp( σ unsafe ) can be quite large.
Therefore, the exploitability of the mixing strategy can also be large even for a rather small p .
In contrast, as shown in Theorem 1, SES’s exploitability does not rely on exp( σ unsafe ) , which makes our bound for SES tighter than that of mixed strategy in most cases.
[Figure]
D I MPLEMENTATION D ETAILS
Leduc Poker.
In Leduc Poker, we solve for a blueprint strategy using a variant of CFR algorithm (Lanctot et al., 2009; Tammelin et al., 2015) with 1M iterations in the full game.
Then we apply search in subgames when the board card is dealt.
Flop Hold’em Poker (FHP).
As for FHP, there are 1,286,792 different infosets for each betting sequence.
We cluster them into 200 infosets by an abstraction algorithm (Johanson et al., 2013) in order to make equilibrium finding feasible.
Then, we compute a blueprint strategy in this abstraction with 10,000,000 iterations.
We apply search immediately once the flop cards are dealt.
Generate estimated opponent strategy.
Given p and ϵ , we use the following procedure to generate the corresponding ˆ p such that | p − ˆ p | = ϵ . 1.
In the beginning, we set ˆ p = p .
We randomly choose a subset S + from index set S of ˆ p and we set S − =
S − S
+ .
We ensure that (cid:80) i ∈ S
+ (1 .
− ˆ p ( i ))
> ϵ/and (cid:80) i ∈ S − ˆ p ( i ) > ϵ/ 2 by the following procedure: to get S + , S − , we will randomly permute the index of ˆ p first to get permutation A .
Then, we will sample k ∼ Uniform (1 , | A | ) .
We will check whether S + =
{ A 1 , ..., A k } and S − =
{ A k +1 , ..., A | A | } satisfy the condition above.
We will continue the process until S + , S − satisfy the condition above.
We divide ϵ/ 2 into 10,000 pieces with value ϵ 20 , 000 assigned to each piece.
For S + , we will do reject sampling to sample 10, pieces to different indexes.
We will pick i ∈ S + randomly each time.
If ˆ p ( i )+ ϵ 20 , 000 < 1 . 0 , we will assign one piece to i and increase ˆ p ( i ) by ϵ 20 , 000 .
The process will continue until we have assigned all 10 , 000 pieces.
We will do the same thing for S − except that only when p ( i ) − ϵ 20 , 000 > 0 we will assign one piece to i .
E C OMPARISON WITH R ESTRICTED N ASH R ESPONSE
We also compare SES with restricted Nash response (RNR) (Johanson et al., 2007), a previous safe exploitation algorithm, in FHP.
RNR calculates an NE for for the whole game restricting that the opponent plays the estimated strategy σ fix with probability p , and any strategy with probability 1 − p .
In each round, we limit the computation time of RNR(normal) to 10 CPU second * , which is the same for SES.
However, as stated in section 2, RNR needs to recompute a strategy for the whole game in each round.
It cannot converge in 10s.
So we also compare with RNR(big), which has a budget
[Table]
[Figure]
of 10M CFR iterations in each round (around 190 CPU second in time).
In contrast, SES only uses 10M CFR iterations to calculate its blueprint once.
As is shown in Figure 5, SES significantly outperforms RNR(normal) in both exploitability and evaluation.
SES also achieves much lower exploitability than RNR(big) and comparable evaluation results with much less computation time.
F C OMPARISON WITH EXP-STRATEGY
It is possible to augment p − RNR with real-time search.
For a subgame S , we can create a similar gadget game to SES in Figure 1.
The difference is that it keeps the opponent strategy fixed to its estimation in the whole exploitation part, while SES only uses the reach probability ˆ p calculated from the estimated opponent strategy and allows the search algorithm to find opponent strategies in the exploitation part as well.
To our best knowledge, this algorithm does not exist in previous literature, and can be regarded as an ablation study for SES.
We call it EXP-STRATEGY.
We provide the full comparison results between SES and EXP-STRATEGY in table 2, 3, and 4, with opponent strategy estimation error equals 0.1, 0.3, and 0.5 accordingly.
Table 2 shows the exploitability and evaluation performance of SES and EXP-STRATEGY under different exploitation level α (or p in RNR).
We add errors in the estimation of opponent strategy, and use the same estimation for both algorithms.
SES performs much better than EXP-STRATEGY: maintains lower exploitability and achieves higher evaluation performances † The experiment shows that EXP-STRATEGY is sensitive to modeling errors, because it relies on the estimated strategy in the whole subgame.
SES, which exploits a distribution of infoset instead of the full opponent strategy, is more robust.
Similar to SES, we derive the theoretical bounds for both exploitability and exploitation for EXPSTRATEGY.
And the theory also demonstrates that EXP-STRATEGY is more sensitive to the accuracy of the estimation.
Please refer to Appendix G for details.
G T HEORETICAL B OUND OF EXP-STRATEGY
Similar to SES, EXP-STRATEGY maximizes the following objective,
[Equation] [Equation]
[Table] [Table]
[Table]
Theorem G.1.
(safety) Let S be a disjoint set of subgames S .
Let σ ∗ = ⟨ σ ∗ 1 , σ ∗ 2 ⟩ be the
NE where P2’s strategy is constrained to be the same with σ 2 outside S .
Define ∆ = max S ∈ S ,I i 1 ∈ S top | CBV σ ∗ 2 1 ( I i 1 ) − v σ
( I i 1 ) | .
We use BR [ S ,σ p ] p ( σ ) to denote the strategy for player p which maximizes its utility in subgame S ∈ S against σ − p under the constraint that BR [ S ,σ p ] p ( σ ) and σ p differs only inside S .
Let ˆ p
( I i 1 ) be the estimation of reach probability p
( I i 1 ) given by the real opponent strategy.
Define Ω = max S max i ( CBV σ ∗ 2 ( I i 1 ) + CBV ˆ σ 1 ( I i 1 )) .
We have a bounded exploitability given by:
[Equation] [Equation]
[Table]
Proof:
[Equation]
where the fourth line to the fifth line is derived from the fact that the fourth line is exactly the objective of σ S 2 subtracted a constant .
That is,
[Equation]
Follows the same induction step,
[Equation]
Theorem G.2.
(opponent exploitation) Let ϵ =
∥
ˆ p − p ∥ 1 be the L1 distance of the distribution p
( I i 1 ) and ˆ p ( I i 1 ) .
Let η = min S ∈ S max I j 1 ∈ S top (cid:16) CBV 1 ( I j 1 , σ S 2 ) − CBV 1 ( I j 1 , σ ∗ 2 ) (cid:17) ≥ 0 .
By maximizing objective 27, for all S ∈ S , the refined strategy σ ′ 2 satisfies
[Equation]
Proof:
Still
[Equation]
we only consider a specific subgame S first
[Equation]
σ S 2 is maximizing
[Equation]
So
[Equation]
we have
[Equation]
34) and
[Equation]
Therefore,
[Equation]
36) which means
[Equation]
i
[Equation]
⇔
[Equation]
i
[Equation]
Since η is defined as minimum over all subgames and Ω is defined as maximum over all subgames
[Equation]
we have
[Equation]