Improving Regret Approximation for Unsupervised Dynamic Environment Generation

Harry Mead, Bruno Lacerda, Jakob Nicolaus Foerster, Nick Hawes

This paper introduces two major improvements to Unsupervised Environment Design (UED): a dynamic generation method called DEGen and a new regret approximation metric called MNA. Together, these innovations allow Reinforcement Learning (RL) agents to learn complex skills in much larger and more difficult environments than previously possible.

The Promise and Pitfalls of UED

In Reinforcement Learning, training agents that can generalize to novel, unseen situations is a primary goal. Unsupervised Environment Design (UED) attempts to solve this by pairing a "student" agent with a "teacher" agent. The teacher's job is to automatically generate a curriculum of increasingly difficult levels for the student to master.

However, current UED methods face two significant hurdles:

  1. The Credit Assignment Problem: Most teacher agents generate an entire level upfront. If the student fails, the teacher receives a single, sparse penalty at the end of the episode. It has no way of knowing which specific obstacle or wall placement caused the failure, making it incredibly difficult for the teacher to learn how to build useful challenges.
  2. Poor Regret Approximation: To select "good" levels, the teacher tries to maximize the student's regret—the difference between the optimal possible score and the student's actual score. Because calculating true regret is impossible in unknown environments, methods rely on approximations (like Positive Value Loss). These shortcuts often fail to identify truly challenging levels, especially in environments where difficulty is not a smooth curve but rather a sudden "step-change" (e.g., requiring a key to open a door).
Comparison of environments where a key is irrelevant versus required, creating a step-change in difficulty.

Proposed Solutions: DEGen and MNA

To overcome these limitations, the authors introduce two core innovations designed to provide better feedback to the teacher agent.

1. Dynamic Environment Generation (DEGen)

Instead of building the entire world at the start of an episode, the teacher agent in DEGen builds the environment on-the-fly. As the student moves and its field of view expands, the teacher fills in the newly observed squares.

DEGen dynamically generates the environment block-by-block as the agent explores, providing denser reward signals.

Why it works: By tying environment generation directly to the student's exploration, DEGen transforms a single, sparse end-of-level reward into a dense sequence of rewards. If the student hits a dead end, the teacher gets immediate, localized feedback on the specific blocks it just placed, drastically simplifying the credit assignment problem.

2. Maximised Negative Advantage (MNA)

The authors argue that the most valuable levels for a curriculum are those where the agent performs worse than it expected to.

To capture this, they introduce Maximised Negative Advantage (MNA). MNA evaluates a trajectory and identifies the maximum "negative advantage"—the exact point where the agent's performance dropped most sharply compared to its own internal value estimate. To prevent the teacher from simply building impossible, walled-off boxes, MNA also includes a penalty for levels that the agent has never successfully solved.

Experimental Results and Scaling

The researchers evaluated DEGen and MNA across several benchmarks, including standard MiniGrid, Key MiniGrid (where finding a key is mandatory), and Sokoban (requiring complex, long-term box-pushing strategies). They specifically tested on larger grids (17x17 and 21x21) to evaluate scalability.

  • Superior Scaling: As environments grow larger, the probability of a random generator creating a useful level drops to near zero. In the massive 21x21 Key MiniGrid, DEGen maintained a solve rate of roughly 80%, whereas the best previous methods (like ACCEL or PLR) dropped to around 40% or failed entirely.
  • MNA as a Drop-in Upgrade: Even when used without DEGen, swapping standard metrics for the MNA metric improved the performance of existing replay-based methods across almost all tasks.
  • Handling Complexity: In Sokoban, MNA-based methods proved significantly better at identifying and curating levels that required complex maneuvers compared to standard regret approximations.

Limitations and Future Directions

While highly effective, the proposed methods come with trade-offs:

  • Computational Cost: Training a DEGen teacher is computationally expensive, taking roughly 4x longer than simpler replay-based methods. For small, simple environments, this overhead may not be justified.
  • Mapping Observations: DEGen currently relies on a direct 1:1 mapping between the grid and the agent's view. Applying this to 3D environments or robotics will likely require integrating World Models to help the teacher interpret the agent's visual inputs.
  • Deterministic Assumptions: The mathematical derivation for MNA assumes a deterministic environment. Adapting the metric for highly stochastic settings remains an area for future work.

Summary updated

BibTeX
@inproceedings{mead2025improving,
  author = {Harry Mead and Bruno Lacerda and Jakob Nicolaus Foerster and Nick Hawes},
  title = {{Improving Regret Approximation for Unsupervised Dynamic Environment Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=UGaAXvav8S},
}
Figure