An Optimisation Framework for Unsupervised Environment Design

Nathan Monette, Alistair Letcher, Michael Beukman, Matthew T. Jackson, Alexander Rutherford, Alexander D. Goldie, Jakob N. Foerster

TL;DR

This paper reframes Unsupervised Environment Design (UED) from an optimization perspective, turning a notoriously unstable training process into a well-behaved, provably convergent game. By introducing entropy regularization, the authors transform the standard nonconvex-nonconcave UED objective into a nonconvex-strongly-concave one, providing the first formal convergence guarantees for a gradient-based UED algorithm. The resulting framework, called NonConvex-Concave optimization for UED (NCC), significantly improves the robustness and sample efficiency of reinforcement learning agents across several challenging benchmarks.

What Problem Does This Paper Address?

To deploy reinforcement learning (RL) agents in high-risk, real-world scenarios, they must be robust to unfamiliar situations. Unsupervised Environment Design (UED) tackles this by setting up a two-player game: a "level-generating adversary" creates a curriculum of increasingly difficult training tasks (levels), while the "agent" tries to solve them.

Ideally, the adversary picks levels where the agent has the most room to improve (often measured as "regret"). However, because both the agent and the adversary are typically parameterized by deep neural networks, the resulting optimization problem is nonconvex-nonconcave. In optimization theory, these games are chaotic, highly unstable, and lack convergence guarantees. Prior UED methods simply assumed convergence happened, leading to fragile training loops. This paper addresses this fundamental theoretical gap by restructuring the UED game so it can be reliably optimized with gradients.

Methods

The authors introduce NCC (NonConvex-Concave optimization for UED). Their approach hinges on three key technical moves:

  1. Probabilistic Reformulation: Instead of letting a neural network generate levels directly, they maintain a level buffer. The adversary's job is redefined as learning a categorical distribution over this buffer, making the objective linear with respect to the adversary's strategy.
  2. Entropy Regularization: They add an entropy penalty to the adversary's objective. This forces the adversary to sample a diverse batch of levels rather than collapsing onto a single hardest level. Crucially, this mathematical addition makes the objective strongly concave with respect to the adversary.
  3. Two-Timescale Gradient Updates: With a nonconvex-strongly-concave landscape established, they apply a two-timescale stochastic gradient descent-ascent algorithm. By setting the adversary's learning rate to be much faster than the agent's ($\eta_y \gg \eta_x$), the adversary quickly finds the optimal task distribution for the agent's current capabilities, mathematically guaranteeing convergence to a first-order Nash Equilibrium.
Figure 1: A visual representation of our training loop, which has simultaneous updates for the agent x and the adversary y. The agent’s update is trained on levels λ sampled from y, and the adversary’s update is computed with scores computed from the policy on all levels from level-buffer Λ. We use the Craftax environment from Matthews et al. (2024) for illustration.

Additionally, the authors generalize the concept of learnability—a score function that prioritizes levels of intermediate difficulty. While prior learnability metrics only worked in simple binary-outcome environments, this paper introduces a Gaussian-scaled variance metric that extends learnability to any deterministic RL environment.

Datasets

The framework was evaluated on three distinct UED benchmarks:

  • Minigrid: A grid-world navigation environment used to test robustness on a holdout set containing 60 walls. It serves as the primary testbed because it allows for an exact calculation of "regret."
  • XLand-Minigrid: A highly scalable meta-reinforcement learning environment used to evaluate sample efficiency.
  • Craftax: A complex, open-ended survival and crafting benchmark that represents a significant step up in difficulty from traditional grid worlds.

Key Insights and Ideas

  • Taming the Landscape: The most elegant insight is that you don't need to fix the agent's nonconvexity (which is inherent to deep RL) to stabilize the game. Making the objective strongly concave on the adversary's side is enough to unlock two-timescale convergence guarantees.
  • The Danger of Irreducible Regret: Standard minimax regret can cause training to stagnate if an environment has inherent stochasticity or partial observability, because the adversary will endlessly exploit unresolvable uncertainty.
  • Learnability as Variance: Levels with high variance in agent returns represent the ideal training frontier—they are neither trivially easy nor impossibly hard. Scaling this variance with a Gaussian over the mean return prevents the adversary from focusing on tasks where the agent fails completely.

Key Results

  • Robustness Gains: On Minigrid, NCC using a regret oracle strongly outperformed all contemporary baselines (including PLR and SFL) when evaluated on worst-case scenarios ($\alpha$-CVaR), demonstrating a massive leap in policy robustness.
  • Superior Sample Efficiency: In XLand-Minigrid, NCC-Learn achieved a mean solve rate of ~30-35% on the evaluation set, significantly outperforming prior methods which plateaued below 25%.
  • SOTA on Complex Domains: In Craftax, leveraging the newly introduced Generalized Learnability score function allowed NCC to outperform PLR-MaxMC, the previous state-of-the-art UED baseline on this benchmark.

Limitations and Future Work

While a major step forward, the authors note several areas for future iteration:

  • Best-Iterate vs. Last-Iterate: The theoretical proofs guarantee best-iterate convergence (meaning the optimal policy is visited during training), but last-iterate convergence (ending exactly at the optimum) remains an open challenge for future work.
  • Theory-Practice Gap: The convergence proofs assume a static level buffer and a standard REINFORCE gradient estimator. However, to get top-tier empirical performance, the practical algorithm uses a dynamic buffer and PPO. Bridging this theoretical gap is a clear next step.
  • General-Sum Guarantees: The convergence guarantees currently hold only for zero-sum formulations (like regret). Extending these guarantees to general-sum metrics like learnability will likely require a bilevel optimization perspective.

Summary updated

BibTeX
@inproceedings{monette2025optimisation,
  author = {Nathan Monette and Alistair Letcher and Michael Beukman and Matthew T. Jackson and Alexander Rutherford and Alexander D. Goldie and Jakob N. Foerster},
  title = {{An Optimisation Framework for Unsupervised Environment Design}},
  booktitle = {RLC},
  year = {2025},
  url = {https://openreview.net/forum?id=WnknYUybWX},
}
Figure