!MDP Playground: Meta-Features in Reinforcement Learning

Raghu Rajan, Frank Hutter · DOI

Introduction

Deep Reinforcement Learning (RL) agents are notoriously brittle. An algorithm that performs exceptionally on one task may fail entirely on another due to minor environmental variations. Traditionally, benchmarking relies on complex "blackbox" environments like Atari games or Mujoco simulations. While these provide high-fidelity challenges, they are computationally expensive and conflate multiple difficulties—such as sparse rewards, long horizons, and visual complexity—making it nearly impossible to diagnose the specific cause of an agent's failure.

The MDP Playground Framework

To address this, the authors introduce MDP Playground, an open-source framework designed to bring "unit testing" to RL. It allows researchers to isolate and manipulate specific "dimensions of hardness" to understand agent behavior in a controlled, "whitebox" setting. The framework is built on three pillars:

  1. Toy Environments: Highly efficient, parameterized discrete and continuous environments that can run in as little as 30 seconds on a standard laptop core.
  2. Complex Environment Wrappers: Tools to inject specific challenges (e.g., reward delay) into standard benchmarks like Atari or Mujoco.
  3. Meta-Features: Controllable dimensions of difficulty that define the MDP's complexity.

Dimensions of Hardness

MDP Playground identifies several "meta-features" that contribute to the difficulty of an MDP. By isolating these, researchers can stress-test agents against specific environmental hurdles rather than dealing with the combined noise of a complex simulation.

Visualizing dimensions of hardness: (a) sequence length, (b) transition stochasticity, (c) reward noise, (d) representation complexity, (e) reward delay, and (f) time unit discretization.

Key dimensions include:

  • Reward Delay: The number of steps an agent must wait after an action to receive feedback.
  • Sequence Length: The requirement of a specific chain of states or actions to trigger a reward.
  • Stochasticity: Noise introduced into transitions or reward signals.
  • Representations: The complexity of the observation space, such as image-based inputs with random transforms.
  • Time Unit: The discretization of time, affecting how frequently an agent interacts with the environment.

Key Insights and Results

The utility of MDP Playground is demonstrated through several key findings that challenge common assumptions in the field:

  • Unit Testing for RL: Just as software developers use unit tests to isolate bugs, RL researchers can use toy MDPs to verify if an agent can handle a specific challenge before scaling up. This approach helped the authors identify a broken "Noisy Nets" implementation in a popular RL library by ablating specific features in a toy environment.
  • Generalization Gaps in CNNs: A surprising finding was that CNN-based agents struggled significantly with simple "shift" transforms in image representations. Despite theoretical spatial invariance, the results suggest these agents often rely on memorization rather than true generalization.
  • Transferability of Hardness: The authors found a high Spearman rank correlation (often $\geq 0.7$) between agent performance on toy environments and complex benchmarks. This confirms that insights gained from 30-second toy runs are actually predictive of performance on heavy-duty simulations like Atari.
  • Optimization via Time Units: By adjusting the "Time Unit" in HalfCheetah, the authors discovered a setting that yielded a 100% performance gain over the standard expert-designed benchmark, highlighting how sensitive agents are to temporal discretization.

Conclusion

MDP Playground provides a much-needed diagnostic tool for the RL community. By shifting the focus from blackbox benchmarking to whitebox analysis, it enables a deeper understanding of why agents succeed or fail. While toy environments do not replace final evaluations on complex tasks, they serve as an essential first step for debugging, analysis, and robust algorithm development. The project is open-source and intended to be a community-driven effort to standardize how we "stress test" RL agents.

Summary updated

Abstract

We present MDP Playground, a testbed for Reinforcement Learning (RL) agents with dimensions of hardness that can be controlled independently to challenge agents in different ways and obtain varying degrees of hardness in toy and complex RL environments. We consider and allow control over a wide variety of dimensions, including delayed rewards, sequence lengths, reward density, stochasticity, image representations, irrelevant features, time unit, action range and more. We define a parameterised collection of fast-to-run toy environments in OpenAI Gym by varying these dimensions and propose to use these to understand agents better. We then show how to design experiments using MDP Playground to gain insights on the toy environments. We also provide wrappers that can inject many of these dimensions into any Gym environment. We experiment with these wrappers on Atari and Mujoco to allow for understanding the effects of these dimensions on environments that are more complex than the toy environments. We also compare the effect of the dimensions on the toy and complex environments. Finally, we show how to use MDP Playground to debug agents, to study the interaction of multiple dimensions and describe further use-cases.
BibTeX
@article{rajan2023mdp,
  author = {Raghu Rajan and Frank Hutter},
  title = {{!MDP Playground: Meta-Features in Reinforcement Learning}},
  journal = {J. Artif. Intell. Res.},
  year = {2023},
  doi = {10.1613/jair.1.14314},
}
Figure