# QMIX

**QMIX** 是一种基于值的多智能体强化学习算法，它以集中式、端到端的方式训练分散式的智能体策略，将联合动作值函数表示为各智能体效用值的单调非线性组合。该算法由塔比什·拉希德（Tabish Rashid）、米卡耶尔·萨姆韦良（Mikayel Samvelyan）、克里斯蒂安·施罗德·德·维特（Christian Schroeder de Witt）、格雷戈里·法夸尔（Gregory Farquhar）、雅各布·福斯特（Jakob Foerster）和西蒙·怀特森（Shimon Whiteson）在第35届国际机器学习大会（ICML 2018）上提出，发表于《机器学习研究论文集》第80卷，第4295至4304页。<sup>[1](https://proceedings.mlr.press/v80/rashid18a.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 完整标题 | QMIX：用于深度多智能体强化学习的单调值函数分解，ICML 2018，PMLR 80:4295-4304<sup>[1](https://proceedings.mlr.press/v80/rashid18a.html)</sup> |
| 作者 | 塔比什·拉希德、米卡耶尔·萨姆韦良、克里斯蒂安·施罗德·德·维特、格雷戈里·法夸尔、雅各布·福斯特、西蒙·怀特森<sup>[1](https://proceedings.mlr.press/v80/rashid18a.html)</sup> |
| 范式 | 集中训练与分散执行（CTDE）<sup>[2](https://arxiv.org/abs/2003.08839)</sup> |
| 核心机制 | 混合网络从各智能体的值估计 \( Q_{\mathrm{tot}} \)，以非负权重强制满足对每个智能体 \( \partial Q_{\mathrm{tot}} / \partial Q_{i} \ge 0 \)<sup>[2](https://arxiv.org/abs/2003.08839)</sup><sup> • </sup><sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC13259518/)</sup> |
| 状态条件化 | 超网络以全局状态 \( s \) 为输入，生成混合网络的权重和偏置<sup>[4](https://xuance.org/documents/algorithms/marl/qmix.html)</sup> |
| 评估 | 星际争霸II微操任务；期刊版本引入了星际争霸多智能体挑战赛（SMAC）基准，QMIX在其中优于IQL、VDN和COMA<sup>[1](https://proceedings.mlr.press/v80/rashid18a.html)</sup><sup> • </sup><sup>[5](https://www.jmlr.org/papers/volume21/20-081/20-081.pdf)</sup> |
| 已知局限 | 无法表示智能体的最优动作依赖于其他智能体同一时间步动作的值函数<sup>[6](https://arxiv.org/abs/2006.10800)</sup> |

## 问题设定

QMIX在[集中训练与分散执行](https://www.edgepedia.org/zh/centralized-training-with-decentralized-execution)（CTDE）范式下解决合作式多智能体强化学习问题。一组智能体必须在以分散方式行动的同时协调行为，每个智能体仅以自己的局部观测为条件；然而在训练期间，全局状态信息是可用的，通信约束也被解除。<sup>[1](https://proceedings.mlr.press/v80/rashid18a.html)</sup> 学习一个以额外状态信息为条件的联合动作值函数是利用这种集中式设定的一种有吸引力的方式，但问题在于如何从中提取分散式策略。<sup>[1](https://proceedings.mlr.press/v80/rashid18a.html)</sup>

这种一致性要求被称为个体-全局最大化（IGM）性质：最大化集中值函数的联合动作必须同时也是各智能体各自贪心动作的组合，<sup>[7](https://github.com/SouthwestLili/QMIX-Algorithm/blob/main/QMIX_Algorithm_Summary.md)</sup>

\[ \arg\max_{\boldsymbol{u}} Q_{\mathrm{tot}}(\boldsymbol{\tau}, \boldsymbol{u}) = \left( \arg\max_{u^{1}} Q_{1}(\tau^{1}, u^{1}), \ldots, \arg\max_{u^{n}} Q_{n}(\tau^{n}, u^{n}) \right). \]

如果这一性质不成立，分散式策略就无法最大化 \( Q_{\mathrm{tot}} \)，也就不会是最优的。<sup>[4](https://xuance.org/documents/algorithms/marl/qmix.html)</sup>

## 单调值函数分解

QMIX的前身VDN（值分解网络）假设联合动作值函数可分解为各智能体效用值的简单求和，即 \( Q_{\mathrm{tot}} = \sum_{i} Q_{i} \)。这种线性假设过于严格，无法捕捉智能体之间的非线性交互。<sup>[7](https://github.com/SouthwestLili/QMIX-Algorithm/blob/main/QMIX_Algorithm_Summary.md)</sup> QMIX的核心创新在于将IGM条件重新表述为单调性约束：它不要求偏导数为单位值，而只要求

\[ \frac{\partial Q_{\mathrm{tot}}}{\partial Q_{i}} \ge 0, \qquad \forall\, i, \]

这是IGM性质的充分非必要条件。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC13259518/)</sup><sup> • </sup><sup>[4](https://xuance.org/documents/algorithms/marl/qmix.html)</sup> 在此约束下，最大化的联合动作可以通过独立选择每个智能体的贪心动作来获得，<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC13259518/)</sup> 这使得在离策略学习中能够以可行的计算开销最大化联合动作值，并保证了集中式策略与分散式策略之间的一致性。<sup>[1](https://proceedings.mlr.press/v80/rashid18a.html)</sup>

## 架构

QMIX用三个组件来表示 \( Q_{\mathrm{tot}} \)：各智能体网络、混合网络和一组超网络。<sup>[4](https://xuance.org/documents/algorithms/marl/qmix.html)</sup>

- **智能体网络。** 每个智能体运行一个形如MLP + GRU + MLP的网络，其输入是该智能体的观测-动作序列历史，输出是其局部效用值 \( Q_{i}(\tau_{i}, u_{i}) \)，用于导出 \( \epsilon \)-贪心探索策略。<sup>[4](https://xuance.org/documents/algorithms/marl/qmix.html)</sup>
- **混合网络。** 它以各智能体效用值和全局状态 \( s \) 为输入，输出 \( Q_{\mathrm{tot}} \)。其隐藏层使用ELU激活函数，输出层为线性。<sup>[4](https://xuance.org/documents/algorithms/marl/qmix.html)</sup>
- **超网络。** 全局状态被送入超网络，由超网络生成混合网络的权重和偏置；权重由线性层后接绝对值激活函数产生，确保其为非负值，而偏置项不受约束。这一设计使混合网络能够以任意精度逼近任何单调函数。<sup>[4](https://xuance.org/documents/algorithms/marl/qmix.html)</sup>

混合网络仅在训练时需要；在执行时，智能体用各自的循环网络行动，与VDN中相同。训练遵循Q学习更新，在 \( Q_{\mathrm{tot}} \) 上使用贝尔曼方程损失，参考的PyMARL配置使用双[Q学习](https://www.edgepedia.org/zh/q-learning)、从1.0在50,000步内退火至0.05的epsilon-贪心选择器、容量为5,000个回合的回放缓冲区，以及每200个回合更新一次目标网络。<sup>[8](https://github.com/oxwhirl/pymarl/blob/master/src/config/algs/qmix.yaml)</sup>

## 在SMAC上的评估

该工作的期刊版本引入了星际争霸多智能体挑战赛（SMAC），这是一个基于星际争霸II微操场景的基准，其中每个单位是一个独立智能体，基于局部观测对抗游戏内置AI行动。<sup>[5](https://www.jmlr.org/papers/volume21/20-081/20-081.pdf)</sup><sup> • </sup><sup>[9](https://arxiv.org/abs/1902.04043)</sup> 在SMAC上的实验表明，QMIX在绝对性能和学习速度上均优于IQL、VDN和COMA，在更难的任务和具有异构智能体的任务上增益最大。<sup>[5](https://www.jmlr.org/papers/volume21/20-081/20-081.pdf)</sup> 消融实验将相对VDN的优势归因于两个组件：状态相关的偏置和学习到的、以状态为条件的智能体效用值混合；学习到的混合本身只需是线性的即可恢复QMIX的大部分性能，但其参数化方式很重要。<sup>[5](https://www.jmlr.org/papers/volume21/20-081/20-081.pdf)</sup>

作者还发布了PyMARL，一个开源的PyTorch框架，包含IQL、VDN、QMIX、QTRAN和COMA的实现，该框架已成为该领域的标准测试平台。<sup>[5](https://www.jmlr.org/papers/volume21/20-081/20-081.pdf)</sup>

## 局限性与扩展

单调性限制使QMIX无法表示智能体对其自身动作的排序依赖于其他智能体动作的值函数。<sup>[6](https://arxiv.org/abs/2006.10800)</sup> 这催生了一系列后继工作。QTRAN通过将联合动作值函数变换为具有相同最优动作的易于分解的函数，消除了VDN和QMIX的结构性约束，覆盖了更广泛的任务类别。<sup>[10](https://arxiv.org/abs/1905.05408)</sup> QPLEX使用双工对决架构直接编码IGM原则，实现了完整的IGM函数类。<sup>[11](https://arxiv.org/abs/2008.01062)</sup> 加权QMIX将QMIX分析为向其可表示空间的投影，并表明即使可以获得 \( Q^{*} \)，这种投影也可能无法恢复最优策略，因为每个联合动作被等权对待；它引入了两种加权方案——CW-QMIX和OW-QMIX——可证明能恢复正确的最大化动作。<sup>[6](https://arxiv.org/abs/2006.10800)</sup>

后来的分析使QMIX作为弱基线的图景变得复杂。RIIT研究发现，代码层面的实现技巧而非单调性约束的放松，解释了QMIX变体所报告的大部分改进；采用统一优化设置的QMIX在SMAC上优于其他工作；单调性约束可以提高在SMAC和难度增强的捕食者-猎物基准上的样本效率。<sup>[12](https://arxiv.org/abs/2102.03479)</sup>

基准本身也在演进。经过多年的改进，算法在原始SMAC上达到了接近完美的性能，分析表明仅以时间步为条件的开环策略在许多场景上也能达到非平凡胜率；SMACv2引入了程序化生成的场景和扩展的部分可观测性挑战，以要求闭环策略。<sup>[13](https://arxiv.org/abs/2212.07489)</sup>

## 应用

除星际争霸II之外，QMIX还被用作工程环境中的合作学习骨干，这些环境具有离散的各智能体动作和共享奖励，包括多无人机覆盖路径规划与任务分配，<sup>[14](https://www.sciencedirect.com/science/article/pii/S0020025526005918)</sup><sup> • </sup><sup>[15](https://www.mdpi.com/2504-446X/6/8/215)</sup> 仓库中多台自动导引车的合作控制，<sup>[16](https://ieeexplore.ieee.org/document/9889332/)</sup> 以及智能物流仓储中的订单拣选规划。<sup>[17](https://pmc.ncbi.nlm.nih.gov/articles/PMC11873157/)</sup>

## References

1. [Rashid, T., Samvelyan, M., Schroeder de Witt, C., Farquhar, G., Foerster, J., Whiteson, S. (2018). QMIX: Monotonic Value Function Factorisation for Deep Multi-Agent Reinforcement Learning. ICML, PMLR 80:4295-4304.](https://proceedings.mlr.press/v80/rashid18a.html)
2. [Rashid, T., et al. Monotonic Value Function Factorisation for Deep Multi-Agent Reinforcement Learning (journal version, arXiv:2003.08839).](https://arxiv.org/abs/2003.08839)
3. [Sparse Communication for Policy Shaping in Multi-Agent Reinforcement Learning, PMC.](https://pmc.ncbi.nlm.nih.gov/articles/PMC13259518/)
4. [Q-Mixing Networks (QMIX), XuanCe documentation.](https://xuance.org/documents/algorithms/marl/qmix.html)
5. [Rashid, T., et al. (2020). Monotonic Value Function Factorisation for Deep Multi-Agent Reinforcement Learning. Journal of Machine Learning Research 21:1-51.](https://www.jmlr.org/papers/volume21/20-081/20-081.pdf)
6. [Rashid, T., Farquhar, G., Peng, B., Whiteson, S. (2020). Weighted QMIX: Expanding Monotonic Value Function Factorisation. arXiv:2006.10800.](https://arxiv.org/abs/2006.10800)
7. [QMIX Algorithm Summary, GitHub (SouthwestLili/QMIX-Algorithm).](https://github.com/SouthwestLili/QMIX-Algorithm/blob/main/QMIX_Algorithm_Summary.md)
8. [pymarl qmix.yaml, oxwhirl/pymarl GitHub repository.](https://github.com/oxwhirl/pymarl/blob/master/src/config/algs/qmix.yaml)
9. [Samvelyan, M., et al. (2019). The StarCraft Multi-Agent Challenge. arXiv:1902.04043.](https://arxiv.org/abs/1902.04043)
10. [Son, K., et al. (2019). QTRAN: Learning to Factorize with Transformation for Cooperative Multi-Agent Reinforcement Learning. arXiv:1905.05408.](https://arxiv.org/abs/1905.05408)
11. [Wang, J., et al. (2020). QPLEX: Duplex Dueling Multi-Agent Q-Learning. arXiv:2008.01062.](https://arxiv.org/abs/2008.01062)
12. [Hu, J., et al. (2021). Rethinking the Implementation Tricks and Monotonicity Constraint in Cooperative Multi-Agent Reinforcement Learning. arXiv:2102.03479.](https://arxiv.org/abs/2102.03479)
13. [Ellis, B., et al. (2022). SMACv2: An Improved Benchmark for Cooperative Multi-Agent Reinforcement Learning. arXiv:2212.07489.](https://arxiv.org/abs/2212.07489)
14. [Yuan, H., et al. Hierarchical reinforcement learning with cohesion-aware adaptive planning for large-scale multi-UAV coverage. Information Sciences.](https://www.sciencedirect.com/science/article/pii/S0020025526005918)
15. [Task Allocation of Multiple Unmanned Aerial Vehicles Based on Deep Transfer Reinforcement Learning. Drones 6(8):215.](https://www.mdpi.com/2504-446X/6/8/215)
16. [MARL-Based Cooperative Multi-AGV Control in Warehouse Systems. IEEE.](https://ieeexplore.ieee.org/document/9889332/)
17. [Real time task planning for order picking in intelligent logistics warehousing, PMC.](https://pmc.ncbi.nlm.nih.gov/articles/PMC11873157/)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › Foundation-model methods and training › Reinforcement learning and world models

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/qmix

English original: https://www.edgepedia.org/qmix
