Independent Policy Gradient for Large-Scale Markov Potential Games: Sharper Rates, Function Approximation, and Game-Agnostic Convergence
Dongsheng Ding, Chen-Yu Wei, Kaiqing Zhang, Mihailo R. Jovanović
Introduction
Multi-agent reinforcement learning (RL) studies how multiple players learn to maximize their long-term returns in a setup where players’ actions influence the environment and other agents’ returns (Busoniu et al., 2008; Zhang et al., 2021a). Recently, multi-agent RL has achieved significant success in various multi-agent learning scenarios, e.g., competitive game-playing (Silver et al., 2016, 2018; Vinyals et al., 2019), autonomous robotics (Shalev-Shwartz et al., 2016; Levine et al., 2016), and economic policy-making (Zheng et al., 2020; Trott et al., 2021). In the framework of stochastic games (Shapley, 1953; Fink, 1964), most results are established for fully-competitive (i.e., two-player zero-sum) games; e.g., see Daskalakis et al. (2020); Wei et al. (2021b); Cen et al. (2021). However, to achieve social welfare for AI (Dafoe et al., 2020, 2021; Stastny et al., 2021), it is imperative to establish theoretical guarantees for multi-agent RL in Markov games with cooperation.
Policy gradient methods (Williams, 1992; Sutton et al., 2000) have received significant attention for both single-agent (Bhandari & Russo, 2019; Agarwal et al., 2021) and multi-agent RL problems (Zhang et al., 2019; Daskalakis et al., 2020; Wei et al., 2021b). Independent policy gradient (Zhang et al., 2021a; Ozdaglar et al., 2021) is probably the most practical protocol in multi-agent RL, where each player behaves myopically by only observing her own rewards and actions (as well as the system states), while individually optimizing its own policy. More importantly, independent learning dynamics do not scale exponentially with the number of players in the game. Recently, Daskalakis et al. (2020); Leonardos et al. (2022); Zhang et al. (2021b) have in fact shown that multi-agent RL players could perform policy gradient updates independently, while enjoying global non-asymptotic convergence. However, these results are only focused on the basic tabular setting in which the value functions are represented by tables; they do not carry over to large-scale multi-agent RL problems in which the state space size is potentially infinite and the number of players is large. This motivates the following question:
Can we design independent policy gradient methods for large-scale Markov games, with non-asymptotic global convergence guarantees?
In this paper, we provide the first affirmative answer to this question for a class of mixed cooperative/competitive Markov games: Markov potential games (MPGs) (Macua et al., 2018; Leonardos et al., 2022; Zhang et al., 2021b). In particular, we make the following contributions:
We propose an independent policy gradient algorithm – Algorithm 1 – for learning an -Nash equilibrium of MPGs with iteration complexity. In contrast to the existing results (Leonardos et al., 2022; Zhang et al., 2021b), such iteration complexity does not explicitly depend on the state space size.
We consider a linear function approximation setting and design an independent sample-based policy gradient algorithm – Algorithm 2 – that learns an -Nash equilibrium with sample complexity. This appears to be the first result for learning MPGs with function approximation.
We establish the convergence of an independent optimistic policy gradient algorithm – Algorithm 3 that has been proved to converge in learning zero-sum Markov games (Wei et al., 2021b) – for learning a subclass of MPGs: Markov cooperative games. We show that the same type of optimistic policy learning algorithm provides an -Nash equilibrium in both zero-sum Markov games and Markov cooperative games while the players are oblivious to the types of games being played. To the best of our knowledge, this appears to be the first game-agnostic convergence result in Markov games.
Markov potential games (MPGs). In stochastic optimal control, the MPG model dates back to Dechert & O’Donnell (2006); González-Sánchez & Hernández-Lerma (2013). More recent studies include Zazo et al. (2016); Mazalov et al. (2017); Macua et al. (2018); Mguni et al. (2018) and all of these studies focus on systems with known dynamics. MPGs have also attracted attention in multi-agent RL. In the infinite-horizon setting, Leonardos et al. (2022); Zhang et al. (2021b) extended the policy gradient method (Agarwal et al., 2021; Kakade, 2001) for multiple players and established the iteration/sample complexity that scales with the size of state space; Fox et al. (2022) generalized the natural policy gradient method (Kakade, 2001; Agarwal et al., 2021) and established the global asymptotic convergence. In the finite-horizon setting, Song et al. (2022) built on the single-agent Nash-VI (Liu et al., 2021) to propose a sample efficient turn-based algorithm and Mao et al. (2022) studied the policy gradient method. Earlier, Wang & Sandholm (2002); Lowe et al. (2017) studied Markov cooperative games and Kleinberg et al. (2009); Palaiopanos et al. (2017); Cohen et al. (2017a) studied one-state MPGs; both of these are special cases of MPGs. We note that the term: Markov potential game has also been used to refer to state-based potential MDPs (Marden, 2012; Mguni et al., 2021), which are different from the MPGs that we study; see counterexamples in Leonardos et al. (2022).
Policy gradient methods for Markov games. Despite recent advances on the theory of policy gradient (Bhandari & Russo, 2019; Agarwal et al., 2021), the theory of policy gradient methods for multi-agent RL is relatively less studied. In the basic two-player zero-sum Markov games, Zhang et al. (2019); Bu et al. (2019); Daskalakis et al. (2020); Zhao et al. (2021) established global convergence guarantees for policy gradient methods for learning an (approximate) Nash equilibrium. More recently, Cen et al. (2021); Wei et al. (2021b) examined variants of policy gradient methods and provided last-iterate convergence guarantees. However, it is much harder for the policy gradient methods to work in general Markov games (Mazumdar et al., 2020; Hambly et al., 2021). The effectiveness of (natural) policy gradient methods for tabular MPGs was demonstrated in Leonardos et al. (2022); Zhang et al. (2021b); Fox et al. (2022); Zhang et al. (2022). Moreover, Xie & Zhong (2020); Wang et al. (2021a); Yu et al. (2021); Peng et al. (2021) reported impressive empirical performance of multi-agent policy gradient methods with function approximation in cooperative Markov games, but the theoretical foundation has not been provided.
Independent learning recently received attention in multi-agent RL (Daskalakis et al., 2020; Zhang et al., 2021a; Ozdaglar et al., 2021; Sayin et al., 2021; Jin et al., 2021a; Song et al., 2022; Kao et al., 2022), because it only requires local information for learning and naturally yields algorithms that scale to a large number of players. The algorithms in Leonardos et al. (2022); Zhang et al. (2021b); Fox et al. (2022); Zhang et al. (2022) can also be generally categorized as independent learning algorithms for MPGs.
Game-agnostic convergence. Being game-agnostic is a desirable property for independent learning in which players are oblivious to the types of games being played. In particular, classical fictitious-play warrants average-iterate convergence for several games (Robinson, 1951; Monderer & Shapley, 1996; Hofbauer & Sandholm, 2002). Although online learning algorithms, e.g., the one based on multiplicative weight updates (MWU) (Cesa-Bianchi & Lugosi, 2006), offer average-iterate convergence in zero-sum matrix games, they often do not provide last-iterate convergence guarantees (Bailey & Piliouras, 2018), which motivates recent studies (Daskalakis & Panageas, 2018; Mokhtari et al., 2020; Wei et al., 2020). Interestingly, while MWU converges in last-iterate for potential games (Palaiopanos et al., 2017; Cohen et al., 2017a), this is not the case for zero-sum matrix games (Cheung & Piliouras, 2020). Recently, Leonardos et al. (2021); Leonardos & Piliouras (2022) established last-iterate convergence of -learning dynamics for both zero-sum and potential/cooperative matrix games. However, it is open question whether an algorithm can have last-iterate convergence for both zero-sum and potential/cooperative Makov games.
Preliminaries
In this section, we introduce Markov potential games (MPGs), define the Nash equilibrium, and describe the problem setting.
We consider an -player, infinite-horizon, discounted Markov potential game (Macua et al., 2018; Leonardos et al., 2022; Zhang et al., 2021b),
where is the set of actions of all but the th player. We use the shorthand for when and are from the same joint policy . It is straightforward to see that , and are bounded between and .
We recall the notion of (Markov perfect stationary) Nash equilibrium (Fink, 1964). A joint policy is called a Nash equilibrium if for each player ,
and called an -Nash equilibrium if for ,
Nash equilibria for MPGs with finite states and actions always exist (Fink, 1964). When the state space is infinite, we assume the existence of a Nash equilibrium; see Takahashi (1962); Maitra & Parthasarathy (1970, 1971); Altman et al. (1997) for cases with countable or compact state spaces.
Given policy and initial state , we define the discounted state visitation distribution,
It is useful to introduce a variant of the performance difference lemma (Agarwal et al., 2021) for multiple players; for other versions, see Zhang et al. (2019); Daskalakis et al. (2020); Zhang et al. (2021b); Leonardos et al. (2022).
For the th player, if we fix the policy and any state distribution , then for any two policies and ,
where
It is common to use the distribution mismatch coefficient to measure the exploration difficulty in policy optimization (Agarwal et al., 2021). We next define a distribution mismatch coefficient for MPGs (Leonardos et al., 2022) in Definition 1, and its minimax variant in Definition 2.
For any distribution and policy , the distribution mismatch coefficient is the maximum distribution mismatch of relative to , , where the division is evaluated in a componentwise manner.
For any distribution , the minimax distribution mismatch coefficient is the minimax value of the distribution mismatch of relative to , , where the division is evaluated in a componentwise manner.
Independent Learning Setting
We examine an independent learning setting (Zhang et al., 2021a; Daskalakis et al., 2020; Ozdaglar et al., 2021) for Markov potential games in which all players repeatedly execute their own policy and update rules individually. At each time , all players propose their own polices : with the player index , while a game oracle can either evaluate each player’s policy or generate a set of sample trajectories for each player. In repeating such protocol for times, each player behaves myopically in optimizing its own policy.
To evaluate the learning performance, we introduce a notion of regret,
which averages the worst player’s local gaps in iterations: for , where is the th player best response given . In , we compare the learnt joint policy with the best policy that the th player can take by fixing . We notice that Nash-Regret is closely related to the notion of dynamic regret (Zinkevich, 2003) in which the regret comparator changes over time. This is a suitable notion because the environment is non-stationary from the perspective of an independent learner (Matignon et al., 2012; Zhang et al., 2021a).
To obtain an -Nash equilibrium with a tolerance , our goal is to show the following average performance,
The existence of such is straightforward,
Since each summand above is non-negative, for any and , which implies that is an -Nash equilibrium.
For an independent learning setting without uncertainty in gradient evaluation, we introduce a policy gradient method for Markov potential/cooperative games in Section 4. In Section 5, we utilize a sample-based approach with function approximation to address the scenario in which true gradient is not available and, in Section 6, we provide the game-agnostic convergence analysis.
Independent Policy Gradient Methods
In this section, we assume that we have access to exact gradient and examine a gradient-based method for learning a Nash equilibrium in Markov potential/cooperative games.
A natural independent learning scheme for MPGs is to let every player independently perform policy gradient ascent (Leonardos et al., 2022; Zhang et al., 2021b). In this approach, the th player updates its policy according the gradient of the value function with respect to the policy parameters,
where the calculation for the gradient in (4.1) can be found in Agarwal et al. (2021); Leonardos et al. (2022); Zhang et al. (2021b).
Update rule (4.1) may suffer from a slow learning rate for some states. Since the gradient with respect to scales with – which may be small if the current policy has small visitation frequency to – the corresponding states may experience slow learning progress. To address this issue, we propose the following update rule (equivalent to (2) in Algorithm 1):
which essentially removes the factor in standard policy gradient (4.1) and alleviates the slow-learning issue. Interestingly, update rule (4) for the single-player MDP has also been studied in Xiao (2022), concurrently. However, since the optimal value is not unique, the analysis of Xiao (2022) does not apply to our multi-player case for which many Nash policies exist and the set that contains them is non-convex (Leonardos et al., 2022). We also note that regularized variants of (4) for the single-player MDP appeared in Lan (2022); Zhan et al. (2021).
Furthermore, in contrast to (4.1), our update rule (4) is invariant to the initial state distribution . This allows us to establish performance guarantees simultaneously for all in a similar way as typically done for natural policy gradient (NPG) and other policy mirror descent algorithms for single-player MDPs (Agarwal et al., 2021; Lan, 2022; Zhan et al., 2021).
Theorem 1 establishes performance guarantees for Algorithm 1; see Appendix B.1 for proof.
For MPG (1) with an initial state distribution , if all players independently perform the policy update in Algorithm 1 then, for two different choices of stepsize , we have
Depending on the stepsize , Theorem 1 provides two rates for the average Nash regret: and . The technicalities behind these choices will be explained later and, to obtain an -Nash equilibrium, our two bounds suggest respective iteration complexities,
Compared with the iteration complexity guarantees in Leonardos et al. (2022); Zhang et al. (2021b), our bounds in Theorem 1 improve the dependence on the distribution mismatch coefficient and the state space size . Since our minimax distribution mismatch coefficient satisfies
our -dependence or -dependence are less restrictive than the explicit -dependence in Leonardos et al. (2022); Zhang et al. (2021b). Importantly, this permits our bounds to work for systems with large number of states, and makes Algorithm 1 suitable for sample-based scenario with function approximation (see Section 5). With polynomial dependence on the number of players instead of exponential, Algorithm 1 overcomes the curse of multiagents (Jin et al., 2021a; Song et al., 2022). In terms of problem parameters , our iteration complexity either improves or becomes slightly worse.
When the state space is infinite, explicit -dependence disappears in our iteration complexities. Implicit -dependence only exists in the distribution mismatch coefficient or . However, it is easy to bound by devising an initial state distribution without introducing constraints on the MDP dynamics. For instance, in MPGs with agent-independent transitions (in which every state is a potential game and transitions do not depend on actions (Leonardos et al., 2022)), if we select to be the stationary state distribution then regardless of the state-space size .
A key step of the analysis is to quantify the policy improvement regarding the potential function in each iteration. Similar to the standard descent lemma in optimization (Arora, 2008), applying the projected policy gradient algorithm to a smooth yields the following ascent property (cf. Eq. (9) in Leonardos et al. (2022) and Lemmas 11 and 12 in Zhang et al. (2021b)),
where is related to the smoothness constant (or the second-order derivative) of the potential function. However, since the search direction in our policy update is not the standard search direction utilized in policy gradient, this ascent analysis does not apply to our algorithm.
To obtain such improvement bound, it is crucial to analyze the joint policy improvement. Let us consider two players and : player changes its policy from to to maximize its own reward based on the current policy profile and player changes its policy from to in its own interest. What is the overall progress after they independently change their policies from to ? One method of capturing the joint policy improvement exploits the smoothness of the potential function, which is useful in the standard policy gradient ascent method (Leonardos et al., 2022; Zhang et al., 2021b). In our analysis, we connect the joint policy improvement with the individual policy improvement via the performance difference lemma. In particular, as shown in Lemma 3, Lemma 2 and Lemma 21 provide an effective means for analyzing the joint policy improvement. The proposed approach could be of independent interests for analyzing other Markov games.
In Lemma 3, we obtain two different joint policy improvement bounds by dealing with the cross terms in two different ways (see the proofs for details). Hence, we establish two different Nash-Regret bounds in Theorem 1: one has better dependence on while the other has better dependence on . Even though, it is an open issue how to achieve the best of the two, we next show that this is indeed possible for a special case: Markov cooperative games.
2 Faster rates for Markov cooperative games
When all players use the same reward function, i.e., for all , MPG (1) reduces to a Markov cooperative game. In this case, and for all and Algorithm 1 works immediately. Thus, we continue to use that is defined through and .
Theorem 2 provides a Nash-Regret bound for Markov cooperative games; see Appendix B.2 for proof.
For MPG (1) with identical rewards and an initial state distribution , if all players independently perform the policy update in Algorithm 1 with stepsize then,
For Markov cooperative games, Theorem 2 achieves the best of the two bounds in Theorem 1 and an -Nash equilibrium is achieved with the following iteration complexity,
This iteration complexity improves the ones provided in Leonardos et al. (2022); Zhang et al. (2021b) in several aspects. In particular, we have introduced the minimax distribution mismatch coefficient , which is upper bounded by . Since we take this , our bound improves the -dependence in Leonardos et al. (2022); Zhang et al. (2021b) from to . We note that if we view the Markov cooperative game as an MPG, then the value function serves as a potential function which is bounded between and . Thus, our -dependence matches the one in Zhang et al. (2021b) and improves the one in Leonardos et al. (2022) by .
Independent Policy Gradient with Function Approximation
We next remove the exact gradient requirement and apply Algorithm 1 to the linear function approximation setting. In what follows, we assume that the averaged action value function is linear in a given feature map.
Moreover, for all , and for all .
Without loss of generality, we can assume ; see Lemma 8 in Wei et al. (2021a). Assumption 1 is a multi-agent generalization of the standard linear assumption (Abbasi-Yadkori et al., 2019) for single-player MDPs. It is different from the multi-agent linear MDP assumption (Xie et al., 2020; Dubey & Pentland, 2021) in which both transition and reward functions are linear in given feature maps. In contrast, Assumption 1 qualifies each player to estimate its averaged action value function without observing other players’ actions. A special case of Assumption 1 is the tabular case in which the sizes of state/action spaces are finite, and where we can select to be an indicator function. Since the feature map is locally-defined coordination between players is avoided (Zhao et al., 2021).
Since RL with function approximation is statistically hard in general, e.g., see Weisz et al. (2021); Wang et al. (2021b) for hardness results, assuming regularity of underlying MDPs is necessary for the application of function approximation to multi-agent RL in which either the value function (Xie et al., 2020; Dubey & Pentland, 2021; Jin et al., 2021b; Huang et al., 2022) or the policy (Zhao et al., 2021) is approximated. Because of restrictive function approximation power, the main challenge is the entanglement of policy improvement (or optimization) and policy evaluation (or approximation) errors. In Theorem 3 and Theorem 4, we show that optimization and approximation errors are decoupled under Assumption 1 so that we can control them, separately. Our analysis can be generalized to some neural networks, e.g., overparametrized neural networks (Liu et al., 2019), a rich function class that allows splitting optimization and approximation errors, which we leave for future work.
After each player collects samples, in Phase 2, they use these samples to estimate , which is required for policy updates. By Assumption 1,
where represents . Our goal is to obtain a solution using samples, and estimate via
where and by Assumption 1. We make the following assumption for the expected regression loss of .
Fix a state distribution . For any sequence of iterates for that are generated by Algorithm 2, there exists an such that
for all and , where the expectation is on randomness in generating .
The bound for can be established using standard linear regression analysis (Audibert & Catoni, 2009) and it is given by \epsilon_{\text{stat}}=O\big{(}\frac{dW^{2}}{K(1-\gamma)^{2}}\big{)}. This bound can be achieved by applying the stochastic projected gradient descent method (Hsu et al., 2012; Cohen et al., 2017b) to the regression problem.
After obtaining , we update the polices in (8) which is different from the update in Algorithm 1 in two aspects: (i) the gradient direction is the estimated version of ; and (ii) the Euclidean projection set becomes that introduces -greedy policies for exploration (Leonardos et al., 2022; Zhang et al., 2021b), where .
Theorem 3 establishes performance guarantees for Algorithm 2; see Appendix C.2 for proof.
Let Assumption 1 hold for MPG (1) with an initial state distribution . If all players independently run Algorithm 2 with \xi=\min\Big{(}\left(\frac{\kappa_{\rho}^{2}NA\epsilon_{\text{stat}}}{(1-\gamma)^{2}W^{2}}\right)^{\frac{1}{3}},\frac{1}{2}\Big{)} and Assumption 2 holds, then
Theorem 3 shows the additive effect of the function approximation error on the Nash regret of Algorithm 2. When , Theorem 3 matches the rates in Theorem 1 in the exact gradient case. As in Algorithm 1, even though update rule (8) iterates over all , we do not need to assume a finite state space . In fact, (8) only “defines” a function instead of “calculating” it. This is commonly used in policy optimization with function approximation, e.g., Cai et al. (2020); Luo et al. (2021). To execute this algorithm, only needs to be evaluated if necessary, e.g., when the state is visited in Phase 1 of Algorithm 2.
When we apply stochastic projected gradient updates to (7), Algorithm 2 becomes a sample-based algorithm and existing stochastic projected gradient results directly apply. Depending on the stepsize choice, an -Nash equilibrium is achieved with sample complexities (see Corollary 1 in Appendix C.4),
Compared with the sample complexity guarantees for the tabular MPG case (Leonardos et al., 2022; Zhang et al., 2021b), our sample complexity guarantees hold for MPGs with potentially infinitely large state spaces. When we specialize Assumption 1 to the tabular case, our second sample complexity improves the sample complexity in Leonardos et al. (2022); Zhang et al. (2021b) from to .
As before, we get improved performance guarantees when we apply Algorithm 2 to Markov cooperative games.
Let Assumption 1 hold for MPG (1) with identical rewards and an initial state distribution . If all players independently perform the policy update in Algorithm 2 with stepsize and exploration rate \xi=\min\Big{(}\left(\frac{\kappa_{\rho}^{2}NA\epsilon_{\text{stat}}}{(1-\gamma)^{2}W^{2}}\right)^{\frac{1}{3}},\frac{1}{2}\Big{)}, with Assumption 2,
where
We prove Theorem 4 in Appendix C.3 and show sample complexity in Corollary 2 of Appendix C.4.
Game-Agnostic Convergence
In Section 4 and Section 5, we have shown that our independent policy gradient method converges (in best-iterate sense) to a Nash equilibrium of MPGs. For the same algorithm in two-player case, however, (Bailey & Piliouras, 2019) showed that players’ policies can diverge for zero-sum matrix games (a single-state case of zero-sum Markov games). A natural question arises:
Does there exist a simple gradient-based algorithm that provably converges to a Nash equilibrium in both potential/cooperative and zero-sum games?
Unfortunately, classical MWU and optimistic MWU updates do not converge to a Nash equilibrium in zero-sum and coordination games simultaneously (Cheung & Piliouras, 2020). Recently, this question was partially answered by Leonardos et al. (2021); Leonardos & Piliouras (2022) in which the authors established last-iterate convergence of -learning dynamics to a quantal response equilibrium for both zero-sum and potential/cooperative matrix games. In this work, we provide an affirmative answer to this question for general Markov games that cover matrix games. Specifically, we next show that optimistic gradient descent/ascent with a smoothed critic (see Algorithm 3 in Appendix A) – an algorithm that converges to a Nash equilibrium in two-player zero-sum Markov games (Wei et al., 2021b) – also converges to a Nash equilibrium in Markov cooperative games.
In Theorem 5, we establish asymptotic last-iterate convergence of Algorithm 3 in Markov cooperative games; see Appendix D.1 for proof.
For MPG (1) with two players and identical rewards, if both players run Algorithm 3 with and a non-increasing that satisfies and for any , then the policy pair converges to a Nash equilibrium when .
Last-iterate convergence in Theorem 5 is measured by the local gaps and , i.e., a policy pair constitutes an approximate Nash policy for large . The condition on algorithm parameters and in Theorem 5 is mild in sense that it is straightforward to take a pair of such parameters that ensures last-iterate convergence in zero-sum Markov games (Wei et al., 2021b). Hence, Algorithm 3 enjoys last-iterate convergence in both two-player Markov cooperative and zero-sum competitive games. Compared with the result (Fox et al., 2022), our proof of Theorem 5 utilizes gap convergence instead of point-wise policy convergence that is restricted to isolated fixed points of the algorithm dynamics. Moreover, our algorithm works for both cooperative and competitive Markov games.
In the following Theorem 6, we further strengthen our result of Theorem 5 and show the sublinear Nash-Regret bounds for Algorithm 3 in both two-player Markov cooperative and zero-sum competitive games; see Appendix D.2 for proof.
(i) For MPG (1) with two players and identical rewards (), if both players independently run Algorithm 3 with and , then
(ii) For a two-player zero-sum Markov game (), if both players independently run Algorithm 3 with the same choice of and , then
For two-player Markov cooperative/competitive games, Theorem 6 establishes the same rate for the Nash regret and the average duality gap, respectively. Alternatively, independent players in Algorithm 3 can find an -Nash equilibrium after iterations, no matter which types of games are being played. To the best of our knowledge, Theorem 6 appears to be the first game-agnostic convergence for Markov cooperative/competitive games with finite-time performance guarantees. We leave the extension to more general Markov games for future work.
Experimental Results
To demonstrate the merits and the effectiveness of our approach, we examine an MDP in which every state defines a congestion game. This example is borrowed from Bistritz & Bambos (2020) and it includes MPG as a special case.
Figure 1 shows that our independent policy gradient with a large stepsize (green curve) quickly converges to a Nash equilibrium. We note that stepsize does not provide convergence of the projected stochastic gradient ascent (Leonardos et al., 2022). In contrast, our approach allows large stepsizes for a broad range of initial distributions; see Appendix G for additional details.
Concluding Remarks
We have proposed new independent policy gradient algorithms for learning a Nash equilibrium of Markov potential games when the size of state space and/or the number of players are large. In the exact gradient case, we show that our algorithm finds an -Nash equilibrium with iteration complexity. Such iteration complexity does not explicitly depend on the state space size. In the sample-based case, our algorithm works in the function approximation setting, and we prove sample complexity in a potentially infinitely large state space. This appears to be the first result for learning MPGs with function approximation. Moreover, we identify a class of independent policy gradient algorithms that enjoys last-iterate convergence and sublinear Nash regret for both zero-sum Markov games and Markov cooperative games (a special case of MPGs). This finding sheds light on an open question in the literature on the existence of such an algorithm.
Future directions include extending techniques that offer faster rates for the single-agent policy gradient methods (Lan, 2022; Zhan et al., 2021; Xiao, 2022) to independent multi-agent learning and applying independent policy gradient for other large-scale Markov games.
Acknowledgements
The work of D. Ding and M. R. Jovanović is supported in part by the National Science Foundation under awards ECCS-1708906 and 1809833. The work of C.-Y. Wei is supported by NSF Award IIS-1943607. The work of K. Zhang is supported in part by the Simons-Berkeley Research Fellowship. Part of this work was done while K. Zhang was visiting Simons Institute for the Theory of Computing.
References
Appendix A Algorithms in Section 5 and Section 6
Appendix B Proofs for Section 4
In this section, we provide proofs of Theorem 1 and Theorem 2 in Appendix B.1 and Appendix B.2, respectively.
We first seek to decompose the difference of a potential function at two different policies for any state distribution .
We prove (10) by induction on the number of players . In the basic step: , the right-hand side of (10) becomes
which equals to the left-hand side: .
Assume the equality (10) holds for players. We next consider the induction step for players . By subtracting and adding ,
In (11), we use the shorthand and for and , respectively. We note that or can be viewed as a function for players if we fix the th policy. By the induction assumption, for the first term ,
where we use to represent .
Adding to the last equivalent expression of above yields
where the first equality has a slight abuse of the notation: represents in the first double sum and represents in the second double sum. Therefore, (10) holds for players. The proof is completed by induction. ∎
We apply Lemma 2 to the potential function at two consecutive policies and in Algorithm 1, where is an initial state distribution. We use the shorthand for , the value of potential function at policy .
For MPG (1) with any state distribution , the potential function at two consecutive policies and in Algorithm 1 satisfies
where is the stepsize, is the number of players, is the size of one player’s action space, and is the distribution mismatch coefficient relative to (see in Definition 1).
We let and for brevity. By Lemma 2 with , it is equivalent to analyze
Bounding . By the property of the potential function ,
where the second equality is due to Lemma 1 using and . The optimality of in line 4 of Algorithm 1 leads to
Bounding . For simplicity, we denote as the joint policy of players where players and use and players use . For each summand in ,
where is due to the property of the potential function, is due to Lemma 1; for , we use Lemma 4, Lemma 20, and the fact that and ; The last inequality follows a direct result from the optimality of given by (14) and and :
We now complete the proof of (i) by combining (12), (15), and (16).
Alternatively, by Lemma 21, we can bound each summand of by
Combining the inequality above with (12) and (15) finishes the proof of (ii). ∎
Suppose for . Let be the policy for all players but and be the policy for player . For any two policies for player : and , we have
We note that and are averaged action value functions for player using policy , but they have different underlying averaged MDPs because of different policies executed by player . Hence, we can directly apply Lemma 19. Specifically, let be the averaged reward and transition functions for player induced by , and be those induced by . Then,
Application of two inequalities above to Lemma 19 competes the proof. ∎
By the optimality of in line 4 of Algorithm 1,
Hence, if , then for any ,
where in we apply the Cauchy-Schwarz inequality and that for any two distributions and ; is because of and . Therefore, for any initial distribution ,
where is due to Lemma 1 and we slightly abuse the notation to represent , in we slightly abuse the notation to represent , in we choose an arbitrary and use the following inequality:
We apply the Cauchy–Schwarz inequality in , and finally we replace ( in ) in the last square root term in by the sum over all players.
If we proceed (17) with , then,
where in we apply the first bound (i) in Lemma 3 (with ) and use Definition 2: , and in we use for any , and further simplify the bound in . We complete the proof for the first bound by taking stepsize (by the upper bound of given in Lemma 18, the condition is satisfied).
If we proceed (17) with the second bound (ii) in Lemma 3 with the choice of , then,
We next discuss two special choices of for proving our bound. First, if , then . By letting , the last square root term can be bounded by . Second, if , the uniform distribution over , then , which allows a valid choice . Hence, we can bound the last square root term by . Since is arbitrary, combining these two special choices completes the proof. ∎
B.2 Proof of Theorem 2
We first establish policy improvement regarding the -function at two consecutive policies and in Algorithm 1.
For MPG (1) with identical rewards and an initial state distribution , if all players independently perform the policy update in Algorithm 1 with stepsize , then for any and any ,
where is the stepsize and is the number of players.
Fixing the time and the state , we apply Lemma 2 to
where (recall that is a joint policy of all players). By Lemma 2, for any two policies and ,
where is a joint policy of players in which players and use , and players use . Particularly, we choose and . Thus, we can reduce (18) into
where is due to the optimality condition (14) and , is due to , and follows the choice of . ∎
By Lemma 1 and Lemma 5, we have for any ,
By the same argument as the proof of Theorem 1,
where in we slightly abuse the notation to represent as in (17), in we take and use the definition of from Definition 2, and we replace ( in ) in the last square root term in by the sum over all players, and we apply (19) in .
Finally, we complete the proof by taking stepsize and using . ∎
Appendix C Proofs for Section 5
In this section, we provide proofs of Theorem 3 and Theorem 4 in Appendix C.2 and Appendix C.3, respectively.
C.2 Proof of Theorem 3
We apply Lemma 2 to the potential function at two consecutive policies and in Algorithm 2, where is the initial state distribution. We use the shorthand for , the value of potential function at policy . The proof extends Lemma 3 by accounting for the statistical error in Assumption 2.
Let Assumption 1 hold. In Algorithm 2, the potential function at two consecutive policies and satisfies
where is the stepsize, is the number of players, is the size of one player’s action space, is the 2-norm bound of , and is the distribution mismatch coefficient relative to (see in Definition 1).
We let and for brevity. We first express , where and are given as those in (12).
Bounding . By the property of the potential function and Lemma 1,
The optimality of in line 14 of Algorithm 2 leads to
where follows the inequality for , and we choose in .
Bounding . For simplicity, we denote as the joint policy of players where players and use and players use . As done in the proof of Lemma 3, we can bound each summand in except for the last step from to ,
where follows a direct result from the optimality of given by (20),
and that . Therefore,
We now complete the proof of (i) by combining (21) and (22) and we also employ that
where follows the definition of and is the definition of :
Alternatively, as done in Lemma 3, we can apply Lemma 21 to each summand of and show that
Combining the inequality above with (21) finishes the proof of (ii). ∎
By the optimality of in line 14 of Algorithm 2,
where the last inequality is because of and . Hence, if , then for any ,
where we apply (24) and the Cauchy-Schwarz inequality in , and is because and . As done in the proof of Theorem 1, the different steps begin from in (17),
where we slightly abuse the notation in to represent and represents as in (17), is due to the definition of the distribution mismatch coefficient (see it in Definition 1):
follows the Cauchy–Schwarz inequality, the inequality for any , the Jensen’s inequality, and the definition of ,
If we proceed (25) with the first bound (i) in Lemma 6, then,
where we apply the first bound (i) in Lemma 6 and the telescoping sum for , and we use the boundedness of the potential function: for any and , and further simplify the bound in by Assumption Assumption 2. We complete the proof of (i) by taking stepsize and exploration rate .
If we proceed (25) with the first bound (ii) in Lemma 6 with the choice of , then,
which completes the proof if we choose and exploration rate . ∎
C.3 Proof of Theorem 4
We first establish policy improvement regarding the -function at two consecutive policies and in Algorithm 2.
For MPG (1) with identical rewards and an initial state distribution , if all players independently perform the policy update in Algorithm 2 with stepsize , then for any and any ,
where is the stepsize and is the number of players,
where is due to the optimality condition (20), the inequality for , and , is due to and , and follows the choice of . ∎
where follows the definition of and is the definition of .
By the same argument as the proof of Theorem 3,
By taking expectation and the Jensen’s inequality,
We complete the proof by taking stepsize , exploration rate , and using . ∎
C.4 Sample complexity
We present our sample complexity guarantees for Algorithm 2 in which the regression problem (7) in each iteration is approximately solved by the stochastic projected gradient descent (38). We measure the sample complexity by the total number of trajectory samples , where is the number of iterations and is the batch size of trajectories.
Assume the setting in Theorem 3 except for Assumption 2. Suppose we compute via a stochastic projected gradient descent (38) with stepsize and . Then, if we choose stepsize and exploration rate , then,
Furthermore, if we choose stepsize and exploration rate , then,
Moreover, their sample complexity guarantees are or , respectively, for obtaining an -Nash equilibrium.
By the unbiased estimate in Appendix C.1, the stochastic gradient in (38) is also unbiased. We note the variance of the stochastic gradient is bounded by . By Lemma 23, if we choose and , then
where . by Assumption 1. Therefore, substitution of into Theorem 3 yields desired results.
Finally, we let the upper bound on be and calculate the sample complexity or , respectively. ∎
Assume the setting in Theorem 4 except for Assumption Assumption 2. Suppose we compute via a stochastic projected gradient descent (38) with stepsize and . Then, if we choose stepsize and exploration rate , then,
Moreover, the sample complexity guarantee is for obtaining an -Nash equilibrium.
The proof follows the proof steps of Corollary 1 above. ∎
Appendix D Proofs for Section 6
In this section, we prove Theorem 5 and Theorem 6 in Appendix D.1 and Appendix D.2, respectively.
It is convenient to introduce an auxiliary sequence associated with the learning rate ,
It is straightforward to verify that for .
In Algorithm 3, for all .
We prove it by induction. When and , it holds trivially by noting that and . Assume that it holds for . By the update rule for in Algorithm 3,
where follows the induction hypothesis and is due to the definition of . ∎
In Algorithm 3, for every state and time ,
where and .
We decompose the difference into three terms:
We next deal with , , and , separately.
Bounding . The optimality of implies that for any ,
which implies that, by taking ,
The optimality of implies that for any ,
which implies that, by taking ,
Combining the two inequalities above yields
Bounding . By the AM-GM and Cauchy-Schwarz inequalities,
where follows and is by .
Finally, we complete the proof by summing up the bounds above for , , and . ∎
In Algorithm 3, for all and , the following two inequalities hold:
We first note that (ii) is a consequence of Lemma 9 and (i),
where is due to Lemma 9, and the update of in Algorithm 3,
Therefore, it suffices to prove (i). We prove it by induction. Define and . For notational simplicity, define , . Thus, (ii) holds for and (i) holds for . We note that for ,
where follows the update of in Algorithm 3, we apply Lemma 8 and in , follows the induction hypothesis (ii), is due to that , and we apply Lemma 14 for . ∎
For every , the following quantities in Algorithm 3 all converge to some fixed values when :
(converges to zero);
.
Establishing (i). By (i) in Lemma 10, is a bounded increasing sequence. By the monotone convergence theorem, it is convergent. Therefore, (i) holds.
Establishing (ii). By summing up the inequality (ii) in Lemma 10 over and using the fact that ,
which implies that must converge to zero when , which further implies (ii).
converges to a fixed value (increasing and upper bounded). In (ii), we have shown that converges to zero. Therefore, must also converge. Therefore, (iii) holds. ∎
In Algorithm 3, for every , exists, and
By Lemma 11, and both are convergent. Let and . We next show by contradiction. Assume that there exists such that . Since converges to , there exists some such that for all ,
By our choice of , for any . Thus, there exists such that for all and all ,
where for is used in . By the update of in Algorithm 3, for all ,
where we apply the triangle inequality for , is due to (31) and , and follows (32). Since , it is impossible that converges to , and it must be that . Therefore, converges to zero as .
Equivalently, can be expressed as
By letting , since , thus,
also converges to zero. Hence, converges to the unique fixed point of the Bellman equation. By the uniqueness, converges to zero. Therefore, . ∎
Rearranging the inequality yields, for any ,
By (ii) of Lemma 11, the right-hand side above converges to zero, which completes the proof. ∎
Let be a non-increasing sequence that satisfies for all . Then for any ,
If suffices to show that . We have the following two cases.
Case 1: . By the definition of and the monotonicity of ,
Case 2: . By the definition of and the monotonicity of ,
By Lemma 13, when . For , we notice that
which converges to zero by Lemma 12. Therefore, when . Therefore, converges to a Nash equilibrium when . ∎
D.2 Proof of Theorem 6
We first introduce a corollary of Lemma 10.
In Algorithm 3, for every state , and any ,
where and .
Thus, by the inequality ,
which yields our desired result if we sum it over , use and , and ignore a negative term. ∎
In Algorithm 3, the gap between the critic and the true satisfies
For notational simplicity, define .
where in we apply from the Cauchy-Schwarz inequality, in we use Lemma 17 and obtain , in we introduce notation,
and apply Lemma of Wei et al. (2021b), is due to that is a non-increasing sequence.
Application of Lemma 33 of Wei et al. (2021b) to the recursion relation above yields
where for and , and .
The right-hand side of (33) can be further upper bounded by
where is due to that
Substitution of the upper bound above into (33) yields,
where is due to that is non-increasing, and is due to that .
Finally, using the definition of and applying to lead to the desired result. ∎
The proof consists of two parts: Markov cooperative games and Markov competitive games, separately.
Markov cooperative games. Fix , the optimality of in Algorithm 3 yields
Thus, for any ,
where we use (34) and in , and is due to the Cauchy-Schwarz inequality and the choice of . Hence,
where we apply the Cauchy-Schwarz inequality for , follows the state distribution , is due to Corollary 3, is because of Lemma 15, and again is due to Corollary 3. By taking and , the last upper bound above is of order,
Markov competitive game. We start from an intermediate step in the proof of Theorem 1 of (Wei et al., 2021b). Specifically, they have shown that if both players use Algorithm 3 in a two-player zero-sum Markov game, then,
where and is an upper bound for with if and . We next calculate the upper bounds for and .
Bounding . Recall that . By the definition of ,
Bounding . Using , for any , we have
Define , where and (if , we simply ignore the second term in (35)). By Lemma 16 with , for all ,
Hence, we can continue to bound the right-hand side of (35) by
which proves that .
which completes the proof by taking . ∎
where . Then for all ,
is non-decreasing.
To show the two items above, we apply Lemma A.1 of (Shalev-Shwartz & Ben-David, 2014) which states that for any . By the definition of , for all , and thus
By the first item and the definition of , . Then by the second item, for all we have
For any two policies and ,
where and achieve the maximum in , and is due to the Bellman equation,
Fix , we next subtract and add in Qiff and apply to reach,
By substituting the upper bound on Qiff above into (36),
Appendix E Auxiliary Lemmas
In this section, we provide some auxiliary lemmas that are helpful in our analysis.
For any -player Markov potential game with instantaneous reward bounded in $$, it holds that
for any and .
where the last inequality is due to for any and . By symmetry, . ∎
E.2 Auxiliary lemmas for single-player MDPs
We provide some auxiliary lemmas in the context of single-player MDPs.
Suppose that two MDPs have the same state/action spaces, but different reward and transition functions: and . Then, for a given policy , two action value functions associated with two MDPs satisfy
Subtracting equalities above on both sides yields
which leads to the desired inequality after rearrangement. ∎
Let and be two policies for a MDP, and be an initial state distribution. Then,
By the definition, for a fixed state ,
By taking reward function , we can view as a value function under the policy and the initial distribution . With a slight abuse of notation, we denote such a value function by . Similarly, we can define and , using the same reward function.
By the performance difference lemma (a single-player version of Lemma 1),
We also note that is the action value function associated with the reward function . Thus,
Therefore, we can arrange (37) as follows,
E.3 Auxiliary lemmas for multi-player MDPs
We first extend Lemma 1 in the 1st-order form to the 2nd-order performance difference, which is useful to measure the joint policy improvement from multiple players.
Consider a two-player common-payoff Markov game with state space and action sets , . Let be the reward function, and be the transition function. Let and be player 1 and player 2’s policy sets, respectively. Then, for any and ,
where is the distribution mismatch coefficient relative to (see in Definition 1).
We define the following non-stationary policies:
With this definition, and . We define similarly. Since is non-stationary, we specify its action distribution as where is the step index. The joint value function for these non-stationary policies can be defined as usual:
In fact, the right-hand side above is equal to
Sending to infinity and recalling that , , , lead to
We next focus on the particular summand above with index and discuss three cases.
We first re-write . Notice that the value difference between the policy pairs and starts at step , since both policy pairs are equal to from step to step . At the th step, changes to while remains as . Therefore,
(note that ). Similarly,
Summing the inequality above over yields
where is a state distribution that generates the state by the following procedure: first sample a state according to , then execute for one step, and then output the next state.
By Lemma 22 (with , , and ), we have . Therefore,
Case 2: i>j𝑖𝑗i>j.
This case is symmetric to the case of , and can be handled similarly.
Case 3: i=j𝑖𝑗i=j.
Summing the bounds in all three cases above completes the proof. ∎
Let , and be three policies, and be some initial distribution. Let be a state distribution that generates a state according to the following: first sample an from , then execute for one step, and then output the next state. Then,
For a particular state , we view the supremum as the optimal value of an MDP whose reward function is and initial state is generated by . The optimal value of this MDP is upper bounded by by Definition 1. We next consider the following non-stationary policy for this MDP: first execute for one step, and then execute in the rest of the steps. The discounted value of this non-stationary policy is lower bounded by
We can upper and lower bound the discounted sum above as the following:
where the right inequality is due to that this discounted value must be upper bounded by the optimal value of this MDP, which has an upper bound , and the left inequality is by the definition of . Now notice that
by the definition of . Plugging this into the previous inequality, we get
Since this holds for any , this gives
Appendix F Auxiliary Lemmas for Stochastic Projected Gradient Descent
Algorithm 2 serves a sample-based algorithm if we solve the empirical risk minimization problem (7) via a stochastic projected gradient descent,
Let . Suppose . If we run Algorithm 4 with stepsize and , then,
See the proof of Theorem 1 in (Cohen et al., 2017b). ∎
Appendix G Additional Experiments
We provide details about our experiments as follows.
For illustration, we consider the state space and action space , and the number of players . In each state , the reward for player taking an action is the -weighted number of players using the action , where specifies the action preference . The reward in state distancing is less than that in state safe by a large amount . For state transition, if more than half of players find themselves using the same action, then the state transits to the state distancing; transition back to the state safe whenever no more than half of players take the same action.
In our experiments, we implement our independent policy gradient method based on the code for the projected stochastic gradient ascent (Leonardos et al., 2022). At each iteration, we collect a batch of trajectories to estimate the action-value function and (or) the stationary state distribution under current policy. We choose the discount factor , and different the stepsize , and initial state distributions as we report next.
Continuing Section 7, we further report our computational results using stepsize in Figure 2, larger stepsize in Figure 3 and stepsize in Figure 4. We notice that the stepsize for the projected stochastic gradient ascent (Leonardos et al., 2022) does not yield convergence while our independent policy gradient converges as shown in Figure 2. As demonstrated in Section 7, our independent policy gradient permits larger stepsizes with fast convergence, e.g., in Figure 3 and in Figure 4. Compared Figure 3 with Figure 4, we see an improved convergence of our independent policy gradient using a larger stepsize. We also remark that the learnt policies for all these experiments can generate the same Nash policy that matches the result in Leonardos et al. (2022).
We also examine how sensitive the performance of algorithms depends on initial state distributions. As discussed in Section 4, our independent policy gradient method (4) is different from the projected policy gradient (4.1) by removing the dependence on the initial state distribution. In the policy gradient theory (Agarwal et al., 2021), convergence of projected policy gradient methods is often restricted by how explorative the initial state distribution is. To be fair, we choose stepsize for our algorithm since it achieves a similar performance as the projected stochastic gradient ascent (Leonardos et al., 2022) in Figure 2. We choose two different initial state distributions and and report our computational results in Figure 5 and Figure 6, respectively. Compared Figure 5 with Figure 2, both algorithms become a bit slower, but our algorithm is relatively insusceptible to the change of . This becomes more clearer in Figure 6 for another . This demonstrates that practical performance of our independent policy gradient method (4) indeed is invariant to the initial distribution .