Implicit Curriculum in Procgen Made Explicit

Zhenxiong Tan, Kaixin Wang, Xinchao WangNeurIPS 2024

In the world of Reinforcement Learning (RL), the Procgen Benchmark is a gold standard for testing an agent's ability to generalize. By generating levels procedurally, it ensures that an agent cannot simply memorize a single path to a goal. However, Procgen has historically operated as a "black box"—researchers provide a random seed, and the environment generates a level with unknown difficulty and underlying parameters.

A new paper from researchers at the National University of Singapore, accepted to NeurIPS 2024, pulls back the curtain on this process. They introduce C-Procgen (Controllable Procgen), a modified benchmark that makes the underlying environment parameters explicit and controllable. Their findings reveal a fascinating phenomenon: even when an agent is trained on a completely random, uniform mix of easy and hard levels, it follows an implicit curriculum, naturally mastering simple tasks before moving on to complex ones.

The Problem with the "Black Box"

Training RL agents in static environments often leads to overfitting, where the agent learns the specific layout of a single level rather than a robust, generalizable skill. Procedurally generated environments like Procgen solve this by providing infinite variety.

However, in standard Procgen, the factors that make a level "hard" (e.g., more enemies, wider gaps, faster speeds) are hidden behind a single random seed. This makes it nearly impossible to observe how the learning process evolves across different difficulties. The authors sought to answer a critical question: In a sea of diverse levels, what does the agent actually focus on at different stages of training? Is there a hidden order to how skills are acquired?

Introducing C-Procgen

To answer these questions, the authors performed a deep refactoring of the original Procgen source code to create C-Procgen.

Comparison of Original Procgen and C-Procgen
  • Parameter Exposure: They exposed over 100 hidden parameters across various games. For example, in the game Ninja, researchers can now directly set the number of sections, the gap range between platforms, and the probability of bombs, rather than relying on an opaque level ID.
  • Tracking Dynamics: Using the Proximal Policy Optimization (PPO) algorithm, they tracked metrics like reward, loss, and the number of samples collected for specific parameter combinations (contexts) throughout 25 million training steps.
  • Context Reconfiguration: They experimented with masking certain difficulty levels or adding "stepping stone" levels to see how it affected the agent's learning trajectory.

Key Insights: The Implicit Curriculum

By tracking learning dynamics across these newly exposed parameters, the researchers uncovered two major insights about how RL agents learn.

1. The "Easy-to-Hard" Shift Even when the environment serves up easy and hard levels with equal probability, the agent’s learning focus naturally shifts over time. Measured by where the highest loss (the strongest learning signal) occurs, the agent focuses on easy contexts first and gradually moves to harder ones. Early in training, the agent effectively "ignores" hard levels because they are too complex to provide a useful signal.

2. The Loss-Sample Mismatch This discovery represents a major "aha moment" for RL efficiency. In the middle of training, agents often spend a massive portion of their time in hard contexts simply because these levels take longer to fail or complete. However, the actual loss is concentrated in easy or medium contexts.

Learning dynamics showing the easy-to-hard shift and loss-sample mismatch

This implies a massive amount of computation is wasted on samples that don't help the agent improve. To quantify this, the authors defined Loss Production Efficiency (LPE). They found that games with low LPE (high waste) benefit the most from algorithms like Prioritized Level Replay (PLR), which manually force the agent to focus on high-loss levels.

Results and Impact

  • Correlation with PLR: There is a clear correlation between the LPE metric and the performance gains of PLR. If a game has a natural mismatch between where the agent spends time and where it learns, PLR provides a massive boost (up to 120% improvement in games like Leaper).
  • The Importance of Stepping Stones: Removing "medium" difficulty levels often stalled learning entirely in games like CoinRun and Ninja. This proves that intermediate levels are essential transitional stages in the implicit curriculum. Furthermore, expanding the context set to include more diverse "stepping stone" levels allowed agents to master the hardest levels millions of steps earlier.

Limitations and Future Work

While the paper provides a breakthrough in understanding learning dynamics, the authors note a few limitations. They analyzed 9 out of the 16 Procgen games, and different games may exhibit different dynamics. Additionally, the current study focuses on static (uniform) distributions rather than dynamic context distributions where the environment evolves based on agent performance. Finally, a standardized curriculum learning leaderboard for C-Procgen has yet to be established.

Ultimately, C-Procgen serves as a foundational tool for the next generation of curriculum RL research, moving the field closer to agents that can learn complex skills as efficiently as humans do.

Summary updated

BibTeX
@inproceedings{tan2024implicit,
  author = {Zhenxiong Tan and Kaixin Wang and Xinchao Wang},
  title = {{Implicit Curriculum in Procgen Made Explicit}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=nZB1FpXUU6},
}
Figure