Adaptive Learning Rates for Multi-Agent Reinforcement Learning

1 INTRODUCTION . Recently , multi-agent reinforcement learning ( MARL ) has been applied to decentralized cooperative systems , e.g. , autonomous driving ( Shalev-Shwartz et al. , 2016 ) , smart grid control ( Yang et al. , 2018 ) , and traffic signal control ( Wei et al. , 2019 ) . Many MARL methods ( Lowe et al. , 2017 ; Foerster et al. , 2018 ; Rashid et al. , 2018 ; Iqbal & Sha , 2019 ; Son et al. , 2019 ) have been proposed for multi-agent cooperation , which follow the paradigm of centralized training and decentralized execution . In many of these methods , a centralized critic learns the joint Q-function using the information of all agents , and the decentralized actors are updated towards maximizing the Q-value based on local observation . However , in these methods , the actors are usually assigned the same learning rates , which is not optimal for maximizing the Q-value . This is because some agents might be more critical than others to improving the Q-value and thus should have higher learning rates . On the other hand , the learning rates of actors and critic are often hand-tuned and fixed , and hence require heavy tuning . More importantly , over the course of training , the effect of actors and critic on the learning varies , so the fixed learning rates will not always be the best at every learning stage . The artificial schedules , e.g. , time-based decay and step decay , are pre-defined and require expert knowledge about model and problem . Some optimizers , e.g. , AdaGrad ( Duchi et al. , 2011 ) , could adjust the learning rate adaptively , but they are proposed for general optimization problems , not specialized for MARL . In this paper , we propose AdaMa for adaptive learning rates in cooperative MARL . AdaMa dynamically evaluates the contribution of actors and critic to the optimization and adaptively updates the learning rates based on their quantitative contributions . First , we examine the gain of Q-value contributed by the update of each actor . We derive the direction along which the Q-value improves the most . Thus , we can update the vector of learning rates of all actors towards the direction of maximizing the Q-value , which leads to diverse learning rates that explicitly captures the contributions of actors . Second , we consider the critic and actors are updated simultaneously . If the critic ’ s update causes a large change of Q-value , we should give a high learning rate to the critic since it is leading the learning . However , the optimization of actors , which relies on the critic , would strug- gle with the fast-moving target . Thus , the learning rates of actors should be reduced accordingly . On the other hand , if the critic has reached a plateau , increasing the learning rates of actors could quickly improve the actors , which further generates new experiences to boost the critic ’ s learning . These two processes alternate during training , promoting the overall learning . Further , by incorporating the second-order approximation , we additionally capture the pairwise interaction between actors ’ updates so as to more accurately update the learning rates of actors towards maximizing the improvement of Q-value . We evaluate AdaMa in four typical multi-agent cooperation scenarios , i.e. , going together , cooperative navigation , predator-prey , and clustering . Empirical results demonstrate that dynamically regulating the learning rates of actors and critic according to the contributions to the change of Qvalue could accelerate the learning and improve the performance , which can be further enhanced by additionally considering the effect of pairwise actors ’ updates . The visualizations of learning rates during training clearly explain how and why AdaMa works . 2 RELATED WORK . MARL . We consider the formulation of decentralized partially observable Markov decision process ( Dec-POMDP ) . There areN agents interacting with the environment . At each timestep t , each agent i receives a local observation oit , takes an action a i t , and gets a shared reward rt . The agents aim to maximize the expected return E ∑T t=0 γ trt , where γ is a discount factor and T is the episode time horizon . Many methods ( Lowe et al. , 2017 ; Foerster et al. , 2018 ; Rashid et al. , 2018 ; Iqbal & Sha , 2019 ; Son et al. , 2019 ) have been proposed for Dec-POMDP , which adopt centralized learning and decentralized execution ( CTDE ) . In many of these methods , a centralized critic learns a joint Q-function by minimizing the TD-error . In training , the critic is allowed to use the information of all agents . The actors , which only have access to local information , learn to maximize the Q-value learned by the critic . In execution , the critic is abandoned and the actors act in a decentralized manner . Adaptive Learning Rate . Learning rate schedules aim to reduce the learning rate during training according to a pre-defined schedule , including time-based decay , step decay , and exponential decay . The schedules have to be defined in advance and depend heavily on the type of model and problem , which requires much expert knowledge . Some optimizers , such as AdaGrad ( Duchi et al. , 2011 ) , AdaDelta ( Zeiler , 2012 ) , RMSprop ( Tieleman & Hinton , 2012 ) , and Adam ( Kingma & Ba , 2015 ) , provide adaptive learning rate to ease manual tuning . AdaGrad performs larger updates for more sparse parameters and smaller updates for less sparse parameters , and other methods are derived from AdaGrad . However , these methods only deal with the gradient pattern for general optimization problems , offering no specialized way to boost multi-agent learning . WoLF ( Bowling & Veloso , 2002 ) provides variable learning rates for stochastic games , but not for cooperation . Meta Gradients for Hyperparameters . Some meta-learning methods employ hyperparameter gradients to tune the hyperparameter automatically . Maclaurin et al . ( 2015 ) utilized the reverse-mode differentiation of hyperparameters to optimize step sizes , momentum schedules , weight initialization distributions , parameterized regularization schemes , and neural network architectures . Xu et al . ( 2018 ) computed the meta-gradient to update the discount factor and bootstrapping parameter in reinforcement learning . OL-AUX ( Lin et al. , 2019 ) uses the meta-gradient to automate the weights of auxiliary tasks . The proposed AdaMa can also be viewed as a meta-gradient method for adaptive learning rates in MARL . 3 METHOD . In this section , we first introduce the single-critic version of MADDPG ( Lowe et al. , 2017 ) , on which we instantiate AdaMa . However , AdaMa can also be instantiated on other MARL methods , and the instantiation on MAAC ( Iqbal & Sha , 2019 ) for discrete action space is also given in Appendix A.1 . Then , we use the Taylor approximation to evaluate the contributions of the critic and actors ’ updates to the change of Q-value . Based on the derived quantitative contributions , we dynamically adjust the direction of the vector of actors ’ learning rates and balance the learning rates between the critic and actors . Further , we incorporate higher-order approximation to estimate the contributions more accurately . 3.1 SINGLE-CRITIC MADDPG Critic Actor Actor ...... TD error In mixed cooperation and competition , each MADDPG agent learns an actor πi and a critic for the local reward . However , since the agents share the reward in Dec-POMDP , we only maintain a single shared critic , which takes the observation vector ~o and the action vector ~a and outputs the Q-value , as illustrated in Figure 1 . The critic parameterized by φ is trained by minimizing the TD-error δ E ( ~o , ~a , r , ~o′ ) ∼D [ ( Q ( ~o , ~a ) − y ) 2 ] , where y = r+γQ− ( ~o′ , ~π−i ( o ′ i ) ) . Q− is the target critic , π−i is the target actor , and D is replay buffer . Each actor πi ( parameterized by θi ) is updated to maximize the learned Q-value by gradient ascent . The gradient of θi is We denote the learning rates of each actor i and the critic as lai and lc respectively . 3.2 ADAPTIVE ~la DIRECTION First , suppose that the critic is trained and frozen , and we only update the actors . By expanding the Q-function , we can estimate the gain of Q-value contributed by actors ’ updates by the Taylor approximation : ∆Q = Q ( ~o , ~a+ ∆~a ) −Q ( ~o , ~a ) ≈ Q ( ~o , ~a ) + N∑ i=1 ∆ai ∂Q ( ~o , ~a ) ∂ai T −Q ( ~o , ~a ) = N∑ i=1 [ πi ( θi + lai ∂Q ( ~o , ~a ) ∂θi ) − πi ( θi ) ] ∂Q ( ~o , ~a ) ∂ai T ≈ N∑ i=1 lai ∂Q ( ~o , ~a ) ∂θi ∂ai ∂θi T ∂Q ( ~o , ~a ) ∂ai T = N∑ i=1 lai ∂Q ( ~o , ~a ) ∂θi ∂Q ( ~o , ~a ) ∂θi T = ~la · ~∂Q ∂θ ∂Q ∂θ T . Assuming the magnitude of the learning rate vector ‖~la‖ is a fixed small constant ‖̂~la‖ , the largest ∆Q is obtained when the direction of ~la is consistent with the direction of vector ~∂Q ∂θ ∂Q ∂θ T . Thus , we can softly update ~la to the direction of ~∂Q ∂θ ∂Q ∂θ T to improve the Q-value : ~la = α~la + ( 1− α ) ‖̂~la‖ ~∂Q ∂θ ∂Q ∂θ T /‖ ~∂Q ∂θ ∂Q ∂θ T ‖ ~la = ~la ‖̂~la‖ ‖~la‖ , ( 1 ) where the second line normalizes the magnitude of ~la to ‖̂~la‖ , and α is a parameter that controls the soft update . From another perspective , the update rule ( 1 ) can be seen as updating ~la by gradient ascent to increase the Q-value the most , since ∂∆Q ∂~la = ~∂Q ∂θ ∂Q ∂θ T . 3.3 ADAPTIVE lc AND ‖~la‖ In the previous section , we assume that the critic is frozen . However , in MADDPG and other MARL methods , the critic and actors are trained simultaneously . Therefore , we investigate the change of Q-value by additionally considering the critic ’ s update : ∆Q = Q ( φ+ ∆φ , ~o , ~a+ ∆~a ) −Q ( φ , ~o , ~a ) ≈ Q ( φ , ~o , ~a ) + N∑ i=1 ∆ai ∂Q ( φ , ~o , ~a ) ∂ai T + ∆φ ∂Q ( φ , ~o , ~a ) ∂φ T −Q ( φ , ~o , ~a ) ≈ ~la · ~∂Q ∂θ ∂Q ∂θ T − lc ∂δ ∂φ ∂Q ∂φ T . We can see that ∆Q is contributed by the updates of both the critic and actors . In principle , the critic ’ s learning is prioritized since the actor ’ s learning is determined by the improved critic . When the critic ’ s update causes a large change of the Q-value , the critic is leading the learning , and we should assign it a high learning rate . However , the optimization of actors , which relies on the current critic , would struggle with the fast-moving target . Therefore , the actors ’ learning rates should be reduced . On the other hand , when the critic has reached a plateau , increasing the actors ’ learning rates could quickly optimize the actors , which further injects new experiences into the replay buffer to boost the critic ’ s learning , thus promoting the overall learning . The contributions of actors ’ updates are always nonnegative , but the critic ’ s update might either increase or decrease the Q-value . Therefore we use the absolute value | ∂δ∂φ ∂Q ∂φ T | to evaluate the contribution of critic to the change of Q-value . Based on the principles above , we adaptively adjust lc and ‖~la‖ by the update rules : lc = αlc + ( 1− α ) l · clip ( | ∂δ ∂φ ∂Q ∂φ T |/m , , 1− ) ‖̂~la‖ = l − lc . ( 2 ) The hyperparameters α , m , l , and have intuitive interpretations and are easy to tune . α controls the soft update and m controls the target value of lc . The clip function and the small constant prevent the learning rate being too large or too small . Therefore , AdaMa works as follows : first update lc and get ‖̂~la‖ using ( 2 ) , then regulate the direction and magnitude of ~la according to ( 1 ) . As Liessner et al . ( 2019 ) pointed out , the actor should have a lower learning rate than the critic , and a high learning rate of actor leads to a performance breakdown . Also , empirically , in DDPG ( Lillicrap et al. , 2016 ) the critic ’ s learning rate is set to 10 times higher than the actor ’ s learning rate . However , we believe such a setting only partially addresses the problem . During training , if the learning rates of actor are always low , actors learn slowly and thus the learning is limited . Therefore , AdaMa decreases lc and increases ‖~la‖ when the learning of critic reaches a plateau , which could avoid the fast-moving target and speed up the learning .

Summary: The paper proposes a new algorithm for multi-agent reinforcement learning (MARL) that adaptively picks learning rates for actor and critic. Specifically, the learning rates are updated to directions maximally affecting the Q-function, and the algorithm dynamically balances the learning rates between actor and critic. In numerical studies, the authors illustrate the efficiency of their method via four toy experimental scenarios and intuitively explain the underlying mechanism.