Improving Sample Efficiency in Model-Free Reinforcement Learning from Images

Denis Yarats, Amy Zhang, Ilya Kostrikov, Brandon Amos, Joelle Pineau, Rob Fergus

Abstract

Training an agent to solve control tasks directly from high-dimensional images with model-free reinforcement learning (RL) has proven difficult. A promising approach is to learn a latent representation together with the control policy. However, fitting a high-capacity encoder using a scarce reward signal is sample inefficient and leads to poor performance. Prior work has shown that auxiliary losses, such as image reconstruction, can aid efficient representation learning. However, incorporating reconstruction loss into an off-policy learning algorithm often leads to training instability. We explore the underlying reasons and identify variational autoencoders, used by previous investigations, as the cause of the divergence. Following these findings, we propose effective techniques to improve training stability. This results in a simple approach capable of matching state-of-the-art model-free and model-based algorithms on MuJoCo control tasks. Furthermore, our approach demonstrates robustness to observational noise, surpassing existing approaches in this setting.

Introduction

In reinforcement learning, training agents from low-dimensional "proprioceptive" states—such as joint angles and velocities—is relatively straightforward. However, real-world applications like robotics often require agents to operate directly from raw camera pixels. Learning a control policy and a high-capacity visual encoder simultaneously using only a sparse reward signal is notoriously sample-inefficient.

While auxiliary tasks like image reconstruction have been proposed to aid representation learning, combining off-policy RL with Variational Autoencoders (VAEs) frequently leads to catastrophic training instability. Alternatively, model-based RL methods that learn predictive world models are often complex and brittle. This research investigates the root causes of instability in model-free RL with autoencoders and proposes a robust solution: SAC+AE.

Methods

The proposed algorithm, SAC+AE, builds upon Soft Actor-Critic (SAC) by integrating it with a regularized, deterministic autoencoder. The authors identified two primary drivers of instability and implemented the following architectural fixes:

  1. Deterministic Latent Space: Unlike previous works that utilized stochastic $\beta$-VAEs, SAC+AE uses a deterministic Regularized Autoencoder (RAE). The authors found that the noise injected by VAEs into the latent space destabilizes the Q-value bootstrapping process essential for off-policy RL.
  2. Gradient Decoupling: To prevent representation collapse caused by the non-stationary gradients of the actor, the authors blocked the actor's gradients from flowing into the shared convolutional encoder. The critic's gradients, supplemented by the reconstruction loss, provide sufficient task-specific information to learn effective visual features.
  3. Accelerated Target Updates: To compensate for the slower signal propagation resulting from blocked actor gradients, the target Q-network's convolutional weights are updated via Polyak averaging at a faster rate than the rest of the network.

Experimental Setup

The algorithm was evaluated primarily on the DeepMind Control Suite (DMC), focusing on six continuous control tasks from pixels. To test robustness against real-world visual distractors, the authors also developed a Noisy DMC variant where static backgrounds are replaced with dynamic, bouncing colored balls.

The DeepMind Control Suite (DMC) provides a variety of continuous control tasks, such as Cheetah Run and Walker Walk, which serve as the primary benchmarks for evaluating image-based RL agents.

Key Results and Insights

Sample Efficiency and Performance

SAC+AE matches the performance and sample efficiency of state-of-the-art model-based methods (such as PlaNet and SLAC) on standard DMC tasks, typically reaching peak performance within 500k to 1 million environment steps. This demonstrates that a well-regularized model-free approach can be as efficient as more complex model-based alternatives.

Robustness to Visual Noise

A significant finding is that model-free RL can be more robust than model-based RL in noisy environments. While model-based agents often collapse when trying to predict unpredictable background noise, SAC+AE remains focused on the current frame's reconstruction. In the Noisy DMC benchmarks, SAC+AE maintained high performance while model-based competitors failed.

Representation Generalization

The learned latent space successfully captures underlying physics. By applying a linear projection to the latent representations, the authors could accurately reconstruct the hidden proprioceptive states of the robots. Furthermore, encoders pre-trained on one task (e.g., walker_walk) allowed for rapid zero-shot transfer and learning on related tasks (e.g., walker_run), confirming the generalizability of the learned features.

Limitations and Future Work

While effective, SAC+AE relies on pixel reconstruction, which may struggle in environments where critical task elements are visually small and contribute little to the overall reconstruction loss. Additionally, the method remains sensitive to the "action repeat" hyperparameter. Future research will focus on applying SAC+AE to real-world robotic systems, where its robustness to noise and sample efficiency are most needed.

Summary updated

BibTeX
@inproceedings{yarats2021improving,
  author = {Denis Yarats and Amy Zhang and Ilya Kostrikov and Brandon Amos and Joelle Pineau and Rob Fergus},
  title = {{Improving Sample Efficiency in Model-Free Reinforcement Learning from Images}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i12.17276},
}
Figure