Distributed Prioritized Experience Replay

Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado van Hasselt, David Silver

Summary

The Ape-X (Distributed Prioritized Experience Replay) architecture decouples data generation from learning, allowing deep reinforcement learning agents to process orders of magnitude more data than previously possible. By using prioritized sampling to focus on the most "useful" experiences, Ape-X achieves new state-of-the-art results on Atari benchmarks in a fraction of the wall-clock time required by previous methods.

Introduction

Deep reinforcement learning (RL) has traditionally been limited by the computational budget of a single machine. While supervised learning has successfully scaled using distributed gradient computation, scaling RL presents unique challenges.

The core difficulty in RL is two-fold: agents must generate vast amounts of diverse experience (exploration) and then efficiently learn from the most informative parts of that data (exploitation). Previous distributed approaches, like Gorila or A3C, focused on parallelizing gradient updates or running multiple learners. However, these methods often struggled with "stale" data or inefficient use of the massive amounts of experience generated. The authors of this paper address a critical question: How can we best harness massive computational resources to generate more data and select the best parts of it to learn from?

The Ape-X Architecture

The authors introduce Ape-X, a distributed architecture that separates the RL process into three distinct, interacting components:

Ape-X Architecture Diagram
  1. Actors (The Generators): Hundreds of workers run independent instances of the environment on CPUs. They use a local, periodically updated copy of the neural network to select actions. Crucially, each actor uses a different exploration policy (e.g., varying $\epsilon$-greedy values). They compute an initial "priority" for each transition based on the temporal-difference (TD) error and send this data to a central buffer.
  2. Replay Buffer (The Warehouse): A massive, centralized memory stores millions of transitions. Unlike standard buffers that sample uniformly, this one uses Prioritized Experience Replay (PER). It favors transitions that the agent found "surprising" or difficult to predict, ensuring the most valuable data is surfaced.
  3. Learner (The Optimizer): A single high-performance GPU worker samples batches of high-priority experience from the buffer, calculates gradients, updates the main neural network, and updates the priorities of the sampled data back in the buffer.

The paper demonstrates this architecture using two algorithmic variants: Ape-X DQN (for discrete actions like Atari) and Ape-X DPG (for continuous control).

Core Principles

  • Decoupling is Key: By separating acting from learning, the system can generate data at a massive scale (up to 50K frames per second) without the learner being bottlenecked by environment simulation.
  • Prioritization as a Filter: In a sea of generated data, most transitions are redundant. Prioritization acts as a filter, ensuring the learner spends its GPU cycles on the most informative experiences. The authors found that prioritization becomes more important as the number of actors increases.
  • Diversity Prevents Local Optima: By giving different actors different exploration rates, the system avoids "collapse" where an agent gets stuck in a sub-optimal strategy. Some actors explore deeply, while others focus on fine-tuning known rewards.
  • Off-Policy Advantage: This architecture thrives on off-policy learning. Because the learner doesn't need data to be "fresh" (generated by the very latest parameters), it can leverage a massive history of diverse experiences.

Performance and Results

The architecture was evaluated on the Arcade Learning Environment (ALE), a suite of 57 Atari 2600 games, and the DeepMind Control Suite for continuous control tasks.

Ape-X Performance vs. Baselines
  • New State-of-the-Art: Ape-X DQN achieved a median human-normalized score of 434% across 57 Atari games, nearly doubling the performance of the previous best agent, Rainbow (223%).
  • Massive Speedup: Ape-X reached the performance levels of previous state-of-the-art agents in just a few hours of wall-clock time, whereas those agents took days or weeks to train.
  • Linear Scaling: The speed of data generation scaled linearly with the number of actors (tested up to 256 actors), and performance consistently improved as the actor count increased.
  • Continuous Control: Ape-X DPG outperformed standard DDPG baselines on complex tasks like Humanoid Running, solving them significantly faster and more reliably.

Limitations and Future Work

While wall-clock time is dramatically reduced, the total CPU/GPU hour "cost" is high. Running hundreds of actors requires significant infrastructure. Furthermore, the architecture is specifically designed for off-policy algorithms; adapting this to on-policy methods (like PPO) would require significant changes to how data is buffered and reused. Finally, while the authors suggest this could be applied to "robot farms" or large-scale multi-user systems, transitioning from simulated environments to the real world remains a formidable challenge.

Summary updated

BibTeX
@inproceedings{horgan2018distributed,
  author = {Dan Horgan and John Quan and David Budden and Gabriel Barth-Maron and Matteo Hessel and Hado van Hasselt and David Silver},
  title = {{Distributed Prioritized Experience Replay}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=H1Dy---0Z},
}
Figure