How the level sampling process impacts zero-shot generalisation in deep reinforcement learning

Samuel Garcin, James Doran, Shangmin Guo, Christopher G. Lucas, Stefano V. Albrecht · DOI

Abstract

Deep Reinforcement Learning (RL) agents often struggle with zero-shot generalization, frequently overfitting to specific training environments. This research explores the relationship between the level sampling process and an agent's ability to generalize. By linking information theory to environment design, the authors demonstrate that the "Generalization Gap" is bounded by the mutual information between an agent’s internal representations and level identity. To address this, they propose Self-Supervised Environment Design (SSED), which utilizes a Variational Autoencoder (VAE) to generate diverse yet task-relevant training levels. Empirical results show that SSED significantly outperforms state-of-the-art baselines, particularly in challenging "edge-case" scenarios.

Introduction

A persistent challenge in Deep RL is "instance overfitting," where agents memorize specific level features rather than learning generalizable skills. Conversely, attempts to mitigate this via Unsupervised Environment Design (UED) can lead to "over-generalization," where agents learn suboptimal policies due to training on levels that lack the semantic structure of the target task. This paper seeks a "Goldilocks" zone: training on levels diverse enough to prevent memorization but grounded enough to remain relevant to the objective.

The authors provide a formal proof that the generalization gap—the difference between training and test performance—is constrained by the Mutual Information (MI) between the agent's internal state and the specific identity of the training level. Popular techniques like Prioritized Level Replay (PLR) are shown to implicitly minimize this MI by focusing training on levels where the agent experiences high "value loss," effectively preventing the agent from relying on level-specific shortcuts once a task is partially mastered.

Impact of level sampling strategies on mean normalized scores and the generalization gap. Strategies minimizing mutual information (S=S^MI) demonstrate superior test performance and a reduced gap.

Self-Supervised Environment Design (SSED)

To move beyond replaying existing levels, the authors introduce SSED. This framework operates in two phases:

  1. Generative Phase: A VAE is trained on a small set of "in-context" levels. By interpolating within the VAE's latent space, SSED generates new levels that preserve the underlying task semantics while introducing structural variety.
  2. Replay Phase: An adaptive sampling strategy selects generated levels that provide the highest "surprise" (measured by value loss), ensuring the agent is constantly challenged by novel, relevant scenarios.

Experimental Results

The researchers evaluated SSED on the Procgen benchmark and a custom MiniGrid "Cave Escape" environment. SSED achieved approximately 1.25x the returns of the next best baseline on unseen levels. Notably, in "edge-case" scenarios involving increased complexity or scale, SSED improved performance by 2 to 3 times over standard uniform sampling.

Performance comparison of SSED against baselines (PLR, ACCEL, etc.) across IQM, Mean Score, and Solved Rate, showing SSED's superior generalization capabilities.

Unlike traditional UED methods like ACCEL, which may generate "out-of-context" levels that break task logic, SSED maintains a low distributional shift from the target task. This ensures the agent learns to utilize task-specific cues effectively.

Conclusion

This work highlights that level sampling is not merely an efficiency tool but a critical regularizer for RL generalization. By leveraging VAEs to stay on the manifold of valid task instances and using value loss to minimize mutual information, SSED provides a robust framework for training agents that generalize to novel environments without losing sight of the core task. Future work will focus on scaling this approach to high-dimensional 3D environments and robotics.

Summary updated

BibTeX
@inproceedings{garcin2023how,
  author = {Samuel Garcin and James Doran and Shangmin Guo and Christopher G. Lucas and Stefano V. Albrecht},
  title = {{How the level sampling process impacts zero-shot generalisation in deep reinforcement learning}},
  booktitle = {ALOE @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=Zi3LcfuTPx},
}
Figure