STITCH-OPE: Trajectory Stitching with Guided Diffusion for Off-Policy Evaluation

Hossein Goli, Michael Gimelfarb, Nathan Samuel de Lara, Haruki Nishimura, Masha Itkina, Florian Shkurti

Introduction

Off-Policy Evaluation (OPE) is a cornerstone of safe reinforcement learning, enabling the assessment of a new "target" policy using historical data collected by a different "behavior" policy. This capability is vital in high-stakes domains like healthcare and robotics, where deploying an untested policy is prohibitively risky. However, OPE faces two fundamental challenges: the Curse of Horizon, where importance sampling methods suffer from exponentially increasing variance over time, and Compounding Errors, where model-based simulators accumulate small prediction errors that lead to unrealistic "hallucinated" trajectories.

The STITCH-OPE Framework

To address these challenges, we introduce STITCH-OPE, a model-based framework that leverages denoising diffusion models to generate synthetic rollouts. Unlike traditional autoregressive models that predict one step at a time, STITCH-OPE employs two core innovations to maintain high fidelity over long horizons.

Trajectory Stitching with Conditional Diffusion

Rather than generating a full-length trajectory or a single step, STITCH-OPE generates short "sub-trajectories" or windows. Each window is conditioned on the final state of the preceding window. This "stitching" approach allows the model to compose diverse behaviors observed in the training data while preventing the rapid accumulation of errors typical of step-by-step prediction.

Negative Behavior Guidance

In guided diffusion, the model is typically steered toward the distribution of the target policy. STITCH-OPE introduces a novel guidance mechanism: it subtracts the score of the behavior policy during the denoising process. This "negative behavior guidance" prevents the model from being overly regularized toward the original data distribution, allowing it to more accurately capture the distribution shift required to evaluate the target policy.

Qualitative comparison of STITCH-OPE (Ours) against baselines. Row A shows how stitching improves composition; Row B demonstrates superior state generalization; Row C illustrates how behavior guidance addresses distribution shift.

Key Insights and Theoretical Advantages

The "Goldilocks" Window

The performance of STITCH-OPE is sensitive to the window size ($w$). A window of $w=1$ reduces the model to a standard autoregressive predictor with high compounding error, while $w=T$ (the full horizon) limits the model's ability to "stitch" or compose new paths from existing data. Empirical results suggest that intermediate values (e.g., $w=8$ or $16$) provide the optimal balance between compositionality and prediction accuracy.

Variance and Entropy

Mathematically, the authors demonstrate that conditional diffusion on sub-trajectories results in an exponential reduction in variance compared to full-horizon trajectory diffusion. Furthermore, this approach maintains higher entropy than global diffusion models, which enhances the model's robustness and ability to generalize when the target policy explores states at the edge of the behavior data's support.

Experimental Evaluation

STITCH-OPE was evaluated on standard benchmarks, including D4RL locomotion tasks (Hopper, Walker2d, HalfCheetah) and OpenAI Gym control problems. The framework demonstrated significant improvements over state-of-the-art baselines such as Fitted Q-Evaluation (FQE) and Policy-Guided Diffusion (PGD):

  • Accuracy: STITCH-OPE achieved the lowest Mean Squared Error (LogRMSE) in 11 out of 15 experimental settings.
  • Ranking and Selection: The model showed superior Spearman Correlation, indicating a high ability to correctly rank candidate policies. In policy selection tasks (Regret@1), STITCH-OPE consistently identified policies near the true optimal.
  • Complex Policies: The framework successfully evaluated "Diffusion Policies," which lack explicit probability density functions and are notoriously difficult for traditional OPE estimators.

Conclusion

STITCH-OPE represents a significant step forward in model-based OPE. by combining the generative power of diffusion with trajectory stitching and negative behavior guidance, it effectively mitigates the trade-off between variance and compounding error. Future work will explore the application of this high-fidelity evaluation framework to offline policy optimization, potentially enabling the discovery of superior policies directly from static datasets.

Summary updated

BibTeX
@inproceedings{goli2025stitch,
  author = {Hossein Goli and Michael Gimelfarb and Nathan Samuel de Lara and Haruki Nishimura and Masha Itkina and Florian Shkurti},
  title = {{STITCH-OPE: Trajectory Stitching with Guided Diffusion for Off-Policy Evaluation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=AghtKxDf7f},
}
Figure