Contrastive Variational Reinforcement Learning for Complex Observations

Xiao Ma, Siwei Chen, David Hsu, Wee Sun Lee

Introduction

Model-based reinforcement learning (MBRL) is a powerful paradigm for improving sample efficiency by allowing agents to learn a "world model" of their environment. By simulating future trajectories within this internal model, agents can plan actions without exhaustive real-world interaction. However, traditional MBRL often struggles when faced with complex, high-dimensional observations—such as naturalistic backgrounds—where irrelevant visual noise can overwhelm the learning process.

The Reconstruction Trap

Most current MBRL methods utilize generative models, such as Variational Autoencoders (VAEs), to learn world models. These models are trained to reconstruct every pixel of an observation. While effective in controlled laboratory settings with static backgrounds, this approach often fails in the real world. In a "Natural Mujoco" setting, for instance, a robot might be surrounded by swaying trees or moving pedestrians. A generative model spends significant computational resources attempting to predict these task-irrelevant details, leading to inaccurate state representations and poor decision-making.

The CVRL Framework

To address this, the authors propose Contrastive Variational Reinforcement Learning (CVRL). CVRL avoids pixel-level reconstruction entirely by employing a contrastive learning objective.

Contrastive Evidence Lower Bound (CELBO)

Instead of maximizing the likelihood of reconstructing an image, CVRL maximizes the mutual information between the latent state ($s$) and the observation ($o$). This is achieved through the Contrastive Evidence Lower Bound (CELBO).

The Contrastive Model architecture used in CVRL, which focuses on maximizing mutual information rather than pixel reconstruction.

InfoNCE Loss and Hybrid Learning

The model utilizes the InfoNCE loss to distinguish between "positive" state-observation pairs and "negative" samples drawn from different time steps or trajectories. This forces the latent space to capture features that uniquely identify the state relative to the task, effectively filtering out background noise. Furthermore, CVRL employs a hybrid actor-critic approach, combining latent imagination with an off-policy model-free learner (Soft Actor-Critic) to ensure robustness even if the world model is imperfect.

Experimental Evaluation

The researchers evaluated CVRL across three distinct domains designed to test its limits:

  1. Standard Mujoco: Classic continuous control benchmarks.
  2. Natural Mujoco: A new benchmark where standard tasks are overlaid with dynamic videos from the ImageNet dataset to mimic real-world visual complexity.
  3. Box Pushing: A manipulation task featuring randomized lighting and dynamic shadows.
An example of the Natural Mujoco benchmark, where agents must perform tasks against complex, dynamic visual backgrounds.

Key Results

CVRL demonstrated significant advantages in complex environments:

  • Robustness to Noise: In the Natural Mujoco "Walker-Walk" task, CVRL achieved a score of 941.5, vastly outperforming the generative Dreamer model, which scored only 206.6.
  • Sample Efficiency: CVRL matched the performance of state-of-the-art model-free algorithms while requiring 20 times fewer environment steps.
  • Task Focus: In the Box Pushing task, CVRL successfully ignored dynamic shadows that confused other models, focusing solely on the task-relevant object.

Conclusion

By replacing pixel reconstruction with contrastive learning, CVRL provides a robust framework for model-based RL in visually complex environments. It demonstrates that for high-dimensional observations, discriminative features are often more valuable for control than full generative reconstructions. Future work will explore more sophisticated negative sampling strategies to further enhance the stability of contrastive world models.

Summary updated

BibTeX
@inproceedings{ma2020contrastive,
  author = {Xiao Ma and Siwei Chen and David Hsu and Wee Sun Lee},
  title = {{Contrastive Variational Reinforcement Learning for Complex Observations}},
  booktitle = {Conference on Robot Learning},
  year = {2020},
}
Figure