How Many Random Seeds? Statistical Power Analysis in Deep Reinforcement Learning Experiments

Cédric Colas, Olivier Sigaud, Pierre-Yves OudeyerarXiv 2018

Introduction

Deep Reinforcement Learning (RL) is currently grappling with a "reproducibility crisis." Despite the field's rapid progress, experimental results are often unreliable due to small sample sizes and high variance. A common practice in RL literature is to claim a new "State of the Art" (SOTA) based on experiments using only 3 to 5 random seeds. However, RL algorithms are notoriously sensitive to initial conditions and environment stochasticity.

Comparison of two algorithms on the Half-Cheetah environment, demonstrating high variance and overlapping performance bands that make visual comparison difficult.

Running the same algorithm twice with different sets of 5 seeds can produce learning curves that appear to come from entirely different distributions. This leads to two major issues: Type-I Errors (False Positives), where Algorithm A is claimed to be better than Algorithm B when they are actually identical, and Type-II Errors (False Negatives), where genuine improvements are missed because noise drowns out the signal.

Statistical Power Analysis

To move beyond "eyeballing" shaded area overlaps on graphs, this paper advocates for rigorous statistical testing, specifically Statistical Power Analysis. Power analysis helps researchers determine the required sample size ($N$) to detect a specific performance gap (effect size) while maintaining a low probability of false negatives ($\beta$).

The relationship between the null hypothesis ($H_0$), alternative hypothesis ($H_a$), significance level ($\alpha$), and statistical power ($1-\beta$) in the context of a t-test.

The core workflow involves three steps:

  1. Pilot Study: Conduct a small number of runs (e.g., $n=20$) to estimate the mean and standard deviation.
  2. Power Calculation: Use these estimates to determine the $N$ needed for a desired power (typically 0.8).
  3. Main Experiment: Execute the full number of seeds prescribed.

Methodology and Tools

The authors contrast two primary statistical tools:

  • Welch’s t-test: Unlike the standard Student’s t-test, Welch’s does not assume equal variance between algorithms. This is crucial in RL, where one algorithm might be significantly more stable than another.
  • Bootstrapped Confidence Intervals: A non-parametric method that estimates uncertainty via resampling. However, the authors warn that bootstrap methods require "bulk"—they should not be used with fewer than 20 samples, as they tend to underestimate uncertainty at low sample sizes.

Key Insights from Benchmarking

Using benchmarks like Half-Cheetah, Hopper, and Swimmer from OpenAI Gym, the authors evaluated the DDPG algorithm. Their findings highlight the "5-Seed Trap": with only 5 seeds, the empirical false positive rate often exceeds the theoretical 5%, sometimes reaching 10% with bootstrap methods.

In a case study comparing two DDPG variants, 5 seeds initially suggested a significant difference. However, power analysis revealed a 51% chance of a Type-II error. To reach a standard statistical power of 0.8, the analysis showed that 10 to 21 seeds were actually required—far exceeding typical publication standards.

Conclusion and Recommendations

While increasing the number of seeds imposes a "compute tax," it is necessary for scientific validity. The paper concludes with several practical recommendations:

  • Use Welch’s t-test as the default for comparing algorithms.
  • Avoid small bootstrap samples (less than 20).
  • Conduct pilot studies with at least 20 samples to avoid underestimating required power.
  • Set significance levels ($\alpha$) conservatively to account for non-normal distributions common in RL.

By adopting these rigorous standards, the RL community can ensure that reported improvements are genuine and reproducible.

Summary updated

BibTeX
@misc{colas2018how,
  author = {Cédric Colas and Olivier Sigaud and Pierre-Yves Oudeyer},
  title = {{How Many Random Seeds? Statistical Power Analysis in Deep Reinforcement Learning Experiments}},
  year = {2018},
  eprint = {1806.08295},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1806.08295},
}
Figure