Safe Opponent-Exploitation Subgame Refinement
Abstract
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 continuously 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.
Introduction
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 and 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 and
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 and Sandholm, 2017, Brown et al., 2018] find safe strategies with low exploitability and produce strong baselines against all opponents [Brown and 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 and Bowling, 2004, Johanson et al., 2007, Li and Miikkulainen, 2018].
From another perspective, there have been extensive studies on opponent exploitation to address the problem.
Some typical works [Carmel and Markovitch, 1996, Billings et al., 2003, Gilpin and Sandholm, 2006, Li and 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.
[2007] and Ganzfried and Sandholm [2015a] aim to search for safe and robust counter-strategies.
Ganzfried and 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 continuously 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.
Related 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 and Sandholm, 2017].
Texas hold ’em poker is widely employed as a benchmark for imperfect information games.
A primary part of the long-term 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 and Sandholm, 2015b, Gilpin and 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 and Markovitch, 1996, Billings et al., 2003, Gilpin and Sandholm, 2006, Li and 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.
Ganzfried and Sandholm [2015a] study 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 and Sandholm [2015a].
Ganzfried and 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 can be a possible efficient substitute for the calculation.
Bernasconi-de Luca et al.
[2021] use a UCB-like algorithm to learn how to encourage opponent’s engagement in repeated games setting by guaranteeing that the opponent’s utility lies in the desired range.
Moravcík et al.
[2017] use a similar mixing distribution technique as ours to speed-up resolving procedure for NE by fixing the distribution of infosets on top of the subgame with a prediction of some unknown NE strategy.
This work does not study opponent exploitation.
Besides, it does not provide a safety or an exploitation bound for the algorithm.
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 and 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.
Notations 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.
A blueprint is a pre-computed strategy for the full game.
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]
We further define v σp ( I ) =
(cid:80) a ∈
A π σp ( h, a ) v σp ( I, a ) .
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 BR p ( σ − p ) =
arg max σ p u ⟨ σ p ,σ − p ⟩ p for player p is the strategy that maximize his own expected utility against fixed opponent strategy σ − p .
The exploitability of strategy σ p is exp
[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 σ − p p
( I
[Equation]
= [Equation] ( I ) 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 .
Method
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.1 Safe Exploitation Search
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 maximizes
[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]
I
[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 [Equation] −
[Equation]
) (cid:17) [Moravcik et al., 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 and 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 5.3 demonstrates that SES is much more computationally efficient, and section 5.4 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 S ∈ S ,I i 1 ∈ S top | CBV σ ∗ 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 τ = max S ∈ S ,I i 1 ∈ S top | ˆ p ( I i 1 ) − ˜ p
( I i 1 ) ˜
p ( I i 1 )
| .
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 B. 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
[Figure]
[Equation]
The proof is provided in Appendix B. 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.2 Gadget Game
[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.
We use P1 to denote player 1, and P2 for player 2.
The procedure of constructing such gadget game can be summarized into 4 steps as described below:
Create a chance node at the top of the gadget game.
It 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.
For P1, notice that S1 and S2 only differs in the distribution of the infosets of player 1.
Given the strategies of player 2 in S1 and S2 are the same, the difference between the distribution of infosets of player 1 on the top of the subgame will not change the counterfactual value of player 1.
Therefore, we will have the same counterfactual regret and the same strategies generated by CFR for player 1 in S1 and S2.
We subtract u 1 ( z ) by v σ 1 ( I i 1 ) for all z ⊑ h, h ∈
I i 1 where I i 1 denotes the infoset on the top of the subgame, and add u 2 ( z ) by v σ 1 ( I i 1 ) in order to keep the subgame zero-sum on both S1 and
S2.
By doing so, the objective 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 enables P1 to enter an arbitrary infoset
I i 1 .
The following chance nodes sample a specific state with probability proportional to π σ − 1 ( h ) for all h ∈
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 in the right part will sample an infoset I i 1 according to reach probability ˆ p
( I i 1 ) .
The following chance nodes again sample a specific state with probability proportional to π σ − 1 ( h ) for all h ∈
I 1 .
So the NE objective of this part is exactly the summation in the first term of SE ( σ S 2 ) .
The pseudocode of SES is shown in Appendix A. We also provide a didactic matrix game in Appendix
D 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.
Experiment
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 C.
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 exploitation.
We also illustrate how estimation accuracy of opponent’s strategy and the exploitation level α impact the results.
Please refer to Appendix E for implementation details.
5.1 Opponents
In our experiments, we test the performance of our algorithm against opponents of various strengths.
We create 3 types of opponents with 3 random seeds each.
The first one is an approximation of NE, and is regarded as a strong opponent.
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 of each infoset 0.132 comparing to 1.036 of a random strategy to NE.
So they are regarded as opponents who are not fully rational but with competitive strength.
5.2 Safe Opponent Search
In Figure 2, 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 E 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, 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 and
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.
[Figure] When the estimation is completely correct ( ϵ = 0 . 0 , the yellow line), the expected payoff in FHP (3rd row in Figure 2) increases as the exploitation level α grows higher.
In Leduc poker, 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, 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.
5.3 Comparison with Restricted Nash Response
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 .
[Figure]
In each round [Figure] we limit the computation time of RNR(normal) to 10 CPU second 1 , which is the same for SES.
However, as stated in section 4.1, 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 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 3, 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.
5.4 Comparison 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.
Table 1 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.
Please refer to Appendix F for full comparison results.
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.
Conclusion
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 [Table] existence of the refined strategy which is both safe and actively exploiting the opponent.
In games of poker [Table] 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.
One limitation of SES is that it relies on an estimation of opponent.
Although the assumption is common in opponent exploitation literature, efficient opponent modeling is still an active research area.
Additionally, the exploitation level α is now regarded as a hyperparameter in SES.
We find that α should be tuned for each specific purpose and automatically learning α is not trivial (see Appendix
H for a brief discussion).
We leave this for future work
[Table]
Checklist
The checklist follows the references.
Please read the checklist guidelines carefully for information on how to answer these questions.
For each question, change the default [TODO] to [Yes] , [No] or [N/A] .
You are strongly encouraged to include a justification to your answer , either by referencing the appropriate section of your paper or providing a brief inline description.
For example:
• Did you include the license to the code and datasets?
[Yes] The code and licence of the code would be released upon the paper acceptance.
• Did you include the license to the code and datasets?
[No] The code and the data are proprietary.
• Did you include the license to the code and datasets?
[N/A]
Please do not modify the questions and only use the provided macros for your answers.
Note that the
Checklist section does not count towards the page limit.
In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] See section 6.
(c) Did you discuss any potential negative societal impacts of your work?
[No] To our knowledge, our work does not pose negative societal impacts.
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[Yes] (b) Did you include complete proofs of all theoretical results?
[Yes] All proofs are included in the appendix.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?
[Yes] See section 5.1 and Appendix E. (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[Yes] (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes] 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[N/A] (b) Did you mention the license of the assets?
[N/A]
(c) Did you include any new assets either in the supplemental material or as a URL?
[N/A] (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating?
[N/A] (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[N/A] 5.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A]
A Algorithm
The pseudocode of SES in Poker is shown in Algorithm[-
-]
Algorithm
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 Do Subgame Resolving on 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
B Proofs B.1 Proof of Theorem 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 σ ∗ 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 τ = max S ∈ S ,I i 1 ∈ S top | ˆ p ( I i 1 ) − ˜ p
( I i 1 ) ˜
p ( I i 1 )
| .
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 and 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.
Base Case of Induction
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 [Equation] we have
[Equation]
where the second term (cid:80) i ˜ p
[Equation] I
[Equation]
CBV
[Equation]
− CBV σ S 2 ( I i 1 )) is no larger than 0 because [Equation]
i ˜ p ( I 1 ) CBV [Equation] ∗ 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 [Equation] ( I i, [Equation]
1 ) − CBV
[Equation]
2 ( I i, − 1 ) ≤ 0 and CBV σ
[Equation] 2 ( I i, + [Equation] − CBV σ S 2 ( I i, + 1 ) > 0 .
And since [Equation]
˜ p
[Equation] ( CBV
[Equation]
( I i 1 ) − CBV
[Equation]
S 2 ( I i 1 )) ≤ 0 as discussed above, we have
[Equation]
which implies that
[Equation]
Then we have
[Equation]
The last inequation holds since min I j
[Equation]
) −
[Equation]
≤ 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]
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.
Inductive Step
The inductive step mostly follows that of Brown and 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 σ ∗ 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
[Equation]
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
[Equation]
by mathematical induction we get
[Equation]
B.2 Proof of Theorem
[Equation]
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
[Equation]
(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. [Table]
[Equation]
So, we have
[Equation]
and
[Equation]
Therefore,
[Equation]
which means
[Equation]
i
[Equation]
[Equation]
⇔ u
[Equation]
Since η is defined as minimum over all subgames, we have
[Equation]
C Poker Rules Rules of Leduc Poker
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 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.
[Table]
Rules of Flop Hold’em Poker
The rules of Flop Hold’em Poker is similar to that of Leduc Poker.
In FHP, we use the standard 52-card 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 .
D Matrix Game
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 2, 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 D.1.
Utility of a mixing strategy: u (mix p ( σ 1 , σ ′ 1 ) , σ 2 ) =
pu ( σ 1 , σ 2 )+(1 − p ) u ( σ ′ 1 , σ 2 ) .
Proposition D.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.
E Implementation Details
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.
c h i p s / h
Evaluation
SESMixing 0.
1.0     c h i p s / h
Exploitability
SESMixing
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 .
F Comparison with EXP-STRATEGY
Table 3, 4, and 5 show the comparison between SES and EXP-STRATEGY.
G Theoretical Bound of EXP-STRATEGY
Similar to SES, EXP-STRATEGY maximizes the following objective,
[Equation]
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 σ 1 ( 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. Let ϵ = ∥
ˆ p − p ∥ 1 be the L distance of the distribution p
( I i 1 ) and ˆ p ( I i 1 ) . Define Ω = max S max i ( CBV σ ∗ 2 ( I i 1 ) + CBV ˆ σ 1 ( I i 1 )) .
We have a bounded exploitability given by:
[Equation]
E XPLOITABILITY E VALUATION
[Table]
E XPLOITABILITY
[Table]
Proof: For any subgame S ∈ S , we have
[Equation]
− α ) min
[Equation]
j
[Equation]
E XPLOITABILITY E VALUATION
[Table]
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]
Therefore, σ ′ 2 also satisfies the inequality above since every subgame of it satisfies that.
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 and ∆ = max S ∈ S ,I i 1 ∈ S [Equation] CBV [Equation]
By maximizing objective 27, 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]
and
[Equation]
Therefore
[Equation]
which means
[Equation]
Since η is defined as minimum over all subgames and Ω is defined as maximum over all subgames, we have
[Equation]
H Choosing α
We find that automatically choosing α by explicitly incorporating modeling accuracy into search formulation is non-trivial.
It still requires additional information like the risk you are willing to take. (i) Without further specifications, there is always a trade-off between safety and exploitation regardless of opponent modeling accuracy
Since the prediction is made based on past observation, high accuracy (confidence) cannot guarantee the success in the future (since we do not have the assump tion that the
opponent will not change his behavior in the next round).
Therefore, to incorporate accuracy(confidence) into objective, we need more information like the risk you are willing to take.
Quantifying the relationship between modeling confidence and α theoretically will require more assumptions about the opponent’s behavior than this paper does.
(ii) Empirically, exploitation and safety correspond to a fixed α and prediction accuracy differ in different games (FHP and Leduc) as our experiments imply.
Practically, we can use learning algorithms (e.g. bandit) to automatically select α in each round with respect to one’s specific goal.