Counterfactual Probabilistic Diffusion with Expert Models

Wenhao Mu, Zhi Cao, Mehmed Uludag, Alexander RodríguezarXiv 2025 · OpenReview

Abstract

Predicting counterfactual distributions in complex dynamical systems is essential for scientific modeling and decision-making in domains such as public health and medicine. However, existing methods often rely on point estimates or purely data-driven models, which tend to falter under data scarcity. We propose a time series diffusion-based framework that incorporates guidance from imperfect expert models by extracting high-level signals to serve as structured priors for generative modeling. Our method, ODE-Diff, bridges mechanistic and data-driven approaches, enabling more reliable and interpretable causal inference. We evaluate ODE-Diff across semi-synthetic COVID-19 simulations, synthetic pharmacological dynamics, and real-world case studies, demonstrating that it consistently outperforms strong baselines in both point prediction and distributional accuracy.

1. Introduction

Predicting "what-if" scenarios—counterfactuals—is a cornerstone of effective decision-making in fields like public health and medicine. ODE-Diff addresses this challenge by combining the generative capabilities of diffusion models with the structural knowledge embedded in expert-defined Ordinary Differential Equations (ODEs). By treating imperfect mechanistic models as "soft guides" rather than rigid constraints, ODE-Diff enables accurate predictions even when observational data is limited.

2. Problem Statement

Predicting counterfactuals in time-series data faces two primary hurdles:

  1. Data Scarcity: In real-world scenarios, we only observe a single realization of events. Interventions are often sparse, making it difficult for purely data-driven models to generalize.
  2. The Expert Gap: While mechanistic models (e.g., SIR models for epidemiology) exist, they are frequently oversimplified or misspecified, failing to capture the nuances of complex human or environmental systems.

Furthermore, most existing methods provide only point estimates, neglecting the uncertainty quantification necessary for high-stakes risk assessment.

3. Methodology: The ODE-Diff Framework

The proposed ODE-Diff framework bridges the gap between rigid physical laws and flexible machine learning through two primary components:

3.1 Hybrid Counterfactual Predictor (Hybrid-CP)

This module serves as a point estimator that blends a Neural ODE with an Expert ODE. It models the "co-evolution" of variables, recognizing that interventions trigger dynamic shifts across multiple factors over time.

3.2 Knowledge-Guided Diffusion Model

At its core, ODE-Diff utilizes a diffusion model to generate counterfactual distributions. The denoising process is steered by two forms of guidance derived from the expert model:

  • Value Guidance: Uses the Hybrid-CP’s point estimate as a starting anchor.
  • Directional Guidance: A novel mechanism that penalizes trajectories contradicting the qualitative patterns of the expert model (e.g., ensuring viral load decreases as drug dosage increases).
The ODE-Diff framework architecture, integrating Hybrid-CP and guided diffusion.

4. Experimental Setup

The performance of ODE-Diff was evaluated across three distinct scenarios:

  • Semi-synthetic COVID-19 Data: Simulating mask mandates in 121 US cities using a complex SEIR-HD model.
  • Synthetic Pharmacological Data: Modeling immune responses to Dexamethasone in 50 patients via a PKPD model.
  • Real-world COVID-19 Case Study: Analyzing school closures during the 2021 US Delta variant surge, using Dynamic Time Warping (DTW) to identify "twin" regions for counterfactual proxying.

5. Results and Discussion

ODE-Diff consistently outperformed state-of-the-art baselines, including MS-Diffusion and DiffPO, across multiple metrics.

Performance comparison on the COVID-19 dataset across various metrics.

Key findings include:

  • Distributional Accuracy: On the COVID-19 dataset, ODE-Diff achieved a Wasserstein distance of 0.0506, a significant improvement over the next best model (0.2058).
  • Uncertainty Quantification: The model provided reliable prediction intervals that closely matched empirical reality, avoiding the overconfidence seen in baseline models.
  • Real-world Fidelity: In the school closure study, predictions for alternative policies aligned closely with data-driven proxies, validating its utility for policy evaluation.

6. Conclusion

ODE-Diff demonstrates that "soft guidance" from expert models is superior to "hard constraints" for counterfactual prediction. By leveraging qualitative signals over purely quantitative ones, the model maintains physical plausibility while correcting for expert model oversimplifications. While dependent on the existence of an expert ODE and computationally intensive, ODE-Diff offers a robust path forward for causal inference in complex dynamical systems.

Summary updated

BibTeX
@misc{mu2025counterfactual,
  author = {Wenhao Mu and Zhi Cao and Mehmed Uludag and Alexander Rodríguez},
  title = {{Counterfactual Probabilistic Diffusion with Expert Models}},
  year = {2025},
  eprint = {2508.13355},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.13355},
}
Figure