Papers › Learning Temporal Distances: Contrastive Successor Features Can Provide a Metric...

Learning Temporal Distances: Contrastive Successor Features Can Provide a Metric Structure for Decision-Making

24 Jun 2024arXiv:2406.17098archive 2025-07-28

Vivek Myers, Chongyi Zheng, Anca Dragan, Sergey Levine, Benjamin Eysenbach

Temporal distances lie at the heart of many algorithms for planning, control, and reinforcement learning that involve reaching goals, allowing one to estimate the transit time between two states. However, prior attempts to define such temporal distances in stochastic settings have been stymied by an important limitation: these prior approaches do not satisfy the triangle inequality. This is not merely a definitional concern, but translates to an inability to generalize and find shortest paths. In this paper, we build on prior work in contrastive learning and quasimetrics to show how successor features learned by contrastive learning (after a change of variables) form a temporal distance that does satisfy the triangle inequality, even in stochastic settings. Importantly, this temporal distance is computationally efficient to estimate, even in high-dimensional and stochastic settings. Experiments in controlled settings and benchmark suites demonstrate that an RL algorithm based on these new temporal distances exhibits combinatorial generalization (i.e., "stitching") and can sometimes learn more quickly than prior methods, including those based on quasimetrics.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2406.17098")

Code

Syntology Ran 11 of 11 code samples harvested from 2 repositories linked to this paper; 0 have no recorded run. Of those that ran: 11 ran with no contract checked.

By repository: official repository: 2 samples from 1 repository, 2 ran; found in paper text by Syntology: 9 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

vivekmyers/contrastive_metrics officialmentioned in paperjax report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 11 ran; 0 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

11ran

Licence: 11 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

collect_data vivekmyers/contrastive_metrics/plot_results.py official repository ran no licence file found · pointer only · 7e534b0247bd8bab · report
make_offline_d4rl vivekmyers/contrastive_metrics/envs/offline_ant_envs.py official repository ran no licence file found · pointer only · ec5bf1abfe384d4c · report
apply_policy_and_sample mnm-anonymous/qmd/metric_distillation/networks.py found in paper text by Syntology ran no licence file found · pointer only · 86b31cc8f58a61b4 · report
collect_data mnm-anonymous/qmd/plot_lc.py found in paper text by Syntology ran no licence file found · pointer only · 8973ec79994a1f01 · report
filter_outliers mnm-anonymous/qmd/plot_lc.py found in paper text by Syntology ran no licence file found · pointer only · c606a9e24a7a5a75 · report
get_reward mnm-anonymous/qmd/envs/fetch_envs.py found in paper text by Syntology ran no licence file found · pointer only · 35bd6ebd08652e20 · report
goal_to_obs_2d mnm-anonymous/qmd/metric_distillation/utils.py found in paper text by Syntology ran no licence file found · pointer only · a5f0dbc29eaab649 · report
make_offline_d4rl mnm-anonymous/qmd/envs/offline_ant_envs.py found in paper text by Syntology ran no licence file found · pointer only · aae1c7c736822527 · report
obs_to_goal_1d mnm-anonymous/qmd/metric_distillation/utils.py found in paper text by Syntology ran no licence file found · pointer only · 414dbeb2f8b06a40 · report
obs_to_goal_2d mnm-anonymous/qmd/metric_distillation/utils.py found in paper text by Syntology ran fingerprinted no licence file found · pointer only · 1896647d018339ef · report
window_smooth mnm-anonymous/qmd/plot_lc.py found in paper text by Syntology ran no licence file found · pointer only · d879cdca2b43f708 · report

Tasks

Contrastive LearningDecision Making

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Contrastive Learning

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections