Dopamine: A Research Framework for Deep Reinforcement Learning

Pablo Samuel Castro, Subhodeep Moitra, Carles Gelada, Saurabh Kumar, Marc G. BellemarearXiv 2018

Abstract

Dopamine is a minimalist, TensorFlow-based framework from Google Brain designed specifically for fast prototyping and reliable reproduction of Deep Reinforcement Learning (RL) algorithms. By prioritizing a small, readable codebase (~2,000 lines) over a "Swiss Army knife" approach, it provides researchers with a stable foundation to iterate on core algorithmic ideas without getting lost in framework complexity.

Introduction

The field of Deep Reinforcement Learning has been plagued by two major issues: reproducibility and framework bloat. As RL agents have grown more complex, so has the software used to build them. Popular frameworks often prioritize being "comprehensive," resulting in highly modularized code where a single agent might be spread across numerous files. This makes it difficult for newcomers to learn and for researchers to implement radically different ideas without fighting the framework's abstractions.

Furthermore, subtle differences in implementation details—such as how an episode ends or how randomness is handled—can lead to wildly different performance results. This lack of standardization makes it nearly impossible to compare new algorithms against published baselines fairly. Dopamine addresses these challenges by providing a transparent, compact, and highly tested environment for RL research.

Methodology

Dopamine is built on three core principles: compactness, reliability, and reproducibility. The entire core codebase consists of just 12 Python files, avoiding deep inheritance hierarchies and complex abstractions to ensure the logic is easy to follow.

The Dopamine framework architecture, highlighting its modular yet compact design with line counts for key files.

The framework uses gin-config for hyperparameter management, allowing researchers to specify all experiment parameters in a single, readable file. It focuses initially on value-based agents, providing high-quality implementations of four milestone algorithms: DQN, C51, a simplified Rainbow agent, and IQN. To ensure reliability, the framework includes a full suite of tests with over 98% code coverage.

Experiments are benchmarked using the Arcade Learning Environment (ALE). Dopamine specifically implements "best practices" for ALE evaluation, such as the use of "sticky actions" (a 25% chance the environment repeats the previous action) to ensure results are robust and not merely a product of environment memorization.

Key Results and Insights

Dopamine's design allows for clear insights into how implementation choices affect agent performance. One significant finding involves termination heuristics. A common practice in RL is to end an episode when an agent loses a "life" rather than waiting for a full "Game Over."

Learning curves comparing "Game Over" vs "Life Loss" termination conditions across three Atari games (Asterix, Breakout, and Space Invaders).

As shown in the figure above, the choice of termination condition can lead to vastly different performance trajectories. While the "Life Loss" heuristic (darker lines) significantly accelerates learning in games like Asterix and Breakout, the authors note it can hinder learning in more complex games like Montezuma’s Revenge by preventing the agent from understanding the true consequences of its actions. This variability underscores the importance of Dopamine’s commitment to providing raw training data and trained models to facilitate "apples-to-apples" comparisons.

Despite its focus on simplicity, the framework remains efficient. For instance, a DQN agent running on Pong achieves approximately 800 frames per second (fps) on a Tesla P100 GPU.

Limitations and Future Work

The initial release of Dopamine is intentionally limited in scope to maintain its core commitment to simplicity. It currently supports only value-based agents and single-GPU execution within the Atari environment. It does not yet include policy-based methods (like PPO or A3C) or support for continuous control tasks (like MuJoCo).

Future development plans include extending the framework to support policy-based methods and more advanced visualization tools. However, the team remains cautious about adding architectural complexity, ensuring that Dopamine remains an accessible and reliable tool for algorithmic research and instruction.

Summary updated

BibTeX
@misc{castro2018dopamine,
  author = {Pablo Samuel Castro and Subhodeep Moitra and Carles Gelada and Saurabh Kumar and Marc G. Bellemare},
  title = {{Dopamine: A Research Framework for Deep Reinforcement Learning}},
  year = {2018},
  eprint = {1812.06110},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.06110},
}
Figure