Abstract
In deep reinforcement learning (RL), agents must often learn effective control policies from high-dimensional visual inputs. This paper introduces Learning via Retracing, a self-supervised method that improves state representation learning by enforcing cycle-consistency in a latent space. By requiring that a forward transition followed by a "retraced" backward move returns the agent to its original state, the proposed Cycle-Consistency World Model (CCWM) captures the underlying structure of physical environments more effectively than standard forward-only models. Our approach achieves state-of-the-art sample efficiency on the DeepMind Control Suite and demonstrates superior long-range planning and zero-shot generalization.
Introduction
A fundamental challenge in visual RL is mapping raw pixels into a compact embedding that captures essential task-relevant physics. While current "World Models" typically learn these representations through forward prediction (e.g., predicting future frames or rewards), they often neglect the supervisory signal provided by reversibility. In many physical systems, the relationship between two states is constrained by the possibility of returning from a future state to a previous one.
Ignoring this "backward" direction leads to representations that fail to fully exploit the environment's structure, resulting in poor sample efficiency and fragile world models. We propose that by forcing a model to "retrace" its steps, we can learn more robust and task-aware representations.
Methodology: Cycle-Consistency World Models
The core of our framework is the Cycle-Consistency World Model (CCWM), which integrates three key components to refine latent state embeddings:
1. Latent Cycle-Consistency
Beyond standard forward dynamics (predicting $s_{t+1}$ from $s_t$ and $a_t$), CCWM learns a reverse action approximator. The model attempts to retrace its steps from a predicted future state back to the original state. The retracing loss ensures that the retraced state matches the original embedding, effectively "closing the loop" in the latent space.
2. Bisimulation Metric Loss
To compare states, CCWM utilizes a bisimulation metric instead of simple Euclidean distance. This metric measures state similarity based on whether two states lead to equivalent long-term rewards and transitions, making the representation resilient to visual noise and irrelevant background details.
3. Adaptive Truncation
Physical environments are not always perfectly reversible (e.g., falling off a ledge). To prevent the model from being penalized for irreversible events, we introduce an adaptive truncation mechanism. By monitoring the agent's Value Function, the model detects sudden spikes or drops that signal irreversible state changes, automatically disabling the retracing loss for those specific frames.
Experiments and Results
We evaluated CCWM on 8 diverse tasks from the DeepMind Control Suite, including locomotion (Cheetah, Walker), balance (Hopper), and manipulation (Finger, Reacher).
Sample Efficiency and Planning
CCWM outperformed the state-of-the-art Dreamer baseline on 5 out of 8 tasks. Notably, in the "Cheetah Run" task, CCWM reached peak performance in half the steps required by Dreamer. Furthermore, CCWM's "imagination" capabilities are significantly more robust; while baseline models' predictions often degrade after 15 steps, CCWM maintains accurate latent trajectories for up to 45 steps.
Generalization
When subjected to "zero-shot" transfer tests—where environment physics like mass or friction were modified—CCWM-trained agents maintained significantly higher performance than baselines. This suggests that the retracing objective encourages the model to learn the fundamental "rules" of the environment rather than simply memorizing visual patterns.
Conclusion
Learning via Retracing provides a powerful inductive bias for world models in RL. By leveraging cycle-consistency and bisimulation metrics, CCWM learns representations that are more structured, task-aware, and generalizable. Future work will focus on automating the hyperparameters for adaptive truncation and exploring more complex recurrent architectures for the reverse action model.
Summary updated