Unsupervised Active Pre-Training for Reinforcement Learning

Hao Liu, Pieter AbbeelOpenReview 2020 · OpenReview

TL;DR

This paper introduces Active Pre-Training (APT), a novel unsupervised method that learns useful representations and policy initializations for reinforcement learning agents by actively exploring novel states in reward-free environments. APT significantly boosts data efficiency and performance on challenging visual RL tasks, achieving human-level performance on many Atari games and outperforming baselines on DMControl.

What Problem Does This Paper Address?

Deep Reinforcement Learning (RL) agents are notoriously sample-inefficient, requiring vast amounts of interaction data to learn effective policies, especially in complex environments with sparse rewards. This data hunger limits their applicability and makes learning new tasks a slow, laborious process. While unsupervised pre-training has revolutionized fields like computer vision and NLP by leveraging massive unlabeled datasets, applying it to RL is challenging because it's not immediately obvious where to source such unlabeled data. Simply pre-training on datasets like ImageNet doesn't transfer well to RL tasks, suggesting that RL-specific data distributions are crucial. This paper aims to bridge this gap by developing an unsupervised pre-training method that actively collects relevant data from the RL environment itself.

Methods

APT combines two key components:

  1. Contrastive Representation Learning: Similar to methods like SimCLR, APT uses a contrastive loss to learn meaningful visual representations from agent observations. This involves augmenting data points and training an encoder to distinguish between different views of the same observation while pushing apart views of different observations. This is done within the learned latent space.
  2. Particle-Based Entropy Maximization: This is the core novelty. Instead of relying on complex density models to estimate state entropy (which is difficult in high-dimensional spaces), APT uses a particle-based entropy estimator. The agent is incentivized to explore by maximizing this entropy in the learned latent representation space. This means the agent is rewarded for visiting novel states in its learned feature space, effectively guiding its exploration towards informative regions. The method actively collects data by maximizing this particle-based entropy, hence the "Active" in APT.

The overall process involves alternating between contrastive representation learning and RL optimization to maximize the particle-based entropy reward, all within a reward-free environment. After this pre-training phase, the learned encoder and policy initialization can be fine-tuned on downstream tasks.

Datasets

  • DMControl Suite: Used for evaluating pre-training and fine-tuning on continuous control tasks.
  • Atari Game Suite: Used for evaluating pre-training and fine-tuning on a wide range of discrete action tasks.
  • ImageNet: Mentioned as a common pre-training dataset for vision models, but the paper shows it's not directly beneficial for RL pre-training.

The paper also introduces several sparse reward variants of DMControl tasks (e.g., "Jump Sparse," "Reach Sparse") to specifically test performance on challenging exploration scenarios.

Key Insights and Ideas

  • RL needs RL-specific data: Pre-training on general vision datasets like ImageNet doesn't effectively transfer to RL. The agent needs to explore and collect data from its own environment to learn useful representations.
  • Active exploration is key: Simply collecting "unlabeled" data isn't enough. The agent must actively search for novel states, guided by an intrinsic reward signal.
  • Latent space entropy maximization is scalable: By maximizing entropy in the learned, lower-dimensional latent space (rather than raw pixel space), APT avoids the difficulties of high-dimensional density estimation and scales to complex visual inputs.
  • Particle-based entropy is a viable alternative: Using particle-based estimators for entropy avoids the need for explicit density models, making the approach more robust and practical.
  • Pre-training can provide strong initializations: APT learns representations and policy initializations that significantly accelerate learning on downstream tasks, even those that are very difficult to learn from scratch.

Key Results

  • Atari Games: APT achieves human-level performance on 12 out of 57 Atari games after pre-training and fine-tuning. It also achieves highly competitive performance compared to fully supervised RL algorithms, often with significantly less data.
  • DMControl Suite: APT outperforms all baselines in terms of asymptotic performance and data efficiency. It dramatically improves performance on tasks that are extremely difficult to train from scratch, especially sparse reward tasks. For example, on "Cheetah Jump Sparse," APT achieves a success rate of ~0.79, while training from scratch is ~0.0.
  • Data Efficiency: APT significantly improves data efficiency, allowing agents to reach high performance levels with a fraction of the samples required by other methods.
  • Multi-environment Pre-training: Pre-training across multiple environments shows promise for generalization, though it can be more complex than single-environment pre-training.

Limitations and Future Work

  • Computational Cost: While APT is more data-efficient, the pre-training phase itself can be computationally intensive due to the extensive exploration required.
  • Intervention in Multi-environment Pre-training: The paper notes that multi-environment pre-training can lead to mixed results due to potential intervention between representation learning in different environments, suggesting this is an area for further research.
  • VISR Comparison: The paper mentions that combining APT with VISR (a skill-discovery method) could potentially further improve performance, suggesting future work in integrating these approaches.
  • Generalization to Different Action Spaces: While APT can fine-tune policies for tasks with different action space dimensions, the paper notes this is a direction for further exploration.

Summary updated

Abstract

We introduce a new unsupervised pre-training method for reinforcement learning called $\textbf{APT}$, which stands for $\textbf{A}\text{ctive}\textbf{P}\text{re-}\textbf{T}\text{raining}$. APT learns a representation and a policy initialization by actively searching for novel states in reward-free environments. We use the contrastive learning framework for learning the representation from collected transitions. The key novel idea is to collect data during pre-training by maximizing a particle based entropy computed in the learned latent representation space. By doing particle based entropy maximization, we alleviate the need for challenging density modeling and are thus able to scale our approach to image observations. APT successfully learns meaningful representations as well as policy initializations without using any reward. We empirically evaluate APT on the Atari game suite and DMControl suite by exposing task-specific reward to agent after a long unsupervised pre-training phase. On Atari games, APT achieves human-level performance on $12$ games and obtains highly competitive performance compared to canonical fully supervised RL algorithms. On DMControl suite, APT beats all baselines in terms of asymptotic performance and data efficiency and dramatically improves performance on tasks that are extremely difficult for training from scratch. Importantly, the pre-trained models can be fine-tuned to solve different tasks as long as the environment does not change. Finally, we also pre-train multi-environment encoders on data from multiple environments and show generalization to a broad set of RL tasks.
BibTeX
@misc{liu2020unsupervised,
  author = {Hao Liu and Pieter Abbeel},
  title = {{Unsupervised Active Pre-Training for Reinforcement Learning}},
  year = {2020},
  url = {https://openreview.net/forum?id=cvNYovr16SB},
  howpublished = {OpenReview},
}
Figure