SimSR: Simple Distance-based State Representation for Deep Reinforcement Learning

Hongyu Zang, Xin Li, Mingzhong Wang

TL;DR

SimSR (Simple State Representation) is a novel framework for learning task-relevant state representations in image-based reinforcement learning. By replacing computationally expensive metrics with a simple cosine-distance operator and an ensemble dynamics model, SimSR achieves state-of-the-art performance and robustness against visual distractors while preventing the "representation collapse" common in previous methods.

What Problem Does This Paper Address?

Deep Reinforcement Learning (RL) from pixels is notoriously difficult because raw images contain a massive amount of task-irrelevant information—like background textures or lighting changes—that can confuse an agent. Ideally, we want an encoder that maps these high-dimensional images into a compact "latent space" containing only the information necessary for the task (e.g., the robot's joint angles and velocity).

One promising theoretical approach is the bisimulation metric, which groups states together if they yield the same immediate rewards and lead to similar future states. However, existing implementations face three major hurdles:

  1. Computational Complexity: Calculating the similarity between state distributions often requires the Wasserstein distance, which is extremely expensive to compute.
  2. Stringent Assumptions: Previous "fixes" (like DBC or DeepMDP) rely on restrictive assumptions, such as state distributions being perfectly Gaussian or mapping functions being Lipschitz continuous.
  3. Representation Collapse: Some methods (like MICo) risk "collapsing," where the encoder learns to map every single observation to the same point in latent space to minimize loss, rendering the representation useless.

Methods

The authors introduce the SimSR operator, which simplifies the bisimulation objective using cosine distance as its core metric.

Key technical innovations include:

  • Cosine-based Distance: Instead of complex metrics, SimSR uses $1 - \text{cosine\_similarity}$. This naturally forces all learned features onto a unit hypersphere. This normalization prevents the scale of rewards from dominating the latent space and ensures all features contribute equally.
  • Zero Self-Distance Guarantee: Mathematically, the cosine distance between a state and itself is always zero. This property is a crucial safeguard against representation collapse; it ensures that if two observations are distinct in their behavior, they cannot be collapsed into the same point.
  • Latent Dynamics Ensemble: To avoid the noise of raw pixel transitions, SimSR learns a compact model of the environment's dynamics in the latent space. They use an ensemble of probabilistic transition models (Gaussians) to better estimate environment uncertainty and stabilize training.
  • Momentum Encoding: To keep the target representations stable during the bootstrapping process (where the model learns from its own previous estimates), they employ a momentum encoder—an exponential moving average of the main encoder.

Datasets

The model was evaluated on the DeepMind Control (DMC) suite, a standard benchmark for continuous control. To test robustness, the authors used two versions:

  1. Default Setting: Clean, simple backgrounds.
  2. Natural Video Setting: The default backgrounds were replaced with complex, moving scenes from the Kinetics dataset to act as visual distractors.
Visualizing the default vs. natural video backgrounds in DMC tasks.

Key Insights and Ideas

  • Task-Agnostic vs. Task-Relevant: Unlike contrastive methods (like CURL) that try to encode everything in an image to distinguish it from others, SimSR only cares about what affects rewards and future transitions. This allows it to "filter out" complex backgrounds that have no impact on the agent's goal.
  • The Power of the Hypersphere: Mapping states to a unit sphere (via $\ell_2$ normalization) is a simple but highly effective stabilizer. The authors show that without this normalization, the representation is prone to instability and failure.
  • Generalization via Shared Observations: Because SimSR learns the underlying "behavioral" structure of the environment, an encoder trained on one task (e.g., "Walker Walk") can be effectively reused for related tasks (e.g., "Walker Run") because they share the same physical state space, even if the rewards differ.

Key Results

SimSR consistently outperformed state-of-the-art baselines like CURL, DBC, and MICo across various DMC tasks.

  • Sample Efficiency: In the default DMC setting, SimSR often closed the performance gap between image-based agents and those trained on "perfect" ground-truth physical states. Performance comparison on 5 DMC tasks. SimSR (orange) consistently leads or remains highly competitive.

  • Robustness to Distractors: In the natural video experiments, SimSR's performance remained stable while other bisimulation-based methods struggled to filter out the background noise.

  • Visualizing the Latent Space: Using t-SNE plots, the authors demonstrated that SimSR successfully clusters observations with similar physical configurations together, regardless of the background, whereas other methods like CURL tend to cluster based on visual similarity (including the background).
Performance comparison on 5 DMC tasks. SimSR (orange) consistently leads or remains highly competitive.
t-SNE visualization showing SimSR (left) clustering by task-relevant features (robot pose) while CURL (right) is distracted by backgrounds.

Limitations and Future Work

While SimSR is highly effective, the authors acknowledge that it does not currently utilize data augmentation (like random cropping or color jitter), which is a staple of other high-performing RL methods. They suggest that combining SimSR's distance-based objective with data augmentation could lead to even more powerful and robust representations. Additionally, while the ensemble dynamics model helps with uncertainty, it adds some computational overhead compared to simpler model-free approaches.

Summary updated

BibTeX
@inproceedings{zang2022simsr,
  author = {Hongyu Zang and Xin Li and Mingzhong Wang},
  title = {{SimSR: Simple Distance-based State Representation for Deep Reinforcement Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i8.20883},
}
Figure