{'fraction_non_alphanumeric': 0.04709561262200322, 'fraction_numerical': 0.012224012129252346, 'mean_word_length': 4.442753996905622, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Lyapunov-Based Reinforcement Learning for Decentralized Multi-Agent Control

Decentralized multi-agent control has broad applications, ranging from multi-robot cooperation to distributed sensor networks. In decentralized multi-agent control, systems are complex with unknown or highly uncertain dynamics, where traditional model-based control methods can hardly be applied. Compared with model-based control in control theory, deep reinforcement learning (DRL) is promising to learn the controller/policy from data without the knowing system dynamics. However, to directly apply DRL to decentralized multi-agent control is challenging, as interactions among agents make the learning environment non-stationary. More importantly, the existing multi-agent reinforcement learning (MARL) algorithms cannot ensure the closed-loop stability of a multi-agent system from a control-theoretic perspective, so the learned control polices are highly possible to generate abnormal or dangerous behaviors in real applications. Hence, without stability guarantee, the application of the existing MARL algorithms to real multi-agent systems is of great concern, e.g., UAVs, robots, and power systems, etc. In this paper, we aim to propose a new MARL algorithm for decentralized multi-agent control with a stability guarantee. The new MARL algorithm, termed as a multi-agent soft-actor critic (MASAC), is proposed under the well-known framework of"centralized-training-with-decentralized-execution". The closed-loop stability is guaranteed by the introduction of a stability constraint during the policy improvement in our MASAC algorithm. The stability constraint is designed based on Lyapunov's method in control theory. To demonstrate the effectiveness, we present a multi-agent navigation example to show the efficiency of the proposed MASAC algorithm.


Introduction
Multi-agent system control has intrigued researchers from both industrial and academic communities for decades, due to its prospect in broad applications, such arXiv:2009.09361v1 [eess.SY] 20 Sep 2020 as formation flight of unmanned aerial vehicles (UAVs) [45,46], coordination of multi-robots [5,38], flocking/swarm control [35,42], distributed sensor networks [34], large-scale power systems [18], traffic and transportation systems [7], etc. Control of a multi-agent system can be achieved in either a centralized or a decentralized manner. However, a multi-agent system with many subsystems has high state and action dimensions that will dramatically increase the design complexity and computational burdens of a single centralized controller [4]. In many applications, every agent of a multi-agent system only has local control capability with access to local observations, e.g., the cooperation of multiple vehicles [14]. The lack of global control capability and information excludes the possibility of centralized control. Besides, centralized control tends to be less reliable. If the central controller fails, the entire system will break down. As an alternative, decentralized control is capable of handling all the above issues.
Decentralized multi-agent control has been extensively studied [10,36,37,43]. With the assumption that the agents' dynamics are known and linear, many model-based control algorithms have been proposed for different tasks [10,38,43]. In control theory, those model-based algorithms can ensure closed-loop stability if a multi-agent system satisfies all the assumptions. The state trajectories of a multi-agent system under a model-based control algorithm will always stay close to or even converge to an equilibrium point [26]. However, in most applications, agent dynamics are nonlinear, complicated, and highly uncertain, e.g., robotic systems, UAVs, and power systems. Assumptions made by model-based control algorithms can be barely satisfied in real life. Therefore, model-based control algorithms are restrictive, though theoretically sound.
Compared with model-based control, deep reinforcement learning (DRL) is more promising for the decentralized multi-agent control for complicated nonlinear dynamical systems, as it can learn controller/policy from samples without using much model information [8,9,13,28,41,47,48]. Recently, deep RL has obtained significant success in applying to a variety of complex single-agent control problems [3,20,27,32]. However, it is more challenging to apply deep RL to decentralized multi-agent control. In multi-agent reinforcement learning (MARL), agents seek the best responses to other agents' policies. The policy update of an agent will affect the learning targets of other agents. Such interactions among agents make MARL training non-stationary, thus influencing the learning convergence. To resolve the non-stationary issue, a "centralized-training-withdecentralized-execution" mechanism was employed, based on which a number of MARL algorithms have been proposed, e.g., MADDPG [31], COMA [15], meanfield MARL [44], MATD3 [1], and MAAC [24], etc. Unfortunately, the existing MARL algorithms can not ensure the closed-loop stability for a multi-agent system, while stability is the foremost concern for the control of any dynamical systems. It is highly possible that learned control polices will generate abnormal or risky behaviors in real applications. From a control perspective, the learned control policies fail to stabilize a multi-agent system, so they cannot be applied to safety-critical scenarios, e.g., formation flight of UAVs.
In this paper, we propose MARL algorithms for decentralized multi-agent control with a stability guarantee. A multi-agent soft actor-critic (MASAC) algorithm is developed based on the well-known "centralized-training-with-decentralizedexecution" scheme. The interactions among agents are characterized using graph theory [12]. Besides, a stability-related constraint is introduced to the policy improvement to ensure the closed-loop stability of the learned control policies. The stability-related constraint is designed based on the well-known Lyapunov's method in control theory which is a powerful tool for the design of a controller to stabilize the complex nonlinear systems with stability guarantee. [26].
Contributions: The contributions of this paper can be summarized as follows.
1. For the first time, a Lyapunov-based multi-agent soft actor-critic algorithm is developed for decentralized control problems based on the "centralizedtraining-with-decentralized-execution" to guarantee the stability of a multiagent system. 2. Theoretical analysis is presented on the design of a stability constraint using Lyapunov's method.

Networked Markov game
Interactions among N agents are characterized using an undirected graph G = I, E , where I := {1, . . . , N } represents the set of N agents and E ⊆ I × I denotes the interactions among agents. If an agent i is able to interact with an agent j with j = i and i,j ∈ I , there exists an edge (i, j) ∈ E, and agent j is called a neighbor of agent i. For an undirected graph, (j, i) ∈ E if (i, j) ∈ E. The neighborhood of agent i is denoted by N i := {∀j ∈ I| (i, j) ∈ E}. Assume the undirected graph is fully connected, so there exists a path from each node i ∈ I to any other nodes j ∈ I [12,17]. If an undirected graph is strongly connected, information could eventually be shared among all agents via the communication graph.
A networked Markov game with N agents is denoted by a tuple, MG := G, S, A, P, r, γ , where G := I, E is the communication graph among N agents, A i denotes the joint action space with A i the local action space for agent i ∈ I, P := S × A × S → R specifies the state transition probability function, and r := S × A → R represents the global reward function of the entire multi-agent system. The global transition probability can, therefore, be denoted by P (s t+1 |s t , a t ). The joint action of N agents is a = {a 1 , . . . , a N } where a i denotes the action of an agent i ∈ I. Accordingly, the joint policy is defined to be π = {π 1 , . . . , π N } where π i (∀i ∈ I) are local policies for an agent i. Hence, the global policy for the entire multi-agent system is defined to be π (a|s) = N i=1 π i (a i |s i ). Assume each agent i can only obtain a local observation s i ∈ S i (e.g. its own states and state information of its neighbors) to make decisions at the execution.
For any given initial global state s 0 , the global expected discounted return following a joint policy π is given by where γ is a discount factor, V is the global value function and ρ π is the stateaction marginals of the trajectory distribution induced by a global policy π. The global action-value function (a.k.a. Q-function) of the entire system is

Soft actor-critic algorithm
In this paper, the soft actor-critic (SAC) algorithm will be used for the design of the multi-agent reinforcement learning algorithm. The SAC algorithm belongs to off-policy RL that is more sample efficient than on-policy RL methods [41], such as the trust region policy optimization (TRPO) [39] and the proximal policy optimization (PPO) [40]. In SAC, an expected entropy of the policy π is added to the value functions (1) and (2) to regulate the exploration performance at the training stage [21,49]. The inclusion of the entropy term makes the SAC algorithm exceed both the efficiency and final performance of deep deterministic policy gradient (DDPG) [19,29]. With the inclusion of the expected entropy, the action value function (1) to be maximized for a multi-agent system will turn into where α is the temperature parameter used to control the stochasticity of the policy by regulating the relative importance of the entropy term against the reward, and H (π (·|s t )) = −E π log (π (·|s t )) is the entropy of the policy π. Accordingly, a modified Bellman backup operator is defined as

Lyapunov stability in control theory
A dynamical system is called stable, if its state trajectory starting in vicinity to an equilibrium point will stay near the equilibrium point all the time. Stability is a crucial concept for the control and safety of any dynamical systems. Lyapunov stability theory provides a powerful means of stabilizing unstable dynamical systems using feedback control. The idea is to select a suitable Lyapunov function and force it to decrease along the trajectories of the system. The resulting system will eventually converge to its equilibrium. Lyapunov stability of dynamic systems at a fixed policy π (a|s) is given by Lemma 1.

Lemma 1 (Lyapunov stability).
[26] Suppose a system is denoted by a nonlinear mapping s t+1 = f (s t , π (a t |s t )). Let L (s t ) be a continuous function such that L (s T ) = 0, L (s t ) > 0 (∀s t ∈ Ω & s t = s T ), and L (s t+1 ) − L (s t ) ≤ 0 (∀s t ∈ Ω) where s T is an equilibrium state and Ω is a compact state space.
Then the system s t+1 = f (s t , π (a t |s t )) is stable around s T and L (s t ) is a Lyapunov function. Furthermore, if L (s t+1 ) − L (s t ) < 0 (∀s t ∈ Ω), the system is asymptotically stable around s T .
Note that maximizing the objective function (1) or (2) doesn't necessarily result in a policy stabilizing a dynamical system.

Multi-agent reinforcement learning with Lyapunov stability constraint
In this section, we will first develop a MARL algorithm based on the SAC algorithm by following a similar idea as the multi-agent deterministic policy gradient descent (MADDPG) [31]. The proposed algorithm is termed as Multi-Agent Soft Actor-Critic algorithm (MASAC). The proposed MASAC algorithm is thereafter enhanced by incorporating a carefully designed Lyapunov constraint.

Fig. 1. Centralized training with decentralized execution
The crucial concept behind the MASAC is the so-called "centralized training with decentralized execution" shown in Figure 1. A centralized critic using global information is employed at the training stage, while each agent uses their own independent policy taking local observations as inputs. Hence, at the training stage, agents share their rewards with all the other agents for the calculation of the central critic. In MASAC, it is expected to maximize the entropy-regularized objective function introduced in (3).
In decentralized control, agents make decisions based on their local observations [4,14,25,36,37]. Hence, their polices are assumed to be independent of one another, i.e., π (a t |s t ) = N i=1 π i (a i |s i ). Hence, the entropy of the joint policy π (a t |s t ) in (3) is where H (π i ) represent the entropy of each local policy π i . The entire algorithm is divided into policy evaluation and policy improvement. In the policy evaluation step, we will repeatedly apply the modified Bellman backup operator (4) to the Q-value of a fixed joint policy. Let the centralized Q-value for the multi-agent system be parameterized by θ. The critic neural network parameter θ is trained to minimize the following Bellman residual.
In the optimization, the value function is replaced by the Q-value function. Therefore, the critic parameters are optimized by stochastic gradient descent as where In policy improvement, the policy is updated according to where π * = {π * 1 , . . . , π * N } is the optimal joint policy. Assume the policy of agent i is parameterized by φ i , ∀i = 1, . . . , N . According to (9), the policy parameters φ i , ∀i = 1, . . . , N are trained to minimize where φ = {φ 1 , . . . , φ N } and π φ = {π φ1 , . . . , π φ N }. In terms of the stochastic gradient descent, each agent's policy parameter φ i will be updated according
The MASAC algorithm is summarized in Algorithm 1. The final MASAC algorithm uses two soft Q-functions to mitigate the estimation bias in the policy improvement and further increase the algorithm performance [2,16,23].

Lyapunov stability constraint
Qualitatively, stability implies that the states of a system will be at least bounded and stay close to an equilibrium state for all the time. The existing MARL algorithms, including the proposed MASAC algorithm in Section 3.1, can find an optimal policy that can maximize either state or action-value functions. However, they do not necessarily produce a policy that ensures the stability of a system. In this section, we offer a possible solution to incorporate Lyapunov stability as a constraint in the optimization of MASAC. A Lyapunov function candidate can be constructed based on cost functions c (s, π) ≥ 0 with c (s T , π (a T |s T )) = 0 and s T the target/equilibrium state [6,11]. One possible choice of the Lyapunov function candidate is an accumulated cost in a finite time horizon, e.g., model predictive control (MPC) [33]. Before the introduction of the Lyapunov stability constraint, we make several assumptions on both the cost functions to be designed and the system dynamics of interest.
The assumption on the cost function is given as follows.
Assumption 1 could ensure the Lyapunov function candidate to be bounded and Lipschitz continuous for the state s, if we choose it to be an accumulated cost in a finite time horizon. Hence, we could further assume the Lyapunov function candidate is Lipschitz continuous with the state s on a compact set Ω with l L the Lipchitz constant.
Since we are interested in the decentralized control problem of multiple agents with deterministic dynamics, the following assumption on the physical dynamics is made.
Assumption 2 Consider a deterministic, discrete-time agent system s t+1 = f (s t , a t ). The nonlinear dynamics f is Lipschitz continuous with respect to a t , namely f s t , a 2 t − f s t , a 1 According to the existence and uniqueness theorem, the local Lipschitz condition is a common assumption for deterministic continuous systems. According to Lemma 1, the state s t+1 is needed to evaluate the stability of a system under a fixed policy, but s t+1 is not available in general. In Theorem 1, we show that it is possible to evaluate the stability of a new policy π new , if we already have a feasible policy π old associated with a Lyapunov function L (s). Here, a feasible policy implies that a system is stable and that a Lyapunov function exists. Theorem 1. Consider a system s t+1 = f (s t , a t ) Suppose Assumptions 1 and 2 hold. Let π old be a feasible policy for data collection and L π old (s) is the Lyapunov function. A new policy π new will also be a feasible policy under which the system is stable, if there exists where ∀s t ∈ Ω, (s t , a π old t , s t+1 ) is a tuple from the policy π old , l L and l f are Lipschitz constants of the Lyapunov function and system dynamics, respectively.
Theorem 1 requires all the states need to be visited to evaluate the stability of a new policy. Unfortunately, it is impossible to visit an infinite number of states. However, Theorem 1 still shows a potential way to use historical samples for the old policies to evaluate the current policy. Based on Theorem 1, we are able to add a Lyapunov constraint similar to (13)  for DC of multi-agent systems. With the inclusion of the Lyapunov constraint (13) [6,22], the objective function (10) is rewritten as where β ∈ [0, 1] and ∆L ψ = L i (s t+1 , a t+1 ) + l L l f a φ − a t 2 − L i (s t , a t ) + βc π (s t ).
At training, the Lyapunov functions L (s t ) will be parameterized by ψ which is trained to minimize where L target = T t=0 c (s t , a t ) with T denoting a finite time horizon as in model predictive control. The modified robust multi-agent reinforcement learning algorithm is summarized in Algorithm 2.

Experiment
In this section, we will evaluate our proposed algorithms in a well-known application of multi-agent systems called "rendezvous" [30]. In the "rendezvous" problem, all agents starting from different locations are required to meet at the same target location in the end. Only a subgroup of agents, which are called leaders, have access to the target location, while others need to learn to cooperate with others. In the experiments, both the critic and actor are represented suing Algorithm 2: Multi-agent soft actor-critic algorithm with a Lyapunov constraint Initialize parameters θ 1 , θ 2 and φi ∀i ∈ Ī θ 1 ← θ 1 ,θ 2 ← θ 2 , D ← ∅ repeat for each environment step do ai,t ∼ π φ i (ai,t|si,t), ∀i ∈ I st+1 ∼ Pi (st+1|st, at), where at = {a1,t, . . . , aN,t} D ← D {st, at, r (st, at) , st+1} end for for each gradient update step do Sample a batch of data, fully connected multiple-layer perceptrons with two hidden layers. Each hidden Layer has 64 neurons with the 'ReLU' activation function. The learning rate for the actor network is chosen to be 0.0003, while the learning rate for the critic network is 0.003. To stabilize the training, learning rates decrease with a certain decay rate (0.075 0.0005 in the experiments). The Lyapunov neural network is approximated by an MLP with three hidden layers (64 neurons for the first two hidden layers, and 16 neurons for the last hidden layers). The batch size is selected to be 256. The parameter τ for soft updates of both actor and critic networks is picked to be 0.005. The discount factor γ is chosen to be 0.95.
The environment is built using the multi-agent environment used in [31]. The agent model in the environment in [31] is replaced by a high-order non-holonomic unicycle model which is widely used in robotics navigationṪhe agent dynamics are given as follows.
where x and y are the positions of the agent, ψ is the heading angle, v is the speed, and ω is the angular rate. The control actions for each agent are a and r, respectively.
Learning curves of both the MASAC and MASAC-Lyapunov are shown in Figure 2. Although both the MASAC and MASAC-Lyapunov will converge, they have a different performance at evaluations. To further verify the performance, we evaluate both the MASAC and MASAC-Lyapunov for 500 times with agents' initial positions randomly generated. We define a criterion called "success rate" to compare the overall performance of the two algorithms. We think an evaluation episode is successful if all agents end up in the target location. The "success rate" is calculated by total number of successful episodes totalnumberof episodesatevaluation × 100. The "success rate" of the two algorithms is shown in Figure 3. With the inclusion of the Lyapunov constraint, we can increase the success rate of the tasks dramatically according to Figure 3. Hence, the Lyapunov constraint will increase the stability performance of the learned policy, thereby resulting in a policy that is more likely to stabilize a system.

Conclusion
In this paper, we studied MARL for data-driven decentralized control for multiagent systems. We proposed a MASAC algorithm based on the "centralizedtraining-with-decentralized-execution'. We thereafter presented a feasible solution to combine Lyapunov's methods in control theory with MASAC to guarantee stability. The MASAC algorithm was modified accordingly by the introduction of a Lyapunov stability constraint. The experiment conducted in this paper demonstrated that the introduced Lyapunov stability constraint is important to design a policy to achieve better performance than our vanilla MASAC algorithm.