Differentiating Bisimulation Metrics: A Framework for Parametric Markov Chain Fitting via Bicausal Optimal Transport

Sergio Calo, Amy Zhang, Javier Segovia-Aguas, Anders JonssonarXiv 2026

TL;DR

This paper introduces D-BOT, a framework that makes bisimulation metrics—a powerful tool for comparing stochastic processes—fully differentiable. By deriving a closed-form gradient via the envelope theorem, the authors enable efficient fitting of parametric Markov chains for tasks like state-space compression, system identification, and imitation learning from observations.

What Problem Does This Paper Address?

In reinforcement learning and sequential decision-making, we often need to "fit" one process to another. For example, we might want a small, compressed model to behave like a large, complex one, or we might want a robot to imitate an expert's transitions.

The challenge lies in how we measure the "distance" between these processes. Simple metrics, like comparing how often an agent visits certain states (marginal occupancy), often fail because they ignore the temporal and causal structure of the behavior. Two policies might spend the same amount of time in the same states but move between them in completely different ways.

Bisimulation metrics (and their equivalent, Bicausal Optimal Transport) solve this by coupling processes across time, ensuring that "close" processes not only visit similar states but also share similar future dynamics. However, until now, these metrics were difficult to optimize directly because they weren't easily differentiable with respect to the model's parameters.

Methods

The authors propose Differentiable Bicausal Optimal Transport (D-BOT). The core technical breakthrough is showing that because the bisimulation metric can be formulated as a Linear Program (LP), its gradient can be calculated exactly using the envelope theorem.

The D-BOT Algorithm

The algorithm operates in a bilevel optimization loop:

  1. Inner Loop (Distance Computation): It uses a stochastic primal-dual algorithm called SOMCOT to estimate the bicausal distance and, crucially, to find the "dual variables" (certificates of the optimization).
  2. Outer Loop (Gradient Step): Using the dual variables from the inner loop, it calculates a closed-form gradient. Because of the envelope theorem, this step is computationally "cheap"—you don't have to differentiate through the entire inner optimization process.
The D-BOT General Algorithm

The paper instantiates this for two main scenarios:

  • D-BOT-REPR: For representation learning and system identification, where the transition kernel is explicitly parameterized.
  • D-BOT-ILFO: For Imitation Learning from Observations, where the gradient is estimated via the policy gradient theorem under an "implicit reward" derived from the bicausal coupling.

Datasets

The authors evaluated D-BOT on several synthetic but illustrative benchmarks:

  • Discrete Random Walk with Drift: A 16-state environment used to test parametric model learning (system identification).
  • Block-Chain Environment: A 25-state chain where groups of 5 states are behaviorally identical, used to test state-space compression.
  • 5-State MDP: A discrete chain with four actions, used to evaluate Imitation Learning from Observations (ILfO) against baselines like IOSTOM and PW-DICE.

Key Insights and Ideas

  • Causality is Key: Unlike standard Optimal Transport, Bicausal OT prevents the coupling from "peeking into the future." This makes it a much more natural fit for time-series and RL data.
  • The Envelope Theorem Shortcut: By applying the envelope theorem to the LP saddle point, the authors avoid the "vanishing/exploding gradient" problems often associated with differentiating through unrolled optimization loops. The gradient only depends on the final dual variables.
  • Implicit Rewards for Imitation: In the ILfO setting, D-BOT naturally generates a reward function that scores transitions based on how well they match the expert's causal structure, rather than just matching state distributions.
  • Robustness to Over-parameterization: In compression tasks, the algorithm is smart enough to leave redundant abstract states unused, meaning you don't need to know the exact "true" latent dimension of a system to compress it effectively.

Key Results

  • System Identification: In the random walk task, D-BOT successfully steered a heavily mis-initialized drift parameter ($f = -2$) to the true value ($f = 1.5$) using only sample transitions.
Figure 1: Model learning (nY = nX = 16, ftrue = 1.5, γ = 0.95). Left: learned drift f versus outer iteration k; dashed red line marks the true value. Right: SOMCOT estimate of dγ(MX, Mθ).
  • State-Space Compression: The algorithm successfully compressed a 25-state system into 5 abstract states, reaching a near-zero bisimulation distance and perfectly recovering the "block" structure of the original environment.
Convergence of the bisimulation distance during compression
  • Imitation Learning: D-BOT-ILFO outperformed state-of-the-art baselines, particularly when the expert policy was stochastic, confirming that it captures transition structures that marginal-based methods miss.

Limitations and Future Work

  • Scalability: The current implementation uses tabular representations, which limits it to environments with a few hundred states ($O(|X|^2 |Y|^2)$ complexity). Scaling to continuous or high-dimensional spaces will require approximating the primal and dual variables with neural networks.
  • Gradient Bias: The envelope theorem assumes you are exactly at the optimal saddle point. In practice, stopping the inner SOMCOT loop early introduces a small bias into the gradient.
  • Local Optima: Like most gradient-based methods for non-convex problems, D-BOT is not guaranteed to find a global optimum and can be sensitive to initialization.

The authors suggest that a "single-loop" variant—updating model parameters and distance variables simultaneously—could be a promising direction to remove the bias-computation trade-off.

Summary updated

BibTeX
@misc{calo2026differentiating,
  author = {Sergio Calo and Amy Zhang and Javier Segovia-Aguas and Anders Jonsson},
  title = {{Differentiating Bisimulation Metrics: A Framework for Parametric Markov Chain Fitting via Bicausal Optimal Transport}},
  year = {2026},
  eprint = {2609.37239},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.37239},
}
Figure