Efficient Exploration with Self-Imitation Learning via Trajectory-Conditioned Policy

Yijie Guo, Jongwook Choi, Marcin Moczulski, Samy Bengio, Mohammad Norouzi, Honglak LeearXiv 2019

Abstract

Reinforcement learning with sparse rewards is challenging because an agent can rarely obtain non-zero rewards and hence, gradient-based optimization of parameterized policies can be incremental and slow. Recent work demonstrated that using a memory buffer of previous successful trajectories can result in more effective policies. However, existing methods may overly exploit past successful experiences, which can encourage the agent to adopt sub-optimal and myopic behaviors. In this work, instead of focusing on good experiences with limited diversity, we propose to learn a trajectory-conditioned policy to follow and expand diverse past trajectories from a memory buffer. Our method allows the agent to reach diverse regions in the state space and improve upon the past trajectories to reach new states. We empirically show that our approach significantly outperforms count-based exploration methods and self-imitation learning on various complex tasks with local optima. In particular, without using expert demonstrations or resetting to arbitrary states, we achieve the state-of-the-art scores under five billion number of frames, on challenging Atari games such as Montezuma's Revenge and Pitfall.

Introduction

In many complex reinforcement learning (RL) tasks, agents must perform thousands of actions before receiving a single positive reward. Standard parametric RL algorithms struggle in these "sparse reward" environments because gradients are frequently zero. While self-imitation learning (SIL) attempts to address this by replaying successful trajectories from a memory buffer, it often leads to myopic behavior. Agents may over-exploit paths that yield small, immediate rewards, failing to explore more difficult routes that lead to higher long-term payoffs.

Methodology: Diverse Trajectory-conditioned Self-Imitation Learning (DTSIL)

We propose DTSIL, a framework that shifts the focus from imitating high-reward paths to imitating diverse experiences.

Diverse Trajectory Buffer

Rather than storing only high-reward paths, DTSIL maintains a buffer of trajectories ending in unique, diverse states. A clustering mechanism is employed to keep the memory compact while maximizing environmental coverage.

Trajectory-Conditioned Policy

The core of DTSIL is a policy conditioned on an entire sequence of states (a demonstration trajectory $g$). This policy utilizes a Recurrent Neural Network (RNN) with an Attention mechanism. The attention mechanism allows the agent to locate its current position within the demonstration, enabling it to follow the path even under stochastic conditions or from slightly different starting positions.

Overview of the DTSIL architecture and buffer management

Learning Objectives

The agent is trained using a dual objective:

  1. RL Loss (PPO): Maximizes environmental rewards and a small imitation reward for reaching states within the stored trajectory.
  2. Supervised Learning Loss: A behavior cloning objective where the agent learns to predict actions from stored trajectories.

Experimental Results

DTSIL was evaluated on several challenging domains, including the Apple-Gold grid-world, hard-exploration Atari games (Montezuma’s Revenge, Pitfall, Venture), and continuous control tasks (Gibson dataset, robotic Bin Picking).

Performance comparison on Montezuma's Revenge showing average reward and room discovery

On Montezuma’s Revenge, DTSIL achieved a state-of-the-art score of 22,616 within 5 billion frames, without expert demonstrations. On Pitfall, it scored 12,446, significantly outperforming baselines like RND or standard PPO, which often score near zero. The results indicate that DTSIL's ability to follow and expand upon diverse trajectories allows it to discover significantly more rooms than previous state-of-the-art methods.

Conclusion

DTSIL demonstrates that conditioning on full trajectories rather than single goals provides a dense "trail" for agents in sparse reward environments. By prioritizing diversity over reward exploitation, the agent avoids local optima and systematically expands its knowledge frontier. Future work includes improving state representation learning to reduce sensitivity to embedding quality and exploring multi-task extensions.

Summary updated

BibTeX
@misc{guo2019efficient,
  author = {Yijie Guo and Jongwook Choi and Marcin Moczulski and Samy Bengio and Mohammad Norouzi and Honglak Lee},
  title = {{Efficient Exploration with Self-Imitation Learning via Trajectory-Conditioned Policy}},
  year = {2019},
  eprint = {1907.10247},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1907.10247},
}
Figure