Value Factorization: VDN & QMIX
Decomposing a team’s Q-function, and the individual–global max principle.
VDN adds the agents' utilities and QMIX mixes them with a monotone network. Both make decentralized greedy action selection exact, and both quietly limit which team values can be learned. This lesson makes the limit precise. It characterizes the individual–global-max condition exactly, proves that monotonic mixing satisfies it, computes what least-squares fitting of monotonic mixtures does to the climbing game, and examines the methods built to escape the limit, QTRAN, QPLEX and Weighted QMIX, including what their guarantees do not say.
What you’ll learn
- State IGM precisely, prove that monotonic mixing satisfies it, and prove that a team value with a unique optimal joint action is IGM-representable exactly when it has QPLEX's advantage form.
- Describe VDN and QMIX, including hypernetworks, nonnegative mixing weights and the decentralized maximization in the TD target, and implement a QMIX mixer.
- Compute the least-squares projection of a payoff onto monotonic mixtures and show how uniform weighting loses the optimal joint action in the climbing game.
- State and prove QTRAN's sufficient condition for factorization, and explain QPLEX's duplex dueling construction.
- Explain Weighted QMIX's weighted projections and what their theorems guarantee, including the role of ties.
IGM, exactly
Fix a joint history (or a state) and drop it from the notation. A team value is defined on joint actions ; each agent has a utility . The utilities satisfy the individual–global-max condition (IGM; Son et al., 2019) when the tuple of individually greedy actions is a greedy joint action. With unique maximizers that is an equality of action tuples; with ties, what decentralized execution needs is that every combination of individually greedy actions maximizes .
A function non-decreasing in each argument is monotone in the componentwise order: if coordinate by coordinate, then (raise the coordinates one at a time). For greedy and any , the vector of utilities at is componentwise below the vector at :
Converse, for strictly increasing : let maximize , and suppose some is not greedy, so . Replacing by strictly increases , contradicting maximality. Hence . With non-strict the inclusion can be strict: a flat region of creates maximizers that no agent's utility points to.
Monotonicity is sufficient, not necessary, as the QMIX authors note. What is necessary? The answer is surprisingly permissive, and it changes how one should read the whole literature: IGM constrains only the agreement between the utilities and the maximizer of , not the values of .
Advantage form implies IGM. At the greedy profile every vanishes, so . At any other some agent deviates, its is multiplied by a positive weight, and no term is positive:
Every team value with a unique maximizer has the form. Let be the maximizer and choose , if and otherwise. For with deviating agents, give each deviator the same positive weight (the others' weights multiply zero):
So IGM by itself rules out no team value with a unique optimum; the utilities need only agree on where the optimum is. What restricts VDN and QMIX is the form of the combination: weights that may not depend on the joint action, or a mixture monotone in the utilities. The hard part of value factorization is learning, not representing.
Two agents with actions A, B, C share the payoff 8 for (A, A), when exactly one agent plays A, and 0 otherwise. Which statement is right?
- No utilities satisfy IGM for it
- It is IGM-representable in advantage form, but no monotonic mixture of utilities reproduces it exactly
- VDN represents it exactly
- It is representable by monotonic mixing but not in advantage form
Show the answer
B. It is IGM-representable in advantage form, but no monotonic mixture of utilities reproduces it exactly
It has a unique maximizer, (A, A), so the construction above writes it in advantage form with utilities that both prefer A. A monotonic mixture cannot match it: forces agent 1 to rank B above A, while forces the opposite. And its interaction terms are nonzero, so a sum cannot match it either.
VDN and QMIX in practice
VDN (Sunehag et al., 2018) represents the team value as a sum of per-agent utilities, , and trains the sum end to end with a Q-learning loss on the shared reward. Each is typically a recurrent network over the agent's own history, with parameters shared across agents and the agent's ID as an input.
QMIX (Rashid et al., 2018) feeds the chosen utilities into a small mixing network whose weights are generated from the global state by hypernetworks: one linear layer per weight matrix, followed by an absolute value, so the weights are nonnegative and . Biases are unconstrained, and the final bias, a state value, comes from a two-layer hypernetwork with a ReLU. The state can thus change how utilities are combined without ever reversing an agent's preferences.
import torch
import torch.nn as nn
import torch.nn.functional as F
class QMixer(nn.Module):
"""Q_tot = w2(s) . elu(W1(s)^T q + b1(s)) + V(s), with W1, w2 >= 0."""
def __init__(self, n_agents, state_dim, embed=32):
super().__init__()
self.n, self.e = n_agents, embed
self.hyper_w1 = nn.Linear(state_dim, n_agents * embed)
self.hyper_b1 = nn.Linear(state_dim, embed)
self.hyper_w2 = nn.Linear(state_dim, embed)
self.hyper_v = nn.Sequential(nn.Linear(state_dim, embed), nn.ReLU(), nn.Linear(embed, 1))
def forward(self, q, s): # q: (B, n) chosen utilities; s: (B, state_dim)
w1 = torch.abs(self.hyper_w1(s)).view(-1, self.n, self.e) # nonnegative
b1 = self.hyper_b1(s).view(-1, 1, self.e) # unconstrained
h = F.elu(torch.bmm(q.unsqueeze(1), w1) + b1) # (B, 1, embed)
w2 = torch.abs(self.hyper_w2(s)).view(-1, self.e, 1) # nonnegative
return torch.bmm(h, w2).view(-1) + self.hyper_v(s).view(-1) # (B,)A QMIX mixing network. ELU is increasing and both weight matrices are nonnegative, so the output is non-decreasing in every utility. For the TD target, is the mixer applied to each agent's maximal utility: evaluations instead of .
The decentralized maximization in the target is the computational payoff of IGM; without it, a Q-learning target over ten agents with ten actions each would require evaluations per transition. It is also where restricted classes bite: the target is computed from the factored value, so an error in which joint action looks best propagates through bootstrapping. The next step computes how large such errors can be.
What least squares does to the climbing game
Rashid, Farquhar, Peng & Whiteson (2020) give an idealized model of QMIX: alternate a Bellman backup with a projection onto the class of monotonic mixtures, by least squares with equal weight on every joint action (as if all were explored equally),
The class is not convex, so the minimizer need not be unique: for the payoff there are several best fits, favoring different diagonal entries, and the idealized QMIX operator is therefore not a contraction. Worse, the best fit can have the wrong maximizer.
A monotonic mixture is determined by how each agent's utilities order its actions (a weak order, ties allowed) and by a function non-decreasing along those orders. For fixed orders the fit is an isotonic regression, a small convex quadratic program. Three actions admit 13 weak orders, so the projection is the best of such programs. For the climbing game (rows: agent 1's actions ; columns: agent 2's ) the best fit, with squared error 997.4, is
Both agents' utilities rank their third action first, then the first, then the second. Monotonicity then forces some cells to share a value, which least squares sets to their average:
Greedy decentralized execution plays , worth 5; the optimum, worth 11, is valued at 4.25. Every monotonic fit that keeps as its unique maximizer has squared error at least 1,459.9. With equal weights, eight non-optimal joint actions, two of them penalties of , outvote the single optimum: relative overgeneralization in the form of a projection. (These numbers come from solving the 169 programs; a short script suffices.)
Think first Son et al.'s payoff (8 for (A, A), when exactly one agent plays A, 0 otherwise) is the standard example of a non-monotonic team value. Its best monotonic fit turns out to keep the optimum: 8 at (A, A) and everywhere else, with error 288. What happens if the 8 is lowered to 5?
The fit that keeps A on top still costs 288: the eight other cells, four at and four at 0, are pooled at their mean , at a cost of 36 each. Ranking A last now costs less: pool (A, A) with the four cells at and keep the zeros, for . The best fit flips: (A, A) is valued at and the maximum moves to the zero-valued block, so greedy agents never coordinate on A. With the 8 the same fit costs . Whether uniform projection loses the optimum depends on how large the optimum is relative to the penalties guarding it. (Rashid et al. (2020, Table 2) illustrate QMIX's wrong argmax with the matrix that has the 8, showing a monotonic fit that values (A, A) at and every other cell exactly. That fit has squared error 400, more than the 288 of the fit that keeps A on top and the 320 of the best fit that ranks A last for both agents, so it is not the least-squares projection; the projection keeps the optimum. Their general claim stands: the matrix with 5, or the climbing game, does lose it.)
Learning dynamics show the same tendency. Early in training, ε-greedy data is close to uniform over joint actions, so QMIX fits something like the uniform projection and may never collect the data that would reveal the optimum. Mahajan et al. (2019) prove that in some games raising QMIX's exploration rate lowers the probability of learning the optimal joint action, and add committed exploration through a shared latent variable (MAVEN). Deep coordination graphs (Böhmer, Kurin & Whiteson, 2020) add pairwise terms to the factorization and maximize by message passing, which solves predator–prey tasks designed to exhibit relative overgeneralization.
Escaping monotonicity: QTRAN, QPLEX and Weighted QMIX
Fix any joint action . The nonnegativity condition bounds the joint value by the shifted sum of utilities:
Each maximizes its own utility, and the equality at closes the chain. Note what was not needed: is never required to be a sum, only to lie below the shifted sum and touch it at the greedy profile.
QTRAN learns an unrestricted joint value beside the utilities and a state value , and enforces the two conditions with soft penalty losses, trading exactness of the class for a harder optimization problem. QPLEX (Wang, Ren, Liu, Yu & Zhang, 2021) builds the advantage form into the architecture: a dueling decomposition of each agent's utility into a value and an advantage, and positive weights computed by attention over the state and the joint action, which by the characterization proved above gives exactly the IGM class.
Weighted QMIX (Rashid et al., 2020) keeps the monotonic class but changes the projection: with weights in . The idealized central weighting puts weight 1 on the optimal joint action and on all others; the optimistic weighting puts weight 1 wherever the fit underestimates the target and elsewhere. For both, the authors' argument shows that for small enough no joint action is strictly better than the optimum in the weighted projection: the optimal joint action becomes a maximizer. Their practical algorithms, CW-QMIX and OW-QMIX, learn an unrestricted centralized critic to compute targets and decide the weights.
Key takeaways
- Monotonic mixing makes every profile of individually greedy actions jointly greedy; strict monotonicity makes these the only maximizers.
- IGM itself restricts nothing about a team value with a unique optimum: exactly these values have the advantage form , which QPLEX parameterizes. VDN and QMIX are limited by the form of their combination, not by IGM.
- Fitting a monotonic mixture by equally weighted least squares can lose the optimum: the exact projection of the climbing game puts its maximum on the joint action worth 5 and values the optimum (11) at 4.25. Son et al.'s matrix keeps its optimum, the same matrix with 5 instead of 8 does not.
- QTRAN's conditions are sufficient for IGM (and necessary up to affine transformations), QPLEX is complete for the IGM class, and Weighted QMIX's weightings make the optimum a maximizer of the projection but not necessarily the only one: on the climbing game both leave ties, and decentralized greedy agents pick a joint action worth 5 (central weighting) or (optimistic).
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
with non-decreasing, but not strictly increasing, in each argument. Which statement is guaranteed?
- The maximizers of are exactly the profiles of individually greedy actions
- Every profile of individually greedy actions maximizes , but may have other maximizers too
- has a unique maximizer
- is a sum of the utilities
Show the answer
B. Every profile of individually greedy actions maximizes , but may have other maximizers too
Componentwise monotonicity gives the inclusion . Equality needs strict monotonicity; with flat regions, joint actions that no agent's utility points to can tie for the maximum.
Which team values can be written as with positive weights and individual advantages that vanish exactly at each agent's greedy action?
- Only additive team values
- Only team values monotone in some per-agent utilities
- Every team value with a unique optimal joint action
- Only team values whose optimal joint action is also each agent's best response to uniform play
Show the answer
C. Every team value with a unique optimal joint action
Put at the maximum, let each agent's advantage be off its part of the optimum, and choose the weights of the deviating agents to make up the gap, which is positive because the maximizer is unique. This is why QPLEX's class equals the IGM class: the weights may depend on the joint action.
The equally weighted least-squares fit of the climbing game by a monotonic mixture values the optimal joint action (true value 11) at only 4.25. Why does least squares accept that?
- Because monotonic mixtures cannot represent any value above 10
- Because the optimum is not unique
- Because the fit was computed with too few samples
- Because with equal weights the eight non-optimal joint actions, two of them penalties of , cost more to misfit than the single optimum
Show the answer
D. Because with equal weights the eight non-optimal joint actions, two of them penalties of , cost more to misfit than the single optimum
Any monotonic fit that ranks and on top must keep their rows and columns above the others, which drags the cells up or the good cells down; the best such fit has squared error 1,459.9 against 997.4 for the fit that sacrifices the optimum. Weighted projections attack exactly this by down-weighting the non-optimal joint actions.
QTRAN's condition says is 0 at the greedy profile and nonnegative elsewhere. Which chain of inequalities shows that maximizes ?
- for every
- , so is bounded by the utilities
Show the answer
A.
The nonnegativity gives the first inequality, the greediness of each the second, and the equality at closes the chain. The condition never requires to be a sum, only to be bounded by the transformed sum with equality at the greedy profile.
Further reading
- P. Sunehag, G. Lever, A. Gruslys, W. M. Czarnecki, V. Zambaldi, M. Jaderberg, M. Lanctot, N. Sonnerat, J. Z. Leibo, K. Tuyls & T. Graepel, "Value-decomposition networks for cooperative multi-agent learning based on team reward," Proceedings of the 17th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2085–2087 (2018).
- T. Rashid, M. Samvelyan, C. Schroeder de Witt, G. Farquhar, J. Foerster & S. Whiteson, "QMIX: Monotonic value function factorisation for deep multi-agent reinforcement learning," Proceedings of the 35th International Conference on Machine Learning, PMLR 80, 4295–4304 (2018).
- K. Son, D. Kim, W. J. Kang, D. E. Hostallero & Y. Yi, "QTRAN: Learning to factorize with transformation for cooperative multi-agent reinforcement learning," Proceedings of the 36th International Conference on Machine Learning, PMLR 97, 5887–5896 (2019).
- J. Wang, Z. Ren, T. Liu, Y. Yu & C. Zhang, "QPLEX: Duplex dueling multi-agent Q-learning," International Conference on Learning Representations (2021).
- T. Rashid, G. Farquhar, B. Peng & S. Whiteson, "Weighted QMIX: Expanding monotonic value function factorisation for deep multi-agent reinforcement learning," Advances in Neural Information Processing Systems 33 (2020).