Abstract
Reproducing state-of-the-art results in deep reinforcement learning (RL) is notoriously difficult due to the sensitivity of algorithms to undocumented implementation details. This paper explores the "dark matter" of the Deep Q-Network (DQN), identifying the specific engineering choices required to replicate DeepMind’s 2015 Atari benchmarks. We present a Java-based implementation using the BURLAP library that achieves comparable performance to the original while running approximately four times faster.
Introduction
In 2015, the Deep Q-Network (DQN) demonstrated human-level performance on Atari 2600 games, marking a milestone in AI. However, the RL community has since recognized a "reproducibility crisis." While high-level concepts like Experience Replay and Target Networks are well-documented, low-level "engineering" choices often determine success or failure. This study aims to bridge this gap by documenting the specific parameters and software optimizations necessary to make DQN function as intended.
Methodology and Implementation
The implementation utilizes the BURLAP (Brown-UMBC Reinforcement Learning and Planning) Java library, with Caffe handling the neural network backend and the Arcade Learning Environment (ALE) providing the simulation. To optimize performance and stability, several critical nuances were incorporated:
- Frame Skipping: The agent processes every 4th frame, reducing computational load without sacrificing control fidelity.
- No-op Starts: Episodes begin with up to 30 "No-op" actions to prevent the agent from overfitting to deterministic starting sequences.
- Experience Pre-filling: The replay buffer is initialized with 50,000 random actions to ensure a diverse initial training set.
- Memory Optimization: Leveraging cuDNN and preallocated memory vectors allowed for a significant increase in frame throughput.
Critical Implementation Insights
Two specific details emerged as vital for stable learning:
Termination on Loss of Life
Standard RL theory suggests using the "Game Over" screen as the terminal state. However, we found that treating the loss of a single life as a terminal state significantly improves learning stability in games like Breakout and Seaquest. This provides a more immediate and frequent signal that certain actions lead to negative outcomes, accelerating policy convergence.
RMSProp Configuration
The original DQN research utilized a non-standard RMSProp optimizer with a momentum factor. Standard implementations in libraries like Caffe or TensorFlow lack this specific behavior. To achieve stability with standard RMSProp, we found it necessary to reduce the learning rate from the original 0.00025 to 0.00005.
Performance and Results
Our implementation demonstrated substantial improvements in training efficiency. On comparable hardware, the system achieved ~985 frames per second (fps), a 4x increase over the original Lua/Torch implementation (~271 fps). This reduced total training time from over 10 days to approximately 3 days.
As shown in the figure above, DQN performance is not always monotonic. Agents can experience "catastrophic forgetting," where a network that previously achieved high scores suddenly degrades. This is visible in the comparison between the "Best" and "Worst" networks for specific game states in Breakout. Despite these swings, final scores were competitive with DeepMind's original results:
- Pong: 19.7 (Original: 18.9)
- Seaquest: 6309 (Original: 5286)
- Breakout: 339.3 (Original: 401.2)
Conclusion
The success of DQN relies heavily on specific, often overlooked implementation details. While these "tricks"—such as life-loss termination—are effective in the Atari domain, they highlight the fragility of current RL methods and the difficulty of generalizing these techniques to other fields like robotics. Future research should focus on developing more robust algorithms that are less sensitive to hyperparameter tuning and domain-specific engineering.
Summary updated