Replicability in Reinforcement Learning

Amin Karbasi, Grigoris Velegkas, Lin Yang, Felix Zhou

TL;DR

This paper provides the first formal mathematical framework for replicability in reinforcement learning (RL). The authors introduce three distinct levels of replicability—ranging from exact policy matching to statistical closeness—and prove that while strict replicability is sample-intensive, relaxing the requirements can lead to exponentially more efficient algorithms.

What Problem Does This Paper Address?

The "reproducibility crisis" is a well-known headache in science, and machine learning is no exception. A famous survey in Nature revealed that 70% of scientists failed to replicate another researcher's findings, and 50% couldn't even reproduce their own.

In RL, this is particularly tricky. Even if you use the same random seed for your algorithm, the "data" (the transitions and rewards you observe from the environment) is stochastic. If you run the same agent twice in the same environment, the slight differences in the samples it sees might lead it to converge to two completely different policies. This paper asks: How many samples do we need to ensure that an RL algorithm consistently outputs the same (or a very similar) policy across different independent runs?

Methods

The authors focus on discounted tabular Markov Decision Processes (MDPs) where the agent has access to a generative model (a simulator that lets you query any state-action pair). They analyze three formal notions of replicability:

  1. $\rho$-Replicability: The strictest form. If you run the algorithm twice on different data but with the same internal random seed, it must output the exact same policy with high probability.
  2. TV Indistinguishability: A relaxation where the distributions of the output policies from two different runs must be close in Total Variation (TV) distance.
  3. Approximate Replicability: The most relaxed form. It doesn't require shared random seeds. It simply asks that the two output policies be "close" to each other according to a statistical measure (like Renyi divergence).

To achieve these, they employ techniques like:

  • Rounding Tricks: Mapping continuous values to a grid to force identical outputs.
  • Gaussian Mechanisms: Borrowing from Differential Privacy (DP) to add noise that masks the variance of the data.
  • Soft-max Rules: Instead of picking the absolute best action (greedy), the agent picks actions according to a smooth probability distribution, making the policy more stable.
  • Poisson Point Process Coupling: A sophisticated way to transform "statistically close" algorithms into "exactly identical" ones.

Datasets

As a theoretical work, this paper does not use standard empirical benchmarks like Atari or MuJoCo. Instead, it uses a mathematically constructed family of MDPs designed to prove lower bounds. This construction demonstrates the "worst-case" scenario for replicability, showing that certain sample complexities are unavoidable for specific classes of algorithms.

Key Insights and Ideas

  • The "Locally Random" Tax: If an algorithm makes every random decision independently (locally random), it faces a steep sample complexity of $\tilde{O}(N^3)$, where $N$ is the number of state-action pairs.
  • Correlated Randomness is a Superpower: By allowing internal randomness to be correlated across different decisions (using a coupling technique), the authors show you can shave off a factor of $N$, bringing the complexity down to $\tilde{O}(N^2)$. However, the current way to do this requires exponential computation time.
  • The DP Connection: There is a deep link between replicability and Differential Privacy. The same Gaussian noise techniques used to protect privacy can be repurposed to ensure that an algorithm's output doesn't "overfit" to the specific samples it saw, thereby making it more replicable.
  • Soft-max for the Win: If we only care that policies are "close" rather than identical, we can achieve a sample complexity of $\tilde{O}(N)$. This matches the order of standard non-replicable RL, suggesting that approximate replicability might be "free" in terms of sample efficiency.

Key Results

The paper establishes a clear hierarchy of sample complexities for finding an $\varepsilon$-optimal policy across different replicability regimes.

Summary of sample and time complexities for different replicability properties.

As shown above, strict replicability with locally random decisions requires $\tilde{O}(N^3)$ samples. Relaxing to TV indistinguishability or using correlated randomness (at an exponential time cost) reduces this to $\tilde{O}(N^2)$. Finally, approximate replicability achieves the standard $\tilde{O}(N)$ sample complexity.

Limitations and Future Work

The primary limitation is the tabular setting. While this is the standard starting point for RL theory, real-world "Deep RL" deals with massive or continuous state spaces where $N$ is effectively infinite.

The authors also note a significant computational gap: they can achieve $N^2$ sample complexity for strict replicability, but only with an exponential-time algorithm. Determining if a polynomial-time $N^2$ algorithm exists is a major open question. Finally, extending these proofs to offline RL (learning from a fixed dataset) and linear function approximation are logical next steps for the community.

Summary updated

BibTeX
@inproceedings{karbasi2023replicability,
  author = {Amin Karbasi and Grigoris Velegkas and Lin Yang and Felix Zhou},
  title = {{Replicability in Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=5cPz5hrjy6},
}
Figure