Deep Q-learning From Demonstrations

Todd Hester, Matej Vecerík, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Dan Horgan, John Quan, Andrew Sendonaris, Ian Osband, Gabriel Dulac-Arnold, John P. Agapiou, Joel Z. Leibo, Audrunas Gruslys

Abstract

Deep Reinforcement Learning (RL) typically requires millions of interactions to learn effective policies, often starting with catastrophic random behavior. This paper presents Deep Q-learning from Demonstrations (DQfD), a hybrid algorithm that leverages small sets of human demonstration data to overcome the "cold start" problem. By pre-training on expert data and employing a multi-part loss function, DQfD achieves high performance from the onset of interaction and outperforms state-of-the-art RL baselines on challenging Atari games.

Introduction

The data-hungry nature of standard RL algorithms like DQN makes them difficult to apply in real-world scenarios where exploration is expensive or dangerous. While perfect simulators are rare, logs of human experts or legacy systems are often available. DQfD addresses how to effectively integrate this small, potentially sub-optimal pool of expert data to accelerate learning without being constrained by the expert's ultimate performance level.

The DQfD Algorithm

DQfD operates in two distinct phases: pre-training and online interaction.

Pre-training with Multi-Part Loss

Before environment interaction, the agent trains solely on demonstration data. It minimizes a complex loss function consisting of:

  • 1-step and n-step TD Loss: Standard Q-learning losses that ensure the value function follows the Bellman equation across different time horizons.
  • Large Margin Supervised Loss: This "secret sauce" forces the Q-values of expert actions to be higher than all other actions by a fixed margin, grounding the agent's understanding of actions it hasn't yet attempted.
  • L2 Regularization: Prevents overfitting to the small demonstration set.

Online Interaction and Data Balancing

During interaction, the agent stores its experience alongside demonstration data in a shared replay buffer. DQfD uses a modified Prioritized Experience Replay (PER) mechanism to automatically balance the sampling of "self-generated" versus "expert" data. Expert data is never overwritten and receives a priority bonus, ensuring it remains influential throughout the learning process.

Figure 1: DQfD performance on Hero, Pitfall, and Road Runner compared to PDD DQN and imitation learning. The rightmost plot shows the up-sample ratio of demonstration data during training.

Key Results

The algorithm was evaluated on 42 games in the Arcade Learning Environment (ALE) using minimal demonstration data (5,000 to 75,000 transitions).

Instant Performance and Efficiency

DQfD outperformed the PDD DQN baseline in the first million steps in 41 out of 42 games. Remarkably, it took PDD DQN an average of 83 million steps to reach the performance level DQfD exhibited at the very start of its online phase. DQfD eventually surpassed human expert performance in 14 games.

Solving Hard Exploration Games

DQfD achieved state-of-the-art results on "unsolvable" exploration games like Montezuma’s Revenge and Pitfall!. In these games, standard RL agents often score zero because random exploration rarely encounters a reward. By starting with expert "grounding," DQfD successfully navigates these sparse-reward environments.

Ablation Analysis

Ablation studies (Figure 2) confirm that both the large margin supervised loss and n-step TD losses are critical. The supervised loss provides a stable starting policy, while n-step returns help the agent understand long-term values even when immediate rewards are zero. Furthermore, the prioritized replay mechanism ensures that in difficult games, the agent naturally continues to sample expert data more frequently as it remains more informative than its own failed attempts.

Conclusion

DQfD demonstrates that a small amount of demonstration data, when integrated through a principled loss function and prioritized replay, can significantly accelerate RL. This approach provides a viable path for applying RL to real-world tasks where initial random exploration is not an option.

Summary updated

BibTeX
@inproceedings{hester2018deep,
  author = {Todd Hester and Matej Vecerík and Olivier Pietquin and Marc Lanctot and Tom Schaul and Bilal Piot and Dan Horgan and John Quan and Andrew Sendonaris and Ian Osband and Gabriel Dulac-Arnold and John P. Agapiou and Joel Z. Leibo and Audrunas Gruslys},
  title = {{Deep Q-learning From Demonstrations}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.1609/aaai.v32i1.11757},
}
Figure