Introduction
Deep reinforcement learning (RL) agents often fail at complex, compositional tasks—such as web navigation—due to sparse rewards and long time horizons. Many real-world problems are inherently compositional, requiring agents to complete a series of interdependent sub-tasks. For example, booking a flight involves selecting a date, entering a destination, and providing payment information. In these scenarios, the action space explodes, and rewards become incredibly sparse.
A promising approach to this challenge is automatic curriculum generation, where a generator network builds increasingly difficult environments for a learner agent. Prior state-of-the-art methods, like PAIRED, achieve this by training a generator to maximize "regret"—the difference in performance between an optimal antagonist agent and a learner agent. However, this approach often fails in compositional tasks due to two primary failure modes:
- The Degenerate Case: To maximize regret, the generator may create infinitely long tasks (e.g., an endless chain of sub-tasks). The probability of solving it drops to zero, and learning stalls.
- Sparse Rewards: If the generator makes a task so difficult that neither the antagonist nor the protagonist can solve it, the regret becomes zero. The generator receives no learning signal, causing the curriculum to collapse.
Furthermore, existing benchmarks for web navigation (like MiniWoB) are often too simplistic and static to test true zero-shot generalization to real-world websites.
Compositional Design of Environments (CoDE)
To address these limitations, the authors introduce CoDE (Compositional Design of Environments), an algorithm that jointly trains a Generator and a population of Learner agents.
The Generator, an LSTM-based decoder, constructs environments by placing "primitives" (e.g., text boxes, locked doors) into a sequence of sub-tasks formalized using Petri Nets. CoDE trains this Generator using a novel multi-objective reward function designed to prevent curriculum collapse:
- Population-based Regret (PopRegret): Instead of relying on a single antagonist, CoDE compares the average score of the learner population against the best-performing agent within that same population. This provides a smoother, more stable learning signal and prevents training from stalling if a single agent gets stuck in a local optimum.
- Difficulty Budget: To prevent the "degenerate case," the generator is explicitly incentivized to tune difficulty. It is rewarded for adding complexity (more primitives) only if the best agent in the population can actually solve the task. If all agents fail, the generator is penalized, forcing it to scale back the difficulty.
Generative Benchmarks and Curriculum Progression
The authors introduce two new open-source benchmarks for generating compositional tasks:
- cMiniGrid (Compositional MiniGrid): An extension of the popular gridworld environment where the generator combines sub-tasks like picking up keys, unlocking doors, and moving boxes.
- gMiniWoB (Generative MiniWoB): A generative web navigation benchmark capable of dynamically generating multi-page websites using 40 different DOM primitives (navigation bars, text fields, carousels). It can generate roughly $10^{14}$ distinct web tasks.
As training progresses, CoDE successfully builds a curriculum, starting with simple single-step forms and gradually evolving into complex, multi-page tasks with numerous distractors.
Key Results and Insights
CoDE demonstrates a massive performance leap, achieving a 4x higher success rate than the strongest baseline (PAIRED) on web navigation tasks. CoDE agents achieved >90% success rates across all difficulty levels on gMiniWoB tasks, including Login, Address, Payment, Flight, and Shopping scenarios. On the cMiniGrid benchmark, CoDE solved 45% of highly complex, sparse-reward tasks, compared to just 16% for PAIRED.
Crucially, the agents exhibited strong zero-shot real-world transfer. For evaluation, the authors scraped 3,500 real primitives from 200 actual websites. Agents trained purely on CoDE's synthetic curriculum successfully generalized to these unseen environments, achieving up to 62% success on real-world Login tasks and 44% on Shopping tasks without any fine-tuning.
The research highlights that in generative environments, "noise" is a feature, not a bug. The generator frequently adds passive primitives (like ad banners) to the web pages. Learning to ignore this noise in a controlled, gradually increasing manner is exactly what allows the agents to survive the chaotic DOM structures of real-world websites.
Limitations and Future Work
While highly effective, the approach has limitations. The Petri Net workflow model used to define tasks is expressive but represents only one topological class of tasks. Furthermore, the difficulty budget relies on the task having a reachable goal state, meaning it may struggle with open-ended tasks or environments lacking clear terminal states. Finally, while agents generalized well to complex real-world web data, they occasionally failed on highly simplistic toy tasks, indicating that future work is needed to understand the exact bounds of generalization across vastly different distributions of primitives.
Summary updated