# 深度Q学习

深度Q学习是一种强化学习方法，它使用深度神经网络来近似动作价值函数 \( Q(s,a) \)，使智能体能够直接从原始像素等高维感知输入中学习成功的策略。<sup>[1](https://www.nature.com/articles/nature14236)</sup> 其标志性成果是深度Q网络（DQN）智能体：仅接收像素和游戏得分，便在49款[Atari 2600](https://www.edgepedia.org/zh/atari-2600)游戏中的43款上超越了此前最佳算法，并在其中29款上以单一算法、单一架构和单一超参数组合达到了超过75%的职业人类得分。<sup>[1](https://www.nature.com/articles/nature14236)</sup> 训练完成后，网络的动作价值估计以贪心方式使用：在每个状态下，智能体选择预测回报最高的动作。该方法无模型，直接从环境样本中求解任务，无需估计奖励或转移动态。<sup>[1](https://www.nature.com/articles/nature14236)</sup>

| 关键事实 | 内容 |
|---|---|
| 近似对象 | 最优动作价值函数 \( Q^{*}(s,a) \)，即在状态s下采取动作a所能获得的最大折扣奖励总和 <sup>[1](https://www.nature.com/articles/nature14236)</sup> |
| 训练信号 | 时序差分（贝尔曼）目标 \( r + \gamma \cdot \max_{a'} Q(s',a') \)，平方误差损失，误差截断至[−1, 1] <sup>[2](https://arxiv.org/abs/1312.5602)</sup><sup> • </sup><sup>[1](https://www.nature.com/articles/nature14236)</sup> |
| 稳定性机制 | 经验回放（从100万条转移的缓冲区中随机抽取小批量）和每10,000步克隆一次的目标网络 <sup>[1](https://www.nature.com/articles/nature14236)</sup><sup> • </sup><sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup> |
| 规范超参数 | \( \gamma = 0.99 \)，学习率 \( \alpha = 0.00025 \)，每4步采样一次大小为32的小批量，ε在100万步内从1退火至0.1，训练5000万步（2亿帧） <sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup> |
| Atari 2015成果 | 在49款游戏中的43款上击败此前最佳强化学习方法；在29款游戏上超过人类得分的75% <sup>[1](https://www.nature.com/articles/nature14236)</sup> |
| 主要已知偏差 | 由max算子导致的高估，在所有49款测试游戏中均观察到；由Double DQN缓解 <sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup> |
| 当前最先进水平 | BTR（2025）：在Atari-60上人类归一化IQM为7.6，在一台桌面PC上12小时内训练2亿帧 <sup>[4](https://proceedings.mlr.press/v267/clark25a.html)</sup> |

## 工作原理

[Q学习](https://www.edgepedia.org/zh/q-learning)通过迭代贝尔曼更新来估计 \( Q^{*}(s,a) \) <sup>[2](https://arxiv.org/abs/1312.5602)</sup>

\[ Q_{i+1}(s,a) = \mathbb{E}\left[ r + \gamma \max_{a'} Q_i(s',a') \,\middle|\, s,a \right], \]

在表格型设定下，当i→∞时该式收敛至Q*。<sup>[2](https://arxiv.org/abs/1312.5602)</sup> 深度Q学习用网络 \( Q(s,a;\theta) \) 替代查找表，并最小化一系列损失函数，通过梯度法对 \( (y_j - Q(\phi_j, a_j; \theta))^2 \) 进行逐步优化，其中对于终止转移目标为 \( y_j = r \)，否则为 \( y_j = r + \gamma \max_{a'} Q(\phi_{j+1}, a'; \theta) \)。<sup>[2](https://arxiv.org/abs/1312.5602)</sup> 学到的Q随后定义贪心策略：选择Q值最大的动作。

将非线性函数逼近、自举（从自身估计中学习）和[离策略学习](https://www.edgepedia.org/zh/off-policy-learning)三者结合，便是致命三元组：价值估计可能发散并变得无界。<sup>[5](https://ar5iv.labs.arxiv.org/html/1812.02648)</sup> 连续观测之间的相关性、数据分布对权重微小变化的敏感性、以及动作价值与目标之间的相关性，都会破坏训练的稳定性。<sup>[1](https://www.nature.com/articles/nature14236)</sup> DQN同时包含了三元组的所有三个成分，却在Atari上取得了成功，这正是其两个稳定器至关重要的原因。<sup>[5](https://ar5iv.labs.arxiv.org/html/1812.02648)</sup>

## 实现方法

实践者按如下步骤运行DQN循环 <sup>[1](https://www.nature.com/articles/nature14236)</sup><sup> • </sup><sup>[2](https://arxiv.org/abs/1312.5602)</sup><sup> • </sup><sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup>：

1. 将帧预处理为84×84×4的堆叠图像（2013年的网络使用两个卷积层和256个整流单元，每个有效动作对应一个输出）。<sup>[2](https://arxiv.org/abs/1312.5602)</sup>
2. 以ε-贪心策略行动：以概率 \( 1 - \varepsilon \) 采取贪心动作，以概率 \( \varepsilon \) 采取随机动作。<sup>[1](https://www.nature.com/articles/nature14236)</sup>
3. 将每条转移 \( e_t = (s_t, a_t, r_t, s_{t+1}) \) 存入容量为100万条元组的回放记忆D中。<sup>[2](https://arxiv.org/abs/1312.5602)</sup><sup> • </sup><sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup>
4. 每4个环境步，随机采样一个大小为32的小批量转移，在平方TD误差上执行一次梯度步，误差项截断至[−1, 1]。<sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup><sup> • </sup><sup>[1](https://www.nature.com/articles/nature14236)</sup>
5. 每10,000步，将在线网络克隆到目标网络Q̂，两次克隆之间的TD目标由目标网络生成。<sup>[1](https://www.nature.com/articles/nature14236)</sup><sup> • </sup><sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup>

规范设置：折扣 \( \gamma = 0.99 \)，学习率 \( \alpha = 0.00025 \)，\( \varepsilon \) 在前100万步内从1退火至0.1，训练5000万步（2亿帧）。<sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup>

## 起源

前身工作包括：表格型Q学习，由克里斯托弗·J. C. H. 沃特金斯和彼得·达扬于1992年在《Machine Learning》上提出，并给出了递减步长下的渐近收敛分析 <sup>[6](https://doi.org/10.1007/bf00992698)</sup>；TD-Gammon，杰拉尔德·特索罗开发的双陆棋程序，完全通过强化学习和自我对弈学习至超人水平 <sup>[7](https://doi.org/10.1145/203330.203343)</sup>；以及[街机学习环境](https://www.edgepedia.org/zh/arcade-learning-environment)（Arcade Learning Environment），即M. G. 贝勒马尔、Y. 纳达夫、J. 维内斯和M. 鲍林于2013年在《Journal of Artificial Intelligence Research》上报道的通用智能体Atari模拟器平台。<sup>[8](https://doi.org/10.1613/jair.3912)</sup>

深度Q学习本身由沃洛迪米尔·姆尼赫及其同事在2013年arXiv预印本《Playing Atari with Deep Reinforcement Learning》中报道，应用于七款Atari游戏，未做任何架构或算法调整。<sup>[2](https://arxiv.org/abs/1312.5602)</sup> 《Nature》版本《Human-level control through deep reinforcement learning》由沃洛迪米尔·姆尼赫及其同事（2015）发表，增加了周期性克隆的目标网络，并将评估扩展至49款游戏。<sup>[1](https://www.nature.com/articles/nature14236)</sup>

## 变体

**Double DQN。** max算子使用相同的值来选择动作和评估动作，因此高估的值更有可能被选中。<sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup> 表格型Double Q学习由哈多·范·哈塞尔特在2010年NeurIPS上提出，使用双重估计器，有时会低估。<sup>[9](https://proceedings.neurips.cc/paper/2010/file/091d584fced301b442654dd8c23b3fc9-Paper.pdf)</sup> Double DQN由哈多·范·哈塞尔特、阿瑟·盖兹和[大卫·西尔弗](https://www.edgepedia.org/zh/david-silver)（AAAI 2016）报道，将其推广到深度网络，用目标网络评估在线网络的贪心动作 <sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup>：

\[ Y^{\mathrm{DoubleDQN}}_t = R_{t+1} + \gamma\, Q\bigl(S_{t+1}, \operatorname{argmax}_{a} Q(S_{t+1}, a; \theta_t),\, \theta_t^- \bigr). \]

**优先经验回放。** 由汤姆·绍尔、约翰·权、扬尼斯·安东诺格鲁和大卫·西尔弗（2015）报道，它以更高频率采样TD误差大的转移，并用重要性采样校正偏差；在49款游戏中的41款上击败了均匀回放的DQN。<sup>[10](https://arxiv.org/abs/1511.05952)</sup>

**竞争网络。** 由王梓宇及其同事（2015）报道，该架构将状态价值和优势流分离，以跨动作泛化。<sup>[11](https://doi.org/10.48550/arxiv.1511.06581)</sup>

**分布Q学习（C51）。** 由马克·G. 贝勒马尔、威尔·达布尼和雷米·穆诺斯（2017）报道，它学习折扣回报在51个原子上的分类分布而非均值；在5000万帧内，它在57款游戏中的45款上超越了完全训练的DQN。<sup>[12](https://proceedings.mlr.press/v70/bellemare17a/bellemare17a.pdf)</sup>

**Noisy DQN** 使用随机网络层进行探索。<sup>[13](https://cdn.aaai.org/ojs/11796/11796-13-15324-1-2-20201228.pdf)</sup> **Rainbow** 由马泰奥·赫塞尔及其同事（2017）报道，将六种扩展集成到一个智能体中，在所有57款游戏上使用相同的超参数。<sup>[13](https://cdn.aaai.org/ojs/11796/11796-13-15324-1-2-20201228.pdf)</sup> 在消融实验中，分布Q学习贡献最大。<sup>[13](https://cdn.aaai.org/ojs/11796/11796-13-15324-1-2-20201228.pdf)</sup>

## 应用

DQN在49款游戏中的43款上超越了现有最佳强化学习方法，并在29款游戏上超过了人类得分的75%。<sup>[1](https://www.nature.com/articles/nature14236)</sup> 人类归一化得分定义为 \( 100 \cdot (s_{\mathrm{agent}} - s_{\mathrm{random}}) / (s_{\mathrm{human}} - s_{\mathrm{random}}) \)，因此0为随机游玩，100为职业人类水平。<sup>[14](https://research.google/blog/from-pixels-to-actions-human-level-control-through-deep-reinforcement-learning/)</sup><sup> • </sup><sup>[15](https://github.com/google-deepmind/dqn_zoo/blob/master/dqn_zoo/atari_data.py)</sup> 源自DQN的方案仍是Atari进展的骨干：BTR（Beyond The Rainbow，ICML 2025）将六项改进集成到[Rainbow](https://www.edgepedia.org/zh/rainbow-dqn-variants) DQN中，在Atari-60上达到人类归一化四分位均值7.6，在高档桌面硬件上12小时内训练2亿帧。<sup>[4](https://proceedings.mlr.press/v267/clark25a.html)</sup>

## 局限与替代方案

**高估偏差。** 特伦和施瓦茨于1993年对其进行了量化：当值误差在[−ε,ε]内均匀随机时，每个目标被高估最多 \( \gamma\varepsilon(m-1)/(m+1) \)，其中m为动作数。<sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup> DQN的高估在所有49款测试Atari游戏中均被观察到。<sup>[3](https://doi.org/10.1609/aaai.v30i1.10295)</sup> Double Q学习以低估偏差作为交换，在近似贝尔曼算子下可能产生多个非最优不动点。<sup>[16](https://papers.neurips.cc/paper_files/paper/2021/file/54e8912427a8d007ece906c577fdca60-Paper.pdf)</sup>

**不稳定性。** 在受控实验中，普通Q学习表现出最大的不稳定比例（61%的运行出现软发散），而缺少重要性采样校正时，发散运行的频率最高可达10倍。<sup>[5](https://ar5iv.labs.arxiv.org/html/1812.02648)</sup> 样本效率是弱项：最先进的Atari智能体需要数百万帧，以标准帧率计相当于数天的游玩，而人类在几分钟内即可达到类似表现。<sup>[17](https://ar5iv.labs.arxiv.org/html/2003.10181)</sup>

**替代方案。** DQN可视为拟合Q迭代的在线形式；固定目标网络使其等价于带随机梯度更新的FQI。<sup>[18](https://papers.nips.cc/paper/2017/file/393c55aea738548df743a186d15f3bef-Paper.pdf)</sup> 受控比较表明，有限时域蒙特卡洛（QMC）在感知复杂的3D环境中匹配或超越基于TD的方法，因为它基于真实回报训练，而非自举的“猜测之猜测”目标。<sup>[19](https://lmbweb.informatik.uni-freiburg.de/Publications/2018/AB18/paper-tdornottd.pdf)</sup> 截断Double Q学习已成为大多数高级[演员-评论家算法](https://www.edgepedia.org/zh/actor-critic-algorithm)的默认实现。<sup>[16](https://papers.neurips.cc/paper_files/paper/2021/file/54e8912427a8d007ece906c577fdca60-Paper.pdf)</sup>

目标网络不再是必需的：HANQ（RLJ/RLC 2025）用非对称预测器、归一化层和学习率上的超梯度下降替代DQN的目标网络，在四个环境中的三个环境的离线强化学习实验中匹配或超越DQN。<sup>[20](https://rlj.cs.umass.edu/2025/papers/RLJ_RLC_2025_137.pdf)</sup> 已发表的比较尚未涵盖基于Transformer的价值函数或DQN在大语言模型/基于人类反馈的强化学习时代的作用，因此对这些发展不做断言。

## References

1. [Human-level control through deep reinforcement learning (Mnih et al., Nature 518, 529–533, 2015)](https://www.nature.com/articles/nature14236)
2. [Playing Atari with Deep Reinforcement Learning (Mnih et al., 2013, arXiv:1312.5602, NIPS Deep Learning Workshop)](https://arxiv.org/abs/1312.5602)
3. [van Hasselt, Hado, Guez, Arthur, Silver, David (2016). Deep Reinforcement Learning with Double Q-Learning. AAAI Publications (The Association for the Advancement of Artificial Intelligence (AAAI)).](https://doi.org/10.1609/aaai.v30i1.10295)
4. [Beyond The Rainbow: High Performance Deep Reinforcement Learning on a Desktop PC (ICML 2025, PMLR)](https://proceedings.mlr.press/v267/clark25a.html)
5. [Deep Reinforcement Learning and the Deadly Triad (DeepMind, arXiv:1812.02648)](https://ar5iv.labs.arxiv.org/html/1812.02648)
6. [Christopher J. C. H. Watkins, Peter Dayan (1992). Q-learning. Machine Learning.](https://doi.org/10.1007/bf00992698)
7. [Gerald Tesauro (1995). Temporal difference learning and TD-Gammon. Communications of the ACM.](https://doi.org/10.1145/203330.203343)
8. [M. G. Bellemare and colleagues (2013). The Arcade Learning Environment: An Evaluation Platform for General Agents. Journal of Artificial Intelligence Research.](https://doi.org/10.1613/jair.3912)
9. [Double Q-learning (van Hasselt, NeurIPS 2010)](https://proceedings.neurips.cc/paper/2010/file/091d584fced301b442654dd8c23b3fc9-Paper.pdf)
10. [Prioritized Experience Replay (Schaul et al., ICLR 2016)](https://arxiv.org/abs/1511.05952)
11. [Wang, Ziyu and colleagues (2015). Dueling Network Architectures for Deep Reinforcement Learning. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1511.06581)
12. [A Distributional Perspective on Reinforcement Learning (Bellemare, Dabney, Munos, ICML 2017)](https://proceedings.mlr.press/v70/bellemare17a/bellemare17a.pdf)
13. [Rainbow: Combining Improvements in Deep Reinforcement Learning (Hessel et al., AAAI 2018)](https://cdn.aaai.org/ojs/11796/11796-13-15324-1-2-20201228.pdf)
14. [From Pixels to Actions: Human-level control through Deep Reinforcement Learning (Google Research blog, Feb 25 2015)](https://research.google/blog/from-pixels-to-actions-human-level-control-through-deep-reinforcement-learning/)
15. [dqn_zoo atari_data.py, DeepMind reference human/random Atari-57 scores](https://github.com/google-deepmind/dqn_zoo/blob/master/dqn_zoo/atari_data.py)
16. [On the Estimation Bias in Double Q-Learning (Doubly Bounded Q-learning, NeurIPS 2021)](https://papers.neurips.cc/paper_files/paper/2021/file/54e8912427a8d007ece906c577fdca60-Paper.pdf)
17. [Importance of using appropriate baselines for evaluation of data-efficiency in deep reinforcement learning for Atari (arXiv:2003.10181)](https://ar5iv.labs.arxiv.org/html/2003.10181)
18. [Shallow Updates for Deep Reinforcement Learning (LS-DQN, NeurIPS 2017)](https://papers.nips.cc/paper/2017/file/393c55aea738548df743a186d15f3bef-Paper.pdf)
19. [TD or not TD: Analyzing the Role of Temporal Differencing in Deep Reinforcement Learning (University of Freiburg)](https://lmbweb.informatik.uni-freiburg.de/Publications/2018/AB18/paper-tdornottd.pdf)
20. [HANQ: Hypergradients, Asymmetry, and Normalization for Fast and Stable Deep Q-Learning (RLJ/RLC 2025)](https://rlj.cs.umass.edu/2025/papers/RLJ_RLC_2025_137.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 25, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/deep-q-learning

English original: https://www.edgepedia.org/deep-q-learning
