Multi-agent reinforcement learning (MARL) employs reinforcement learning to solve the multi-agent system problems. With cooperative multi-agent systems playing an increasingly important role, such as controlling robot swarms with limited sensing capabilities [1, 7], mastering build order production  and micro-management task in real-time strategy (RTS) games [22, 19, 29], dispatching ride requests , autonomous driving [42, 10, 8], and so on, MARL attracts the attention of many researchers. MARL algorithms face the problem of huge action space, non-stationary environment, and global exploration. Although many algorithms have been proposed to solve these problems, it is still an open problem.
To address cooperative tasks, one class of MARL methods is independent learning that allows the agents to learn independently [15, 27, 5]. Independent learning suffers from the non-stationarity because other agents are also impacting the environment. Another class is centralized learning that takes the multi-agent system as a whole [4, 21, 40]. Centralized training with decentralized execution (CTDE) is a compromise between independent and centralized learning [39, 26, 19]. It provides local autonomy to agents by decentralized execution and mitigates the problem of the non-stationary environment by centralized training. There are many methods adopting CTDE framework [32, 38, 31, 36], including QMIX , VDN , QTRAN , and so on.
Unshaped scenario is defined as the scenario where the number of units and the size of action set change over time, which is a common multi-agent scenario.  solves the problem of formation control in face of an uncertain number of obstacles. DyAN  reconstructs the agent observation into information related to environment and units, and ASN  categorizes the agent action set considering the semantics between actions. Although the mentioned methods adapt to unshaped scenarios, there is still room for improvement.
StarCraft II micro-management is a widely used experimental environment to test MARL methods . It is actually an unshaped scenario, in which the death of agents in combat leads to the change in their number. In addition, since the enemy can also be killed, the size of attack action subset of each unit changes as well. However, the existing methods [19, 23] ignore the variation of action set and still provide action-values for invalid actions. This may cause miscalculation of the action-value among all agents. In addition, as their joint action-value functions still collect the meaningless action-values of dead agents, the joint action-value may also be miscalculated.
In this paper, we focus on the unshaped cooperative multi-agent scenarios, in which the number of agents and the size of action set change over time. Our contribution to the uncertain challenge of MARL is twofold. (i) The self-weighting mixing network is proposed with the network input dimension adapting with the number of agents, so that the joint action-value is estimated more accurately. (ii) The action set of an agent is divided into two subsets:environment-oriented subset and unit-oriented subset. We use two network streams, the environment-oriented stream and unit-oriented stream, to calculate the Q values of corresponding actions. Finally, we introduce the training algorithm of UNMAS and conduct experiments to compare with several other MARL algorithms in the StarCraft II micro-management scenarios. The results show that UNMAS achieves the highest winning rates on a wide variety of StarCraft II micro-management maps.
I-B Related Work
Research on independent learning begins with the work of 
, in which the author tries to execute Q-learning independently for each agent to achieve cooperation. With the use of deep learning, IQL introduces Deep Q-Network (DQN)  into MARL to cope with high-dimensional observations. Some other research that tackles the multi-agent problem with independent learning can be found in [5, 15, 41, 43]. DyAN  divides the observation of the agents into environment-oriented and unit-oriented subsets, and employs a GNN to adapt to the change in the number of agents in the expansion from small-scale scenarios to large-scale scenarios. However, independent learning suffers from the non-stationarity of environment, which leads to the difficulty of learning convergence .
Centralized learning treats the multi-agent system as a whole. Grid-Net  employs an encoder-decoder architecture to generate actions for each grid agent.  and  propose methods for the multi-agent system in the framework of actor-critic.  formulates the problem of multitask into a multi-agent system. However, the centralized learning method is hard to be scaled to larger scenarios, so the CTDE framework becomes popular as a compromise between independent and centralized learning. One spectrum of the CTDE method is the actor-critic method. MADDPG , which is developed from DDPG , provides a centralized critic for the whole system and a group of decentralized actors for each agent. COMA  computes a counterfactual baseline to marginalize out a single agent’s action while the other agents’ actions are fixed. COMA also provides a centralized critic to estimate the joint Q-function.
The other spectrum is the value-based method. The challenge for value-based methods in the framework of CTDE is how to factorize the joint action-value correctly . VDN  factorizes the joint action-value by summing up the individual action-values of each agent. QMIX  combines the individual action-values in a non-linear way by a mixing network whose weights and biases are generated according to the multi-agent global state. ASN  improves the individual action-value network in VDN and QMIX by considering action semantics between agents. QTRAN  guarantees more general factorization by factorizing the joint action-value with a transformation. Q-DPP  introduces DPP into MARL tasks to increase the diversity of agents’ behaviors. ROMA  and RODE  allow agents with a similar role to share similar behaviors. Qatten  designs a multi-head attention network to approximate joint action-value function. However, such methods do not consider the problem of unshaped scenarios. They assume that the number of agents and the size of action set are fixed, and this assumption limits the applications of these methods.
This paper is organized as follows. Section II introduces the background knowledge about multi-agent reinforcement learning and factorization of the joint action-value. Section III describes UNMAS from three aspects: joint action-value function, individual action-value function, and training algorithm. Section IV shows the experiments and results, and analyzes the learned strategies. Finally, Section V gives the conclusion.
Ii-a Multi-Agent Reinforcement Learning
We consider a fully cooperative multi-agent task with partially observable environment, in which agents observe and take actions individually. This task is also called the decentralized partially observable Markov decision process
decentralized partially observable Markov decision process(Dec-POMDP) . It can be defined as a tuple . is the set of agents, the number of which is n. The Dec-POMDP extends POMDP by introducing the set of joint actions and joint observations . The multi-agent system takes the joint action according to the joint observation and gets the immediate reward from environment according to the function . Then, the global state of multi-agent system is produced according to the transition function , which specifies Pr. Finally, in tuple denotes the discount factor of discounted cumulative reward: .
In the Dec-POMDP, we consider a joint policy , which is composed of the policies of every agent . The joint policy has a joint action-value function: . The purpose of fully cooperative multi-agent task is to maximize this return.
Ii-B Factorization of Joint Action-Value Function
As mentioned before, value-based methods with CTDE framework need to find an efficient and adaptable way to factorize the joint action-value. A common requirement in the field of CTDE is the Individual Global Max (IGM) condition.
For a multi-agent system with agents, if the optimal joint action is equivalent to the set of agents’ actions that make the individual action-value functions get the maximum values, the system is said to satisfy the IGM condition. This statement is formulated as follows:
Since the IGM condition is difficult to be verified in practice, the following monotonicity condition is mostly used as its substitute:
If is factorized monotonically as (2), then this way of factorization meets the IGM condition. Under the IGM condition, maximizing the joint action-value is equivalent to maximizing the action-value of each agent. Thus, the multi-agent system pursues the same goal as every agent and achieves cooperation.
We propose UNMAS in the next section to adapt to the number and size changes in the unshaped scenario.
Iii Unshaped Networks for Multi-Agent Systems
In this section, we propose a new method called Unshaped Networks for Multi-Agent Systems (UNMAS), aiming at helping agents adapt to the change in the unshaped scenario. UNMAS uses the self-weighting mixing network, which is adaptive to the size of input, to factorize the joint action-value. The individual action-value network of agent is specially designed with two network streams to evaluate the actions in the environment-oriented subset and unit-oriented subset separately. The size of unit-oriented subset is also unshaped.
Iii-a Self-weighting mixing network
Fig. 1 presents the self-weighting mixing network, which approximates the joint action-value function. Since UNMAS adopts the CTDE framework, the joint action-value function is only used in training. The weights and biases of the self-weighting mixing network are produced by a group of hyper networks represented by the yellow blocks in the architecture, and the input of the hyper networks is the global state .
Instead of following the original definition of the joint action-value function that takes joint observations and joint actions as input, CTDE decomposes it as a mapping from the individual action-values of each agent. Such way greatly decouples the complicated interplay between different agents.
The biggest difference between UNMAS and other CTDE methods lies in the ways of dealing with the input size of joint action-value function. In the other CTDE methods, the input size of joint action-value function is determined beforehand and keeps constant during the whole training and execution phase. Since they still provide action-values for dead agents, the joint action-value may be miscalculated and reduce the performance of agent policies. However, the joint action-value function represented by self-weighting mixing network can change its input size with the number of agents. It outputs two scalars and for each agent:
where is the result after nonlinear mapping by self-weighting mixing network, and is the individual weight, which describes the contribution of agent to the joint action-value. By dynamically evaluating the contribution of each agent according to , the estimation of the joint action-value could be more accurate. Thus, the cooperation of the multi-agent system becomes better. Elu 
is a nonlinear activation function, which is also used in the mixing network of QMIX.is the action-value of agent , which is estimated by the individual action-value network. , , and are weights of the self-weighting mixing network as shown in Fig. 1, and , , and are the corresponding biases. and are outputs of networks and , which take observation of agent and the global state as input, respectively. Finally, the concatenation of and is taken as the input of to calculate the weight .
By employing self-weighting mixing network to evaluate the contribution of each agent, UNMAS can adapt to the change in the number of agents in training and improve the accuracy of the estimation of joint action-value. Taking the StarCraft II micro-management scenario as an example, the number of agents decreases due to the death caused by enemies attack. The weights and biases of the self-weighting mixing network are obtained through the global state. Therefore, even if the of each agent do not take the information of other agents into account, the self-weighting mixing network can still estimate the joint action-value accurately. The joint action-value function is formulated as follows:
where is the number of agents in the current timestep , and is a scalar output from the hyper network. It is a bias of the joint action-value, which is generated from a fully-connected network with as input. The ablation result of QMIX  shows that adding to the joint action-value is able to achieve better results, which is also confirmed in our ablation experiments. In (4), in order to adapt to the change in the number of agents, we use to average the weighted sum . Besides, the weights of self-weighting mixing network take the absolute values to make sure that the factorization meets the IGM condition. The proof that the self-weighting mixing network meets the IGM condition is provided in Theorem 1.
In a fully cooperative task, if letting the self-weighting mixing network shown in Fig. 1 represent the joint action-value function, then the factorization process meets the IGM condition.
The joint action-value estimated by the self-weighting mixing network is written as follows:
The partial derivative of the joint action-value to agent action-value is shown in (6), where all elements are non-negative.
Since the parameter of elu function is set to 1, the derivative shown in (6) can be written as follows:
As described above, the weights of self-weighting mixing network take absolute values, so the partial derivative is also non-negative. According to the monotonicity condition, the factorization meets the IGM condition. ∎
Through the special design of network structure and averaging weighted sum with , self-weighting mixing network can adapt to the change in the number of agents. In the next subsection, we introduce the architecture of the individual action-value network, which can adapt to the change in the size of action set.
Iii-B Individual action-value network
The individual action-value network approximates the action-value function of each agent, and it shares the parameters among agents. In the framework of CTDE, an agent takes an action according to its local observation without communicating with the other agents.
In order to help agents adapt to the change in the size of action set, we divide the action set into two subsets. One is the environment-oriented subset, and the other is the unit-oriented subset. The first action subset represents the interactions between the agent and the environment, and keeps constant during the whole running phase. The second represents the interactions between the agent and other agents, and its size varies with the number of agents in the current environment. Taking StarCraft II micro-management scenario as an example, the environment-oriented actions include stop and four movement actions in the directions of up, down, left, and right, while the unit-oriented action is the attack action aiming at an enemy unit.
Based on the division of the action set, we propose the individual action-value network as shown in Fig. 2. Two network streams are constructed for the two action subsets. The environment-oriented stream takes the environment-oriented observation as input. It contains three Fully-Connected (FC) layers , and one Gated Recurrent Unit (GRU)  layer .
The GRU layer, employed to solve the problem of POMDP, can better estimate the current state. At each timestep , the GRU layer additionally inputs a hidden state , which contains historical information and outputs the next hidden state. Its outputs are the Q values of the environment-oriented actions as follows:
where are the Q values of agent executing the environment-oriented actions. is the environment-oriented observation, which describes the information observed by agent from the environment. is the hidden state of the next timestep . is the short form of the environment-oriented stream.
The unit-oriented stream takes the unit-oriented observations as input. Its outputs are the Q values of the unit-oriented actions. The unit-oriented observation differs from the environment-oriented observation in the fact that it describes the information from agent to the target unit . Taking the StarCraft II micro-management scenario as an example, if there are 3 enemies on the map at timestep t
, the unit-oriented stream takes 3 observations in terms of these enemies to evaluate the Q values of attacking them. Due to the number of enemies changes over time in unshaped scenarios, the number of attack targets also changes. Besides, it should be noted that if the agent has a healing action, the target units here will be other agents, not enemies. Furthermore, we concatenate the first layer’s output of two streams to form a new vector, and feed it into the second layer of the unit-oriented stream. The Q values of the unit-oriented actions are calculated as follows:
where is the concatenation of and , which are the output of the first part of environment-oriented stream and unit-oriented stream. is the Q value of agent executing the unit-oriented action on target unit . is the second layer of the unit-oriented stream.
Due to the concat operation, the output of the unit-oriented stream also contains the historical information provided by , so there is no need to provide a GRU layer for it. For the sake of brevity, the environment-oriented observations and unit-oriented observations of agent are simplified into one variable . Finally, we concatenate all and to form the individual action-value function .
It should be noted that the individual action-value networks of other methods like QMIX fail in adapting to the change in the size of action set. They use a single network to evaluate the Q values of all kinds of actions, which include both valid and invalid actions.
Iii-C Training algorithm of UNMAS
In this subsection, we introduce the training algorithm of UNMAS. The detail is shown in Algorithm 1. The agents take -greedy policy to explore the environment in training, that is, choose a random action with probability , otherwise choose the action with the highest Q value:
where the exploration rate decays along the training steps. The transitions and rewards generated by the interaction between the multi-agent system and the environment are stored into the replay buffer D.
When the replay buffer D is full, we sample a minibatch from replay buffer D to update the networks. They are trained by minimizing the loss:
where is the size of minibatch. is the parameter of all networks involved in training. and are the parameters of self-weighting mixing network and individual action-value network respectively. is the joint update target of the multi-agent system, which is defined as follows:
where the target action is obtained by maximizing the individual action-value function of agents. and are parameters of the target network for the self-weighting mixing network and the individual action-value network. Throughout the training phase, they are replaced by the current parameters every fixed episodes, which is defined as target update interval.
The multi-agent system is treated as a whole in the training phase, so the self-weighting mixing network and individual action-value network can also be seen as one neural network, which possesses the parameter. At each iteration,
is updated by the gradient that is obtained by minimizing the loss function in (11). Since the self-weighting mixing network only appears in the training phase, this learning law indicates that the role of the self-weighting mixing network and its parameter is to help the update of the individual action-value network.
Iv Experiments on StarCraft II Micro-Management
Iv-a Experimental Setup
The micro-management scenario is an important aspect of StarCraft II. It requires the player to control a group of agents to win a combat against enemies. The micro-management scenario with a decentralized setting is a proper experimental scenario to test MARL methods because the agents are partially observable and can perform decentralized actions. We use StarCraft Multi-Agent Challenge (SMAC) as the environment and evaluate our method on various maps.
We consider combats with two groups of units, one of which is using UNMAS and the other is the enemy. This scenario is an unshaped scenario, as the number of agents and enemies will decrease due to the attack. In this scenario, each agent is partially observable, which means that it could only get the information within its sight range. The observation mainly contains the following attributes for both allies and enemies: distance, relative_x, relative_y, health, shield, and unit_type. The global state mainly contains the above information for all units, both agents and enemies. Details of the observation and state are provided in the Appendix A. Each agent has the following actions: move[direction], stop, and attack[enemy_id]. Each enemy is controlled by the built-in StarCraft II AI, which uses hand-crafted scripts. We set the difficulty of built-in AI as “very difficult”.
We take the scenario in Fig. 3
(a) as an example to show more details about the uncertainty in StarCraft II micro-management. In this scenario, there are three agents and three enemies at the beginning. Each agent receives two kinds of observations. One kind is environment-oriented represented by a tensor of length 42. It contains the information of agent self (8), agent allies and enemies (), and the one-hot coding of agent last action (9). The other kind is unit-oriented represented by a collection of 3 tensors of length 5. Each tensor describes the information of an enemy (5) observed by this agent. Then, agents select actions from their action sets according to these observations. Their action sets contain the following actions: move[up], move[down], move[left], move[right], stop, attack[enemy_0], attack[enemy_1], and attack[enemy_2].
Each agent evaluates actions by the individual action-value network described before. This network takes environment-oriented observations (42) and unit-oriented observations () as input, and outputs the values of actions (). The values of 6 environment-oriented actions and 3 unit-oriented actions are computed by the separate streams. If an enemy dies in combats, the size of unit-oriented observations will become , and thus the unit-oriented stream just outputs the values of attack actions towards the remaining two enemy units. In this way, the output dimension of the individual action-value network becomes .
During training, UNMAS samples from the replay buffer and uses the self-weighting mixing network shown in Fig. 1 to compute the joint action-value of the multi-agent system. The input dimension of this network is 3, which corresponds to the number of agents on the map. Furthermore, if an agent dies later in combat, the individual action-value network provides only the action-values of the remaining two agents. Therefore, the input dimension of self-weighting mixing network becomes 2.
At each timestep, agents perform their actions in the decentralized way and receive a global reward from the environment. SMAC provides positive rewards by default, that is, the damage done by agents to enemy units. In addition, the positive (+10) reward is also provided after an enemy is killed. We evaluate the method by running 32 episodes every 10000 timesteps to get the test winning rates. The agents use -greedy to choose their action and turn it off in testing. The exploration rate decays from 1 to 0.05.
where is the parameter of the newtork representing the individual action-value function. QMIX employs a mixing network to represent the joint action-value function. This network takes the action-value of all agents as input and the joint action-value as output, where is its parameter. By being taken absolute values, the weights of the mixing network keep non-negative. QTRAN factorizes the joint action-value by designing a special learning objective. Therefore, it can transform the original joint action-value function into a new, easily factorizable one with the same optimal actions in both functions. ASN considers the action semantics between agents to compute the action-values and reconstruct the observation of agent at timestep as follows: , where is the observation about environment, is the private information about agent itself, and is the observation of agent to other agent .
Experiments are performed on the following symmetric maps, where agents and enemies have the same numbers and types: 3 Marines (), 8 Marines (), 2 Stalkers and 3 Zealots (), 3 Stalkers and 5 Zealots (). Besides, the asymmetric maps including 5 Marines against 6 Marines (), 3 Stalkers and 5 Zealots against 3 Stalkers and 6 Zealots () are also chosen for comparison. The description of these units is provided in Table I.
These maps are provided by SMAC and could test the performance of UNMAS on StarCraft II micro-management scenario. VDN , QMIX , and QTRAN  are commonly used for comparison in CTDE methods and have already been implemented in SMAC. The code of ASN 
is also open-source. Besides, the detailed implementation of networks and hyper parameters are provided in Appendix TableB.1.
Obtained by the experiments that we conduct.
Obtained by the results provided in literature.
Iv-B Main Results
We apply these methods on the maps, and choose the test winning rate as the comparison metric. Each experiment is repeated three times for average results, and the learning curves are shown in Fig. 4.
[labelsep = .5em, leftmargin = 0em, itemindent = 2em]
Symmetric Scenarios: The maps with symmetric setting include: , , and .
[leftmargin = 2em]
Homogeneous Scenarios: and . In these scenarios, there is only one type of unit: Marine. Therefore, the individual action-value network only needs to represent the policy of one type of unit. As shown in Fig. 4(a) and Fig. 4(d), all of the methods quickly achieve a winning rate close to 100%. The curve of UNMAS starts rising slowly, but still achieves a higher winning rate faster than other methods.
Heterogeneous Scenarios: and . In these scenarios, there are two types of units: Zealot and Stalker, so the individual action-value network needs to represent the policies of different types of units. Different types of units have different roles in combat, so heterogeneous scenarios are more difficult than homogeneous scenarios. As shown in Fig. 4(b) and Fig. 4(e), UNMAS achieves the highest winning rate on these maps, especially . The map is more difficult than , because the increase in the number of units makes the multi-agent system harder to control. In the experiment, VDN and ASN can not perform well, and QTRAN fails to win. Only UNMAS and QMIX can win combats stably.
Asymmetric Scenarios: The maps with asymmetric setting include: and . It means that the number of enemies is greater than that of own agents.
[leftmargin = 2em]
Homogeneous Scenarios: . In this scenario, 5 Marines controlled by the algorithms have to combat against 6 enemy Marines. Even if there is only one difference in the number, the control difficulty in order to win increases considerably. Therefore, the policies of agents are required to be more elaborate in order to win. A more elaborate policy means that the agents make fewer mistakes. As shown in Fig. 4(c), no method achieves 100% winning rate. Among the tested methods, UNMAS achieves the highest winning rate, which means that the multi-agent system using UNMAS is more possible to achieve cooperation and choose correct actions.
Heterogeneous Scenarios: . It is an asymmetric and heterogeneous scenario, the most difficult of all. With an extra Zealot, the enemy is better able to block our Zealots and attack our important damage dealer Stalkers. Therefore, the multi-agent system not only needs to ensure the stability of its policy but also explores a better policy to win. As shown in Fig. 4(f), UNMAS achieves the highest winning rate.
Throughout the plot in Fig. 4, it is shown that UNMAS achieves uniform convergence on all experimental maps, and is especially superior on the most difficult scenario 3s5z_vs_3s6z. The final winning rates of different methods are listed in Table II. Compared with QMIX and other methods, we provide a more flexible network structure to represent the joint action-value function, so it is more suitable for training on unshaped scenarios. As for the design of the individual action-value network, ASN uses the GRU layer in unit-oriented stream, while we remove it. Since we are considering a Dec-POMDP especially with limited sight range, a unit wandering close to an agent’s sight range will cause it to receive the unit’s observations intermittently. Therefore, it may lead to a wrong computation of the hidden state for GRU layer and have a negative effect on the strategy of agent.
Besides, for other state-of-the-art MARL methods, due to the limits of reproduction, we only compare with the results provided in their literature, and show them in Table II. MADDPG  provides a centralized critic for the whole system and a group of decentralized actors for each agent. Qatten  designs a multi-head attention network to approximate joint action-value function. RODE  allows agents with a similar role to share similar behaviors. QPD  employs integrated gradients method to factorize the joint action-value of multi-agent system into individual action-values of agents. QPLEX  takes a duplex dueling network to factorize the joint action-value.
The results shown in Table II are the average winning rates after 2 million timesteps. In the article of RODE, the experiment on most maps is the result of training 5 million timesteps, we run RODE on each map and test its winning rate at 2 million timesteps. Since MADDPG does not experiment on StarCraft II micro-management scenarios, we compare with the results provided by , in which the authors implement several MARL methods. Although these methods achieve similar performance to us in symmetric maps, UNMAS still has obvious advantage in the most difficult scenario 3s5z_vs_3s6z. These results indicate that UNMAS is still competitive among those state-of-the-art methods.
Iv-C Ablation Results
In order to investigate the effect of (i) the weight , (ii) the value in the self-weighting mixing network, and (iii) the concat operation in the individual action-value network, we conduct ablation experiments on three maps: , and .
The effect of weight . We remove the weight in the self-weighting mixing network and replace the joint action-value with the following equation:
which denotes that the weight of each agent is set to 1 in any case. We refer to this method as UNMAS-ADD. Fig. 5 shows that the winning rate of self-weighting mixing network decreases under the condition of fixed weights . One possible explanation is that because the weights are fixed, the self-weighting mixing network cannot correctly estimate the true joint action-value based on the contribution of each agent to the joint action-value.
Fig. 6: Two screenshots of the combat on the map. The weight ratio is marked on the position of each agent .
In order to illustrate the effect of specifically, we provide two screenshots of the combat on the map and mark the weight ratio of each agent as shown in Fig. 6. The screenshots indicate that agents have different contribution to the joint action-value. When there is no close combat between two sides as shown in Fig. 6(a), the long-range unit Stalker is more important. Its average weight of 0.186 is larger than Zealot’s 0.073. Once they are fighting hand-to-hand as shown in Fig. 6(b), the short-range unit Zealot becomes vital. Its average weight of 0.120 is larger than Zealot’s 0.092. Besides, within the same type of units, agents get larger weights if there are more enemies around them. Taking the Zealots in Fig. 6(b) as an example, the unit surrounded by enemies has larger weight (0.162) than the one that is alone (0.095).
The effect of value . In the second experiment, we remove the value in the joint action-value. Therefore, the joint action-value can be calculated by the following formula:
We refer to this method as UNMAS-NV. Fig. 5 shows that the introduction of increases the efficiency of approximation, which leads to higher winning rate. It indicates that the lack of a bias term makes it more difficult for the self-weighting mixing network to approximate the joint action-value function.
The effect of the concat operation. In the third experiment, we remove the concat operation in the individual action-value network. It means that the Q values used to evaluate unit-oriented actions only depend on the observations of target units rather than the observation history. We refer to this method as UNMAS-NCAT. Fig. 5 shows that the concat operation is critical to the performance of the agent. The winning rate of UNMAS-NCAT in ablation experiments is much lower than UNMAS.
According to the ablation experiments, we figure out the importance of the weight , value , and the concat operation. The reason that UNMAS achieves the highest winning rate becomes clear. In the factorization of joint action-value, UNMAS provides the weights for each alive agent and ignores the agents that are killed by enemies, which leads to a more proper factorization. The bias term also helps approximate the joint action-value function. In estimating the action-value of an agent, UNMAS evaluates the actions in two different subsets respectively with the help of the concat operation, making the evaluation more accurate.
Iv-D Strategy Analysis
To understand what UNMAS has learned to achieve the performance, we analyze the strategies of agents using UNMAS according to the combat replay in this subsection.
[labelsep = .5em, leftmargin = 0em, itemindent = 2em]
Homogeneous Scenarios: , and . In these scenarios, the combat is conducted between Marines. Next is the analysis of the strategies executed by the multi-agent system.
[leftmargin = 2em]
More to Fight Less: The multi-agent system adjusts the formation to form a situation where more agents attack fewer enemies in the combat. It is a basic strategy for micro-management scenario. Taking an example, as shown in Fig. 7(a), agents try to concentrate on attacking an enemy Marine. The red line indicates that the agent is attacking. By adopting this strategy, the multi-agent system is able to eliminate the enemies as quickly as possible to reduce the damage caused by them.
Damage Sharing: The agents with higher health share the damage for agents with lower health. Since only alive agents can cause damage to enemies, it is important to ensure the survival of agents who is in danger. As shown in Fig. 7(b), when the health of the agent is low, it retreats a distance from the enemies to allow the other agents to share the damage. The white line indicates that the agent is moving. At the same time, the agents around it step forward in the enemy’s direction to ensure successful damage sharing. By adopting this strategy, the agents are able to survive longer to maximize the damage they cause.
In the homogeneous scenarios, the multi-agent system performs the above strategies to defeat the enemies. Although other methods like QMIX can also learn these strategies, the agents using UNMAS make fewer mistakes.
[labelsep = .5em, leftmargin = 0em, itemindent = 2em]
Heterogeneous Scenarios: , and the most difficult map . In these scenarios, the combat is conducted between two types of units: Zealot and Stalker. The former is short-range and the latter is long-range. For scenarios where units have different roles, the multi-agent system not only needs to execute the strategies analyzed above but also needs new strategies to accommodate the change. Next is the analysis of the strategies executed by the multi-agent system.
[leftmargin = 2em]
Block Enemies: The Zealots try to block the enemy Zealots to protect the Stalkers. Since the Stalker is a long-range unit, it is able to cause damage to the enemies without being attacked. As shown in Fig. 7(c), the multi-agent system using UNMAS learns the strategy of placing the Zealots between Stalkers and enemies to ensure the safety of Stalkers. The yellow line is the defensive line formed by Zealots. Through this strategy, the multi-agent system can maximize its damage as much as possible.
Defensive Counterattack: Agents focus on eliminating enemy Zealots who break through the defensive line as a defense, and then continue their previous attack as a counterattack. In the actual combat, the defensive line may not completely separate the enemies from Stalkers. As shown in Fig. 7(d), the multi-agent system using UNMAS learns to attack the enemy who breaks through the defensive line. They also perform a more to fight less strategy to eliminate enemies as quickly as possible. In addition, sometimes one Stalker chooses to attack the enemies at the edge of the battlefield to disperse pressure from other allies.
It should be noted that, in the heterogeneous scenarios, the multi-agent system not only learns the strategies mentioned above, but also learns more to fight less and damage sharing as in homogeneous scenarios. Other methods all fail in because they just perform the more to fight less strategy as in homogeneous scenarios, while UNMAS achieves 28% winning rate because of the above strategies.
This paper proposes UNMAS, a novel multi-agent reinforcement learning method that is more adaptable to the unshaped scenario, in which the number of agents and the size of action set change over time. UNMAS factorizes the joint action-value by mapping Q values nonlinearly and calculating its weights in the joint action-value for each agent. We theoretically analyze that the value factorization of UNMAS meets the IGM condition. In order to adapt to the change in the size of action set, the individual action-value network uses two network streams to evaluate the actions in environment-oriented subset and unit-oriented subset.
We compare UNMAS with VDN, QMIX, QTRAN, and ASN in StarCraft II micro-management scenario. Our results show that UNMAS achieves state-of-the-art performance among tested algorithms and also learns effective strategies in the most difficult scenario that other algorithms fail in.
The authors would like to thank Professor Hongbin Sun of Xi’an Jiaotong University for his suggestions.
Appendix A Environmental Settings
We use SMAC as the experimental environment. Alive agents obtain their local observations from environment and execute their actions. The observation provided by SMAC consists of the information about agent self, other agents, and the enemies within sight range. In detail, the information contains the following elements:
Distance: the distance between agent and other units;
Relative coordinates: the relative coordinates of x and y between agent and other units;
Health: the health percentage of agent and other units;
Shield: the shield percentage of agent and other units;
Unit type: the one-hot coding for the unit type of agent and other units;
Last action: the action executed by agent at last timestep;
Agent Index: the index used to distinguish agents.
Similarly, the global state also provides the above information. However, the difference is that the relative information takes the center point of the map as the reference point. The information included in the state contains all the alive agents on the map instead of those only within the sight range.
Appendix B Parameter Settings
In the experiments, all methods adopt the same hyper parameters, which are shown in Table B.1, and are the default values in PyMARL.
|Training Settings||Size of Replay buffer D||5000 episodes|
|Batch size||32 episodes|
|Testing interval||10000 timesteps|
|Target update interval||200 episodes|
|Maximum timesteps||2 million timesteps|
|Exploration rate||1.0 to 0.05|
|Network Settings||Self-weighting mixing network unit||32|
|Hyper network unit||64|
|GRU layer unit||64|
The hypernetwork of UNMAS, which is used to calculate the weights and biases of self-weighting mixing network, adopts the same settings as QMIX.
, the final element of self-weighting mixing network, is the output of a network with two layers and one ReLU activation. Other parameters related to the networks are also shown in TableB.1.
-  (2013) An overview of recent progress in the study of distributed multi-agent coordination. IEEE Transactions on Industrial informatics 9 (1), pp. 427–438. Cited by: §I.
On the properties of neural machine translation: encoder-decoder approaches. In Workshop on Syntax, Semantics and Structure in Statistical Translation, Cited by: §III-B.
-  (2016) Fast and accurate deep network learning by exponential linear units. In International Conference on Learning Representations, Cited by: §III-A.
-  (2018) Counterfactual multi-agent policy gradients. In Proceedings of the 32nd AAAI Conference on Artificial Intelligence, Cited by: §I-B, §I.
-  (2017) Cooperative multi-agent control using deep reinforcement learning. In International Conference on Autonomous Agents and Multiagent Systems, pp. 66–83. Cited by: §I-B, §I.
Grid-wise control for multi-agent reinforcement learning in video game ai.
International Conference on Machine Learning, pp. 2576–2585. Cited by: §I-B.
-  (2019) Multi-agent reinforcement learning for efficient content caching in mobile D2D networks. IEEE Transactions on Wireless Communications 18 (3), pp. 1610–1622. Cited by: §I.
-  (2020) Deep reinforcement learning-based automatic exploration for navigation in unknown environment. IEEE Transactions on Neural Networks and Learning Systems 31 (6), pp. 2064–2076. Cited by: §I.
-  (2019) Efficient ridesharing order dispatching with mean field multi-agent reinforcement learning. In The World Wide Web Conference, pp. 983–994. Cited by: §I.
-  (2019) Spectrum sharing in vehicular networks based on multi-agent reinforcement learning. IEEE Journal on Selected Areas in Communications 37 (10), pp. 2282–2292. Cited by: §I.
-  (2016) Continuous control with deep reinforcement learning. In International Conference on Learning Representations, Cited by: §I-B.
-  (2017) Multi-agent actor-critic for mixed cooperative-competitive environments. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 6382–6393. Cited by: §I-B, §IV-B.
-  (2015) Human-level control through deep reinforcement learning. nature 518 (7540), pp. 529–533. Cited by: §I-B.
-  (2016) A concise introduction to decentralized pomdps. Vol. 1, Springer. Cited by: §II-A.
-  (2018) Lenient multi-agent deep reinforcement learning. In International Foundation for Autonomous Agents and Multiagent Systems, pp. 443–451. Cited by: §I-B, §I.
-  (2020) Comparative evaluation of multi-agent deep reinforcement learning algorithms. arXiv preprint arXiv:2006.07869. Cited by: §IV-B.
-  (2017) Multiagent bidirectionally-coordinated nets: emergence of human-level coordination in learning to play StarCraft combat games. arXiv preprint arXiv:1703.10069. Cited by: §I-B.
-  (2019) Optimal synchronization control of multiagent systems with input saturation via off-policy reinforcement learning. IEEE Transactions on Neural Networks and Learning Systems 30 (1), pp. 85–96. Cited by: §I-B.
-  (2018) QMIX: monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 4295–4304. Cited by: §I-B, §I, §I, §I, §III-A, §IV-A, §IV-A.
-  (2019) The StarCraft multi-agent challenge. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, pp. 2186–2188. Cited by: §IV-A.
-  (2017) Cooperative reinforcement learning for multiple units combat in StarCraft. In 2017 IEEE Symposium Series on Computational Intelligence, pp. 1–6. Cited by: §I.
StarCraft micromanagement with reinforcement learning and curriculum transfer learning. IEEE Transactions on Emerging Topics in Computational Intelligence 3 (1), pp. 73–84. Cited by: §I.
-  (2019) QTRAN: learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 5887–5896. Cited by: §I-B, §I, §I, §IV-A, §IV-A.
-  (2020) Formation control with collision avoidance through deep reinforcement learning using model-guided demonstration. IEEE Transactions on Neural Networks and Learning Systems. Cited by: §I.
-  (2020) Reinforcement learning with task decomposition for cooperative multiagent systems. IEEE Transactions on Neural Networks and Learning Systems. Cited by: §I-B.
-  (2018) Value-decomposition networks for cooperative multi-agent learning based on team reward. In International Foundation for Autonomous Agents and Multiagent Systems, pp. 2085–2087. Cited by: §I-B, §I, §IV-A, §IV-A.
-  (2017) Multiagent cooperation and competition with deep reinforcement learning. PloS One 12 (4), pp. 1–15. Cited by: §I-B, §I.
-  (1993) Multi-agent reinforcement learning: independent vs. cooperative agents. In Proceedings of the International Conference on Machine Learning, pp. 330–337. Cited by: §I-B.
-  (2018) A review of computational intelligence for StarCraft AI. In 2018 IEEE Symposium Series on Computational Intelligence, pp. 1167–1173. Cited by: §I, §I.
-  (2018) Reinforcement learning for build-order production in StarCraft II. In International Conference on Information Science and Technology, pp. 153–158. Cited by: §I.
-  (2020) QPLEX: duplex dueling multi-agent Q-learning. arXiv preprint arXiv:2008.01062. Cited by: §I, §IV-B.
-  (2020) ROMA: multi-agent reinforcement learning with emergent roles. In Proceedings of the 37th International Conference on Machine Learning, Cited by: §I-B, §I.
-  (2021) RODE: learning roles to decompose multi-agent tasks. In International Conference on Learning Representations, Cited by: §I-B, §IV-B.
-  (2020) Action semantics network: considering the effects of actions in multiagent systems. In International Conference on Learning Representations, Cited by: §I-B, §I, §IV-A, §IV-A.
-  (2020) From few to more: large-scale dynamic multiagent curriculum learning. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34, pp. 7293–7300. Cited by: §I-B, §I.
-  (2020) Q-value path decomposition for deep multiagent reinforcement learning. arXiv preprint arXiv:2002.03950. Cited by: §I, §IV-B.
-  (2020) Qatten: a general framework for cooperative multiagent reinforcement learning. arXiv preprint arXiv:2002.03939. Cited by: §I-B, §IV-B.
-  (2020) Multi-agent determinantal Q-learning. arXiv preprint arXiv:2006.01482. Cited by: §I-B, §I-B, §I.
-  (2018) Model-free reinforcement learning for fully cooperative multi-agent graphical games. In International Joint Conference on Neural Networks, pp. 1–6. Cited by: §I.
-  (2017) FMRQ—A multiagent reinforcement learning algorithm for fully cooperative tasks. IEEE Transactions on Cybernetics 47 (6), pp. 1367–1379. Cited by: §I.
-  (2019) Factorized Q-learning for large-scale multi-agent systems. In Proceedings of the First International Conference on Distributed Artificial Intelligence, pp. 1–7. Cited by: §I-B.
-  (2019) Adaptive optimal control of heterogeneous CACC system with uncertain dynamics. IEEE Transactions on Control Systems Technology 27 (4), pp. 1772–1779. Cited by: §I.
-  (2020) Online minimax Q network learning for two-player zero-sum markov games. IEEE Transactions on Neural Networks and Learning Systems. Cited by: §I-B.