Self-Imitation Advantage Learning

Johan Ferret, Olivier Pietquin, Matthieu Geist

Self-imitation learning (SIL) is a powerful concept in reinforcement learning: if you did something that worked out better than expected, do it again. While this works wonders for on-policy actor-critic methods, adapting it to off-policy, value-based agents like DQN has been a persistent challenge.

In this paper, researchers from Google Research and Inria introduce SAIL (Self-Imitation Advantage Learning), a method that successfully bridges this gap by rethinking how we calculate reward bonuses and connecting self-imitation to the concept of "Advantage Learning."

TL;DR

SAIL is a novel framework that brings self-imitation to off-policy reinforcement learning by modifying the Bellman operator. By using an "optimistic" return estimate to calculate reward bonuses, SAIL solves the problem of stale data in replay buffers and significantly outperforms state-of-the-art baselines like Rainbow and IQN on hard-exploration Atari games.

What Problem Does This Paper Address?

The core challenge is two-fold:

  1. The Off-Policy Gap: Standard self-imitation learning relies on policy gradients—you nudge the policy toward high-return actions. However, many popular RL agents (like DQN) are "off-policy" and value-based; they don't have an explicit policy to nudge. They just estimate the value of actions ($Q$-values).
  2. The Stale Return Problem: Off-policy agents learn from a replay buffer containing old experiences. Imagine an agent that once found a key in a game but then died immediately. That "find key" action is recorded in the buffer with a total return of zero. As the agent gets better and learns to use the key to win, that old "zero-return" entry becomes "stale" and can actually mislead the agent if used for self-imitation.

Methods

The authors propose a modified reward function that combines Self-Imitation with Advantage Learning (AL).

The SAIL Reward

Instead of the standard reward $r$, SAIL uses a modified reward $\tilde{r}$: $$\tilde{r}_{SAIL} = r + \alpha \left( \max(G_t, Q(s_t, a_t)) - \max_a Q(s_t, a) \right)$$

Where:

  • $G_t$ is the observed return from the past.
  • $Q(s_t, a_t)$ is the current estimate of the action's value.
  • $\max_a Q(s_t, a)$ is the value of the best possible action in that state.

Key Innovations:

  • Optimistic Returns: By taking the $\max$ of the observed return ($G_t$) and the current $Q$-value, the agent ignores "stale" low returns from its past if it currently believes the action is worth more.
  • Action-Gap Increasing: By subtracting the value of the best action ($\max_a Q$), SAIL incorporates "Advantage Learning." This pushes the value of the optimal action further away from sub-optimal ones, making the "right" choice easier for the agent to distinguish.
  • Simplicity: Unlike other exploration methods (like RND) that require auxiliary neural networks, SAIL only requires storing the discounted return in the replay buffer—a negligible computational cost.

Datasets

The researchers evaluated SAIL on the Arcade Learning Environment (ALE), specifically the suite of 59 Atari 2600 games. They placed a heavy emphasis on "Hard Exploration" games—titles like Montezuma’s Revenge, Venture, and PrivateEye—where rewards are sparse and standard agents often fail to score at all.

Key Insights and Ideas

  • Self-Imitation as Reward Shaping: The paper shows that self-imitation can be viewed as a form of reward modification that encourages "optimism in the face of uncertainty."
  • Fixing the "Pessimism Drift": Without the $\max(G_t, Q)$ term, old data in the replay buffer would bias the agent toward pessimism. SAIL ensures that the agent's "best ever" performance (or its current best estimate) is what drives learning.
  • Synergy with Distributional RL: SAIL works exceptionally well when combined with Implicit Quantile Networks (IQN). It allows the agent to not just learn the mean return, but to specifically reinforce the high-performing tails of the return distribution.

Key Results

  • Massive Gains on Hard Games: SAIL-DQN showed a +654% average improvement over standard DQN on hard exploration games.
  • Outperforming Rainbow: SAIL-IQN (without using prioritized replay or n-step returns) outperformed the full Rainbow agent, which is generally considered a very high bar in Atari benchmarks.
  • Montezuma’s Revenge: While standard IQN scores 0 on this notoriously difficult game, SAIL-IQN achieved a score of 833. When combined with Random Network Distillation (RND), it reached 5180, matching the best-reported results for RND-Rainbow.
  • Efficiency: SAIL-IQN is more than twice as fast to train (in terms of frames per second) compared to RND-IQN because it doesn't require extra neural networks.

Limitations and Future Work

  • Stochasticity: While SAIL handles the default "sticky actions" of Atari well, the authors note that in extremely noisy environments, the "optimism" of SAIL might lead to overestimating actions that were just "lucky" once.
  • Hyperparameter Sensitivity: While $\alpha=0.9$ worked well across most games, the optimal balance between self-imitation and standard Bellman updates might vary in non-gaming environments.
  • Offline RL: The authors suggest that SAIL’s ability to handle stale data makes it a promising candidate for Offline RL (learning purely from a fixed dataset), though they did not test this explicitly in the paper.

Summary updated

BibTeX
@inproceedings{ferret2021self,
  author = {Johan Ferret and Olivier Pietquin and Matthieu Geist},
  title = {{Self-Imitation Advantage Learning}},
  booktitle = {AAMAS},
  year = {2021},
  url = {https://openreview.net/forum?id=zuvFhdsxlR_},
}
Figure