Abstract
Standard Generative Adversarial Imitation Learning (GAIL) focuses on mimicking expert successes, often discarding the "failures" encountered during the agent's own training process. This paper introduces GAILFE (GAIL from Failed Experiences), a framework that utilizes a replay buffer of failed attempts to train a more sensitive discriminator. By treating failures as negative constraints, GAILFE significantly improves learning speed and sample efficiency in complex control tasks.
Introduction
Imitation Learning (IL) enables agents to acquire complex behaviors by observing experts, bypassing the need for manually engineered reward functions. Generative Adversarial Imitation Learning (GAIL) is a prominent IL method employing a GAN-like architecture: a generator (the agent) attempts to mimic expert behavior, while a discriminator learns to distinguish between agent and expert actions.
Despite its success, GAIL suffers from two primary limitations: high data requirements and the neglect of "failed" trajectories produced during training. In standard GAIL, when an agent fails (e.g., a robot falls over), that data is typically discarded. However, understanding what not to do is arguably as critical as knowing what to do. GAILFE addresses this by incorporating failed experiences into the learning signal.
Methodology: GAIL from Failed Experiences
GAILFE modifies the standard GAIL objective by introducing a "failed experience" replay buffer, denoted as $\beta_F$. The core innovation lies in a constrained optimization objective for the discriminator.
In standard GAIL, the discriminator only learns to separate "expert" from "agent" distributions. GAILFE adds a constraint requiring the discriminator to assign a high probability of "failure" to samples within $\beta_F$. Mathematically, a threshold $Z_F$ is defined to adjust the intensity of the penalty for failed behaviors. Since the agent's reward in GAIL is derived from the discriminator's output (specifically $-\log(D_\omega(s, a))$), forcing the discriminator to recognize failures results in a lower reward for the agent if it enters states similar to those in the failure buffer.
To optimize this objective, the authors employ Lagrangian duality. They introduce a multiplier ($\lambda_F$) to balance two competing goals:
- Matching the expert's state-action distribution.
- Maximizing the distance from the failed experience distribution.
Experimental Setup
The researchers evaluated GAILFE on two physics-based control benchmarks from the MuJoCo suite:
- HalfCheetah: A 2D robot learning to run forward.
- Hopper: A one-legged robot learning to hop forward.
For each task, 30 expert trajectories (each consisting of 1,000 state-action pairs) were generated using Proximal Policy Optimization (PPO) to serve as the ground truth for imitation.
Results
Empirical results demonstrate that GAILFE consistently outperforms standard GAIL in both learning speed and final performance.
As shown in the learning curves, GAILFE (blue line) exhibits a much steeper ascent compared to standard GAIL (green line). In the HalfCheetah environment, GAILFE approaches its peak return around iteration 800, whereas standard GAIL continues to struggle to reach comparable levels even after 1400 iterations. Similarly, in the Hopper environment, GAILFE achieves higher average returns with lower variance, indicating more stable and efficient learning.
Discussion and Key Insights
The success of GAILFE stems from several key factors:
- Failures as Negative Constraints: By treating failures as "no-go zones," GAILFE transforms imitation from a simple matching problem into a boundary-constrained problem.
- Discriminator Sensitivity: Training on failures makes the discriminator more "opinionated," providing sharper gradients that more clearly signal when the policy is veering toward a known bad outcome.
- Abundant Data: Identifying failures (e.g., a robot falling) is often easier than providing perfect demonstrations. This makes failed experiences a "cheap" and abundant source of data that standard GAIL simply ignores.
Conclusion
GAILFE demonstrates that incorporating failed experiences into the GAIL framework significantly enhances sample efficiency. While the current implementation assumes a simple heuristic for labeling failures, future work could explore more complex "annotators" or the inclusion of successful self-generated samples to further reduce reliance on limited expert data.
Summary updated