Abstract: Approaches for goal-conditioned reinforcement learning (GCRL) often use learned state representations to extract goal-reaching policies. Two frameworks for representation structure have yielded particularly effective GCRL algorithms: (1) contrastive representations, in which methods learn "successor features" with a contrastive objective that performs inference over future outcomes, and (2) temporal distances, which link the (quasimetric) distance in representation space to the transit time from states to goals. We propose an approach that unifies these two frameworks, using the structure of a quasimetric representation space (triangle inequality) with the right additional constraints to learn successor representations that enable optimal goal-reaching. Unlike past work, our approach is able to exploit a quasimetric distance parameterization to learn optimal goal-reaching distances, even with suboptimal data and in stochastic environments. This gives us the best of both worlds: we retain the stability and long-horizon capabilities of Monte Carlo contrastive RL methods, while getting the free stitching capabilities of quasimetric network parameterizations. On existing offline GCRL benchmarks, our representation learning objective improves performance on stitching tasks where methods based on contrastive learning struggle, and on noisy, high-dimensional environments where methods based on quasimetric networks struggle.
Introduction
In Goal-Conditioned Reinforcement Learning (GCRL), an agent must learn to reach arbitrary goal states from a fixed, offline dataset. This is inherently difficult because offline data is often suboptimal, containing inefficient paths rather than direct routes. Existing approaches typically fall into two categories: stable but "stitching-limited" contrastive methods, and "stitching-capable" but noise-sensitive temporal distance methods.
As shown in the comparison above, prior works like Contrastive RL (CRL) or Quasimetric RL (QRL) fail to simultaneously address stochasticity, optimality from suboptimal data, and metric architectural constraints. Temporal Metric Distillation (TMD) aims to bridge this gap by treating RL as a geometric problem, enforcing the triangle inequality to enable "free" stitching while maintaining the robustness of contrastive learning.
Methodology: Temporal Metric Distillation
TMD learns a representation where the distance between two points corresponds to the expected travel time. The framework consists of two phases: learning the temporal distance representation and extracting the goal-reaching policy.
The core technical innovations include:
- Quasimetric Parameterization: Utilizing Metric Residual Networks (MRN) to bake the triangle inequality ($d(a, c) \le d(a, b) + d(b, c)$) into the architecture.
- Invariance Constraints: TMD adds two critical loss terms: Action Invariance ($\mathcal{I}$), which ensures the distance from a state to the immediate result of an action is zero, and Temporal Invariance ($\mathcal{T}$), which relates the distance from a state-action pair to a goal with the expected distance from the next state.
- Bregman Divergence: To ensure stability across long horizons, TMD employs a specific mathematical divergence instead of standard MSE, preventing gradient issues in log-space distance backups.
Experimental Results
TMD was evaluated on the OGBench suite, covering locomotion (AntMaze, HumanoidMaze), stitching-specific tasks, and high-dimensional visual environments.
- Superior Stitching: In the
antmaze_large_stitchtask, TMD achieved a 37.3% success rate, significantly outperforming CRL (10.8%) and QRL (18.4%). - Robustness to Noise: In "teleport" environments with noisy transitions, TMD maintained a ~29% success rate in PointMaze, whereas contrastive methods dropped to near zero (~4%).
- Scalability: TMD demonstrated state-of-the-art performance on "Giant" maze tasks with 21-dimensional state spaces and tasks involving raw pixel observations, proving it can handle the complexity of modern RL challenges.
Conclusion
TMD successfully unifies value-based RL with geometric representation learning. By treating RL as a geometry problem, it can use neural network architectures to enforce logic that standard Q-learning has to learn the hard way. While TMD shows great promise, future work will explore more advanced quasimetric architectures and tighter integration between representation learning and policy extraction.
Summary updated