Automatic Goal Generation for Reinforcement Learning Agents

Carlos Florensa, David Held, Xinyang Geng, Pieter Abbeel

Standard Reinforcement Learning (RL) excels at training agents to master single, specific tasks, such as winning a game of Go. However, real-world robotics demands "generalists"—agents capable of navigating complex environments to reach a wide variety of goals. Training these generalist agents presents a significant challenge, primarily due to sparse rewards. In many scenarios, an agent only receives a reward upon successfully reaching its exact goal; if the goal is too far away, the agent receives no feedback and fails to learn.

Traditionally, researchers have bypassed this issue by manually designing a "curriculum"—starting the agent on easy tasks and progressively increasing the difficulty. This manual approach is tedious, requires deep domain expertise, and scales poorly to complex environments. To address this, researchers have introduced Goal GAN, a framework that uses adversarial training to automatically generate a curriculum of tasks, allowing agents to efficiently master a wide range of goals without manual reward engineering.

The Goal GAN Framework

The core innovation of this paper is the Goal Generative Adversarial Network (Goal GAN), which automates curriculum generation through three main components:

  1. Goal Labeling (The "Goldilocks" Rule): The system evaluates goals based on the agent's current capabilities, specifically seeking out Goals of Intermediate Difficulty (GOID). These are tasks where the agent's success probability falls between a minimum threshold (e.g., 10%) and a maximum threshold (e.g., 90%). Goals that are too easy teach the agent nothing new, while goals that are too hard provide no actionable reward signal.
  2. Adversarial Generation: The framework employs a two-part adversarial system. A Generator network creates new goals from random noise, while a Discriminator network is trained to distinguish whether these generated goals fall into the "GOID" sweet spot. Through this continuous competition, the generator learns to produce a steady stream of perfectly balanced challenges.
  3. Policy Optimization: The RL agent (acting as the "student") uses Trust Region Policy Optimization (TRPO) to attempt the goals proposed by the generator. As the agent's skills improve, the definition of "intermediate difficulty" naturally shifts, prompting the GAN to automatically generate harder, more distant goals.

Experimental Environments

The researchers evaluated Goal GAN across several simulated robotic environments using the MuJoCo physics engine to test its scalability and robustness.

Simulated environments used to evaluate the Goal GAN framework.
  • Ant Locomotion: A complex 8-joint quadruped "Ant" tested in two scenarios: a Free Ant environment where it must reach any point in an open square, and a Maze Ant environment where it must navigate a U-shaped maze.
  • Multi-path Point-mass Maze: A 2D agent in a maze with multiple routes, designed to test if the GAN can handle "multimodal" distributions (i.e., generating goals simultaneously in different branches of the maze).
  • N-dimensional Point Mass: A high-dimensional scalability test (up to 6D) where feasible goals are restricted to a narrow subset of the space.

Key Insights and Results

The Goal GAN approach yielded several compelling advantages over traditional methods:

  • The "Growing Ring" of Knowledge: In open environments, Goal GAN naturally produces a "growing ring" curriculum. It begins by proposing goals very close to the agent's starting position and expands outward only as the agent masters the inner regions.
  • Handling Multimodality: Unlike previous methods that often get stuck practicing in only one area, the GAN successfully represents complex, disjointed sets of goals. In the multi-path maze, the GAN learned to propose goals across all available branches.
  • Superior Coverage and Sample Efficiency: In the complex "Maze Ant" task, Goal GAN achieved significantly higher coverage (the percentage of the maze the agent can reliably reach) compared to uniform sampling or other intrinsic motivation baselines. By focusing training efforts exclusively on GOIDs, it avoids wasting time on impossible or already-mastered tasks.
  • No Distance Metric Required: Because Goal GAN operates on pure binary rewards (success or failure), it does not require a predefined distance metric (like Euclidean distance) to measure how close an agent is to a goal. This makes it highly adaptable to tasks where distance is difficult to quantify.

Future Directions

While Goal GAN represents a significant step forward, the authors note that the GAN requires a reasonable initialization to find its first feasible goals, which can be challenging in highly constrained environments. Looking ahead, integrating Goal GAN with techniques like Hindsight Experience Replay (HER)—which allows agents to learn from failed attempts by treating them as successes for alternative goals—could yield even greater sample efficiency. Additionally, this automatic curriculum generation could be leveraged to train low-level skills for hierarchical RL systems tackling long-horizon, multi-step problems.

Summary updated

BibTeX
@inproceedings{florensa2018automatic,
  author = {Carlos Florensa and David Held and Xinyang Geng and Pieter Abbeel},
  title = {{Automatic Goal Generation for Reinforcement Learning Agents}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
  url = {https://openreview.net/forum?id=HyZbmjZ_br},
}
Figure