TL;DR
COMA, short for counterfactual multi-agent policy gradients, is a method for teams of agents that learn together in a simulator and act separately in the world. A single critic that can see the full state and every agent's action estimates the value of the team's joint action. For each agent, COMA then compares that value with the average value over the agent's own alternative actions, holding the teammates' actions fixed. That difference is the agent's credit for the team reward. On a decentralised version of StarCraft micromanagement, the paper reports that COMA beats the other multi-agent actor-critic methods it tests, and that its best agents are competitive with centralised controllers.
Builds on: Actor-Critic Methods, Markov Game, partially observable Markov decision process, Advantage Function · Leads to: Centralized Training with Decentralized Execution, QMIX: Monotonic Value Function Factorisation for Deep Multi-Agent
Why it mattered
Multi-agent systems are everywhere the paper points: coordinating autonomous vehicles, routing network packets and planning distributed logistics. In all of them the team earns one shared reward, so no single agent can see how much it contributed. COMA made a specific claim: a critic used only during training can supply that per-agent credit without extra simulations, without a hand-designed reward for each agent and without a default action. The paper gives a clear actor-critic method for the centralised-training, decentralised-execution pattern, and it supplies an agent-specific counterfactual advantage. Its StarCraft benchmark, with the field of view reduced to the firing range, is the testbed that the experiments below use.
The problem
Three problems make cooperative multi-agent learning hard, and the paper names each one.
The joint action space explodes. If there are agents and each has actions, the joint action has possibilities. A single critic with one output per joint action becomes impractical as grows.
Execution has to be decentralised. Each agent acts on its own action-observation history, because it cannot see the whole state or talk to teammates in real time. The policy of each agent must therefore be a function of its local history only, which is the setting of a partially observable problem.
Credit is hard to assign. The team gets one reward at each step. Plain actor-critic uses the team's temporal-difference error as the learning signal for every actor. If one agent acts well while another makes a mistake, the same signal pushes both the same way. The paper calls this the multi-agent credit assignment problem.
A natural fix is difference rewards, in which an agent is scored by how much the team reward drops when its action is replaced by a default action. This works, but it needs a simulator to rerun the episode for each agent, and the default action is hard to choose. COMA keeps the idea and removes both costs.
How it works
COMA has three parts, and the paper builds them up in this order: a centralised critic, a counterfactual baseline, and a critic architecture that makes the baseline cheap. Here is the training loop for one step, with a tiny illustrative instance. Each step uses an actor-critic update with a policy gradient. The numbers below are made up for the walkthrough and are not from the paper.
- Collect a step. Each agent looks at its own history and samples an action from its actor . The team applies the joint action and returns one shared reward and a new state . Check: the actors used only local histories, so the same policies can run during execution without the critic.
- Estimate the joint action value. The centralised critic takes the global state and all histories, and it returns the value of the whole joint action. Suppose it returns for the joint action the team took. Check: this value depends on the teammates' actions as well as on agent 's, so it can tell whether agent helped.
- Build the counterfactual baseline. Hold the teammates' actions fixed, and ask the critic for the value of each alternative action that agent could have taken. Suppose agent has three actions with values and policy probabilities . The baseline is the policy-weighted average of these values: . Check: the baseline is an average over agent 's own choices only, so it does not depend on what agent actually did.
- Compute the advantage. Subtract the baseline from the value of the action taken. If agent took action 1, its advantage is . If it took action 2, the advantage is . Check: a positive advantage says the action beat the average alternative, and a negative one says it did not.
- Update the actor. Each agent's policy gradient is its log-probability gradient times its own advantage, summed over agents. An agent whose action beat its alternatives is pushed toward that action, and an agent whose action did not is pushed away from it. Check: the expected advantage over the agent's own actions is zero, so the baseline does not bias the gradient. The check for the example is .
- Train the critic. The critic is updated toward a bootstrapped target built from the team reward, using TD() with a target network. Only the critic uses the full state, and the agents do not need it at execution time. Check: at execution time the agents need only their actors, which is the decentralised execution the setting requires.
The diagram below shows the information flow. The red parts exist only during learning.
flowchart LR E["Environment"] -->|"local observation"| A1["Actor 1"] E -->|"local observation"| A2["Actor 2"] A1 -->|"action u1"| E A2 -->|"action u2"| E E -->|"global state, all histories"| C["Central critic Q"] A1 -.->|"joint action"| C A2 -.->|"joint action"| C C -->|"Q for each action of agent a"| B["Counterfactual baseline per agent"] B -->|"advantage A^a"| A1 B -->|"advantage A^a"| A2
The math
The paper's setting is a fully cooperative stochastic game with agents, a true state , a shared reward and discount factor . Each agent sees an observation and keeps an action-observation history , and its policy conditions only on that history. Bold symbols are joint quantities over all agents, and the superscript means all agents except .
Definition: the counterfactual advantage
For agent with policy , the counterfactual advantage of its taken action is
The sum is the baseline. It averages the critic's value over the agent's own alternative actions while the teammates' actions stay fixed.
This is the formula used in step 4 of the walkthrough. The baseline in step 3 is the sum in the definition, which for the example equals .
Step 2 in symbols: the joint value
The centralised critic is trained on the team's return. The paper trains it with TD(), in which the target is a mixture of -step returns, . The paper's target is
and the critic minimises . The paper sets , the value that worked best for both COMA and the baselines in its tuning.
Step 3 in symbols: the baseline does not change the expected gradient
The policy gradient for the team is
The counterfactual baseline does not depend on the action that agent actually took, so it adds no expected contribution to this gradient. For agent , the sum over its own actions of the policy times the gradient of its log-probability is . This is the standard property that makes an action-independent baseline safe, not a separate result of the paper; Lemma 1's proof rests on the same policy-gradient results. The check in step 5 of the walkthrough is this property on the example numbers.
Step 4 in symbols: exploration floor
The paper bounds each action probability from below so that every action keeps some chance of being tried:
Here are the final-layer outputs of the actor and is the number of actions. The paper anneals linearly from 0.5 to 0.02 across 750 training episodes. Because each action has probability at least , the explored set of actions never shrinks to zero.
Step 5 in symbols: efficient evaluation
Because the critic takes the other agents' actions as input and outputs one value per action of agent , all values needed for the baseline come from one forward pass. The network has outputs rather than , which is what the paper calls the efficient representation.
Convergence
The paper's Lemma 1 states that an actor-critic method with a compatible TD(1) critic following the COMA gradient reaches a locally optimal policy, in the sense that the gradient norm has a limit inferior of zero with probability 1. The paper's errata notes that an earlier version had a flaw in the proof, which came from a critic that depended on the state but not the joint history. The revised version adds that dependence and changes the proof accordingly.
Results
The paper's main test is a decentralised version of StarCraft unit micromanagement. Agents see only units within their weapon's firing range, and they lose the built-in attack-move action, so each agent must position and focus fire itself. Four scenarios are reported: 3 marines (3m), 5 marines (5m), 5 wraiths (5w) and 2 dragoons with 3 zealots (2d_3z). Each win rate is a mean over the final 1000 evaluation episodes, with a 95% confidence interval in brackets. The paper runs 35 independent trials per method, with learning frozen every 100 training episodes to evaluate.
| Map | Hand-coded heuristic | IAC-V | IAC-Q | central-V | central-QV | COMA |
|---|---|---|---|---|---|---|
| 3m | 35 | 47 (3) | 56 (6) | 83 (3) | 83 (5) | 87 (3) |
| 5m | 66 | 63 (2) | 58 (3) | 67 (5) | 71 (9) | 81 (5) |
| 5w | 70 | 18 (5) | 57 (5) | 65 (3) | 76 (1) | 82 (3) |
| 2d_3z | 63 | 27 (9) | 19 (21) | 36 (6) | 39 (5) | 47 (5) |
Reading the table honestly, the paper's claims are as follows.
- COMA has the highest mean win rate on all four maps among the learned methods. It improves on the strongest ablation, central-QV, by 4 points on 3m, 10 on 5m, 6 on 5w and 8 on 2d_3z.
- The heuristic is stronger than COMA on 2d_3z (63 against 47). The paper does not claim COMA beats it on every map.
- The text notes that the heuristic reaches a 98% win rate on 5m with a full field of view, but only 66% in the restricted setting. The restriction is what makes the benchmark hard.
- COMA is the most consistent method across training, and it reaches good policies faster than central-V. The paper attributes this to the shaped training signal.
- The paper states that centralised critics clearly outperform their decentralised counterparts. The gap between IAC and the centralised methods is the evidence for this claim.
- The paper also compares the best COMA agents against published centralised controllers that see the full state and use macro-actions. It says the decentralised agents are competitive with them in most settings. The table's right-hand columns are published numbers under different conditions, so they should not be read as a direct comparison.
Limits. The paper focuses on discrete actions. It notes that continuous actions can be handled by estimating the baseline's expectation with Monte Carlo samples or with analytic forms such as Gaussian policies. The authors tried critics factored at the agent level and found that the bottleneck for scalability was not the centralisation of the critic but the difficulty of multi-agent exploration. They deferred factored COMA critics to future work.
Reading guide
Read the paper in this order, with the prerequisite lessons in hand.
- Section 1, Introduction. The three ideas of COMA: a centralised critic, a counterfactual baseline and an efficient critic. Needs Actor-Critic Methods and Centralized Training with Decentralized Execution.
- Section 2, Related Work. Earlier multi-agent RL methods and the difference-rewards line of work. Needs Q-Learning for the independent Q-learning idea.
- Section 3, Background. The stochastic game, the action-observation history, policy gradients and the advantage. Needs Markov Game, partially observable Markov decision process, Policy Gradient, REINFORCE and Advantage Function.
- Section 4, Methods. The independent actor-critic baselines and the COMA gradient, including the counterfactual advantage. Needs Value Function and Target Network.
- Section 5, Experimental setup. The StarCraft task, the state features and the GRU actors and feedforward critics. Needs Recurrent Neural Network, Long Short-Term Memory and Gated Recurrent Unit.
- Section 6, Results. Table 1 and the ablations. Needs the vocabulary above only.
- Appendices A and B. The proof of Lemma 1 and the training hyperparameters. Read the proof after Policy Gradient.
Check yourself
QuestionIn one sentence, what does the counterfactual baseline compare, and for which agent?Show answer
For a given agent, it compares the critic's value for the action the agent took with the average value over the agent's own alternative actions, holding the other agents' actions fixed. The result is that agent's own credit for the team reward.
QuestionAn agent has policy probabilities over two actions, and the critic gives values for those actions with the teammates' actions fixed. What is the baseline, and what is the advantage of the first action?Show answer
The baseline is . The advantage of the first action is . The advantage of the second action would be , and the policy-weighted sum of the two advantages is zero, as it should be.
QuestionWhy does the paper use one critic during learning but only the actors during execution?Show answer
The critic needs the global state and all agents' histories, which are available in a simulator but not to the agents once they are deployed. The actors condition only on their own action-observation histories, so they can run without the critic. This is the centralised training, decentralised execution pattern.
QuestionIn the paper's experiments, which map is the one where the hand-coded heuristic beats COMA, and why does this not contradict the paper's main claim?Show answer
The map is 2d_3z, where the heuristic scores 63 and COMA scores 47. The main claim is that COMA beats the other multi-agent actor-critic methods, and the table supports that on this map too, since COMA beats every learned baseline there. The paper does not claim COMA beats every hand-coded strategy.
QuestionWhy does the paper bound each action probability from below with an exploration floor?Show answer
Each action keeps probability at least , so every action keeps some chance of being tried while the policy is still poor. The floor is annealed from 0.5 to 0.02 over 750 episodes, so exploration is heavy early and light later.