Learning the Minimum Action Distance

Lorenzo Steccanella, Joshua Benjamin Evans, Özgür Şimşek, Anders Jonsson

Introduction

In Reinforcement Learning (RL), an agent’s ability to generalize depends heavily on how well it understands the "geometry" of its environment. If an agent knows that State A is "close" to State B in terms of effort, it can efficiently transfer knowledge between them. However, most standard distance metrics, such as Euclidean distance, are symmetric—they assume the distance from A to B is identical to the distance from B to A. Real-world environments are rarely so forgiving. Falling off a cliff is a one-step process, but climbing back up might take hundreds of steps, or be entirely impossible.

Existing methods often fail to capture this asymmetry or require labeled data (actions and rewards) that is not always available in offline datasets. To address this, the authors introduce a self-supervised framework for learning the Minimum Action Distance (MAD)—the fewest number of steps needed to travel between two states—using only raw state trajectories. By employing asymmetric "quasimetrics" and novel loss functions, this approach can accurately map out the reachability of complex environments without needing to know the actions taken or the rewards received.

Methodology

The core of the proposed framework involves mapping states into an embedding space where the distance between points accurately represents the MAD. To achieve this, the authors introduce two key innovations:

  1. Quasimetric Embeddings: Unlike standard metrics, a quasimetric $d(x, y)$ satisfies the triangle inequality but allows for asymmetry ($d(x, y) \neq d(y, x)$). The authors propose a "simple quasimetric" based on ReLU units that is computationally efficient yet outperforms more complex existing architectures.
  2. Action-Free Learning Algorithms: The authors introduce two novel algorithms that learn offline without needing to know what the agent did, only where it ended up:
  3. MadDist (Direct Distance Learning): This algorithm uses a scale-invariant loss function. This subtle but vital tweak ensures that errors on long-distance paths do not mathematically "drown out" errors on short-distance paths during training. It also employs a contrastive loss to push unrelated states apart.
  4. TDMadDist (Temporal Difference Learning): This version incorporates bootstrapping. It uses the model’s own current estimates to refine its predictions (e.g., estimating the distance to the goal as one step plus the distance from the next state to the goal).

Experimental Setup

The framework was evaluated on a diverse suite of environments where the "ground truth" MAD is known, allowing for rigorous benchmarking. These environments included:

  • Classic RL Benchmarks: NoisyGridWorld, KeyDoorGridWorld (which is highly asymmetric), and CliffWalking.
  • Continuous Mazes: PointMaze, which involves navigating a 2D ball through walls.
  • High-Dimensional Robotics: OGBench AntMaze, featuring a complex 8-jointed quadruped robot.

The authors also tested various data distributions, ranging from "expert" navigation data and "fragmented" trajectories that need to be stitched together, to purely "random" exploration data.

Key Findings and Insights

Asymmetry is a Feature, Not a Bug By explicitly modeling the environment as a directed graph, the authors demonstrate that capturing one-way transitions (like teleports or cliffs) is essential for a representation to be genuinely useful for planning.

Global Over Local Coherence Many previous methods focus on "local" constraints, ensuring only that adjacent states are close. MadDist, however, looks at the entire trajectory, using the path distance between any two states as a supervision signal. This creates a globally coherent "map" of the environment.

Superior Accuracy and Downstream Success MadDist and TDMadDist consistently achieved higher Spearman and Pearson correlations with ground-truth distances compared to baselines like Hilbert representations or PlanDist. To prove the metric's utility, the authors used it as a heuristic for a simple "random-shooting" planner. In the PointMaze Large and Giant environments, MadDist achieved a 1.00 success rate, while symmetric baselines and previous quasimetric methods often struggled to reach the goal at all.

Robustness and Data Agnosticism Because MAD only cares about whether a transition is possible (the support of the transition function), it is naturally more robust to environmental noise and stochasticity than metrics that try to predict exact future states. Furthermore, the methods performed remarkably well even when trained on purely random exploration data, suggesting they can extract the "skeleton" of an environment from very low-quality experience.

Limitations and Future Directions

While the framework is highly effective, the Minimum Action Distance is inherently a "best-case" lower bound. In highly unpredictable environments, the Stochastic Shortest Path (SSP)—the expected number of steps—might serve as a more realistic measure. The authors suggest exploring metrics that align more closely with SSP in future work.

Additionally, the current work assumes a "unit cost" per action (discrete time steps). Extending this to continuous-time systems where actions have varying durations is a logical next step. Finally, there is a clear path for integrating these learned MAD estimates into more sophisticated search algorithms and transfer learning setups, enabling agents to adapt more rapidly to new tasks within familiar environments.

Summary updated

BibTeX
@inproceedings{steccanella2026learning,
  author = {Lorenzo Steccanella and Joshua Benjamin Evans and Özgür Şimşek and Anders Jonsson},
  title = {{Learning the Minimum Action Distance}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=ZnOnnJJghs},
}
Figure