Effective Diversity in Unsupervised Environment Design

Wenjun Li, Pradeep Varakantham, Dexun Li · OpenReview

TL;DR

Unsupervised Environment Design (UED) automatically generates training curricula for reinforcement learning agents, but existing methods often waste time on highly similar environments simply because they offer high learning potential. This paper introduces DIPLR, a novel framework that uses Wasserstein distance over state-action occupancy distributions to ensure training environments are both challenging and diverse. By explicitly prioritizing environmental diversity, DIPLR significantly boosts zero-shot generalization to unseen, out-of-distribution tasks.

What Problem Does This Paper Address?

Deep Reinforcement Learning (DRL) agents are notoriously brittle. An agent trained to navigate a specific maze or drive on a particular track often fails catastrophically when faced with minor changes, such as a relocated obstacle or a slightly altered background.

To build more robust agents, researchers use Unsupervised Environment Design (UED). Instead of training an agent in a static environment, a "teacher" algorithm dynamically generates a curriculum of environments (or "levels") for the "student" agent. Currently, state-of-the-art UED frameworks select levels based on learning potential or regret—focusing on environments where the agent currently performs poorly but has a high capacity to improve.

However, the authors identify a major flaw in this approach: redundancy. A teacher prioritizing purely on regret might generate dozens of environments that are nearly identical in structure and required strategy, as long as they all yield high regret. Training on these repetitive levels wastes computational resources without teaching the agent anything new, ultimately hurting its ability to generalize to out-of-distribution (OOD) scenarios.

Methods

The authors propose DIPLR (Diversity Induced Prioritized Level Replay), a framework that explicitly injects diversity into the environment selection process.

Figure 1: An Overview of DIPLR Algorithm

The key technical challenge is defining a meaningful distance metric between two environments. Simple parameter-space distances (e.g., comparing vectors of obstacle coordinates) fail because they don't account for how the agent actually behaves, nor do they handle environment stochasticity well.

Instead, DIPLR measures the similarity between levels based on the state-action occupancy distributions induced by the agent's current policy. If the trajectories traversed by the agent in two different levels result in similar state-action distributions, the levels are deemed similar.

To compute the distance between these empirical distributions, DIPLR utilizes the Wasserstein distance (Earth Mover's Distance). Wasserstein distance is ideal here because, unlike Kullback-Leibler (KL) divergence, it provides smooth, non-zero gradients even when the distributions have disjoint supports (which happens frequently when an agent explores entirely different areas of different maps).

DIPLR incorporates this diversity metric in two main ways:

  1. Level Generation: When new levels are randomly generated, only those that maximize the minimum distance to existing levels in the buffer are retained.
  2. Level Replay: Levels are sampled from the replay buffer using a combined priority score ($Preplay$) that balances diversity ($PD$) and regret ($PR$): $$Preplay = \rho \cdot PD + (1 - \rho) \cdot PR$$ where $\rho$ is a tuning parameter.

Datasets

The authors evaluated DIPLR across three distinct, widely recognized UPOMDP (Underspecified Partially Observable Markov Decision Process) benchmark domains:

  • Minigrid: A discrete-control, partially observable navigation task with sparse rewards. The teacher places blocks, a starting point, and a goal. Evaluation is conducted on 8 human-designed OOD configurations (e.g., Labyrinth, PerfectMaze).
  • Bipedal-Walker: A continuous-control walking task with dense rewards. The teacher controls 8 terrain parameters (roughness, stairs, pit gaps, etc.).
  • Car-Racing: A continuous-control driving task where the teacher designs challenging tracks using Bézier curves. Evaluation includes real-world-inspired F1 tracks (Singapore, Italy, Germany).

Key Insights and Ideas

  • The Power of Pure Diversity: In an ablation study using a variant called DIPLR$^-$ (which prioritizes only diversity and ignores regret entirely), the model still performed on par with or better than the previous state-of-the-art baseline (PLR$^\perp$) in continuous domains. This reveals that environmental diversity alone can be a stronger driver for generalization than learning potential.
  • Diversity and Regret are Complementary: While diversity alone is powerful, combining it with regret (the full DIPLR algorithm) yielded the absolute best performance across all domains. Diversity ensures a broad perspective, while regret ensures the agent is continuously challenged.
  • Behavior-Driven Metrics Matter: Measuring distance based on agent trajectories rather than raw environment parameters makes the framework robust to domain-specific quirks and stochastic environment generation.

Key Results

DIPLR demonstrated substantial performance gains over leading UED baselines like Domain Randomization (DR), Minimax, PAIRED, and PLR$^\perp$. Performance was aggregated using robust metrics like the Interquartile Mean (IQM) and Optimality Gap.

  • Minigrid: DIPLR outperformed the leading baseline, PLR$^\perp$, by more than 20% in both IQM and Optimality Gap, showing remarkable zero-shot transfer to complex, human-designed mazes.
Figure 3: Aggregate zero-shot OOD test performance in Minigrid Domain across 10 independent runs. Higher IQM scores and lower optimality gap are better.
  • Bipedal-Walker & Car-Racing: In these continuous control tasks, DIPLR consistently dominated the benchmarks, converging faster to optimal performance and maintaining a lower optimality gap on challenging OOD terrains and tracks.

Limitations and Future Work

While the paper demonstrates excellent empirical results, a few areas remain open for future exploration:

  • Computational Overhead: Calculating pairwise Wasserstein distances over agent trajectories can become computationally expensive as the level buffer grows. Although the authors utilized an accelerated empirical solver, scaling this to massive buffers or highly complex trajectory spaces could pose a bottleneck.
  • Hyperparameter Sensitivity: The balance between diversity and regret relies on the tuning parameter $\rho$. The paper does not deeply explore how sensitive the model is to this parameter across wildly different domains, suggesting a need for adaptive balancing mechanisms in future work.

Summary updated

BibTeX
@inproceedings{li2023effective,
  author = {Wenjun Li and Pradeep Varakantham and Dexun Li},
  title = {{Effective Diversity in Unsupervised Environment Design}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.24963/ijcai.2023/601},
}
Figure