Search

Search papers and lessons

Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments

Ryan Lowe, Yi Wu, Aviv Tamar et al. · 2017

MADDPG gives each agent a critic that sees every agent's actions during training, so learning stays stable in mixed cooperative and competitive games while agents act on local observations alone.

On this page

  • Colour = topic mix
  • Reinforcement learning
  • Probability
  • Calculus
  • Discrete math
  • Linear algebra
  • Neural network basics
  • ReadReady to readNot yet

TL;DR

Lowe and colleagues show that standard reinforcement learning breaks down when several learning agents share one environment, because each agent's world keeps changing as the others learn. Their fix, MADDPG, gives every agent its own critic that sees the actions of all agents during training, while each agent's actor uses only its own observations. The method works in cooperative tasks, competitive tasks, and mixed ones, and the agents it trains can coordinate or deceive without any shared policy.

Builds on: Deep Deterministic Policy Gradient (DDPG), Centralized Training with Decentralized Execution, Partially Observable Markov Decision Process · Leads to: later multi-agent methods that give each agent a centralized critic, such as counterfactual multi-agent policy gradients (arXiv:1705.08926, cited by the paper)

Why it mattered

Many practical systems contain several learners at once, such as teams of robots that must coordinate or avoid each other. The paper gave a practical recipe for deep networks in these settings. It adopts "centralized training with decentralized execution" from earlier communication work and applies it to continuous control, with a separate critic for each agent. That separate critic is what lets the same method handle competitive games. The paper's environments are two-dimensional tasks with communication and physical interaction, released as open code.

History

By the mid 2010s deep reinforcement learning had reached human-level Atari play (Mnih and colleagues, 2015, cited as reference 24) and visuomotor robot control (Levine and colleagues, 2015). The multi-agent case was known to be harder. The paper cites independent Q-learning for multiple agents as an early approach (Tan, 1993) that does not perform well in practice. Deterministic policy gradients (Silver and colleagues, 2014) and DDPG (Lillicrap and colleagues, 2015) had just made deep continuous control practical. This paper combined the centralized-training idea from earlier communication work with the DDPG actor-critic and tested it on multi-agent tasks where the baselines failed.

The problem

Imagine two agents learning at the same time. Agent A learns to move left when agent B moves right. While B is still learning, its moves change, so from A's point of view the same action now leads to different results. The environment is no longer fixed, and the standard guarantees of Q-Learning assume a fixed environment. The paper states this as an assumption violation: the Markov property that Q-learning relies on fails when other learners' policies change.

Two specific failures follow.

  1. Replay breaks. Deep Q-learning uses an Experience Replay buffer to reuse old transitions. A transition recorded when B followed an old policy no longer describes the world as B now plays it. The paper notes that the replay buffer cannot be used naively because the transition probability depends on the other agents' policies.
  2. Policy gradients get noisy. A policy gradient method such as Policy Gradient scores an action by the reward it earned. In a team, that reward depends on what everyone else did, so the score for one agent's action jumps around from episode to episode.

The paper goes further and shows that the second problem gets worse with more agents, even in a one-step game with binary actions (Proposition 1 below).

How it works

We follow one small instance from start to finish. Two agents, A and B, each pick a number. Agent A's reward is 1 only when both picked the same number.

  1. Each agent has an actor. A's actor looks only at A's own observation and outputs an action. Likewise for B. Neither actor sees the other's action at test time. This is the decentralized part.
  2. Each agent also has a critic. A's critic is a function that takes the whole situation as input: A's observation, B's observation, and both chosen actions. It outputs a number for "how good is this situation for A". Check: the critic has 4 inputs in this tiny case, and it outputs one number.
  3. The critic is trained from experience. Each step is stored in a shared replay buffer that records everyone's observations and actions and every agent's reward. For a stored step, A's critic is trained to match a target: the reward A got, plus a discounted estimate of the next situation's value. The estimate uses the target actors, which are slowly moving copies of the actors, as in Target Network and Deep Deterministic Policy Gradient (DDPG).
  4. The actor is trained through its critic. A's actor is moved in the direction that makes its chosen action score higher under the critic. Because the critic sees B's action too, A's update accounts for what B is doing. The actor gradient is the deterministic policy gradient of Deterministic Policy Gradient, with the critic in the role that DDPG gives its single-agent critic.
  5. Only the actors are kept. After training, A and B run their actors on their own observations. The critics are discarded.

Check: if the critic is accurate, A's update pushes A toward whatever number B is likely to pick. That is exactly the coordination a single-agent learner could not see.

The diagram below summarises the split. Each actor reads only its own observation. Each critic reads everything.

flowchart LR
  subgraph Training
    O1["Observation of agent 1"] --> A1["Actor 1"]
    O2["Observation of agent 2"] --> A2["Actor 2"]
    A1 --> Act["All actions"]
    A2 --> Act
    X["All observations and actions"] --> C1["Critic 1"]
    X --> C2["Critic 2"]
    C1 -. "trains" .-> A1
    C2 -. "trains" .-> A2
  end
  subgraph Execution
    L1["Own observation only"] --> E1["Actor 1"]
    L2["Own observation only"] --> E2["Actor 2"]
  end

The math

The setting is a partially observable Markov game (see Partially Observable Markov Decision Process). There are NN agents. Agent ii has an observation oio_i, an action aia_i, and its own reward rir_i. The full state is x\mathbf{x}, which may be the tuple of all observations, x=(o1,…,oN)\mathbf{x} = (o_1, \ldots, o_N). Each agent ii has a deterministic policy μi\mu_i with parameters θi\theta_i, and each agent wants to maximise its own expected discounted return with discount factor γ\gamma.

Step 2 in symbols: the centralized critic

Agent ii has its own action-value function Qiμ(x,a1,…,aN)Q^{\mu}_i(\mathbf{x}, a_1, \ldots, a_N). It takes the state and the actions of all agents and returns the value for agent ii. Because each agent has its own critic, the agents' reward functions can differ, which is what lets competitive games work.

Step 4 in symbols: the actor gradient

The paper writes the gradient for agent ii's actor as

∇θiJ(μi)=Ex,a∼D[∇θiμi(oi) ∇aiQiμ(x,a1,…,aN)∣ai=μi(oi)].\nabla_{\theta_i} J(\mu_i) = \mathbb{E}_{\mathbf{x}, a \sim \mathcal{D}} \left[ \nabla_{\theta_i} \mu_i(o_i) \, \nabla_{a_i} Q^{\mu}_i(\mathbf{x}, a_1, \ldots, a_N) \big|_{a_i = \mu_i(o_i)} \right].

Read the right side as a chain. The first factor says how changing θi\theta_i changes agent ii's action. The second factor says how changing that action changes the centralized value. The expectation is over stored experience in the replay buffer D\mathcal{D}.

Step 3 in symbols: the critic loss

The critic is fit by minimising

L(θi)=Ex,a,r,x′[(Qiμ(x,a1,…,aN)−y)2],\mathcal{L}(\theta_i) = \mathbb{E}_{\mathbf{x}, a, r, \mathbf{x}'} \left[ \left( Q^{\mu}_i(\mathbf{x}, a_1, \ldots, a_N) - y \right)^2 \right],

with the target

y=ri+γ Qiμ′(x′,a1′,…,aN′)∣aj′=μj′(oj).y = r_i + \gamma \, Q^{\mu'}_i(\mathbf{x}', a'_1, \ldots, a'_N) \Big|_{a'_j = \mu'_j(o_j)}.

Here μ′\mu' are the target policies, copies of the actors whose parameters move slowly toward the current ones. The paper uses the same slow-update idea as DDPG, with a rate of τ=0.01\tau = 0.01 in its experiments.

Step 4b: the ensemble objective

To make the policies robust, each agent ii keeps KK sub-policies μi(k)\mu_i^{(k)}. At each episode one sub-policy is drawn uniformly at random. The objective becomes

Je(μi)=Ek∼unif(1,K), s∼pμ, a∼μi(k)[Ri(s,a)],J_e(\mu_i) = \mathbb{E}_{k \sim \mathrm{unif}(1,K),\, s \sim p^{\mu},\, a \sim \mu_i^{(k)}} \left[ R_i(s, a) \right],

and each sub-policy gets its own replay buffer Di(k)\mathcal{D}_i^{(k)}. The gradient for sub-policy kk is the same as above, scaled by 1K\frac{1}{K}.

Proposition 1 in symbols: why policy gradients get noisy

Take NN agents, each choosing 1 with probability θi\theta_i. The reward is 1 only if everyone picks 1, which is the proof's case. At the start, θi=0.5\theta_i = 0.5 for all ii. The proof shows the expected reward is (0.5)N(0.5)^N, and the probability that one sample of the policy gradient points in the right direction is also (0.5)N(0.5)^N. The paper's final line gives exactly P(⟨∇^J,∇J⟩>0)=(0.5)NP(\langle \hat{\nabla} J, \nabla J \rangle \gt 0) = (0.5)^N. More agents, lower chance of a useful step.

Worked examples

Example
Example 1: one critic target, by hand

Suppose agent A receives reward rA=1r_A = 1 on a step, the discount is γ=0.9\gamma = 0.9, and the target critic estimates the next situation at QA′=5Q'_A = 5. These numbers are illustrative, not from the paper.

  1. The target is y=rA+γQA′y = r_A + \gamma Q'_A.
  2. Substitute: y=1+0.9×5y = 1 + 0.9 \times 5.
  3. Multiply first: 0.9×5=4.50.9 \times 5 = 4.5.
  4. Add: y=1+4.5=5.5y = 1 + 4.5 = 5.5.
  5. Suppose the current critic outputs QA=4.0Q_A = 4.0 for this step. The squared error is (4.0−5.5)2=(−1.5)2=2.25(4.0 - 5.5)^2 = (-1.5)^2 = 2.25.
  6. The gradient of the loss with respect to the critic output is 2(4.0−5.5)=−32(4.0 - 5.5) = -3, so training pushes the critic's output up.

Interpretation: the critic learns from both the reward and the estimated future. Here the estimate is 4.5 of the 5.5 target, so the next-state estimate dominates the update.

Example
Example 2: the variance argument with two and three agents

Use Proposition 1 with the all-ones reward and θi=0.5\theta_i = 0.5.

  1. For N=2N = 2, the probability of a correct gradient step is (0.5)2=0.25(0.5)^2 = 0.25.
  2. Two agents give a 25 percent chance per sample.
  3. For N=3N = 3, the probability is (0.5)3=0.125(0.5)^3 = 0.125.
  4. Three agents give 12.5 percent.
  5. The variance of a single gradient sample is (0.5)N−(0.5)2N(0.5)^N - (0.5)^{2N}. For N=2N = 2 that is 0.25−0.0625=0.18750.25 - 0.0625 = 0.1875. For N=3N = 3 it is 0.125−0.015625=0.1093750.125 - 0.015625 = 0.109375.
  6. The variance falls as NN grows, but the expected gradient falls faster. The signal-to-noise ratio shrinks.

Interpretation: adding agents makes the signal weaker relative to the noise, so naive policy gradients stall. The centralized critic removes the noise that comes from other agents' actions, which is the paper's stated reason it helps.

Example
Example 3: a competitive case from the paper's table

Physical deception pits two cooperating agents (AG) against one adversary (ADV). Table 4 of the paper reports, for two agents and two landmarks, the success percentages in one matchup of MADDPG agents against a MADDPG adversary, and in another against a DDPG adversary.

  1. Matchup 1, both MADDPG: AG success 94.4 percent, ADV success 39.2 percent.
  2. The gap is 94.4−39.2=55.294.4 - 39.2 = 55.2 percentage points.
  3. Matchup 2, MADDPG agents against a DDPG adversary: AG success 92.2 percent, ADV success 16.4 percent.
  4. The gap is 92.2−16.4=75.892.2 - 16.4 = 75.8 percentage points.
  5. Compare with DDPG agents against a DDPG adversary: AG success 74.7 percent, ADV success 38.6 percent.
  6. The gap is 74.7−38.6=36.174.7 - 38.6 = 36.1 percentage points.
  7. The MADDPG agents win by a wider margin in both matchups, and the DDPG adversary is the weakest of the three.

Try it: in the covert communication test (Table 5), Bob trained with DDPG against a DDPG Eve gets 92.7 percent success and Eve gets 67.6 percent. What is the gap? Answer: 92.7−67.6=25.192.7 - 67.6 = 25.1 points, which matches the paper's 25.1 percent. For the MADDPG-trained Bob against a DDPG Eve, the paper reports 96.8 percent and 44.4 percent, a gap of 52.452.4 points.

Results

The paper's main findings are these. All numbers come from its tables and text.

  • Cooperative communication (Table 1 and text). The speaker must describe a target landmark by colour, and the listener must move to it. After 25000 episodes, MADDPG reaches the target on 84.0 percent of episodes with an average distance of 0.133. DDPG reaches it on 32.0 percent with distance 0.456. DQN reaches 24.8 percent, actor-critic 17.2 percent, TRPO 20.6 percent, and REINFORCE 13.6 percent. The paper also reports that MADDPG learns the correct policy reliably over runs, while the baseline listeners, in the authors' observation, learn to ignore the speaker.
  • Cooperative navigation (Table 2). With three agents, MADDPG has an average distance to landmarks of 1.767 and 0.209 collisions per episode. DDPG has 1.858 and 0.375. With six agents, MADDPG has 3.345 and 1.366, and DDPG has 3.350 and 1.585.
  • Predator-prey (Table 3). In the variant where prey are 30 percent faster, MADDPG predators get 16.1 touches per episode against DDPG prey, compared with 10.3 for DDPG predators against MADDPG prey. In the variant where prey are 100 percent faster, the numbers are 0.405 and 0.298.
  • Physical deception (Table 4). With two agents, MADDPG against MADDPG gives 94.4 percent agent success. The text says cooperating MADDPG agents cover all landmarks around 94 percent of the time.
  • Covert communication (Table 5). Bob trained with MADDPG reaches 96.8 percent against a DDPG Eve. The paper's Table 5 gap for MADDPG-trained Bob against DDPG Eve is 52.4 points, against 25.1 points for DDPG Bob against DDPG Eve. Only Alice trained with MADDPG pushes Eve to near random reconstruction.

What the results mean: in these tables the advantage is largest where coordination or deception is needed, and smallest where the task is mostly physical. All the evidence comes from small, simulated tasks.

The limits are real. The results are in simulated two-dimensional worlds with a small number of agents. The competitive comparisons pit MADDPG against DDPG rather than against other multi-agent methods. The paper also notes that its critic's input grows with NN, and that its scaling beyond small teams is future work.

Common mistakes and tradeoffs

It is tempting to think that the centralized critic means agents can see each other at test time. In fact the critic is used only during training and is thrown away. The actor reads only its own observation, which is why the deployed agents work in a decentralized way. Deployment does not need the other agents' actions, so the agents still act when those actions are hidden. Training does need them, unless the approximate-model option is used.

It is tempting to think that the critic has to know what the other agents will do in the future. The critic is given the actions of the other agents on the stored step. The paper also shows an option to avoid knowing their policies: each agent learns an approximate model of the others from observations (Section 4.2), and the paper reports that this approximate version reached the same success rate in its cooperative communication test. Learning the model is optional.

It is tempting to think that more agents is always fine because the critic can handle it. In fact the critic's input grows with the number of agents, so the paper notes that its input space grows linearly with NN. The authors suggest a modular critic that looks only at nearby agents, but they leave that for future work.

It is tempting to think that a single learned policy is the most robust. In fact in competitive games an agent can overfit to one opponent. The ensemble objective trains several sub-policies and picks one at random each episode, which the paper reports makes ensemble agents stronger than single-policy agents in keep-away, cooperative navigation, and predator-prey.

When to use the method: a small team of learners that must coordinate or compete in a shared continuous-action environment, where simulation gives access to everyone's actions during training. When not to use it: when agents are many and interchangeable (a centralized critic over all of them becomes large), when the actions of other agents cannot be observed even in simulation, or when the actions are discrete and a differentiable actor is awkward. Alternatives include independent learners (simple but unstable) and counterfactual critics, which the paper cites as concurrent work with a single centralized critic for all agents.

Reading guide

The paper is short, so read it in this order.

  1. Abstract and Section 1 (Introduction). The three goals: local execution, no differentiable model, and support for competitive games. Needs Reinforcement Learning and Centralized Training with Decentralized Execution.
  2. Section 2 (Related Work). Read quickly. It places the paper among independent learners and communication methods. Needs nothing new.
  3. Section 3 (Background). Markov games, Q-learning, DQN, policy gradients, and DPG. Needs Q-Learning, Deep Q-Network, Policy Gradient, and Deterministic Policy Gradient. Proposition 1 is here; read its proof in the appendix.
  4. Section 4.1 (MADDPG). The centralized critic and the actor gradient. This is the core. Needs Actor-Critic Methods and Deep Deterministic Policy Gradient (DDPG).
  5. Section 4.2 (Inferring policies). Optional on a first read. It needs the entropy-regularised log-likelihood from Maximum Entropy Reinforcement Learning.
  6. Section 4.3 (Ensembles). Needs Ensemble Learning at the level of "several models, one chosen at random".
  7. Section 5 (Experiments). Read the environments and the tables. The tables are the source of every number in the Results section above.

Check yourself

QuestionWhy does a centralized critic help when the actor stays local? Answer in one or two sentences.Show answer

The critic is trained with the actions of all agents as input, so from its point of view the environment is stationary: the transition probability depends on the actions it sees, not on the other agents' changing policies. The actor needs only its own observation to act, so the deployed agent is decentralized.

QuestionA team has N=4N = 4 agents, each choosing 1 with probability 0.5, and reward 1 only if all four pick 1. Using Proposition 1, what is the probability that one policy gradient sample points in the right direction? Give the number.Show answer

The probability is (0.5)4=0.0625(0.5)^4 = 0.0625, which is 6.25 percent. The formula in the paper is (0.5)N(0.5)^N with N=4N = 4.

QuestionIn the target y=ri+γQi′(x′,a1′,…,aN′)y = r_i + \gamma Q'_i(\mathbf{x}', a'_1, \ldots, a'_N), why are the next actions taken from the target policies rather than the current ones?Show answer

The target policies are slow-moving copies of the actors. Using them keeps the target stable while the current policies change, the same reason DDPG and DQN use target networks. Using the current policies would make the target move with every update and can make training diverge.

QuestionPhysical deception with two agents: MADDPG agents against a DDPG adversary get 92.2 percent agent success and 16.4 percent adversary success. What is the gap, and what does it say?Show answer

The gap is 92.2−16.4=75.892.2 - 16.4 = 75.8 percentage points. It says the MADDPG agents succeed far more often than the adversary in that matchup, the largest gap in the two-agent table for the MADDPG side.

QuestionA researcher wants to use MADDPG on a warehouse of 500 identical robots, each choosing among 10 discrete actions. Name one reason the method as described in the paper may be a poor fit.Show answer

Any reasonable answer names one of these: the critic's input grows with the number of agents, so 500 agents make a single critic very large; the actor gradient in the paper is for continuous actions and needs a differentiable actor, so discrete actions need a different method (such as the Gumbel-softmax trick the paper uses for messages); or identical robots could share a policy, which the paper does not exploit.

Sources

Read the full paper

Ryan Lowe, Yi Wu, Aviv Tamar et al., 2017. arXiv:1706.02275