{'fraction_non_alphanumeric': 0.031135488388376705, 'fraction_numerical': 0.008775819815614424, 'mean_word_length': 4.7821862348178135, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 2, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Learning to Simulate Self-Driven Particles System with Coordinated Policy Optimization

Self-Driven Particles (SDP) describe a category of multi-agent systems common in everyday life, such as flocking birds and traffic flows. In a SDP system, each agent pursues its own goal and constantly changes its cooperative or competitive behaviors with its nearby agents. Manually designing the controllers for such SDP system is time-consuming, while the resulting emergent behaviors are often not realistic nor generalizable. Thus the realistic simulation of SDP systems remains challenging. Reinforcement learning provides an appealing alternative for automating the development of the controller for SDP. However, previous multi-agent reinforcement learning (MARL) methods define the agents to be teammates or enemies before hand, which fail to capture the essence of SDP where the role of each agent varies to be cooperative or competitive even within one episode. To simulate SDP with MARL, a key challenge is to coordinate agents' behaviors while still maximizing individual objectives. Taking traffic simulation as the testing bed, in this work we develop a novel MARL method called Coordinated Policy Optimization (CoPO), which incorporates social psychology principle to learn neural controller for SDP. Experiments show that the proposed method can achieve superior performance compared to MARL baselines in various metrics. Noticeably the trained vehicles exhibit complex and diverse social behaviors that improve performance and safety of the population as a whole. Demo video and source code are available at: https://decisionforce.github.io/CoPO/


Introduction
Self-Driven Particles (SDP) describe a wide range of multi-agent systems (MAS) in nature and human society. In SDP, individual agent pursues its own goal and interacts with each other following simple local alignment, and then the population exhibits complex collective behaviors [55]. We commonly see the phenomena of collective behaviors, such as the flocking birds [4], molecular motors [8], human crowd [20,19], and the traffic system [23]. To understand and simulate such phenomena, researchers have developed a number of SDP models. For example, simple-rule based models [9] or Hydrodynamic equations based models [2,22] can simulate the SDP very well in an unconstrained environment with random movement and resemble complex behaviors such as schooling fish [15] and marching locusts [5]. However, in a more structured environment such as a particular traffic scene where the interactions of agents are time-varying and the environment is non-stationary, it is difficult to design manual controllers or use rules to recover the underlying collective behaviors.
When the interactive environment is available, reinforcement learning becomes a promising approach to learn the controllers for actuating the SDP. Recently, many multi-agent reinforcement learning (MARL) methods have been developed to play competitive multi-player games, such as Hide and Seek [1], Football [26], Go and other board games [41], and StarCraft [40]. However, it is challenging to apply the existing MARL to simulate SDP systems. One essential issue is that 35th Conference on Neural Information Processing Systems (NeurIPS 2021). each constituent agent in a SDP system is self-interested and the relationship between agents is constantly changing. As illustrated in Fig. 1A, the vehicles in the traffic system demonstrate social behaviors that are either cooperative or competitive depending on the situation. Meanwhile, the cooperation and the competition naturally emerge as the outcomes of the self-driven instinct and the multi-agent interaction. Thus it is difficult to generate those social behaviors through a top-down design. Furthermore, most of the MARL methods assume that the role of each agent is pre-determined and fixed within one episode. In cooperative MARL methods [39,48,12,11], all agents need to cooperate to maximize a joint scalar reward. However, the credit decomposition problem centered in such setting is not the major issue of simulating SDP systems, because each agent in SDP has its individual objective and the credit decomposition is no longer needed. On the other hand, directly applying independent learning [50,42] will lead to a group of agents with unreasonable behaviors that are aggressive or egocentric, since each agent is trained to maximize its own reward.
In order to simulate SDP systems, the coordination of the self-interested constituents is the major issue. The coordination of agents in MARL has been previously studied in the context of mixed cooperative and competitive tasks [28,45]. However, seldom works focus on the simulation of SDP systems. Taking the microscopic traffic simulation as an example, existing works focus on learning high-level controller to indirectly actuate vehicles [56], or using independent learner to train policies executing in the environments engaging a limited set of agents on simple scenes [37,65], without considering the coordination problem. Instead, we aim to control all the vehicles in the scene by operating on the low-level continuous control space. This allows a higher degree of freedom to learn diverse behaviors but poses a challenging continuous control problem. In this work we propose a novel MARL method called Coordinated Policy Optimization (CoPO) to facilitate the coordination of agents at both local and global levels. To evaluate the proposed method, as illustrated in Fig. 1, we construct five typical traffic environments as the testing bed. These environments contain rich interactions between agents and complex road structures. Besides, we develop three task-agnostic metrics to characterize different aspects of the learned populations. We show that the proposed CoPO method can achieve superior performance compared to the baselines. Noticeably, collective social behaviors that resemble real-world patterns emerge in the trained population. methods like MADDPG [34], QMIX [39], QTRAN [47], and COMA [12] are only applicable to discrete action space. We instead focus on learning policies for continuous control.
The independent PPO [42] and the Mean Field MARL [61] are two recent methods applied for continuous control in MARL. The Mean Field MARL method proposed by Yang et al. [61] approximates the value of global reward Q(s, a), a = [a 1 , ..., a N ] by agent-independent value functions Q i (s, a i ,ā N i ), whereā N i is the average action of the nearby agents around agent i. Following similar design but in the context of simulating SDP, we use the mean field to compute neighborhood reward and use that reward to enforce local coordination, instead of using mean field to factorize joint value via averaging actions as done in [61].
Traffic simulation. Simulating the macroscopic and microscopic traffic systems has been studied for decades [24]. As for the macroscopic traffic system where the dynamics of individuals is simple and the high-level characters of flow such as the traffic throughput are more concerned, early works focus on designing controllers to direct a fleet of vehicles into a dense and stable platoon [46,3]. CityFlow [62] and FLOW [59] use RL agents to steer the low-level controllers of vehicles in order to investigate the traffic phenomenon in large-scale macroscopic traffic flow. For microscopic system, researchers also use behavioral model [53] or hand-designed control laws [25,58] to control individual vehicles. Zhou et al. [65] propose SMARTS simulator to investigate the interaction of RL agents and social vehicles in atomic traffic scenes. Pal et al. [37] find the emergent road rules of MARL agents trained by simple independent learner, which are also shown in our experiments. In this work, we work on the traffic environments with complex real-world scenarios such as tollgate and parking lot. The traffic flow can contain more than 40 vehicles. In contrast to previous work, we also propose novel method to improve the collective motions that better simulate SDP systems.

Problem Setting
SDP system has two distinguishable properties: (1) each individual agent is self-interested, (2) the individual agent can vary to be cooperative or competitive with others within one episode and (3) the individual agent only actively interacts with its nearby agents.
To accommodate these properties, we formulate a SDP system as a set of Decentralized Partially Observable Markov Decision Processes (Dec-POMDPs) [17] represented by a tuple G =< E, S, A, P, R, ρ 0 , O, Z, γ >. E is the set of the agent indices. We define the active agent set at each environmental time step t as E t = {i 1,t , ..., i kt,t } ⊂ E wherein k t is the number of existing agents at this step. We consider a partially observable setting in which each agent can not access the environmental state s t and instead draws individual observation o i,t according to the local observation function o i,t = Z i (s t ) : S → O. The joint action space A t ⊂ A is composed of the union of all active agents' action spaces kt i=1 A i,t . Each agent i chooses its action a i,t ∈ A i,t following its policy a i,t ∼ π i (·|o t ). These actions form a joint action a t = {a i,t } kt i=1 ∈ A t causing a transition on the environmental state subjected to the state transition distribution P(s t+1 |s t , a t ). Each agent receives their individual reward from its reward function r i,t = R i (s t , a t ). ρ 0 is the initial state distribution and γ is the discount factor. So in test time our system is decentralized, where each agent is fed with its local observation and actuated by its policy and interacts with others.
Here we define the environmental episode τ = {(s t , a t , r 1,t , ..., r kt,t )} T t=0 , where T is the environmental horizon. An environmental episode thus contains a set of agent episodes: , wherein t s i and t e i denote the environmental steps when agent i enters and terminates, respectively. Suppose the policy π i is parameterized by θ i , the individual objective for each agent is defined as the discounted sum of individual reward (namely the individual return):

Individual Policy Optimization
To simulate SDP systems, a simple approach is the independent policy optimization (IPO) [42] where each agent maximizes individual objective as if in the single-agent environment. Denote the individual value function is t =t γ (t −t) r i,t ] and the corresponding advantage wherein a ¬i,t = {a i } kt j=1,j =i is the shorthand of other agents' actions, the policy gradient method computes the gradient of individual objective as [49]: [∇ θi log π θi (a i |s)A I i (s, a i , a ¬i )]. (1) As a common practice, in PPO algorithm [44] the clipped importance sampling factor ρ = π i,new (a i |s)/π i,old (a i |s) is used to mitigate the distribution shift occurred after the policy is updated for several epochs, wherein π i,old is the behavior policy that generate samples and π i,new is the latest policy parameterized by θ i . We call the resulting objective as the surrogate objective: is hyper-parameter. By conducting the stochastic gradient ascent on the surrogate objective w.r.t. the policy parameters, the expected individual return can be improved. In continuous control RL problem, both the state space and action space are high-dimensional. Therefore V I i is approximated using a neural network whose input is typically the local observation. In the centralized training and decentralized execution (CTDE) framework [34], the value function takes global information as input by concatenating all agents' local observations.

Coordinated Policy Optimization
In a SDP system each agent has its individual objective. However, if we simply maximize each individual reward, the system will have sub-optimal solutions where, for example, the agents will become aggressive and egocentric, jeopardizing the performance of the population and leading to critical failures. On the contrary, if we apply cooperative learning schemes [39,48] and consider the summation of individual reward as the joint objective, the trained agents will exhibit unreasonable behaviors such as sacrificing oneself to improve group reward, which is not expected in SDP systems. To find a balance, as illustrated in Fig. 2 and Algorithm in the Appendix, we devise a novel MARL algorithm called Coordinated Policy Optimization (CoPO) to facilitate the bi-level coordination of agents to learn the controllers of the SDP systems. Following the CTDE framework, during centralized training, we first propose individual learning objectives by local coordination (Sec. 4.1), a mechanism inspired by the fact that each individual agent is mostly affected by its nearby agents [61]. We coordinate agents' objectives in neighborhood by mixing rewards following a common social psychological principle. We further design the meta-learning technique to optimize the local coordination process, leading to the global coordination (Sec. 4.2) which can improve collective performance of the population.

Local Coordination
IPO only maximizes the individual objective (Eq. 1) which leads to egocentric policies that damage the overall performance of the population. However, in natural SDP systems, e.g. animal groups, there exists a certain level of cooperative behavior that not only benefits others, but also results better individual utility. To resemble such feature, we incorporate the ring measure of social value orientation [32,45], a common metric from social psychology, into our formulation of local coordination. Concretely, we define the Local Coordination Factor (LCF) as a degree φ ∈ [−90 • , 90 • ] describing an agent's preference of being selfish, cooperative, or competitive. 1 We then define the neighborhood reward as: N dn (i, t) defines the neighborhood of agent i within the radius d n at step t. Note that the neighborhood of agent is time-varying, therefore the the neighborhood reward can not be simply computed from a fixed set of agents across the episode. Weighted by LCF, the coordinated reward is defined as:  The LCF enables the local coordination in the optimization process. Supposing the agents maximize the coordinated reward with φ = 0 • , 90 • , −90 • , the agents should become egoistic, altruistic, or sadistic respectively. Illustratively, Fig. 3 demonstrates an interesting preliminary result on a simple version of Roundabout environment. During IPO training, we randomly select φ ∼ U(0 • , 90 • ) and assign it to each agent in each episode. Current φ is fed to policy as extra observation. In test time, we run the trained population for multiple runs. In each run we set a fixed LCF for all agents. The test results show that a peak of success rate at certain LCF at test time. This suggests that increasing the awareness of neighbors' interests when training individual agents will propose better policies that increase the collective performance. IPO might lead to sub-optimal policies since the individual objectives never consider local coordination with other agents.
In order to incorporate the LCF into training process to improve the population performance, apart from the value function approximator for the individual reward (Sec. 3.2), we use another value function to approximate the discounted sum of the neighborhood reward and the neighborhood advantage is therefore calculated as: The coordinated advantage can be derived as: We now have the coordinated objective, which takes the utilities of neighbors into consideration, as follows: We follow a similar training procedure as IPO in Sec. 3.2 with the advantage replaced by the coordinated advantage. To improve diversity, we use distributional are the learnable parameters of the LCF distribution.

Global Coordination
The major challenge of local coordination is the selection of LCF. Though the experiment in Fig. 3 shows that there exists an optimal LCF that can maximize the population success rate, it is laborious to search for such LCF. We therefore introduce global coordination which enables automatic search of the best LCF distribution to improve population efficiency.
In this section, we introduce how we accomplish global coordination with bi-level optimization method that computes a meta-gradient of the global objective. We first define the global objective that indicates the performance of a population: wherein E τ,t denotes the active agents at environmental time step t of the episode τ . Here we remove γ since it is ambiguous when the start steps of agents are not aligned. Eq. 6 can not be directly optimized when computing policy gradients of individual policies' parameters.
We introduce the concept of individual global objective to make the optimization of the global objective feasible. By this way, we can turn the system-level optimization process into agent-level optimization processes, so that the individual agent's data can be easily accessed. We factorize such that maximizing the objective for each agent i is equivalent to maximizing Eq. 6. The individual global objective is defined as: If we introduce the global reward r G = j∈Eτ,t r j,t /|E τ,t | as the average reward of all active agents at step t, then this objective is the cumulative global reward in the time interval when agent i is alive. Proposition 1 (Global objective factorization). Suppose each agent i ∈ E can maximize its individual global objective J G i , then the original global objective J G is maximized.
We prove that such factorization does not affect the optimality of global objective in Appendix.
To improve global objective via optimizing LCF, we need to compute the gradient of Eq. 7 w.r.t. Φ. Denote the parameters of policies before and after optimizing Eq. 5 as θ old i and θ new i respectively, we can compute the gradient applying the chain rule as: The 1st term resembles the policy gradient as Eq. 2 with the objective replaced by J G i : Here we use an extra global value function V G to estimate the value of global reward r G , then compute the global advantage A G . The samples (s, a) are generated by the behavior policy θ old i . By following first-order Taylor expansion, the 2nd term can be computed as follows. Note that Averaging over all agents and combining Eq. 9 and Eq. 10, we can derive the LCF objective as: We then conduct stochastic gradient ascent on J LCF w.r.t. Φ with learning rate α.
The detailed procedure of CoPO is given in Appendix. In our implementation, we follow the commonly used parameter sharing technique [52] so that all agents share the same set of neural networks, which guarantees the scalability of our method. As a summary, our method totally employs 4 neural networks: the policy network, the individual value network, the neighborhood value network, and the global value network. The input to all networks is always the local observation of the agent. Our further study (see Sec. 5.5) shows that centralized critic method, which feeds global information to the value networks, does not yield better performance and usually causes unstable training. The reason might be the time-varying input to the centralized critics, that the combined observation of nearby agents is always changing and doesn't hold a temporal consistency across the episodes.

Evaluation Platform
We develop a set of 3D traffic environments to evaluate MARL methods for simulating SDP systems based on MetaDrive [30], a lightweight and efficient microscopic driving simulator 2 . The environments are developed in Panda3D [16] and Bullet Engine, which can run 80 FPS on a standard workstation. Examples of the environments are shown in Fig. 1. The descriptions and typical settings of the five traffic environments are as follows: Roundabout: A four-way roundabout with two lanes. 40 vehicles spawn during environment reset. This environment includes merge and split junctions.
Intersection: An unprotected four-way intersection allowing bi-directional traffic as well as U-turns. Negotiation and social behaviors are expected to solve this environment. We initialize 30 vehicles.
Tollgate: Tollgate includes narrow roads to spawn agents and ample space in the middle with multiple tollgates. The tollgates create static obstacles where the crashing is prohibited. We force agent to stop at the middle of tollgate for 3s. The agent will fail if they exit the tollgate before it is allowed to pass. 40 vehicles are initialized. Complex behaviors such as deceleration and queuing are expected. Additional states such as whether vehicle is in tollgate and whether the tollgate is blocked are given.
Bottleneck: Complementary to Tollgate, Bottleneck contains a narrow bottleneck lane in the middle that forces the vehicles to yield to others. We initialize 20 vehicles.
Parking Lot: A compact environment with 8 parking slots. Spawn points are scattered in both parking lots and external roads. 10 vehicles spawn initially. In this environment, we allow agents to back their cars to spare space for others. Maneuvering and yielding are the key to solve this task.
Those environments cover several scenarios in previous simulators [65,37] but are extended with real-world scenarios rather than atomic scenes. Besides, our environments support dense traffic flow where all vehicles are controlled through the low-level continuous signals. All the environments can be further concatenated to form more complex tasks for the future study of multi-task learning.
Evaluating a population simulated by MARL is an open question. In this work, we define a set of general-purpose metrics that can characterize different aspects of the SDP systems. We choose three episodic metrics with minimal assumptions on the tasks. We evaluate the competence of population with success rate. It is the ratio of the number of agents that reach their goals over the total number of agents in one episode. We also evaluate the efficiency of the population. It indicates the difference between successes and failures in a unit of time (N success − N failure )/T . It is possible for a population to achieve high success rate but has low efficiency, because the agents in the population are running in very low velocity. The third metric we adopt here is the safety. It is defined as the total number of critical failures for all agents in one episode.

Experiment Setting
We compare the independent policy optimization (IPO) method [42] using PPO [44] as the individual learners. We further encode the nearby agents' states into the input of value functions (centralized critics) following the idea of Mean Field MARL [61] and form the mean field policy optimization (MFPO). We examine different variants of centralized critics, but find MFPO yields best performance (see Sec. 5.5). The curriculum learning (CL) [36] is also a baseline, where we chunk the training into 4 phases and gradually increase initial agents in each episode from 25% to 100% of the target number.
We conduct experiments with the aforementioned environments and algorithms using RLLib [31], a distributed learning system which allows large-scale parallel experiments. Generally, we host 4 concurrent trials in an Nvidia GeForce RTX 2080 Ti GPU. Each trial consumes 2 CPUs with 4 parallel rollout workers. Each trial is trained over roughly 1M environmental steps, which corresponds to about 55 hours in real-time transportation system and +2,000 hours of individual driving experience (assume averagely 40 vehicles running concurrently). All experiments are repeated 8 times with different random seeds. Other hyper-parameters are given in Appendix.    We also find the MFPO performs worse than the independent PPO in several environments. That might be due to the neighborhood changing all the time. Simply concatenating or averaging neighbors' states as the additional input to the value functions makes the training unstable. A detailed comparison of different design choices in centralized critics is given in Sec. 5.5. Fig. 4 presents the radar plots under the three metrics. In each environment, we normalize each metric to its maximal and minimal values in all evaluated episodes for all algorithms. For safety measurement, we use negative values of total crashes in normalization. We can see that CoPO achieves superior results across all three metrics. Noticeably, CoPO has a substantial improvement in safety, showing the importance of the bi-level coordination.

Main Results
To further evaluate the generalization of the populations, we run the trained policies in the test environments with different initial numbers of agents. As shown in Fig. 5, we find that in Roundabout and Intersection, where the interactions are extremely intensive, IPO and MFPO overfit to the initial number of agents. In the environment with sparse traffic, their performance is inferior to that in the environment with more agents. On the contrary, our method does not overfit these two environments. In Parking Lot, it seems that all methods has some degree of overfitting to the initial number of agents.
The results are consistent with the finding in [27], showing that strategies learned via a single instance of MARL algorithm can overfit to the policies of other agent in the population. In Appendix, we conduct an experiment using a simple heuristic to control part of the vehicles in the population to test the generalizability of different training methods. The experiment shows that CoPO trained agents are robuster than IPO trained ones when interacting with vehicles controlled by unseen policies. It is left to future work on improving the generalization of MARL methods.  population trained from other methods tend to directly rush into the center of Intersection, causing severe congestion and frequent crashes. On the contrary, the population from CoPO tends to drive collectively and successfully avoid crashes through social behaviors such as yielding, with superior success rate and high safety. The qualitative result suggests that CoPO can resemble the collective motions widely existing in SDP systems [63]. Fig. 7 further visualizes the temporal behaviors of CoPO agents in 5 environments. Each vehicle in the population tends to drive socially and react to its nearby vehicles. A set of diverse behaviors emerge through the interactions, including socially compliant behaviors such as yielding, queuing, and even reversing to leave more room to others, as well as aggressive behaviors such as cutting in and rushing. The population trained from CoPO successfully reproduces diverse interaction behaviors in traffic systems.

Ablation Studies
We evaluate different variants of centralized critics in Roundabout environment. The Concat variant refers to simply concatenating all states of nearest K=4 agents as a long vector fed to the value networks. The Mean Field method uses the average of the states from nearby agents within a given radius (we use 10 meters). The CF refers to "counterfactual", namely adding the neighbors' actions accompanied with their observations as the input to value functions. Note that the Mean Field w/ CF method follows the Mean Field Actor Critic proposed in [61], the difference is that we use the training pipeline of PPO [43] in order to operate in continuous action space. As illustrated in Fig. 9, we find that the design with Mean Field is more stable compared to Concat. CF also stabilizes the training. We therefore report the results of Mean Field w/ CF as the MFPO method in Sec. 5.3. Fig. 8 plots the learning curves of CoPO with and without centralized critics. We find that CoPO with centralized critics yields inferior success rate and is unstable in some environments compared to the native CoPO. This might because nearby agents are always changing and doesn't hold the temporal consistency within episode.   In Table 2(a), we validate the effectiveness of global coordination by replacing the LCF distribution with a given normal distribution during the course of training. The proposed method can yield better success rate than the result of manually defined fixed LCF distributions. In (b), we use IPO to maximize the global reward directly. Unfortunately, the training fails because it is hard to build the causal connection between individual's behavior with the average reward of all agents. In (c), we use IPO to maximize the neighborhood reward. This method performs poorer than CoPO since we balance the individual reward and the neighborhood reward.

Conclusion
In this work, we develop a novel MARL method called Coordinated Policy Optimization (CoPO) to incorporate social psychology principle to learn neural controller of SDP systems. Experiments on microscopic traffic simulation show that the proposed method can learn populations which achieve superior performance over the previous MARL methods in three general-purpose metrics. Interestingly, we find the trained vehicles exhibits complex and socially compliant behaviors that improve the efficiency and safety of the population as a whole.

Social Impact and Limitations
This work could help the development of intelligent transportation systems which would have a wide impact on society. We can analyze the emergent behaviors of the traffic under different scene structures and optimize the road structure or traffic light control to improve the traffic efficiency. Moreover, CoPO can simulate diverse traffic flow, which can be used to benchmark the generalizability of the autonomous driving systems. Besides simulating traffic flow, the proposed method is applicable for pedestrian crowd simulation to study social crowd behaviors as well as potential human stampedes and crushes.
This work focuses on decision-making problem, so we simplify the perception of the vehicles as one-channel LiDAR and assume the acquisition of accurate sensory data. In reality, the precise perception of the surroundings in self-driving remains very challenging. This work adopts 5 typical traffic scenarios in a simulator as the testbed, which are still far from emulating the complexity of real-world traffic scenes. In the future we will import real-world HD maps in the simulator to create more realistic scenarios. 3 Clear buffer D and store current policy πold ← π θ . 4 for t = 0, ..., T do 5 Assign each newly spawned agent i with φi ∼ N (φµ, φ 2 σ ). 6 at = [a1,t, ..., a k t ,t ], ai,t ∼ π θ (·|oi,t), ∀i = 1, ..., kt. 7 Step the environment with at and store the tuple (st, at, r1,t, ..., o1,t, ...) to D. Shuffle D and slice it into M batches. 10 Update π θ , V I η , V N ψ and V G ω following Eq. 5 for each mini batch. 11 for k = 1, ..., KΦ do 12 Update Φ following Eq. 11 with D.

B Proof of global objective factorization
The global objective can not be directly optimized when computing the policy gradients of individual policies' parameters. This is because when t < t s i or t > t e i , the agent i does not exist in the environment and therefore no samples (s, a i , a ¬i ) are there. Alternatively, we look for the factorization of the global objective such that optimizing it for each policy can converge to the optimal global objective.
We use the average rewards of all active agents at each time step as the individual reward for each agent. Concretely, we use the following individual global objective: We justify our choice by the following proposition and the proof: Proposition 2 (Global objective factorization). Supposing each agent i ∈ E can maximize its individual global objective J G i , then the original global objective J G is maximized.
Proof. We can easily show that: Since J G (θ 1 , θ 2 , ...) is the summation of J G i (θ i ), following the idea of [39], we have: This shows that increasing the individual global objective of each agent can increase the global objective. Therefore, is hold and maximizing the individual global objective of each agent is equivalent to maximizing the global objective.

C Details and comparison of the driving simulator
In all five environments proposed in this work, we initialize a given number of vehicles in random spawn points, and assign a destination to each of them randomly. Agents are terminated in three situations: reaching the destinations (called success), crashing with others or driving out of the road (called failure). The new vehicles spawn immediately after existing agents are terminated. Meanwhile, the terminated vehicles remains static for 10 steps (2s) in the original positions, creating impermeable obstacles. Crashing to dead vehicles is also considered as failure. This design enables the total number of vehicles to vary in time and exceed the the initial number of agents, which mimics real-world situation and brings more challenges.
The local observation of each vehicle contains (1) current states such as the steering, heading, velocity and relative distance to boundaries etc., (2) the navigation information that guides the vehicle toward the destination, and (3) the surrounding information encoded by a vector of 72 Lidar-like distance measures of the nearby vehicles. Vehicles are controlled by continuous steering and acceleration signals. The reward function only contains a dense driving reward for longitudinal movement to the destination and a sparse reward that incentives or penalizes the terminations.
MetaDrive [30] is a lightweight and efficient driving simulator implemented based on Panda3D [16] and Bullet Engine. Panda3D is an open-source engine for real-time 3D games, rendering, and simulation. Its well designed rendering capacity enables our simulator to construct realistic monitoring and observational data. Bullet Engine is a physics simulation system that supports advanced collision detection, rigid body motion, and kinematic character controller, which empowers accurate and efficient physics simulation. Empowered by the engine and our optimized implementation, our simulator can achieve high efficiency. In the Roundabout environment, where averagely 40 vehicles runs concurrently, our simulator achieves ∼50 FPS on PC during training. In the less populated environment such as the Parking Lot, where averagely 10 vehicles are running, our simulator can achieves ∼150 FPS. Our simulator will be open-sourced.
Apart from ours, there are lots of existing driving simulators that support RL research. The simulators CARLA [10], GTA V [35], and SUMMIT [6] realistically preserve the appearance of the physical world. For example, CARLA not only provides perception, localization, planning, control modules, and sophisticated kinematics models, but also renders the environment in different lighting conditions, weather and the time of a day shift. Thus the driving agent can be trained and evaluated more thoroughly. Other simulators such as TORCS [60], Duckietown [7] and Highway-env [29] abstract the driving problem to a higher level or provide simplistic scenarios as the environments for the agent to interact with. However, the aforementioned simulators are majorly designed for single-agent scenario, wherein the traffic vehicles are controlled by predefined models or heuristics.
In the MARL context, CityFlow [62] and FLOW [59] are two macroscopic traffic simulators that based on SUMO [33]. However, since these two simulators focus on different aspect of simulating the traffic system, they are not suitable to investigate the detailed behaviors of each learning-based agents.
MACAD [38] provides high-fidelity rendering as the observation based on CARLA. In our preliminary experiments, we have tried to use first-view camera to generate images as the observations, but we find that to be inefficient. So in this paper, we use the scalar states as well as Lidar-like measures as the observation for each agent, which also improves the efficiency of our simulator.
SMARTS [65] is a similar simulator to ours. According to the efficiency test 3 , 25 FPS is achieved when 10 agents are running with the scalar state observation as input. However, in our 10-agents environment Parking, our simulator can achieve 150 FPS on single PC even with the Lidar-like observations are feeding to each agent. Besides, our environments cover the major atomic scenes in SMARTS by creating several complex scenes that includes rich driving situations in each scene. For example, in the Tollgate environment, the agents need to learn not only interacting with others, but also interacting with the road infrastructure, the tollgates. They need to learn queueing and patient waiting in the tollgate until being allowed to pass.
The simulator used in [51] is not open-sourced, while our simulator and training code will be available to public. Besides, they only use one scene with relatively fewer vehicles. In [37], the environments are relatively simpler than ours, and the density of traffic are lower. Besides, using the low-level control in our work allowing the RL agents to apply continuous actuation to vehicles directly and learn more diverse behaviors. For example in the Intersection environment, though we do not invite traffic signals as in [37], the negotiation and other social behaviors naturally emerge as the outcome of the proposed CoPO algorithm.
In short, the driving simulator used in this work can run more flexibly and efficiently with complex environments and dense traffic flow. Table 3 summarizes the hyper parameters used in our experiments. LCF learning rate 0.0001 LCF number of SGD epochs K Φ 5 LCF distribution initial STD φ σ 0.1 LCF distribution initial mean φ µ 0.0 Table 4 summarizes the components used in CoPO. We use three value networks to estimate different cumulative rewards. Note that we do not apply centralized critics since its performance is unstable in SDP-like system due to the variation of local neighborhood. We also leverage a distributional LCF. The reason why we do not use a neural network to predict step-wise φ is that we consider the local coordination is a episode-level problem. A network predicting step-wise φ will introduce huge noise in the coordinated objective, which leads to undesired solutions. Finally, since we use parameter sharing [52] among all agents, the extra neural networks introduced by CoPO will not scale up with the increasing number of agents.   Figure 10: The learning curves of success rate of the populations trained by three approaches. Method CL Figure 11: The success rate of populations trained by Curriculum Learning. We split the training into 4 phases with different initial number of agents. The gray lines indicate the time step when we switch the initial number of agents in the environments. Fig. 10 and Fig. 11 plot the success rate curves of different algorithms. CoPO prevails in all environments. In most of the environment, MFPO shows slower convergence, because learning value function becomes harder as the input dimension is increased.

D Implementation details
In curriculum learning baseline, we vary the number of agents to 25%K, 50%K, 75%K and 100%K at different phases, wherein K is the initial number of agents at each episode. We find that increasing initial agents creates instant drops on the success rate, but the learning algorithm will soon cover. In all the environments except the Tollgate, the performance at the beginning of each phase shows clear downgrade. This makes sense since the tasks in later phase become harder. In Tollgate however, the major challenge is the interaction between agents and the environmental infrastructure the tollgates. This might be the reason why the performance at the final phase is better than the one at the first phase in Tollgate.

F Generalization experiments
To justify the generalizability of different training schemes, in test time, we use a simple heuristic to control 25%, 50% and 75% vehicles respectively in the scene. The heuristic we implemented is a rule-based policy which mixes the cruising, lane changing, emergency stopping behaviors with various driving models such as IDM and mobile policy.
In the following table, we can see that introducing heterogeneous policies severely damages the success rate of the IPO population. Noticeably, the CoPO population seems to be mildly affected by IDM policies. This result suggests that the proposed method, due to the distributional LCF in training, can yield more robust policies.   Cutting in is a common competitive behavior of human drivers, referring to that one vehicle rapidly rushes into the potential future trajectory of another vehicle in order to take priority. This is a kind of competitive behavior that only benefits the one who conducts it. It can increase the utility of the vehicle that does the cutting in but probably cause unpleasant sudden braking of other vehicles. In (a), the brown vehicle hopes to cut in the path of the blue vehicle, but the blue car sticks to the path. Therefore the crash happens. In (b), the green vehicle cuts in the path of the top blue vehicle, while the top blue vehicle yields to it. In (c), the gray vehicle takes over the original future lane of the brown vehicle because the brown vehicle gives up its path and changes to another lane.
Queueing is another common behavior, where vehicles line up to wait for passing. In (a) and (b), vehicles queue and wait for moving. In (c), which is the upper right corner of the Tollgate environment, vehicles queue for passing, since other vehicles have to stay inside the tollgate for a while.
Bypassing is a behavior that the drivers use another lane different from the current lane and drive fast to bypass some front vehicles. We find CoPO agents learn the bypassing policy to take over some slow front cars. In (b), the middle orange vehicle bypasses the right orange vehicle by slightly changing its direction. The middle vehicle shifts to its right-hand side a little bit and then rushes rapidly, in order to take over the right vehicle. Both (a) and (c) exhibit excellent lane-changing skills.
Yielding is one important cooperative behavior. The driver stops or even moves toward another direction to spare space for other vehicles to pass. Yielding harms short-term individual interest since the vehicle has to slow down or stop, but it improves long-term reward because crashing to other terminates the episode. The demonstrations in Yielding part of Fig. 13 contain complex interaction behaviors. In (a), three vehicles are negotiating who should go first. Note that we use the term "negotiation", but in fact, no explicit communication is implemented between agents. They have to respond to others only based on their own local observations. In (b), both orange vehicles yield to a pink vehicle. The upper left blue vehicle also yields to the middle orange vehicle when the orange vehicle is bypassing another orange vehicle. In (c), the green vehicle conducts a sudden brake, yielding to a yellow vehicle.