Replicable Reinforcement Learning

Eric Eaton, Marcel Hussing, Michael Kearns, Jessica Sorrell

Abstract

Reinforcement learning (RL) is notoriously sensitive to stochasticity; agents trained on the same environment with identical hyperparameters often converge to vastly different policies due to variations in data collection and exploration. This paper introduces the first formal framework for replicable reinforcement learning, ensuring that an algorithm produces the same policy with high probability when trained on different samples from the same underlying distribution. We present two provably replicable algorithms—Replicable Phased Value Iteration (rPVI) and Replicable Episodic R-max (RepRMAX)—bridging the gap between theoretical stability and practical RL deployment.

Introduction

The "replicability crisis" in science has a specific parallel in artificial intelligence. While the community has historically focused on reproducibility—the ability to achieve the same result using the same code and random seeds—this paper tackles the more rigorous standard of replicability. A replicable algorithm must produce identical outputs (with high probability) even when run on two entirely different datasets sampled from the same environment.

In RL, achieving replicability is exceptionally difficult. Because data is collected sequentially, a minor deviation in early exploration can snowball into a completely different learning trajectory. This instability is a major hurdle for the reliable deployment of AI in safety-critical industries and scientific research.

Methods: Stabilizing the Learning Trajectory

The authors adapt recent theoretical frameworks for replicable algorithms to the unique challenges of control problems. They propose two primary algorithmic solutions:

1. Replicable Phased Value Iteration (rPVI)

Designed for settings with a "generative model" (a simulator), rPVI utilizes a technique called rSTAT (Replicable Statistical Queries). Instead of updating value functions based on raw empirical averages—which are prone to sampling noise—rPVI "rounds" these estimates to a set of canonical representatives using shared internal randomness. By forcing estimates into discrete "bins," the algorithm ensures that two different runs are likely to "snap" to the same value estimate, creating a buffer against noise.

2. Replicable Episodic R-max (RepRMAX)

This algorithm addresses the more complex challenge of exploration in unknown environments. Standard R-max algorithms mark a state as "known" once it has been visited a fixed number of times ($k$). However, a fixed threshold is a replicability nightmare: one run might visit a state $k$ times while another visits it $k-1$ times, leading to divergent models. RepRMAX solves this by employing a randomized threshold sampled from a specific window. This makes it statistically unlikely that two independent runs will fall on opposite sides of the "known/unknown" boundary.

Empirical Validation: The GridWorld Benchmark

The proposed framework was validated using a custom GridWorld environment. The setup features a starting point, obstacles, and two potential goals. This environment was specifically designed to be "fidgety"; standard algorithms like Phased Q-learning easily diverge, picking the left goal in one run and the right goal in another based on minor sampling noise. In contrast, the replicable versions consistently converged to the same policy across independent trials, demonstrating that stability can be engineered into the learning process.

Key Insights

  • The Hierarchy of Replicability: The authors identify that replicability exists on a spectrum. It is most difficult to make the full MDP model replicable, slightly easier for the value function, and most achievable for the final policy.
  • Discretization as a Stabilizer: Counterintuitively, discretization—often viewed as a source of error—is a powerful tool for stability. By binning estimates, the algorithm ignores minor fluctuations that would otherwise cause divergence.
  • Randomization for Consistency: Adding controlled randomness (such as the randomized threshold in RepRMAX) is the key to ensuring that independent runs stay in sync.
  • Direct vs. Model-Based Efficiency: The research proves that estimating values directly is significantly more sample-efficient for replicability than attempting to build a replicable model of the environment's entire transition physics.

Results and Theoretical Guarantees

The paper establishes the first formal proofs that RL algorithms can be simultaneously $\epsilon$-optimal (near-perfect performance) and $\rho$-replicable (highly consistent). While replicability introduces a "sample tax"—requiring more data than non-replicable counterparts (specifically a squared dependence on the state-action space size)—empirical results were encouraging. In GridWorld tests, rPVI achieved high replicability with orders of magnitude fewer samples than the theoretical worst-case bounds suggested, indicating that replicable RL may be more practical than initially feared.

Limitations and Future Work

Despite these breakthroughs, several challenges remain:

  • The Tabular Constraint: Current proofs apply to tabular RL, where states and actions can be explicitly counted. Extending these guarantees to Deep RL (involving neural networks and continuous state spaces) is a significant open challenge.
  • Sample Overhead: While practical performance is better than the theory suggests, the sample complexity is still higher than standard RL. Future research is needed to optimize "rounding" schemes.
  • Non-Episodic Settings: The current work focuses on episodic tasks. Applying these concepts to "continuing" tasks, where an agent learns indefinitely, remains a frontier for the field.

By formalizing consistency, this work provides a rigorous foundation for building AI systems that behave predictably, regardless of the specific training data they encounter.

Summary updated

BibTeX
@inproceedings{eaton2023replicable,
  author = {ERIC EATON and Marcel Hussing and Michael Kearns and Jessica Sorrell},
  title = {{Replicable Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=tBwRbgsol1},
}
Figure