A Sharp Analysis of Model-based Reinforcement Learning with Self-Play
Qinghua Liu, Tiancheng Yu, Yu Bai, Chi Jin
Introduction
This paper is concerned with the problem of multi-agent reinforcement learning (multi-agent RL), in which multiple agents learn to make decisions in an unknown environment in order to maximize their (own) cumulative rewards. Multi-agent RL has achieved significant recent success in traditionally hard AI challenges including large-scale strategy games (such as GO) (Silver et al., 2016, 2017), real-time video games involving team play such as Starcraft and Dota2 (OpenAI, 2018; Vinyals et al., 2019), as well as behavior learning in complex social scenarios (Baker et al., 2020). Achieving human-like (or super-human) performance in these games using multi-agent RL typically requires a large number of samples (steps of game playing) due to the necessity of exploration, and how to improve the sample complexity of multi-agent RL has been an important research question.
One prevalent approach towards solving multi-agent RL is model-based methods, that is, to use the existing visitation data to build an estimate of the model (i.e. transition dynamics and rewards), run an offline planning algorithm on the estimated model to obtain the policy, and play the policy in the environment. Such a principle underlies some of the earliest single-agent online RL algorithms such as E3 (Kearns and Singh, 2002) and RMax (Brafman and Tennenholtz, 2002), and is conceptually appealing for multi-agent RL too since the multi-agent structure does not add complexity onto the model estimation part and only requires an appropriate multi-agent planning algorithm (such as value iteration for games (Shapley, 1953)) in a black-box fashion. On the other hand, model-free methods do not directly build estimates of the model, but instead directly estimate the value functions or action-value (Q) functions of the problem at the optimal/equilibrium policies, and play the greedy policies with respect to the estimated value functions. Model-free algorithms have also been well developed for multi-agent RL such as friend-or-foe Q-Learning (Littman, 2001) and Nash Q-Learning (Hu and Wellman, 2003).
How sample-efficient are model-based algorithms in multi-agent RL?
In this paper, we advance the theoretical understandings of multi-agent RL by presenting a sharp analysis of model-based algorithms on Markov games. Our core contribution is the design of a new model-based algorithm Optimistic Nash Value Iteration (Nash-VI) that achieves an almost optimal sample complexity for zero-sum Markov games and improves significantly over existing model-based approaches. We summarize our main contributions as follows. A comparison between our and prior results can be found in Table 1.
Markov games (or stochastic games) are proposed in the early 1950s (Shapley, 1953). They are widely used to model multi-agent RL. Learning the Nash equilibria of Markov games has been studied in Littman (1994, 2001); Hu and Wellman (2003); Hansen et al. (2013); Lee et al. (2020), where the transition matrix and reward are assumed to be known, or in the asymptotic setting where the number of data goes to infinity. These results do not directly apply to the non-asymptotic setting where the transition and reward are unknown and only a limited amount of data are available for estimating them.
Another line of works make certain strong reachability assumptions under which sophisticated exploration strategies are not required. A prevalent approach is to assume access to simulators (generative models) that enable the agent to directly sample transition and reward information for any state-action pair. In this setting, Jia et al. (2019); Sidford et al. (2019); Zhang et al. (2020a) provide non-asymptotic bounds on the number of calls to the simulator for finding an -approximate Nash equilibrium. Wei et al. (2017) study Markov games under an alternative assumption that no matter what strategy one agent sticks to, the other agent can always reach all states by playing a certain policy.
Recent works of Bai and Jin (2020); Xie et al. (2020) provide the first line of non-asymptotic sample complexity guarantees for learning Markov games without reachability assumptions. More recently, Bai et al. (2020) propose two model-free algorithms—Nash Q-Learning and Nash V-Learning with better sample complexity guarantees. In particular, the Nash V-learning algorithm achieves near-optimal dependence on , and . However, the dependence on is worse than our results and the output policy is a nested mixture, which is hard to implement. We compare our results with existing non-asymptotic guarantees in Table 1.
We remark that the classic R-max algorithm (Brafman and Tennenholtz, 2002) also provides provable guarantees for learning Markov games. However, Brafman and Tennenholtz (2002) use a weaker definition of regret (similar to the online setting in Xie et al., 2020), and consequently their result does not imply any sample complexity guarantee for finding Nash equilibrium policies.
Another way to model the multi-player bahavior is to use adversarial MDPs. Most works in this line consider the setting with adversarial reward (Zimin and Neu, 2013; Rosenberg and Mansour, 2019; Jin et al., 2019), where the reward can be manipulated by an adversary arbitrarily and the goal is to compete with the optimal (stationary) policy in hindsight. Learning adversarial MDPs with changing dynamics is computationally hard even under full-information feedback (Yadkori et al., 2013). Notice these results also do not imply provable algorithms in our setting, because the opponent in Markov games can affect both the reward and the transition.
Jin et al. (2020) study a new paradigm of learning MDPs called reward-free learning, which is also known as the task-agnostic (Zhang et al., 2020b) or reward-agnostic setting. In this setting, the agent goes through a two-stage process. In the exploration phase the agent interacts with the environment without the guidance of any reward information, and in the planning phase the reward information is revealed and the agent computes a policy based on the transition information collected in the exploration phase and the reward information revealed in the planning phase.
Jin et al. (2020) also propose an algorithm, which first finds a covering policy by maximizing the probability to reach each state separately and then collects data following this policy. Zhang et al. (2020b) take a different approach by first running the optimistic Q-learning algorithm (Jin et al., 2018) with zero reward to explore the environment, and then utilizing the trajectories collected to compute a policy in an incremental manner. Wang et al. (2020) follow a similar scheme, but study reward-free exploration in linear-parametrized MDPs.
Preliminaries
In this paper, we consider Markov Games (MGs, Shapley, 1953; Littman, 1994), which are also known as stochastic games in the literature. Markov games are the generalization of standard Markov Decision Processes (MDPs) into the multi-player setting, where each player seeks to maximize her own utility. For simplicity, in this section we describe the important special case of two-player zero-sum games, and return to the general formulation in Section 5.
A (Markov) policy of the max-player is a collection of functions , each mapping from a state to a distribution over actions. (Here is the probability simplex over action set .) Similarly, a policy of the min-player is a collection of functions . We use the notation and to represent the probability of taking action or for state at step under Markov policy or respectively.
for all , and at the step we have for all .
For any policy of the max-player , there exists a best response of the min-player, which is a policy satisfying for any . We denote . By symmetry, we can also define and . It is further known (cf. Filar and Vrieze, 2012) that there exist policies , that are optimal against the best responses of the opponents, in the sense that
We call these optimal strategies the Nash equilibrium of the Markov game, which satisfies the following minimax equation The minimax theorem here is different from the one for matrix games, i.e. for any matrix , since here is in general not bilinear in .:
Intuitively, a Nash equilibrium gives a solution in which no player has anything to gain by changing only her own policy. We further abbreviate the values of Nash equilibrium and as and . We refer readers to Appendix A for Bellman optimality equations for (the value functions of) the best responses and the Nash equilibrium.
We measure the suboptimality of any pair of general policies using the gap between their performance and the performance of the optimal strategy (i.e., Nash equilibrium) when playing against the best responses respectively:
A pair of general policies is an -approximate Nash equilibrium, if .
Let , denote the policies deployed by the algorithm in the episode. After a total of episodes, the regret is defined as
One goal of reinforcement learning is to design algorithms for Markov games that can find an -approximate Nash equilibrium using a number of episodes that is small in its dependency on as well as (PAC sample complexity bound). An alternative goal is to design algorithms for Markov games that achieves regret that is sublinear in , and polynomial in (regret bound). We remark that any sublinear regret algorithm can be directly converted to a polynomial-sample PAC algorithm via the standard online-to-batch conversion (see e.g., Jin et al., 2018).
Optimistic Nash Value Iteration
In this section, we present our main algorithm—Optimistic Nash Value Iteration (Nash-VI), and provide its theoretical guarantee.
We describe our Nash-VI Algorithm 1. In each episode, the algorithm can be decomposed into two parts.
At a high-level, this two-phase strategy is standard in the majority of model-based RL algorithms, and also underlies provably efficient model-based algorithms such as UCBVI for single-agent (MDP) setting (Azar et al., 2017) and VI-ULCB for the two-player Markov game setting (Bai and Jin, 2020). However, VI-ULCB has two undesirable drawbacks: the sample complexity is not tight in any of , , and dependency, and its computational complexity is PPAD-complete (a complexity class conjectured to be computationally hard (Daskalakis, 2013)).
As we elaborate in the following, our Nash-VI algorithm differs from VI-ULCB in a few important technical aspects, which allows it to significantly improve the sample complexity over VI-ULCB, and ensures that our algorithm terminates in polynomial time.
Before digging into explanations of techniques, we remark that line 14-15 is only used for computing the output policies. It chooses policy to be the policy in the episode with minimum gap . Our final output policies are simply the marginal policies of . That is, for all , , and .
Our Nash-VI allows two choices of the bonus function :
The prior algorithm VI-ULCB (Bai and Jin, 2020) computes the “greedy” policy with respect to the estimated value functions by directly computing the Nash equilibrium for the -value at each step . However, since the algorithm maintains both the upper confidence bound and lower confidence bound of the -value, this leads to the requirement to compute the Nash equilibrium for a two-player general-sum matrix game, which is in general PPAD-complete (Daskalakis, 2013).
To overcome this computational challenge, we compute a relaxation of the Nash equilibrium—Coarse Correlated Equalibirum (CCE)—instead, a technique first introduced by Xie et al. (2020) to address reinforcement learning problems in Markov Games. Formally, for any pair of matrices , returns a distribution such that
Intuitively, in a CCE the players choose their actions in a potentially correlated way such that no one can benefit from unilateral unconditional deviation. A CCE always exists, since Nash equilibrium is also a CCE and a Nash equilibrium always exists. Furthermore, a CCE can be computed by linear programming in polynomial time. We remark that different from Nash equilibrium where the policies of each player are independent, the policies given by CCE are in general correlated for each player. Therefore, executing such a policy (line 17) requires the cooperation of two players.
2 Theoretical guarantees
Now we are ready to present the theoretical guarantees for Algorithm 1. We let denote the policy computed in line 12 in the episode, and denote the marginal policy of for each player.
For any , letting , then with probability at least , Algorithm 1 with Hoeffding type bonus (3) (with some absolute ) achieves:
, if the number of episodes .
.
Our next theorem states that when using Bernstein bonus instead of Hoeffding bonus as in (3), the sample complexity of Nash-VI algorithm can be further improved by a factor in the leading order term (and the regret improved by a factor).
For any , letting , then with probability at least , Algorithm 1 with Bernstein type bonus (3) (with some absolute ) achieves:
, if the number of episodes .
.
Compared with the information-theoretic sample complexity lower bound and regret lower bound (Bai and Jin, 2020), when is small, Nash-VI with Bernstein bonus achieves the optimal dependency on all of up to logarithmic factors in both the sample complexity and the regret, and the only gap that remains open is a factor. The proof of Theorem 4 can be found in Appendix C.2.
Reward-free Learning
In this section, we modify our model-based algorithm Nash-VI for the reward-free exploration setting. Formally, reward-free learning has two phases: In the exploration phase, the agent collects a dataset of transitions from a Markov game without the guidance of reward information. After the exploration, in the planning phase, for each task , is augmented with stochastic reward information to become , where is sampled from some unknown reward distribution with expectation equal to . Here, denotes the unknown reward function of the task. The goal is to compute nearly-optimal policies for tasks under simultaneously given the augmented datasets .
There are strong practical motivations for considering the reward-free setting. First, in applications such as robotics, we face multiple tasks in sequential systems with shared transition dynamics (i.e. the world) but very different rewards. There, we prefer to learn the underlying transition independent of reward information. Second, from the algorithm design perspective, decoupling exploration and planning (i.e. performing exploration without reward information) can be valuable for designing new algorithms in more challenging settings (e.g., with function approximation).
We now describe our algorithm for reward-free learning in zero-sum Markov games.
2 Theoretical guarantees
Since MDPs are special cases of Markov games, our algorithm VI-Zero directly applies to the single-agent setting, and yields a sample complexity similar to existing results (Zhang et al., 2020b; Wang et al., 2020). However, distinct from existing results which require both the exploration algorithm and the planning algorithm to be specially designed to work together, our algorithm allows an arbitrary planning algorithm as long as it computes the Nash equilibrium of a Markov game with known transition and reward. Therefore, our results completely decouple the exploration and the planning.
Finally, we comment that despite the sample complexity in Theorem 5 scaling as instead of , our next theorem states that unlike the general reward-aware setting, this scaling is unavoidable in the reward-free setting. This reveals an intrinsic gap between the reward-free and reward-aware learning: An dependency is only achievable via sampling schemes that are reward-aware. A similar lower bound is also presented in Zhang et al. (2020a) for the discounted setting with a different hard instance construction.
There exists an absolute constant such that for any , there exists a family of Markov games satisfying that: for any reward-free algorithm using episodes, there exists a Markov game such that if we run on and output policies , then with probability at least , we have .
This lower bound shows that the sample complexity in Theorem 5 is optimal in , , and . The proof of Theorem 6 can be found in Appendix D.3.
Multiplayer General-sum Markov Games
In this section, we extend both our model-based algorithms (Algorithm 1 and Algorithm 2) to the setting of multiplayer general-sum Markov games, and present corresponding theoretical guarantees.
In this section, we consider three versions of equlibrium for general-sum MGs: Nash equilibrium (NE), correlated equilibrium (CE), and coarse correlated equilibrium (CCE), all being standard solution notions in games (Nisan et al., 2007). These three notions coincide on two-player zero-sum games, but are not equivalent to each other on multi-player general-sum games; any one of them could be desired depending on the application at hand. Below we introduce their definitions.
The policy of the player is denoted as \pi_{i}\mathrel{\mathop{:}}=\big{\{}\pi_{h,i}:\mathcal{S}\rightarrow\Delta_{\mathcal{A}_{i}}\big{\}}_{h\in[H]}. We denote the product policy of all the players as , and denote the policy of all the players except the player as . We define as the expected cumulative reward that will be received by the player if starting at state at step and all players follow policy . For any strategy , there also exists a best response of the player, which is a policy satisfying for any . We denote . The Q-functions of the best response can be defined similarly.
Our first objective is to find an approximate Nash equilibrium of Markov games.
A product policy is an -approximate Nash equilibrium if .
The above definition requires the suboptimality gap to be less than for all player . This is consistent with the two-player case (Definition 1) up to a constant of 2, since in the two-player zero-sum setting, we have for any product policy , and therefore .We can similarly define the regret.
Let denote the (product) policy deployed by the algorithm in the episode. After a total of episodes, the regret is defined as
The coarse correlated equilibrium (CCE) is a relaxed version of Nash equilibrium in which we consider general correlated policies instead of product policies. Let denote the joint action space.
A (correlated) policy is a CCE if for all .
Compared with a Nash equilibrium, a CEE is not necessarily a product policy, that is, we may not have . Similarly, we also define -approximate CCE and CCE-regret below.
A policy is an -approximate CCE if .
Let policy denote the (correlated) policy deployed by the algorithm in the episode. After a total of episodes, the regret is defined as
The correlated equilibrium (CE) is another relaxation of the Nash equilibrium. To define CE, we first introduce the concept of strategy modification: A strategy modification for player is a set of functions from to itself. Let denote the set of all possible strategy modifications for player .
One can compose a strategy modification with any Markov policy and obtain a new policy such that when policy chooses to play at state and step , policy will play instead.
A policy is a CE if holds for all .
Similarly, we have an approximate version of CE and CE-regret.
A policy is an -approximate CE if .
Let policy denote the policy deployed by the algorithm in the episode. After a total of episodes, the regret is defined as
For general-sum MGs, we have , so that they form a nested set of notions of equilibria (Nisan et al., 2007). Indeed, one can easily verify that if we restrict the choice of strategy modification to those consisting of only constant functions, i.e., being independent of , Definition 12 will reduce to the definition of CCE policy. In addition, any Nash equilibrium is a CE by definition. Finally, since a Nash equilibrium always exists, so does CE and CCE.
2 Multiplayer optimistic Nash value iteration
Here we present the Multi-Nash-VI algorithm, which is an extension of Algorithm 1 for multi-player general-sum Markov games.
Our Equilibrium subroutine in Line 11 could be taken from either one of the subroutines for one-step games. When using Nash, we compute the Nash equilibrium of a one-step multi-player game (see, e.g., Berg and Sandholm (2016) for an overview of the available algorithms); the worst-case computational complexity of such a subroutine will be PPAD-hard (Daskalakis, 2013). When using CE or CCE, we find CEs or CCEs of the one-step games respectively, which can be solved in polynomial time using linear programming. However, the policies found are not guaranteed to be a product policy. We remark that in Algorithm 1 we used the CCE subroutine for finding Nash in two-player zero-sum games, which seemingly contrasts the principle of using the right subroutine for finding the right equilibrium, but nevertheless works as the Nash equilibrium and CCE are equivalent in zero-sum games.
Now we are ready to present the theoretical guarantees for Algorithm 3. We let denote the policy computed in line 11 of Algorithm 3 in the episode.
There exists an absolute constant , for any , let , then with probability at least , Algorithm 3 with bonus and Equilibrium being one of satisfies (repsectively):
is an -approximate {Nash,CE,CCE}, if the number of episodes .
.
In the situation where the Equilibrium subroutine is taken as Nash, Theorem 15 provides the sample complexity bound of Multi-Nash-VI algorithm to find an -approximate Nash equilibrium and its regret bound. Compared with our earlier result in two-player zero-sum games (Theorem 3), here the sample complexity scales as instead of . This is because the auxiliary bonus and Bernstein concentration technique do not apply here. Furthermore, the sample complexity is proportional to , which increases exponentially as the number of players increases.
We remark that while the Nash guarantee is the strongest among the three guarantees presented in Theorem 15, the runtime of Algorithm 3 in the Nash case is not guaranteed to be polynomial and in the worst case PPAD-hard (due to the hardness of the Nash subroutine). In contrast, the CE and CCE guarantees are weaker, but the corresponding algorithms are guaranteed to finish in polynomial time.
3 Multiplayer reward-free learning
We can also generalize VI-Zero to the multiplayer setting and obtain Algorithm 4, Multi-VI-Zero, which is almost the same as VI-Zero except that its exploration bonus is larger than that of VI-Zero by a factor.
Conclusion
References
Appendix A Bellman Equations for Markov Games
In this section, we present the Bellman equations for different types of values in Markov games.
For any pair of Markov policy , by definition of their values in (1) (2), we have the following Bellman equations:
for all , where for all .
For any Markov policy of the max-player, by definition, we have the following Bellman equations for values of its best response:
for all , where for all .
Similarly, for any Markov policy of the min-player, we also have the following symmetric version of Bellman equations for values of its best response:
for all , where for all .
Finally, by definition of Nash equilibria in Markov games, we have the following Bellman optimality equations:
for all , where for all .
Appendix B Properties of Coarse Correlated Equilibrium
Recall the definition for CCE in our main paper (4), we restate it here after rescaling. For any pair of matrices , the subroutine returns a distribution that satisfies:
We make three remarks on CCE. First, a CCE always exists since a Nash equilibrium for a general-sum game with payoff matrices is also a CCE defined by , and a Nash equilibrium always exists. Second, a CCE can be efficiently computed, since above constraints (5) for CCE can be rewritten as linear constraints on , which can be efficiently resolved by standard linear programming algorithm. Third, a CCE in general-sum games needs not to be a Nash equilibrium. However, a CCE in zero-sum games is guaranteed to be a Nash equalibrium.
Let , and be the marginal distribution over both players’ actions induced by . Then is a Nash equilibrium for payoff matrix .
Let be the value of Nash equilibrium for . Since , by definition, we have:
Intuitively, a CCE procedure can be used in Nash Q-learning for finding an approximate Nash equilibrium, because the values of upper confidence and lower confidence ( and ) will be eventually very close, so that the preconditions of Proposition 17 becomes approximately satisfied.
Appendix C Proof for Section 3 – Optimistic Nash Value Iteration
As a result, the bonus terms can be written as
Let be some large absolute constant. Define event to be: for all and ,
The proof is standard and folklore: apply standard concentration inequalities and then take a union bound. For completeness, we provide the proof of the second one here.
Now we can take a union bound over all and , and obtain that with probability at least , for all and ,
Note that the agent can reach each for at most times, this directly implies that the third inequality also holds with probability at least . ∎
We begin with an auxiliary lemma bounding the lower-order term.
Suppose event holds, then there exists absolute constant such that: if function satisfies for all , then
where is by the second inequality in event and is by AM-GM inequality. This proves the empirical version. Similarly, we can show
Combining the two bounds completes the proof. ∎
Now we can prove the upper and lower bounds are indeed upper and lower bounds of the best reponses.
Suppose event holds. Then for all and , we have
The proof is by backward induction. Suppose the bounds hold for the -values in the step, we now establish the bounds for the -values in the step and -values in the -step. For any state :
Similarly, we can show . Therefore, we have: for all ,
Now consider an arbitrary triple in the step. We have
Invoking Lemma 19 with ,
By the first inequality in event ,
Plugging the two inequalities above back into (10) and recalling the definition of and , we obtain . Similarly, we can show . ∎
Finally we come to the proof of Theorem 3.
Suppose event holds. We first upper bound the regret. By Lemma 20, the regret can be upper bounded by
For brevity’s sake, we define the following notations:
Let be the -field generated by the following random variables:
It’s easy to check and are martingale differences with respect to . With a slight abuse of notation, we use to refer to and to refer to in the following proof.
where and follow from Lemma 19.
Define and . Recursing this argument for and summing over ,
By Azuma-Hoeffding inequality, with probability at least ,
For the PAC guarantee, recall that we choose such that . As a result,
C.2 Proof of Theorem 4
We use the same notation as in Appendix C.1 except the form of bonus. Besides, we define the empirical variance operator
and the true (population) variance operator
As a result, the bonus terms can be written as
Let be some large absolute constant. Define event to be: for all and ,
The proof of Lemma 21 is highly similar to that of Lemma 18. Specifically, the first two can be proved by following basically the same argument in Lemma 18; the third one is standard (e.g., equation (12) in Azar et al. (2017)). We omit the proof here.
Since the proof of Lemma 19 does not depend on the form of the bonus, it can also be applied in this section. As in Appendix C.1, we will prove the upper and lower bounds are indeed upper and lower bounds of the best reponses.
Suppose event holds. Then for all and , we have
The proof is by backward induction and very similar to that of Lemma 20. Suppose the bounds hold for the -values in the step, we now establish the bounds for the -values in the step and -values in the -step.
The proof for the -values is the same as (9).
For the -values, the decomposition (10) still holds and is bounded using Lemma 19 as before. The only difference is that we need to bound more carefully.
First, by the first inequality in event ,
By the relation of -values in the step,
Plugging the above inequalities back into (10) and recalling the definition of and completes the proof. ∎
We need one more lemma to control the error of the empirical variance estimator:
Suppose event holds. Then for all and , we have
By Lemma 22, we have . As a result,
These terms can be bounded separately by using event :
Combining with completes the proof. ∎
Finally we come to the proof of Theorem 4.
Suppose event holds. We define , abd as in the proof of Theorem 3. As before we have
where is some absolute constant. Define and . Plugging (18) back into (17), we have
Recursing this argument for and summing over ,
The remaining steps are the same as that in the proof of Theorem 3 except that we need to bound the sum of variance term.
By the Law of total variation and standard martingale concentration (see Lemma C.5 in Jin et al. (2018) for a formal proof), with probability at least , we have
Appendix D Proof for Section 4 – Reward-Free Learning
In this section, we prove Theorem 5 for the single reward function case, i.e., . The proof for multiple reward functions () simply follows from taking a union bound, that is, replacing the failure probability by .
where and is some large absolute constant.
We use and to denote the empirical optimal value functions of as following.
We begin with stating a useful property of matrix game that will be frequently used in our analysis. Since its proof is quite simple, we omit it here.
Let be some large absolute constant such that . Define event to be: for all and ,
The proof is standard: apply concentration inequalities and then take a union bound. For completeness, we provide the proof of the third one here.
Now we can take a union bound over all and , and obtain that with probability at least , for all and ,
Note that the agent can reach each for at most times, so we conclude the third inequality also holds with probability at least . ∎
The following lemma states that the empirical optimal value functions are close to the true optimal ones, and their difference is controlled by the exploration value functions calculated in Algorithm 2.
Suppose event (defined in Lemma 25) holds. Then for all and , we have,
Let’s prove by backward induction on . The case of holds trivially.
Assume the conclusion hold for ’th step. For ’th step,
where follows from the induction hypothesis and event , and follows from the definition of . By Lemma 24, we immediately obtain . ∎
Now, we are ready to establish the key lemma in our analysis using Lemma 26.
Suppose event (defined in Lemma 25) holds. Then for all and , we have
where and .
We only prove the first set of inequalities. The second one follows exactly the same. Again, the proof is by performing backward induction on . It is trivial to see the conclusion holds for ’th step with . Now, assume the conclusion holds for ’th step. For ’th step,
where the second inequality follows from the definition of event .
We can control the term by combining Lemma 26 and the induction hypothesis to bound , and then applying the third inequality in event :
The term is bounded by directly applying the induction hypothesis
Plugging (29) and (30) into (28), we obtain
where follows from the definition of , and follows from the definition of . Therefore, by (31), choosing suffices for the purpose of induction.
Now, let’s prove the inequality for functions.
where follows from the definition of and , and uses (31) and Lemma 24. ∎
For any , choose the exploration bonus in Algrothm 2 as (20). Then, with probability at least ,
Recall that . By Lemma 27 and Theorem 28, with probability at least ,
D.2 Vanilla Nash Value Iteration
Here, we provide one optional algorithm, Vanilla Nash VI, for computing the Nash equilibrium policy for a known model. Its only difference from the value iteration algorithm for MDPs is that the maximum operator is replaced by the minimax operator in Line 7. We remark that the Nash equilibrium for a two-player zero-sum game can be computed in polynomial time.
By recalling the definition of best responses in Appendix A, one can directly see that the output policy is a Nash equilibrium for .
D.3 Proof of Theorem 6
In this section, we first prove a lower bound for reward-free learning of matrix games, i.e., , and then generalize it to for reward-free learning of Markov games.
In the matrix game, let the max-player pick row and the min-player pick column. We consider the following family of Bernoulli matrix games:
where in matrix game , the reward is sampled from if the max-player picks the ’th row and the min-player picks the ’th column.
Above, we visualize by using {\color[rgb]{1,0,0}+} and {\color[rgb]{0,0,1}-} to represent and , respectively. It is direct to see that the optimal (Nash equilibrium) policy for the max-player is always picking the ’th row. If the max-player picks the ’th row with probability smaller than , it is at least suboptimal.
We simply define as running algorithm and choosing the most played row by its output policy as the guess for . Because any -optimal policy must play with probability at least , we obtain will correctly identify with probability at least . ∎
Lemma 29 directly implies that in order to prove the desired lower bound for reward-free matrix games:
for any reward-free algorithm using at most samples, there exists a matrix game in such that when running on , it will output a policy that is at least suboptimal for the max-player with probability at least ,
it suffices to prove the following claim:
for any reward-free algorithm using at most samples, there exists a matrix game in such that when running on , it will fail to identify the optimal row with probability at least .
By Lemma 29, the existence of such ’ideal’ implies the existence of an ’ideal’ , so to prove such ’ideal’ does not exist (Claim 30), it suffices to show such ’ideal’ does not exist (Claim 31).
WLOG, we assume is deterministic. Since is reward-free, being deterministic means that in the exploration phase algorithm always pulls each arm for some fixed times (because there is no information revealed in this phase), and in the planning phase it outputs a guess for , which is a deterministic function of the reward information revealed.
: the stochastic reward information revealed after algorithm ’s pulling.
: the output of based on the stochastic reward information revealed. More precisely, is function mapping from to .
The arguments in proving Claim 31 basically follows the same line in proving lower bounds for multi-arm bandits (e.g., see Lattimore and Szepesvári, 2018).
D.3.2 Reward-free learning of Markov games
Now let’s generalize the lower bound for reward-free learning of matrix games to for reward-free learning of Markov games. We can follow the same way of generalizing a lower bound for multi-arm bandits to a lower bound for MDPs (see e.g., Dann and Brunskill, 2015; Lattimore and Szepesvári, 2018; Zhang et al., 2020b).
Proof sketch. Given the family of Bernoulli matrix games defined in (34), we simply construct a Markov game to consist of Bernoulli matrix games where ’s are sampled independently and identically from the uniform distribution over . We will define the transition measure to be totally ’uniform at random’ so that in each episode the agent will always reach each with probability (it is not because in each episode the agent can visit matrix games). As a result, to guarantee -optimality, the output policy must be at least -optimal for at least different ’s. Recall Claim 30 shows learning a -optimal policy for a single requires samples. Therefore, we need samples in total for learning different ’s.
Below, we provide a rigorous proof where the constants may be slightly different from those in our sketch. We remark that although the notations we will use are involved, they are only introduced for rigorousness and there is no real technical difficulty or new informative idea in the following proof.
We define the following family of Markov games:
where MG is defined as
States and actions: is a finite-horizon MG with states and of length . There is a fixed initial state in the first step, states in the remaining steps. The two players have and actions, respectively.
Rewards: there is no reward in the first step. For the remaining steps , if the agent takes action at state in the step, it will receive a binary reward sampled from
Transitions: The agent always starts at a fixed initial state in the first step Regardless of the current state, actions and index of steps, the agent will always transit to one of uniformly at random.
It is direct to see that is a collection of matrix games from . Therefore, the optimal policy for the max-player is to always pick action whenever it reaches state at step ().
Now, let’s use to prove the lower bound (in terms of number of episodes) for reward-free learning of Markov games. We start by proving an analogue of Lemma 29.
Denote by the output policy for the max player. Denote by the collection of ’s in such that .
Observe that each time the max player picks a suboptimal action, it will incur an suboptimality in expectation. As a result, if is at most -suboptimal, we must have
which implies , that is, for at most different ’s, . Therefore, we can simply pick as the guess for . Since policy is at most suboptimal with probability at least , our guess will be correct for at least different pairs also with probability no smaller than . ∎
Similar to the funtion of Lemma 29, Lemma 34 directly implies that in order to prove the desired lower bound for reward-free learning of Markov games:
for any reward-free algorithm that interacts with the environment for at most episodes, there exists such that when running on , it will output a policy that is at least suboptimal for the max-player with probability at least ,
it suffices to prove the following claim:
for any reward-free learning algorithm that interacts with the environment for at most episodes, there exists such that when running on , it will fail to correctly identify for at least different pairs with probability at least .
We prove by contradiction. Suppose for any , can identify the optimal actions for at least different pairs with probability larger than . Then we have
For technical reason, we introduce a new MG as below:
States, actions and transitions: same as .
Rewards: there is no reward in the first step. For the remaining steps , if the agent takes action at state in the step such that , it will receive a binary reward sampled from
otherwise it will receive a binary reward sampled from
Briefly speaking, is the same as except the matrix game embedded at state at step , where for the max player all its actions are equivalently bad A graphic illustration based on (35) would be replacing the column [{\color[rgb]{0,0,1}-},\ldots,{\color[rgb]{0,0,1}-},{\color[rgb]{1,0,0}+},{\color[rgb]{0,0,1}-},\ldots,{\color[rgb]{0,0,1}-}]^{\top} with a column of all {\color[rgb]{0,0,1}-}’s in the matrix game embedded at state at step .. Finally, we remark that is independent of .
To proceed, we introduce (and recall) the following notations:
: the number of times picks action at state at step within episode.
: the whole interaction trajectory of states, actions and rewards produced by algorithm within episodes.
: the guess of for based on .
By mimicking the arguments in (36), we have
Plugging in completes the proof. ∎
Appendix E Proof for Section 5 – Multi-player General-sum Markov Games
In this section, we prove Theorem 15 (NE version). As before, we begin with proving the optimistic estimations are indeed upper bounds of the corresponding V-value and Q-value functions.
With probability , for any and :
For each fixed , we prove this by induction from to . For the base case, we know at the -th step,. Now, assume the inequality (40) holds for the -th step, for the -th step, by the definition of -functions,
By induction hypothesis, for any , , and thus . By uniform concentration (e.g., Lemma 12 in Bai and Jin, 2020), . Putting everything together we have . The second inequality can be proved similarly.
Now assume inequality (39) holds for the -th step, by the definition of -functions and Nash equilibrium,
Since by induction hypothesis, for any , . As a result, we also have , which is exactly inequality (40) for the -th step. The second inequality can be proved similarly. ∎
We can define and recursively by and
Then we can prove inductively that for any , , and we have
Thus we only need to bound . Define the shorthand notation
We can check and are martingale difference sequences. As a result,
Recursing this argument for and taking the sum,
E.1.2 CCE Version
The proof is very similar to the NE version. Specifically, the only part that uses the properties of NE there is Lemma 38. We prove a counterpart here.
With probability , for any and :
For each fixed , we prove this by induction from to . For the base case, we know at the -th step, . Now, assume the inequality (40) holds for the -th step, for the -th step, by the definition of -functions,
By induction hypothesis, for any , , and thus . By uniform concentration, . Putting everything together we have . The second inequality can be proved similarly.
Now assume inequality (45) holds for the -th step, by the definition of -functions and CCE,
Since by induction hypothesis, for any , . As a result, we also have , which is exactly inequality (40) for the -th step. The second inequality can be proved similarly. ∎
E.1.3 CE Version
The proof is very similar to the NE version. Specifically, the only part that uses the properties of NE there is Lemma 38. We prove a counterpart here.
With probability , for any and :
For each fixed , we prove this by induction from to . For the base case, we know at the -th step, . Now, assume the inequality (40) holds for the -th step, for the -th step, by definition of -functions,
By induction hypothesis, for any , , and thus . By uniform concentration, . Putting everything together we have . The second inequality can be proved similarly.
Now assume inequality (47) holds for the -th step, by the definition of -functions and CE,
Since by induction hypothesis, for any , . As a result, we also have , which is exactly inequality (40) for the -th step. The second inequality can be proved similarly. ∎
E.2 Proof of Theorem 16
In this section, we prove each theorem for the single reward function case, i.e., . The proof for the case of multiple reward functions () simply follows from taking a union bound, that is, replacing the failure probability by .
We prove the following two lemmas, which together imply the conclusion about Nash equilibriums in Theorem 16 as in the proof of Theorem 5.
With probability , for any and , we have
For each fixed , we prove this by induction from to . For base case, we know at the -th step,. Now, assume the conclusion holds for the ’th step, for the ’th step, by definition of - functions,
By uniform concentration (e.g., Lemma 12 in Bai and Jin, 2020), . Putting everything together we have
which proves the first inequality in (49). The inequality for functions follows directly by noting that the value functions are computed using the same policy . ∎
With probability , for any , we have
For each fixed , we prove this by induction from to . For the base case, we know at the -th step,. Now, assume the conclusion holds for the ’th step, for the ’th step, by definition of the functions,
By uniform concentration, . Putting everything together we have
which proves the first inequality in (50). It remains to show the inequality for -functions also hold in the ’th step.
Since is a Nash-equilibrium policy, we have
Combining the two equations above, and utilizing the bound we just proved for functions, we obtain
E.2.2 CCE version
The proof is almost the same as that for Nash equilibriums. We will reuse Lemma 41 and prove an analogue of Lemma 42. The conclusion for CCEs will follow directly by combining the two lemmas as in the proof of Theorem 5.
With probability , for any and , we have
For each fixed , we prove this by induction from to . For base case, we know at the -th step,. Now, assume the conclusion holds for the ’th step, for the ’th step, by definition of -functions,
By uniform concentration, . Putting everything together we have
which proves the first inequality in (51). It remains to show the inequality for -functions also hold in the ’th step.
Observe that obeys the Bellman optimality equation, so we have
Combining the two equations above, and utilizing the bound we just proved for -functions, we obtain
E.2.3 CE version
The proof is almost the same as that for Nash equilibriums. We will reuse Lemma 41 and prove an analogue of Lemma 42. The conclusion for CEs will follow directly by combining the two lemmas as in the proof of Theorem 5.
With probability , for any , and strategy modification for player , we have
For each fixed , we prove this by induction from to . For the base case, we know at the -th step, . Now, assume the conclusion holds for the ’th step, for the ’th step, following exactly the same argument as Lemma 43, we can show
which proves the first inequality in (52). It remains to show the inequality for -functions also hold in the ’th step.
where the maximum is take over all possible functions from to itself.
Observe that obeys the Bellman optimality equation, so we have
Combining the two equations above, and utilizing the bound we just proved for -functions, we obtain