Improving Sample Efficiency in Model-Free Reinforcement Learning from Images

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

Abstract

Learning complex control tasks directly from raw camera images remains a significant challenge in reinforcement learning (RL). While humans effortlessly map visual inputs to physical actions, model-free RL agents typically require millions of frames to achieve similar proficiency. This paper introduces SAC+AE, an algorithm that enhances Soft Actor-Critic (SAC) with a simple image reconstruction task, achieving the sample efficiency of complex model-based methods while maintaining the robustness of model-free approaches.

Introduction

Reinforcement learning has seen remarkable success when agents have access to "proprioceptive" states—clean, low-dimensional data like joint angles and velocities. However, real-world robotics often relies on high-dimensional pixel data. Learning a policy directly from pixels is notoriously "sample inefficient" because the agent must simultaneously learn feature representation and policy optimization.

Existing solutions generally fall into two categories:

  1. Model-Free RL: Simple and stable but data-hungry, as it learns features solely from sparse reward signals.
  2. Model-Based RL: Highly efficient by learning a "world model" to predict future states, but often computationally expensive and brittle when faced with visual "noise" or distractors.

SAC+AE provides a middle ground: a model-free approach using an auxiliary image reconstruction task to learn features rapidly without the overhead of a full world model.

The SAC+AE Framework

The core innovation of SAC+AE is the integration of a Regularized Autoencoder (RAE) into the Soft Actor-Critic (SAC) framework. By analyzing previous failures in combining Variational Autoencoders (VAEs) with off-policy RL, the authors identified two primary sources of instability: stochasticity in VAE sampling and non-stationary gradients from the Actor.

Key Architectural Improvements

  • Deterministic Encoder: SAC+AE replaces the stochastic VAE with a deterministic RAE, utilizing $L_2$ penalty and weight decay to stabilize the latent space.
  • Gradient Decoupling: To prevent the representation from shifting too rapidly for the Critic to keep up, the authors blocked the Actor’s gradients from updating the convolutional encoder. The encoder is updated only by the reconstruction loss and the Critic’s gradients.
  • Optimized Update Rates: The algorithm employs different "Polyak averaging" rates for the encoder and the critic, allowing the representation to stabilize at a cadence distinct from the value function.

Experimental Evaluation

The researchers evaluated SAC+AE on six challenging tasks from the DeepMind Control Suite (DMC). These environments require precise control and coordination.

The Cheetah Run task, one of the benchmarks used to evaluate SAC+AE.

Beyond standard benchmarks, the authors tested robustness using a modified DMC environment with "distractors"—bouncing colored balls in the background. This setup simulates real-world conditions where irrelevant visual motion can confuse an agent.

The Walker Walk task, another complex control environment from the DMC suite.

Key Insights and Results

The study yielded several critical insights into visual RL:

  • Reconstruction Sufficiency: Predicting the future (dynamics modeling) is not strictly necessary for learning effective control representations. Reconstructing the current frame provides a sufficiently strong signal.
  • The Critic as a Teacher: While Actor gradients can be destabilizing, the Critic’s gradients help the encoder focus on task-relevant features by mapping states to long-term value.
  • Robustness to Noise: Unlike model-based methods (e.g., PlaNet) that may overfit to background noise by trying to model all movement, SAC+AE’s simpler reconstruction focus proved significantly more resilient to distractors.

Performance Summary

SAC+AE matched the state-of-the-art performance of complex model-based algorithms like PlaNet and SLAC across standard benchmarks while significantly outperforming standard pixel-based SAC. Furthermore, its implementation is straightforward, avoiding the complex loss balancing required by world models.

Conclusion and Future Work

SAC+AE demonstrates that model-free RL can be highly sample-efficient when paired with the right auxiliary tasks and architectural constraints. While powerful, the authors note that pixel reconstruction may struggle in environments where the agent or target is very small relative to the background. Future research may explore attention mechanisms to prioritize task-critical pixels in more complex visual scenes.

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