# R2D2（强化学习）

**R2D2**（Recurrent Replay Distributed DQN，循环回放分布式DQN）是Steven Kapturowski、Georg Ostrovski、Will Dabney、John Quan和Rémi Munos在DeepMind提出的一种分布式深度强化学习智能体，发表于ICLR 2019论文，它通过分布式优先经验回放来训练循环网络智能体<sup>[1](https://khansong-paper-with-me.hf.space/paper/recurrent-experience-replay-in-distributed)</sup>。仅使用单一网络架构和一组固定超参数，R2D2就在Atari-57基准上将此前的最佳成绩提升至四倍，并在DMLab-30上超越了最佳成绩<sup>[1](https://khansong-paper-with-me.hf.space/paper/recurrent-experience-replay-in-distributed)</sup>。

| 关键事实 | 详情 |
|---|---|
| 全称与来源 | Recurrent Replay Distributed DQN，ICLR 2019，Kapturowski、Ostrovski、Dabney、Quan和Munos<sup>[1](https://khansong-paper-with-me.hf.space/paper/recurrent-experience-replay-in-distributed)</sup> |
| 核心思想 | 通过分布式优先经验回放训练基于RNN的强化学习智能体，在Ape-X设计基础上扩展循环（LSTM）网络<sup>[1](https://khansong-paper-with-me.hf.space/paper/recurrent-experience-replay-in-distributed)</sup><sup> • </sup><sup>[2](https://openreview.net/pdf?id=r1lyTjAqYX)</sup> |
| 循环回放 | 循环状态与每条序列一同存入回放缓冲区，在计算损失前用预热前缀更新所存状态<sup>[3](https://scalablebook.icsgen-ai.org/part-4-parallel-deep-learning/module-20-distributed-rl-infrastructure/section-20.6.html)</sup> |
| 基准测试 | Atari-57（经典电子游戏）和DMLab-30（3D探索任务），两者共用同一架构和同一组超参数<sup>[1](https://khansong-paper-with-me.hf.space/paper/recurrent-experience-replay-in-distributed)</sup><sup> • </sup><sup>[4](https://www.chapterpal.com/s/u9ribxiy/recurrent-experience-replay-in-distributed-reinforcement-learning)</sup> |
| 结果 | 在Atari-57上将此前最佳成绩提升至四倍，在DMLab-30上超越最佳成绩<sup>[1](https://khansong-paper-with-me.hf.space/paper/recurrent-experience-replay-in-distributed)</sup> |
| 参考设置 | 在Google的SEED RL实现中：预热长度40，优先级指数0.9（取自R2D2论文表2），重要性采样指数0.6，5步回报，价值函数重缩放参数ε为0.001<sup>[5](https://github.com/google-research/seed_rl/blob/master/agents/r2d2/learner.py)</sup> |

## 背景及与Ape-X的关系

R2D2属于分布式强化学习智能体家族，这类系统中许多执行者在并行生成经验，而一个或多个学习器从共享的回放缓冲区中训练。它的直接前身是Ape-X，论文指出两者的主要算法差异在于使用了循环神经网络<sup>[2](https://openreview.net/pdf?id=r1lyTjAqYX)</sup>。作者指出，这一差异使R2D2在Atari上相较此前最佳成绩的提升幅度令人惊讶，因为Atari-57环境几乎可以从堆叠帧中完全观测，因此智能体本不应从记忆增强表示中获得显著收益<sup>[2](https://openreview.net/pdf?id=r1lyTjAqYX)</sup>。

由于异步或分布式智能体的性能可能取决于微妙的实现细节乃至精确的硬件配置，作者认为与最初报告的Ape-X结果进行直接比较并不现实。因此，他们将R2D2与所有其他参数保持固定的纯前馈变体进行了比较<sup>[2](https://openreview.net/pdf?id=r1lyTjAqYX)</sup>。

## 循环经验回放的工作原理

从回放缓冲区训练循环网络会产生一个特定问题：存储的序列从回合中途开始，因此网络在序列开始时的隐藏状态是未知的。R2D2通过两种协同运作的机制解决这一问题。首先，循环状态与每条序列一同存储在回放缓冲区中，因此采样时会恢复智能体在该时间点实际拥有的状态<sup>[3](https://scalablebook.icsgen-ai.org/part-4-parallel-deep-learning/module-20-distributed-rl-infrastructure/section-20.6.html)</sup>。其次，在计算损失之前，将一段预热前缀时间步通过网络运行以更新所存的循环状态；这些步骤不计算损失，也不传播梯度<sup>[5](https://github.com/google-research/seed_rl/blob/master/agents/r2d2/learner.py)</sup>。在Google的SEED RL对该算法的实现中，预热长度为40步，连续两个存储展开在预热步骤上重叠<sup>[5](https://github.com/google-research/seed_rl/blob/master/agents/r2d2/learner.py)</sup>。

存储状态与序列回放预热的结合，是循环价值学习能够在大规模训练中保持稳定的原因；一篇关于该算法的评论认为，在部分可观测Atari测试集上创下当时纪录分数，正是这一结合的功劳<sup>[6](https://temporalbook.icsgen-ai.org/part-6-sequential-decision-making/module-23-pomdps/section-23.3.html)</sup>。

**序列的优先回放。** 与其前身一样，R2D2按优先级比例从回放缓冲区中采样整条序列。直接基于该算法的后续工作将序列的优先级描述为序列内绝对n步TD误差的最大值与均值的混合，写作 \( p = \eta \cdot \max(\delta) + (1 - \eta) \cdot \bar{\delta} \)，其中 \( \eta = 0.9 \) 的选择是为了避免压缩优先级范围；SEED RL代码确认0.9为R2D2论文表2中的优先级指数<sup>[7](https://www.researchgate.net/publication/344734667_Recurrent_Distributed_Reinforcement_Learning_for_Partially_Observable_Robotic_Assembly)</sup><sup> • </sup><sup>[5](https://github.com/google-research/seed_rl/blob/master/agents/r2d2/learner.py)</sup>。由于优先采样改变了更新的分布，重要性采样权重用于修正由此产生的偏差；SEED RL实现使用的重要性采样指数为0.6<sup>[5](https://github.com/google-research/seed_rl/blob/master/agents/r2d2/learner.py)</sup>。

## 性能分析

论文的消融实验分离了循环网络的贡献。在相同设置下比较完整的R2D2智能体与前馈变体，作者发现LSTM组件对智能体的峰值性能和学习速度都至关重要，解释了与Ape-X的大部分性能差异<sup>[4](https://www.chapterpal.com/s/u9ribxiy/recurrent-experience-replay-in-distributed-reinforcement-learning)</sup>。为了探究记忆所表示的内容，他们用限制在固定历史长度上的策略评估训练好的智能体：在时间步 \( t \)，LSTM在 \( o_{t-k+1}, \ldots, o_t \) 上展开，隐藏状态 \( h_{t-k} \) 替换为零，该限制仅在评估时应用，训练时不使用<sup>[2](https://openreview.net/pdf?id=r1lyTjAqYX)</sup>。

评估涵盖了Atari-57和DMLab-30两个高难度基准套件，全程使用相同的网络设计和超参数设置，以证明该智能体的可靠性是广泛的而非针对每个任务调优的<sup>[4](https://www.chapterpal.com/s/u9ribxiy/recurrent-experience-replay-in-distributed-reinforcement-learning)</sup>。

## 影响与后续使用

R2D2成为强化学习研究中的标准循环基线。2022年的一种检索增强强化学习方法将其检索过程集成到在线R2D2智能体中，并在Atari上表明检索增强版本的学习速度显著快于基线R2D2且取得更高分数<sup>[8](https://arxiv.org/abs/2202.08417)</sup>。在机器人领域，用于部分可观测机器人装配的循环分布式DDPG（RD2）智能体将同样的方案扩展到连续动作空间，在Ape-X风格分布式DDPG的执行者和价值评估网络中增加LSTM层，并按R2D2的方式按优先级采样序列<sup>[7](https://www.researchgate.net/publication/344734667_Recurrent_Distributed_Reinforcement_Learning_for_Partially_Observable_Robotic_Assembly)</sup>。Google的SEED RL框架附带一个持续维护的R2D2智能体实现<sup>[5](https://github.com/google-research/seed_rl/blob/master/agents/r2d2/learner.py)</sup>，2025年《Reinforcement Learning Journal》的一篇论文仍将R2D2用作基于价值的基线，沿用原始配置中的预热LSTM长度40和优先级混合参数0.9<sup>[9](https://openreview.net/pdf/a0cf45f2de1d1a6fa918a8555d122937be35aabe.pdf)</sup>。

## 名称的其他用途

R2D2这一名称被重新用于无关系统。NVIDIA于2025年3月推出的R²D²是“机器人研究与开发文摘”（Robotics Research and Development Digest），一个博客系列，涵盖MobilityGen、COMPASS、HOVER和ReMEmbR等机器人移动与全身控制工作流<sup>[10](https://developer.nvidia.com/blog/r2d2-advancing-robot-mobility-whole-body-control-with-ai-from-nvidia-research/)</sup>。2025年的一篇arXiv论文提出了一个独立的R2D2框架用于网络智能体，将记忆增强导航与反思学习相结合；在WebArena基准上，它报告导航错误减少50%，任务完成率提高至原来的三倍<sup>[11](https://arxiv.org/abs/2501.12485)</sup>。

## References

1. [Kapturowski, S., Ostrovski, G., Dabney, W., Quan, J., Munos, R. (2019). Recurrent Experience Replay in Distributed Reinforcement Learning (paper companion page)](https://khansong-paper-with-me.hf.space/paper/recurrent-experience-replay-in-distributed)
2. [Recurrent Experience Replay in Distributed Reinforcement Learning, ICLR 2019 conference paper PDF](https://openreview.net/pdf?id=r1lyTjAqYX)
3. [Section 20.6: Ape-X, R2D2, and SEED RL Designs, Scaling Out AI](https://scalablebook.icsgen-ai.org/part-4-parallel-deep-learning/module-20-distributed-rl-infrastructure/section-20.6.html)
4. [Recurrent Experience Replay in Distributed Reinforcement Learning, chapter summary](https://www.chapterpal.com/s/u9ribxiy/recurrent-experience-replay-in-distributed-reinforcement-learning)
5. [seed_rl/agents/r2d2/learner.py, google-research/seed_rl, GitHub](https://github.com/google-research/seed_rl/blob/master/agents/r2d2/learner.py)
6. [Section 23.3: Recurrent and SSM-Based Agents for Partial Observability, Building Temporal AI](https://temporalbook.icsgen-ai.org/part-6-sequential-decision-making/module-23-pomdps/section-23.3.html)
7. [Recurrent Distributed Reinforcement Learning for Partially Observable Robotic Assembly](https://www.researchgate.net/publication/344734667_Recurrent_Distributed_Reinforcement_Learning_for_Partially_Observable_Robotic_Assembly)
8. [Goyal, A., et al. (2022). Retrieval-Augmented Reinforcement Learning. arXiv:2202.08417](https://arxiv.org/abs/2202.08417)
9. [Reinforcement Learning Journal 2025 (paper using R2D2 as a baseline)](https://openreview.net/pdf/a0cf45f2de1d1a6fa918a8555d122937be35aabe.pdf)
10. [R²D²: Advancing Robot Mobility and Whole-Body Control with Novel Workflows and AI Foundation Models from NVIDIA Research, NVIDIA Technical Blog, March 27, 2025](https://developer.nvidia.com/blog/r2d2-advancing-robot-mobility-whole-body-control-with-ai-from-nvidia-research/)
11. [Huang, T., et al. (2025). R2D2: Remembering, Reflecting and Dynamic Decision Making for Web Agents. arXiv:2501.12485](https://arxiv.org/abs/2501.12485)

---
*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/r2d2-reinforcement-learning

English original: https://www.edgepedia.org/r2d2-reinforcement-learning
