Skip to content
StackDecode
AI & ML Atlas
Reinforcement LearningalgorithmAnimated walkthrough

Counterfactual Multi-Agent Policy Gradients (COMA)

Credits each agent by asking how the team would have done had it acted differently.

The idea

A centralised critic evaluates the joint action. For each agent, COMA computes a counterfactual baseline: the average value over that agent's alternative actions while the other agents' actions stay fixed. The difference is that agent's own contribution, a clean learning signal for its policy.

Aᵃ = Q(s, u) − Σᵤ′ᵃ πᵃ(u′ᵃ) Q(s, (u⁻ᵃ, u′ᵃ))

Watch it run

The pipeline lights up one step at a time. Use the controls to pause or step through it.

  1. 1Run the agents' decentralised policies.
  2. 2Estimate Q(s, joint action) with a centralised critic.
  3. 3For each agent compute the baseline by marginalising over its own actions.
  4. 4Use the advantage to update that agent's policy.

Aᵃ = Q(s, u) − Σᵤ′ᵃ πᵃ(u′ᵃ) Q(s, (u⁻ᵃ, u′ᵃ))

1/4

Step by step

  1. 1Run the agents' decentralised policies.
  2. 2Estimate Q(s, joint action) with a centralised critic.
  3. 3For each agent compute the baseline by marginalising over its own actions.
  4. 4Use the advantage to update that agent's policy.

Where it is used

Cooperative tasks with hard credit assignment.

Watch out for

Computing the baseline costs more as the number of actions grows.

Related