Reinforcement Learning through Self-Imitation

This direction is merged into another direction: hindsight goal relabeling (hindsight experience replay). Its last version stays readable and citable here.

Version 1 of 114 papers18 conceptsfrozen 2026-10-04

In traditional reinforcement learning (RL), an agent learns by trial and error, guided by a reward signal. However, in the real world, rewards are often "sparse"—a robot might wander for hours before accidentally stumbling upon a success. To bridge this gap, researchers often turn to Imitation Learning, where the agent follows a trail of breadcrumbs left by a human expert.

But what happens when expert data is too expensive, unavailable, or simply doesn't exist for a new environment?

A growing body of research suggests a powerful alternative: Self-Imitation. Instead of looking for an external teacher, the agent treats its own past successes—and even its "successful failures"—as expert demonstrations. By imitating itself, an agent can bootstrap its way out of the sparse-reward trap.

The Expert Bottleneck

The fundamental challenge in RL is the "reward function." As Chelsea Finn, Sergey Levine, and their colleagues note in Generalizing Skills with Semi-Supervised Reinforcement Learning, it is easy to define success in a lab but incredibly difficult in the "wild" where sensors are uninstrumented.

If an agent cannot rely on a constant stream of rewards or a human to show it the way, it must become introspective. Anna Harutyunyan and Patrick Mannion describe this as a process where agents accelerate learning by treating high-reward historical trajectories as self-generated demonstrations in Special issue on adaptive and learning agents 2018.

Exploiting Accidental Success

The simplest form of self-imitation is "ranking and reproducing." In complex, procedurally-generated environments, an agent might explore thousands of paths, most of which lead nowhere.

The RAPID framework, introduced by Daochen Zha and Xia Hu in Rank the Episodes, works by scoring and ranking entire episodes. When the agent finds a "good try," it uses behavior cloning to replicate that trajectory. This turns exploration from a source of transient rewards into a skill to be mastered.

Similarly, the TDMPBC framework (TDMPBC: Self-Imitative Reinforcement Learning for Humanoid Robot Control) applies this to humanoid robotics. By adding a behavior cloning loss that forces the robot to imitate its own high-reward experiences, the researchers achieved a 120% performance improvement, solving tasks in 2 million steps that previously took 10 million.

Learning from Every Mistake via Hindsight

What if the agent never succeeds at the intended goal? In the HGAIL framework (Hindsight Generative Adversarial Imitation Learning), Naijun Liu and colleagues use "hindsight re-labeling."

If an agent tries to reach Goal A but ends up at Goal B, it has failed at A—but it has provided a perfect demonstration of how to reach B. By re-labeling these failed attempts as successful demonstrations for alternative goals, the agent creates an automated curriculum for itself. Kisung Shin and Min Whoo Lee extended this to visual navigation in Visual Hindsight Self-Imitation Learning for Interactive Navigation, using visual embeddings to re-label trajectories and stabilize learning without any human intervention.

Distilling Experience into Skills and Memory

As agents become more complex, such as those based on Large Language Models (LLMs), self-imitation evolves from simple trajectory copying into "skill extraction."

In SkillGen, Ruomeng Ding and Wei Cheng demonstrate how agents can extract structured domain knowledge from their own noisy explorations. By identifying critical actions through credit assignment, the agent builds a "skill library" that it can reference in future tasks.

This concept of "self-guidance" is taken further by Genglin Liu and Shijie Geng in WebCoach. They found that web-browsing agents often perform better when following advice derived from their own past sessions rather than human experts. This is because an agent's own history is perfectly aligned with its internal "inductive biases"—it is essentially speaking its own language.

Why It Works: The Self-Alignment Advantage

Self-imitation works because it solves the distribution shift problem. When an agent tries to imitate a human expert, it often struggles because the human's way of moving or thinking doesn't perfectly match the agent's sensors or actuators.

By imitating itself, as explored in Reward Relabelling for combined Reinforcement and Imitation Learning by Fabien Moutarde and Jesus Bujalance Martin, the agent is guaranteed that the "expert" behavior is actually achievable. This creates a virtuous cycle: exploration leads to accidental success, success is reinforced through self-imitation, and the resulting stronger policy enables even more effective exploration.

Papers in this version

History & citationVersion 1 · 2026-10-04

Merged into another direction · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_reinforcement_learning_through_self_imit_8794bb23,
  title = {Reinforcement Learning through Self-Imitation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/reinforcement-learning-through-self-imitation/rdr_8794bb23edd847e79949404b0a33d9c7},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-24},
}

This exact version (version 1, frozen text):

@misc{lacuna_reinforcement_learning_through_self_imit_8794bb23_v1,
  title = {Reinforcement Learning through Self-Imitation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/reinforcement-learning-through-self-imitation/rdr_8794bb23edd847e79949404b0a33d9c7/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-24},
}