TL;DR
QMIX is a method for teams of agents that learn together in a simulator but must act apart in the real task. During training it learns one joint value estimate for the whole team. That estimate is built by mixing each agent's own value with a network that is forced to be monotonic: if one agent's value goes up, the team value never goes down. Because of that rule, each agent can pick its own best action and the team's combined choice is still the best one. On StarCraft II unit fights, the paper reports that QMIX beats independent learning and the simpler additive method VDN.
Builds on: Centralized Training with Decentralized Execution, Q-Learning, Hypernetwork, Recurrent Neural Network · Leads to: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
Why it mattered
The paper's setting is the one many real multi-agent systems share: a group of agents must coordinate, each sees only part of the world, but a lab or simulator can show everything during training. The authors name robot swarms and autonomous cars as motivating cases. Their test bed was micromanagement in StarCraft II, where each learning agent controls one army unit and the team must win a fight against a built-in enemy. They used the StarCraft II Learning Environment, which the game's developers support; the paper says this removes many practical difficulties of the original StarCraft as a research platform, such as complicated game APIs and external emulation software.
The problem
Three older options each fail in one way.
- Independent learners. Each agent learns its own action values and treats the others as part of the environment. Because the other agents keep changing, the environment seems to move under each learner, and learning is unstable.
- One big joint value function. A single value function over every combination of actions captures teamwork, but the number of joint actions grows exponentially with the number of agents, so it is impractical beyond a few agents. It also gives no obvious way to extract a policy in which each agent acts on its own observation.
- A plain sum (VDN). Writing the team value as a sum of per-agent values is simple and lets each agent act alone. But a sum cannot represent many team values. The paper's example is a team where the best move of one agent depends on what the other does at the same time step.
QMIX aims at the gap between options 2 and 3: a richer team value that still splits into per-agent parts.
How it works
Setting: two agents, two actions each (A and B), and a simplified mixer whose weights are fixed for one moment in time. Each agent gives a value to each action: agent 1 gives A the value 1 and B the value 2; agent 2 gives A 3 and B 0. QMIX must turn these four numbers into one team value for each of the four joint actions.
- Each agent scores its own actions. Agent 1 has values (A: 1, B: 2). Agent 2 has values (A: 3, B: 0). Each agent sees only its own observations, so these are the only numbers it contributes.
- A state-dependent mixer sets positive weights. The full state of the game, which only the training algorithm sees, is fed to a hypernetwork. For this state it outputs weight 2 for agent 1 and weight 1 for agent 2. Both are positive, so the mixer is monotonic. Check: raising agent 1's value by 1 raises the team value by 2, never lowers it.
- Combine each joint action. The team value is 2 times agent 1's value plus 1 times agent 2's value.
- (A, A): 2 × 1 + 1 × 3 = 5
- (A, B): 2 × 1 + 1 × 0 = 2
- (B, A): 2 × 2 + 1 × 3 = 7
- (B, B): 2 × 2 + 1 × 0 = 4
- Find the best joint action. The largest team value is 7, at (B, A).
- Check that each agent can act alone. Agent 1's own best action is B (value 2). Agent 2's own best action is A (value 3). Together they give (B, A), exactly the joint maximum from step 4. The team does not have to search all four joint actions; it only needs each agent's local argmax.
- Why the rule matters. Step 5 works only because the mixer is monotonic. If a weight were negative, the joint maximum could sit at a combination that no individual argmax produces, and the decentralised policy would disagree with the team plan.
The real mixer is non-linear: a hidden layer sits between the agent values and the team value, and its weights are produced from the state by hypernetworks. The step-by-step logic is the same.
- increasing: allowed
- decreasing: not allowed
The math
The team value Q_tot is a function of the per-agent values Q_1, ..., Q_n and the state s. It is monotonic in each agent's value when the partial derivative of Q_tot with respect to Q_a is zero or positive for every agent a.
Step 1 in symbols: agent values
Each agent a has its own network that reads its action-observation history and outputs Q_a(tau_a, u_a) for each of its actions. The paper uses DRQN agent networks, which are Deep Q-Network-style value networks with a Recurrent Neural Network core. Each agent's value depends only on its own history, not on the other agents.
Step 2 in symbols: the monotonic mixer
The mixer takes the vector of agent values and produces Q_tot. Its weights are restricted to be non-negative, and its biases are not. Writing the mixer as one hidden layer with a non-linear activation h, a sketch in the paper's spirit is
where Q is the vector of agent values and every entry of the matrix W_1(s) and the vector W_2(s) is non-negative. The weights come from hypernetworks: each is a Hypernetwork that reads the state s and outputs a weight matrix, and an absolute-value step makes the output non-negative,
Because the activation is increasing and the weights that multiply the agent values are non-negative, the chain rule gives ∂Q_tot/∂Q_a ≥ 0 for every a. That is constraint (5) of the paper. The biases can be negative because they do not multiply the agent values. The paper's text mentions ELU and a hidden layer of 32 units for the mixer in its appendix; the formula above is a sketch and does not reproduce the paper's exact parameterisation.
Step 3 in symbols: the argmax that stays cheap
The paper's consistency condition is
Maximising over all joint actions would take time exponential in n in the worst case. Under monotonicity the right-hand side needs only n separate maximisations, so the joint maximum is found in time linear in the number of agents, as the paper states.
Step 4 in symbols: the training loss
Training uses the Temporal-Difference Learning target of Q-Learning, with a Target Network theta-minus held fixed between updates, and a batch of b transitions from Experience Replay:
The maximum in the target is cheap for the reason given in step 3. This loss is the usual Deep Q-Network loss with Q_tot in place of Q.
Results
The paper's main claims are on decentralised StarCraft II micromanagement maps (3m, 5m, 8m, 2s_3z, 3s_5z, 1c_3s_5z), with test win rates averaged over 20 runs and 95 percent confidence intervals. The win-rate curves are in its figures, and the text describes them in words. The numbers it states in the text and tables are these.
- Two-step game (Table 6). The final test reward is 7 for IQL, VDN, VDN-S and QMIX-Lin, and 8 for QMIX and QMIX-NS. The text explains that VDN learns to pick Action A at the first step and receives 7, while QMIX recovers the optimal strategy and receives 8. The game is a sanity check of representational capacity, not a benchmark.
- Heuristic reference (Table 7). The non-learning heuristic, which attacks the nearest enemy, reaches test win rates of 76 (3m), 60 (5m), 95 (8m), 82 (2s_3z), 45 (3s_5z) and 70 (1c_3s_5z) percent.
- Main comparison (Section 7.1). IQL fails on every scenario and trains unstably. VDN beats IQL everywhere, and QMIX is the strongest method on all maps. The largest gap is on the heterogeneous maps 3s_5z and 1c_3s_5z, where VDN cannot reach the heuristic.
- Ablations (Section 7.2). QMIX is competitive with or better than its ablations. On the heterogeneous maps, both the state and the non-linear mixing are needed for good performance.
How to read a win rate: each evaluation runs 20 independent test episodes with greedy action selection, so one win is 5 percentage points. Check the arithmetic on Table 7 this way: 9 wins out of 20 is 45 percent, and 13 wins out of 20 is 65 percent, which would still sit below the 70 percent heuristic on 1c_3s_5z.
The paper's representational point can be checked by hand. Its Table 3(a) gives a monotonic two-agent payoff with values 0 for (A, A), 1 for (A, B), 1 for (B, A) and 8 for (B, B). Write the agent values as x = Q_1(A), w = Q_1(B), y = Q_2(A) and z = Q_2(B). Then x + y = 0, x + z = 1 and w + y = 1. So z - y = 1 and w - x = 1. The sum for (B, B) is w + z = (w - x) + (z - y) + (x + y) = 1 + 1 + 0 = 2, not 8. No additive VDN fits this payoff, while a monotonic mixer can.
Limits. The results are on one family of unit micromanagement tasks with a built-in medium-difficulty enemy AI. The authors state that they plan larger and more diverse unit groups, and that they plan to add more coordinated exploration for settings with many learning agents, which QMIX does not provide. The representational guarantee in the appendix holds only in the fully observed case; under partial observability an agent's value ordering must also be right for the mixer to represent the team value.
Reading guide
Read the sections in this order. Each is mapped to the lessons it leans on.
- Abstract and Section 1 (Introduction). Needs Centralized Training with Decentralized Execution and the idea of decentralised policies from Partially Observable Markov Decision Process.
- Section 2 (Related Work). Names independent learning, VDN, COMA, and the StarCraft setting. Useful background; the names are defined in "The problem" above.
- Section 3 (Background). Needs Q-Learning, Deep Q-Network, Experience Replay, Target Network, Recurrent Neural Network and, for the gated cells in the agent networks, Gated Recurrent Unit.
- Section 4 (QMIX). The core method. Needs Hypernetwork and Rectified Linear Unit (ReLU) (the paper's non-linear pieces are ELU-type and ReLU-type activations). Read with "How it works" and "The math" above.
- Section 5 (Two-Step Game). Needs the action-value view in Value Function. A small example of when VDN fails.
- Sections 6 and 7 (Setup and Results). Need the win-rate evaluation described in "Results". No new theory.
- Appendices A to D. The representability argument (A), the two-step game training details (B), the StarCraft II setup and hyperparameters (C), and the full results (D). Appendix C is where the episode lengths, replay size and learning rate are given.
Check yourself
QuestionRecall: what does the monotonicity constraint require of the mixer?Show answer
The partial derivative of Q_tot with respect to each agent value Q_a must be zero or positive. In practice the mixer's weights on the agent values are non-negative, so raising any agent's value never lowers the team value.
QuestionCompute: agent 1 values (A: 2, B: 1), agent 2 values (A: 0, B: 4), and a mixer with weight 3 on agent 1 and weight 1 on agent 2. What joint action has the largest team value?Show answer
Team value = 3 × Q_1 + 1 × Q_2. (A, A) = 6 + 0 = 6. (A, B) = 6 + 4 = 10. (B, A) = 3 + 0 = 3. (B, B) = 3 + 4 = 7. The largest is 10 at (A, B). Each agent's own argmax is A for agent 1 (value 2) and B for agent 2 (value 4), which gives (A, B), so the cheap per-agent argmax still finds the joint best.
QuestionWhy: why does QMIX pass the global state to hypernetworks instead of concatenating it to the agent values?Show answer
Concatenating the state to the agent values and feeding both through a monotonic network would force Q_tot to be monotonic in the state too, which is too strong a restriction. The team value may depend on the state in non-monotonic ways. Hypernetworks let the state set the weights of the mixer, so the mixer stays monotonic in the agent values while the state can shape the values in any way.
QuestionApplied: a team of three agents is trained with QMIX on a map where the enemy has several units. Training uses the global state, but the deployed agents see only what is within their sight range. What does each agent use at run time?Show answer
Each agent uses its own agent network Q_a on its own observation history, and it chooses its greedy action. The mixer and hypernetworks are used only during training to compute the team value for the loss. This is centralised training with decentralised execution.
Sources
- Rashid et al., QMIX, arXiv:1803.11485 — https://arxiv.org/abs/1803.11485
- Vinyals et al., StarCraft II: A New Challenge for Reinforcement Learning, arXiv:1708.04782 — https://arxiv.org/abs/1708.04782