Settling the Variance of Multi-Agent Policy Gradients

Jakub Grudzien Kuba, Muning Wen, Linghui Meng, Shangding Gu, Haifeng Zhang, David Henry Mguni, Jun Wang, Yaodong Yang

TL;DR

Multi-agent policy gradient (MAPG) methods struggle because gradient variance explodes as more agents explore the environment. This paper mathematically quantifies this variance—showing it scales linearly with the number of agents—and derives an exact Optimal Baseline (OB), along with a computationally tractable surrogate for deep reinforcement learning. When applied to algorithms like COMA and multi-agent PPO, OB substantially dampens gradient variance and unlocks massive performance gains on complex cooperative benchmarks.

What Problem Does This Paper Address?

In cooperative Multi-Agent Reinforcement Learning (MARL), Centralized Training with Decentralized Execution (CTDE) is standard: agents learn decentralized policies while relying on a centralized critic that observes the joint state and actions. However, CTDE suffers from severe multi-agent credit assignment challenges.

When multiple agents explore simultaneously, an agent cannot easily tell whether an outcome changed because of its own action or its teammates' explorations. This inflates the variance of policy gradient estimators, causing unstable training and poor sample efficiency. While baselines like COMA's counterfactual baseline mitigate some joint-action noise, a rigorous mathematical understanding of what drives this variance—and how to construct a baseline that minimizes it—had remained an open question.

Methods

  • Variance Decomposition & Bounding: The authors prove a multi-agent advantage decomposition lemma, decomposing total advantage into sequential local advantages. They use this to bound the excess variance of CTDE over decentralized training (DT).
  • Derivation of the Optimal Baseline (OB): By decomposing the estimator's variance into components stemming from the state, teammates' actions, and the agent's own action, the authors isolate the terms affected by baseline subtraction and solve for the baseline that analytically minimizes total variance: $$b^{\text{optimal}}(s, \mathbf{a}^{-i}) = \frac{\mathbb{E}_{a^i \sim \pi^i} \left[ \hat{Q}(s, \mathbf{a}^{-i}, a^i) \|\nabla_{\theta^i} \log \pi_\theta^i(a^i|s)\|^2 \right]}{\mathbb{E}_{a^i \sim \pi^i} \left[ \|\nabla_{\theta^i} \log \pi_\theta^i(a^i|s)\|^2 \right]}$$
  • Surrogate Local Variance for Deep Networks: Calculating gradient norms across millions of network parameters $\theta^i$ is computationally prohibitive. The authors factor the policy gradient through the distribution parameters $\psi_\theta^i(s)$ (e.g., logits for discrete actions or mean/std for continuous Gaussians). This yields a tractable surrogate OB whose gradient vectors only match the dimensionality of the action space (often $\sim 10$) instead of the network parameter space ($\sim 10^4+$).
  • Plug-and-Play Integration: The modified value signal $\hat{X}^i(s, \mathbf{a}^{-i}, a^i) = \hat{Q}(s, \mathbf{a}^{-i}, a^i) - b^*(s, \mathbf{a}^{-i})$ directly replaces the advantage term in both discrete (COMA, discrete MAPPO) and continuous (continuous MAPPO) policy gradient architectures.

Datasets

The authors evaluated the method across two standard cooperative MARL benchmark suites (no new benchmark datasets were created):

  1. StarCraft Multi-Agent Challenge (SMAC): Discrete-action cooperative battle scenarios across easy, hard, and super-hard difficulties (e.g., 3m, 8m, 2s3z, 3s vs. 5z, 5m vs. 6m, 6h vs. 8z, and 27m vs. 30m).
  2. Multi-Agent MuJoCo (MAMuJoCo): Continuous-action robotic locomotion environments where multiple agents control separate joints of a single robot (2-Agent Swimmer, 2-Agent Walker, 3-Agent Hopper, and 6-Agent HalfCheetah).

Key Insights and Ideas

  • Linear Scaling with Team Size: The excess variance of CTDE policy gradients over decentralized gradients grows linearly with the number of agents ($n - 1$) and quadratically with agents' local advantages (exploratory terms).
  • Why COMA Still Suffers: COMA’s counterfactual baseline reduces the noise induced by other agents, but fails to mitigate the variance induced by the agent's own local exploration.
  • Counter-intuitive Weighting: For discrete policies, the optimal baseline weights actions by an altered probability distribution $x^i(a^i|s)$. Unlike standard baselines that weight expected value by action probability $\pi^i$, OB scales up the weight of low-probability actions and scales down high-probability actions. This penalizes suboptimal actions much more heavily and sharply reduces variance when local advantages fluctuate.

Key Results

  • Gradient Variance Reduction: On SMAC's 27m vs. 30m scenario involving 27 agents, incorporating OB reduced the standard deviation of MAPPO's gradient norm by over 40% (from $19.62 \pm 6.90$ down to $11.55 \pm 4.80$). Gradient norm variance was consistently reduced across all evaluated SMAC and MuJoCo tasks.
  • Super-Hard SMAC Maps: On 3s vs. 5z, standard MAPPO achieved a near 0% win rate; adding OB boosted the win rate to ~90%.
  • Continuous Multi-Agent MuJoCo: MAPPO with OB outperformed baseline algorithms across all robot tasks, with the performance gap widening as agent count increased (most prominently on 6-Agent HalfCheetah).

Limitations and Future Work

  • Critic Architecture Dependency: The formulation fundamentally relies on querying a centralized joint-action critic $\hat{Q}(s, \mathbf{a})$. Consequently, it cannot be directly applied alongside popular variance-reduction schemes like Generalized Advantage Estimation (GAE) that rely solely on state-value functions $V(s)$.
  • Continuous Action Sampling: In continuous action spaces, OB cannot be solved in closed form and requires Monte Carlo sampling from the policy distribution, adding sampling overhead.
  • Future Work: The authors propose investigating alternative multi-agent variance reduction mechanisms that do not strictly depend on joint Q-function critics.

Summary updated

BibTeX
@inproceedings{kuba2021settling,
  author = {Jakub Grudzien Kuba and Muning Wen and Linghui Meng and Shangding Gu and Haifeng Zhang and David Henry Mguni and Jun Wang and Yaodong Yang},
  title = {{Settling the Variance of Multi-Agent Policy Gradients}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=jI97GGA0H_},
}
Figure