NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Revisiting fundamentals of experience replay

William Fedus, Prajit Ramachandran, Rishabh Agarwal, Yoshua Bengio, Hugo Larochelle, Mark Rowland, Will Dabney

TL;DR

This paper systematically investigates the fundamental properties of experience replay in deep reinforcement learning, specifically replay capacity and replay ratio. They discover that n-step returns are uniquely critical for enabling agents to benefit from larger replay capacities, a finding that challenges conventional wisdom and opens new avenues for improving RL agent performance.

What Problem Does This Paper Address?

Experience replay is a cornerstone of off-policy reinforcement learning (RL), crucial for improving sample efficiency and stability by storing and reusing past experiences. However, despite its widespread use, a deep understanding of why and how experience replay impacts learning, especially in conjunction with modern deep RL components, remains elusive. Researchers often tune hyperparameters like replay buffer size without a clear grasp of the underlying mechanisms. This paper aims to disentangle the effects of key replay properties – replay capacity (how much data is stored) and replay ratio (how often the agent learns from new data vs. old) – and understand their interaction with algorithmic components, particularly n-step returns.

Methods

The authors conduct a large-scale empirical study using the Dopamine Rainbow agent, a well-regarded deep RL algorithm. Their approach involves:

  • Disentangling Factors: They systematically vary replay capacity and the "age of the oldest policy" (a proxy for off-policyness) independently to understand their individual and combined effects.
  • Controlling Replay Ratio: They analyze how the replay ratio (gradient updates per environment transition) influences performance.
  • Additive and Ablative Studies: They build upon a baseline DQN agent by incrementally adding components of the Rainbow agent (prioritized replay, n-step returns, Adam optimizer, C51) to identify which component is responsible for improvements with larger replay capacities. Conversely, they remove components from Rainbow to see if performance gains diminish.
  • Offline RL Experiments: To test the limits of their findings, they evaluate n-step returns in an offline RL setting, where data is fixed and off-policyness is maximized.

Datasets

The experiments were primarily conducted on the Atari 2600 Learning Environment, using a subset of 14 games for initial experiments and a larger subset of 20 games for broader analysis. For the offline RL experiments, they utilized a dataset collected by a DQN agent as described in Agarwal et al. (2020).

Key Insights and Ideas

  • N-step Returns are Key: The most surprising finding is that n-step returns are uniquely critical for agents to benefit from larger replay capacities. Without n-step returns, increasing replay capacity offers little to no improvement, and can even be detrimental.
  • Challenging Conventional Wisdom: Contrary to some prior assumptions, the paper demonstrates that larger replay capacities generally improve performance, especially when combined with n-step returns. This contradicts the idea that larger buffers are always detrimental.
  • Age of Oldest Policy Matters: Decreasing the age of the oldest policy in the replay buffer (i.e., having more recent data) generally leads to improved performance, suggesting the benefit of more on-policy data.
  • N-step Balances Bias-Variance: The authors hypothesize that n-step returns help by balancing the high bias/low variance of single-step TD targets with the low bias/high variance of Monte Carlo targets. This is particularly useful in environments with higher variance, like those with sticky actions.
  • N-step's Theoretical "Flaw" is Beneficial: Uncorrected n-step returns are theoretically problematic in off-policy settings due to potential discrepancies between behavior and target policies. However, the paper shows these "theoretically unprincipled" returns are empirically crucial for leveraging large replay buffers.

Key Results

  • Increased Replay Capacity Boosts Performance: For agents equipped with n-step returns (like Rainbow), increasing replay capacity from 1M to 10M consistently improved performance, with median improvements of up to +28.7% for Rainbow.
  • DQN Alone Doesn't Benefit: A standard DQN agent showed no significant improvement with increased replay capacity, regardless of whether the replay ratio or oldest policy age was fixed.
  • N-step is the Enabler: Adding n-step returns to DQN enabled it to benefit from larger replay capacities, showing median improvements of +24.8% when increasing capacity from 1M to 10M.
  • Offline RL Confirms N-step's Role: In a challenging offline RL setting with massive replay capacities, n-step returns consistently improved performance, validating their importance even under extreme off-policyness.
  • Variance Reduction Hypothesis Partially Supported: Reducing environmental variance (by turning off sticky actions) reduced the gains from increasing replay capacity, supporting the idea that n-step helps manage variance, though it's not the sole explanation.

Limitations and Future Work

  • Computational Cost: The experiments, especially those involving large replay capacities and extensive sweeps, are computationally expensive. The authors had to exclude some extreme settings due to impracticality.
  • Generalization Beyond Atari: While the findings are significant, they are primarily demonstrated on Atari games. Further validation on a wider range of environments would be beneficial.
  • Understanding the "Why": While the paper strongly implicates n-step returns, the precise theoretical mechanism linking them to replay capacity remains an area for deeper investigation. The authors suggest exploring other multi-step and off-policy methods as future work.
  • Interaction with Other Components: The paper focuses on n-step returns but acknowledges that other components of Rainbow (PER, Adam, C51) also interact with replay, and further research into these interactions is warranted.

Summary updated

BibTeX
@inproceedings{fedus2020revisiting,
  author = {William Fedus and Prajit Ramachandran and Rishabh Agarwal and Yoshua Bengio and Hugo Larochelle and Mark Rowland and Will Dabney},
  title = {{Revisiting fundamentals of experience replay}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=s6hLWO5x_Nx},
}
Figure