Search

Search papers and lessons

QPLEX: Duplex Dueling Multi-Agent Q-Learning

Jianhao Wang, Zhizhou Ren, Terry Liu et al. · 2020

QPLEX (2020) trains a team of agents with a joint value built from dueling networks, so the team's best joint action is exactly the combination of each agent's best action.

On this page

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

TL;DR

QPLEX is a method for teaching a team of agents to act well together when each agent can only see its own part of the world. It learns one joint value during training and, at the end, each agent acts alone from its own observations. Its key move is a duplex dueling network that builds the joint value so the team's best joint action is exactly the combination of each agent's best action. On StarCraft II micromanagement tasks it beat the earlier multi-agent Q-learning methods, both when the data came from live play and when it came from a fixed dataset.

Builds on: Decentralized POMDP, Centralized Training with Decentralized Execution, QMIX: Monotonic Value Function Factorisation for Deep Multi-Agent, Dueling Network Architectures for Deep Reinforcement Learning · Leads to: none yet in the graph

Why it mattered

Cooperative multi-agent reinforcement learning is the study of teams of learners that share one reward. The paper's motivating examples are sensor networks, coordinated robot swarms and autonomous cars. A common test bed is StarCraft II micromanagement, where a team of units is controlled through the StarCraft Multi-Agent Challenge (SMAC). The paper evaluates on 17 scenarios: 14 standard SMAC maps and 3 new very hard ones. Teams in these scenarios range from 2 to 27 agents.

The paper's contribution is that it gives multi-agent Q-learning full expressiveness and scalability at once. Before it, the strongest value-factorisation methods either kept a simple structure that cannot represent every good joint policy, or relaxed the consistency requirement that makes decentralised action safe. QPLEX keeps the consistency exact by construction, and the paper reports that this translates into higher win rates and better sample efficiency across the benchmark.

The problem

A team of nn agents has a joint action a\mathbf{a} made of one action per agent. The number of joint actions is the number of individual actions raised to the power nn, so it grows exponentially with the team size. Each agent also sees only its own history of observations and actions, because of partial observability. A Dec-POMDP (Decentralized POMDP) is the standard model for this setting.

The usual answer is centralised training with decentralised execution (Centralized Training with Decentralized Execution): during training the learner may use global information, but at run time each agent picks its action from its own history. To make this work in value-based methods, the joint action-value function QtotQ_{tot} must be factorised into per-agent functions QiQ_i so that the joint greedy action equals the tuple of individual greedy actions. This is the IGM (Individual-Global-Max) principle. It has two payoffs: decisions made during execution are consistent with the team's joint plan, and training can compute the one-step target of the joint function without enumerating all joint actions.

Two earlier methods satisfy IGM with sufficient but restrictive conditions. VDN (Value-Decomposition Networks For Cooperative Multi-Agent Learning) makes the joint value a plain sum of per-agent values. QMIX (QMIX: Monotonic Value Function Factorisation for Deep Multi-Agent) makes it a monotonic function of them, so each per-agent value only needs to go up when the joint value goes up. Both conditions are sufficient, not necessary, so some joint value functions that satisfy IGM cannot be represented. QTRAN turns IGM into soft penalties, and WQMIX reweights QMIX's projection towards better joint actions. Both are approximations and cannot guarantee exact IGM consistency. The question QPLEX answers is how to get exact consistency with full expressiveness and a scalable network.

How it works

QPLEX works on the joint value through a dueling split, one part per agent. Here is the pipeline in the order it runs, and a tiny instance traced through it.

flowchart LR
  O[Each agent history] --> Q[Individual Q networks]
  Q --> D[Per agent value V and advantage A]
  D --> T[Transformation with joint history]
  T --> M[Dueling mixing network]
  M --> J[Joint Q tot]
  J --> L[TD loss for training]
  1. Each agent has its own recurrent Q-network. It reads its hidden state from the last step, its current observation and its last action, and outputs one value QiQ_i per action. This is the network that runs at execution time. It is a Recurrent Neural Network so that its choice can depend on the history it has seen.
  2. Split each agent's value into a state value and an advantage. The agent's value is the largest of its action values, and its advantage for each action is how far that action falls below the best one. This is the dueling decomposition from Dueling Network Architectures for Deep Reinforcement Learning, and the advantage is the object in Advantage Function.
  3. Transform the split with joint information (training only). A transformation network looks at the joint history and produces a positive weight and a bias for each agent. It rescales that agent's value and advantage. The weight is always positive, so the ordering of the agent's actions is unchanged.
  4. Add the state values. The joint state value is the plain sum of the transformed per-agent values. Since state values do not affect which action is chosen, the sum imposes no constraint.
  5. Weight the advantages. The joint advantage is a sum of the per-agent advantages, each multiplied by a positive importance weight. The weights come from a Multi-Head Attention module over the joint history and joint action.
  6. Form the joint value and train. The joint value is the joint state value plus the joint advantage. It is trained with a temporal-difference error (Temporal-Difference Learning) whose target comes from a Target Network.
  7. Execute alone. At run time the mixing and transformation parts are removed. Each agent picks the action with the largest QiQ_i from its own network.

A tiny trace. Take two agents with two actions each. In the paper, the weights in step 5 come from attention. Here they are fixed so you can check the arithmetic, and the transformation in step 3 is the identity.

  1. Agent 1 has Q1(0)=1.0Q_1(0) = 1.0 and Q1(1)=3.0Q_1(1) = 3.0. So its value is V1=3.0V_1 = 3.0 and its advantages are A1=(−2.0,0.0)A_1 = (-2.0, 0.0).
  2. Agent 2 has Q2(0)=2.0Q_2(0) = 2.0 and Q2(1)=0.5Q_2(1) = 0.5. So V2=2.0V_2 = 2.0 and A2=(0.0,−1.5)A_2 = (0.0, -1.5). Check: V2+A2(1)=0.5V_2 + A_2(1) = 0.5, which is Q2(1)Q_2(1).
  3. The joint state value is Vtot=3.0+2.0=5.0V_{tot} = 3.0 + 2.0 = 5.0.
  4. Take the weights λ1=2.0\lambda_1 = 2.0 and λ2=0.5\lambda_2 = 0.5. Both are positive, as the method requires.
  5. The joint advantage for each joint action (a1,a2)(a_1, a_2) is Atot=2.0⋅A1(a1)+0.5⋅A2(a2)A_{tot} = 2.0 \cdot A_1(a_1) + 0.5 \cdot A_2(a_2). For (0,0)(0,0) that is −4.0+0=−4.0-4.0 + 0 = -4.0. For (0,1)(0,1) it is −4.0−0.75=−4.75-4.0 - 0.75 = -4.75. For (1,0)(1,0) it is 0+0=00 + 0 = 0. For (1,1)(1,1) it is 0−0.75=−0.750 - 0.75 = -0.75.
  6. Add the state value. The joint values are Qtot(0,0)=1.0Q_{tot}(0,0) = 1.0, Qtot(0,1)=0.25Q_{tot}(0,1) = 0.25, Qtot(1,0)=5.0Q_{tot}(1,0) = 5.0 and Qtot(1,1)=4.25Q_{tot}(1,1) = 4.25.
  7. The best joint action is (1,0)(1,0), and it is the only one with advantage zero. Each agent's own best action is also 1 for agent 1 and 0 for agent 2, so the joint best is the combination of the individual bests. That is IGM holding exactly in this instance.

Check the arithmetic in the trace another way: Qtot(0,0)Q_{tot}(0,0) should equal ∑iQi(0)+∑i(λi−1)Ai(0)=(1.0+2.0)+(1.0)(−2.0)+(−0.5)(0.0)=1.0\sum_i Q_i(0) + \sum_i (\lambda_i - 1) A_i(0) = (1.0 + 2.0) + (1.0)(-2.0) + (-0.5)(0.0) = 1.0. It does.

Worked examples

Example
Example 1: VDN as a special case (tiny)
  1. Set every weight to λ1=λ2=1\lambda_1 = \lambda_2 = 1. Then the correction term in Step 6 in symbols (below) vanishes.
  2. Use the same individual values as the tiny trace: Q1(0)=1.0Q_1(0) = 1.0, Q2(0)=2.0Q_2(0) = 2.0.
  3. The joint value at (0,0)(0,0) is 1.0+2.0=3.01.0 + 2.0 = 3.0.
  4. Interpretation: with all weights equal to 1, the joint value is the plain sum of the individual values. That is the VDN structure, and it is a special case of QPLEX, not a different method.
Example
Example 2: the standard case (new weights on the same tiny instance)
  1. Keep the individual values from the trace, so A1=(−2.0,0.0)A_1 = (-2.0, 0.0) and A2=(0.0,−1.5)A_2 = (0.0, -1.5), and Vtot=5.0V_{tot} = 5.0.
  2. Change the weights to λ1=1.0\lambda_1 = 1.0 and λ2=3.0\lambda_2 = 3.0.
  3. Compute the joint advantages: (0,0)(0,0) gives −2.0-2.0, (0,1)(0,1) gives −2.0+3.0⋅(−1.5)=−6.5-2.0 + 3.0 \cdot (-1.5) = -6.5, (1,0)(1,0) gives 00, and (1,1)(1,1) gives 3.0⋅(−1.5)=−4.53.0 \cdot (-1.5) = -4.5.
  4. Add VtotV_{tot}: QtotQ_{tot} is 3.03.0, −1.5-1.5, 5.05.0 and 0.50.5 for the four joint actions in that order.
  5. The best joint action is still (1,0)(1,0), with advantage zero and value 5.05.0.
  6. Interpretation: the weights change the size of the joint values, but not which joint action wins. Here any positive weights give the same choice, because the sign pattern of the advantages is fixed.
Example
Example 3: a realistic team (ending with a question)

Suppose a team of 5 units, each with 6 possible actions, is trained with QPLEX. A joint action is one choice per unit, so there are 65=7,7766^5 = 7{,}776 joint actions.

  1. A search over all joint actions to find the best one needs 7,776 joint values to be compared.
  2. In execution, each unit only compares its own 6 values. The five comparisons take 5×6=305 \times 6 = 30 value reads in total.
  3. Each unit's own best action combined gives the joint best, by IGM. So the 30 reads give the same decision the 7,776-way search would give, if the factorisation is exact.
  4. The same argument explains why the paper cares about exactness. A factorisation that only approximates IGM can make the 30-read choice differ from the true joint best.

Try it: if the team had 10 units with 6 actions each, how many joint actions would there be, and how many individual value reads would execution need? Answer: 610=60,466,1766^{10} = 60{,}466{,}176 joint actions, and 10×6=6010 \times 6 = 60 individual reads.

The math

The paper's central object is the advantage-based IGM principle.

Definition: Advantage-based IGM

Given a joint action-value function Qtot(τ,a)Q_{tot}(\boldsymbol{\tau}, \mathbf{a}) over joint action-observation histories τ\boldsymbol{\tau} and joint actions a\mathbf{a}, and individual functions Qi(τi,ai)Q_i(\tau_i, a_i), the individual functions satisfy advantage-based IGM for QtotQ_{tot} when both are written as a state value plus an advantage, Q=V+AQ = V + A, with VV the maximum over actions, and the joint advantage and individual advantages have the same greedy choices: arg⁡max⁡aAtot(τ,a)\arg\max_{\mathbf{a}} A_{tot}(\boldsymbol{\tau}, \mathbf{a}) equals the tuple of arg⁡max⁡aiAi(τi,ai)\arg\max_{a_i} A_i(\tau_i, a_i).

Because VV does not depend on the action, comparing actions only depends on the advantages. That is why this form is equivalent to the ordinary IGM condition (the paper's Proposition 1). The paper also shows the following: a joint advantage is zero at the best joint action and negative elsewhere, and each individual advantage is zero at its best action and not positive elsewhere. The constraint therefore reduces to sign conditions on the advantages.

Step 1 in symbols

Each agent computes Vi(τi)=max⁡aiQi(τi,ai)V_i(\tau_i) = \max_{a_i} Q_i(\tau_i, a_i) and Ai(τi,ai)=Qi(τi,ai)−Vi(τi)A_i(\tau_i, a_i) = Q_i(\tau_i, a_i) - V_i(\tau_i).

Step 3 in symbols

The transformation gives, for each agent ii, a positive weight wi(τ)>0w_i(\boldsymbol{\tau}) \gt 0 and a bias bi(τ)b_i(\boldsymbol{\tau}), and sets

Vi(τ)=wi(τ)Vi(τi)+bi(τ),Ai(τ,ai)=wi(τ)Ai(τi,ai).V_i(\boldsymbol{\tau}) = w_i(\boldsymbol{\tau}) V_i(\tau_i) + b_i(\boldsymbol{\tau}), \qquad A_i(\boldsymbol{\tau}, a_i) = w_i(\boldsymbol{\tau}) A_i(\tau_i, a_i).

Since wi>0w_i \gt 0, the advantage of an action keeps its sign and its order, so each agent's greedy choice is unchanged.

Steps 4 and 5 in symbols

The joint state value and joint advantage are

Vtot(τ)=∑i=1nVi(τ),Atot(τ,a)=∑i=1nλi(τ,a) Ai(τ,ai),with λi>0.V_{tot}(\boldsymbol{\tau}) = \sum_{i=1}^{n} V_i(\boldsymbol{\tau}), \qquad A_{tot}(\boldsymbol{\tau}, \mathbf{a}) = \sum_{i=1}^{n} \lambda_i(\boldsymbol{\tau}, \mathbf{a}) \, A_i(\boldsymbol{\tau}, a_i), \quad \text{with } \lambda_i \gt 0.

The weights come from KK attention heads:

λi(τ,a)=∑k=1Kλi,k(τ,a) ϕi,k(τ) υk(τ),\lambda_i(\boldsymbol{\tau}, \mathbf{a}) = \sum_{k=1}^{K} \lambda_{i,k}(\boldsymbol{\tau}, \mathbf{a}) \, \phi_{i,k}(\boldsymbol{\tau}) \, \upsilon_k(\boldsymbol{\tau}),

where λi,k\lambda_{i,k} and ϕi,k\phi_{i,k} are sigmoid outputs in (0,1)(0, 1) and υk>0\upsilon_k \gt 0 is a positive key. Each term is therefore positive, and so is λi\lambda_i. The sigmoid also keeps each λi,k\lambda_{i,k} between 0 and 1, which makes each agent's share of the joint advantage sparse.

Step 6 in symbols

The joint value is Qtot=Vtot+AtotQ_{tot} = V_{tot} + A_{tot}. Substituting the sums, and writing ∑iQi\sum_i Q_i for the sum of the transformed individual values, gives

Qtot(τ,a)=∑i=1nQi(τ,ai)+∑i=1n(λi(τ,a)−1)Ai(τ,ai).Q_{tot}(\boldsymbol{\tau}, \mathbf{a}) = \sum_{i=1}^{n} Q_i(\boldsymbol{\tau}, a_i) + \sum_{i=1}^{n} \bigl(\lambda_i(\boldsymbol{\tau}, \mathbf{a}) - 1\bigr) A_i(\boldsymbol{\tau}, a_i).

The first sum is the value that the earlier method Qatten computes. The second term is the correction that QPLEX adds to reach full expressiveness.

The training loss is the squared temporal-difference error, with the target taken from frozen parameters θ−\theta^{-}:

L(θ)=E[(r+γmax⁡a′Qtot(τ′,a′;θ−)−Qtot(τ,a;θ))2],\mathcal{L}(\theta) = \mathbb{E}\left[\left(r + \gamma \max_{\mathbf{a}'} Q_{tot}(\boldsymbol{\tau}', \mathbf{a}'; \theta^{-}) - Q_{tot}(\boldsymbol{\tau}, \mathbf{a}; \theta)\right)^2\right],

where rr is the team reward, γ\gamma the discount factor and τ′\boldsymbol{\tau}' the next joint history.

Results

The paper evaluates on small matrix games, a two-state MMDP and the 17 StarCraft II scenarios, with 6 random seeds per method and results shown as the median with the 25th and 75th percentiles.

SettingWhat the paper reports
Matrix games (harder one-step game)QPLEX, QTRAN and WQMIX reach the optimum. QMIX, VDN and Qatten fall into a local optimum caused by miscoordination penalties.
Two-state MMDPQMIX, VDN and Qatten diverge in their joint value. QPLEX, QTRAN and WQMIX converge to the optimal value.
SMAC, online data collectionAveraged over the 17 scenarios, QPLEX's median test win rate exceeds the baselines by at least 10%. It is the best performer on up to 8 tasks and underperforms on 2. On the hardest map, 5s10z, the gap is above 30% in test win rate.
SMAC, offline data collectionQPLEX significantly outperforms the other multi-agent Q-learning baselines. QMIX and Qatten do not always learn stably, and VDN is weak.

What the numbers mean: the matrix games and the two-state MMDP are designed to isolate expressiveness and stability. They show that a method with a restricted function class can get stuck or diverge even when the environment is simple. The StarCraft II results show that the same advantage holds in a large, partially observable benchmark. The offline result matters because it shows QPLEX can learn from a fixed log of past play without new exploration, which the paper links to the wider Offline Reinforcement Learning literature.

The limits are real. Results are on one simulator and one family of tasks. The paper uses a small attention module (1 layer with 4 heads) for the complex maps, because learning gets harder as the module grows. The method is for discrete actions, and the paper names continuous action spaces as the next step.

Common mistakes and tradeoffs

It is tempting to think that QPLEX lets each agent see the whole team at run time. In fact the global information is used only during training, in the transformation and the mixing network. At execution each agent runs only its own recurrent Q-network on its own history, because that is all it can observe.

It is tempting to think that making the mixing weights larger always helps. In fact the weights must be positive, and the paper's proof depends on that. A negative weight would flip the order of one agent's advantages and break IGM for that agent.

It is tempting to think that a richer joint function is always better. In fact the paper's results show that the value of exactness depends on the setting. With online data collection and epsilon-greedy exploration, a method whose greedy choices are exact gathers better training data. QTRAN, which relaxes IGM, did worst there in the paper's experiments, even though it did well on the small matrix games. Relaxation can be cheaper but may not reach the best joint policy.

When to use QPLEX: cooperative teams with a shared reward, a value-based learner, and enough data or compute to train the attention module. When not to use it: a single agent (use Deep Q-Network), competing agents (the setting is a Markov Game with separate rewards, and IGM does not apply), or a team so small that a joint table is cheap. Alternatives: VDN for the simplest additive structure, or QMIX when a monotonic mixer is enough. QPLEX is larger and slower than both, so it is worth it when expressiveness is the bottleneck.

Reading guide

Read the paper in this order. Each section lists the lessons it leans on.

Check yourself

QuestionWhat does the IGM principle require of the individual and joint greedy actions?Show answer

The joint greedy action must equal the tuple of individual greedy actions, one per agent. Each agent can then act on its own Q-function at execution time, and the team still plays the joint-optimal action. Without it, decentralised execution could choose a joint action that is not the best one.

QuestionIn the tiny trace, what is Qtot(0,0)Q_{tot}(0,0) if λ1=λ2=1\lambda_1 = \lambda_2 = 1?Show answer

It is 3.0. With both weights equal to 1, Qtot=Vtot+Atot=5.0+(−2.0+0)=3.0Q_{tot} = V_{tot} + A_{tot} = 5.0 + (-2.0 + 0) = 3.0, which equals Q1(0)+Q2(0)=1.0+2.0Q_1(0) + Q_2(0) = 1.0 + 2.0. That is the VDN sum.

QuestionWhy must each λi\lambda_i be strictly positive?Show answer

A positive weight keeps the sign of each agent's advantages, so the agent's ordering of actions is preserved. If a weight were zero or negative, the joint advantage could rank that agent's actions in the wrong order, and the best joint action would no longer be made of the agents' individual best actions.

QuestionA team of 4 drones shares one reward. During training a learner sees every drone's position; at run time each drone sees only its own sensors. Which parts of QPLEX run on each drone?Show answer

Each drone runs only its own recurrent Q-network and takes the action with the largest QiQ_i. The transformation network and the dueling mixing network use global information, so they are used only during training and removed at execution.

Sources

Read the full paper

Jianhao Wang, Zhizhou Ren, Terry Liu et al., 2020. arXiv:2008.01062