Generative Adversarial Self-Imitation Learning

Yijie Guo, Junhyuk Oh, Satinder Singh, Honglak LeearXiv 2018

Abstract

This paper explores a simple regularizer for reinforcement learning by proposing Generative Adversarial Self-Imitation Learning (GASIL), which encourages the agent to imitate past good trajectories via generative adversarial imitation learning framework. Instead of directly maximizing rewards, GASIL focuses on reproducing past good trajectories, which can potentially make long-term credit assignment easier when rewards are sparse and delayed. GASIL can be easily combined with any policy gradient objective by using GASIL as a learned shaped reward function. Our experimental results show that GASIL improves the performance of proximal policy optimization on 2D Point Mass and MuJoCo environments with delayed reward and stochastic dynamics.

Introduction

Reinforcement learning (RL) is fundamentally a credit assignment problem: when an agent receives a reward, it must determine which preceding actions were responsible. This task becomes significantly more difficult in environments with sparse or delayed rewards, where an agent may perform a long sequence of actions before receiving any feedback.

Standard policy gradient methods, such as Proximal Policy Optimization (PPO), often struggle in these settings because they rely solely on raw environment rewards. If rewards are rare, the agent learns slowly or converges to sub-optimal "safe" behaviors. While Self-Imitation Learning (SIL) helps agents revisit past successes, traditional methods often rely on simple behavior cloning losses that may not generalize well in complex, continuous state spaces.

Methodology: Generative Adversarial Self-Imitation Learning (GASIL)

GASIL addresses the credit assignment problem by adapting the Generative Adversarial Imitation Learning (GAIL) framework to a self-imitation context. Instead of imitating human experts, the agent treats its own historical high-performing trajectories as "expert" data.

Key components of the GASIL framework include:

  1. Good Trajectory Buffer ($\mathcal{B}$): The agent maintains a buffer of its "top-K" highest-scoring trajectories encountered during training.
  2. The Discriminator ($D$): A neural network trained to distinguish between the agent's current trajectories and the "good" ones in the buffer.
  3. Adversarial Reward Shaping: The discriminator's output is used as an internal reward function. If the discriminator identifies a current action as similar to a "good" past action, it provides a positive internal reward.
  4. Combined Objective: The agent is trained to maximize a combination of the environment's true reward and this internal imitation reward, effectively "shaping" the reward landscape to be denser and easier to navigate.
Visualization of policy trajectories and learned discriminator rewards in the 2D Point Mass environment.

Experimental Results

The authors evaluated GASIL on a custom 2D Point Mass environment and the standard MuJoCo suite (OpenAI Gym). To test robustness, they also utilized "Delayed MuJoCo," where rewards are provided only every 20 steps.

Performance and Sample Efficiency

GASIL consistently outperformed standard PPO, PPO with Behavior Cloning (PPO+BC), and standard Self-Imitation Learning (PPO+SIL) across most MuJoCo tasks. The adversarial discriminator learns a more general representation of "good" behavior than simple behavior cloning, providing a smoother gradient for the policy to follow.

Performance comparison of GASIL against PPO, PPO+BC, and PPO+SIL on standard MuJoCo environments.

Key Insights

  • Self-Expertise: An agent can create a virtuous cycle of improvement by imitating its own "best self," eliminating the need for external expert demonstrations.
  • Overcoming Local Optima: In 2D Point Mass experiments, GASIL encouraged exploration by imitating early "lucky" trajectories that found superior rewards, whereas standard PPO often got stuck in local optima.
  • Robustness to Delay: The performance gap was most dramatic in delayed reward settings, where GASIL's internal reward signal provided critical guidance in the absence of frequent environmental feedback.

Discussion and Future Work

While GASIL is empirically successful, it faces challenges in highly stochastic environments where it might be biased toward "lucky" outcomes. Additionally, standard Gaussian policies may struggle to average between multi-modal "good" trajectories in the buffer. Future research aims to develop more principled training methods for the discriminator with stronger theoretical convergence guarantees.

Summary updated

BibTeX
@misc{guo2018generative,
  author = {Yijie Guo and Junhyuk Oh and Satinder Singh and Honglak Lee},
  title = {{Generative Adversarial Self-Imitation Learning}},
  year = {2018},
  eprint = {1812.00950},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.00950},
}
Figure