Causal Time Series Generation via Diffusion Models

Yutong Xia, Chang Xu, Yuxuan Liang, Li Zhao, Qingsong Wen, Roger Zimmermann, Jiang Bian

TL;DR

Standard conditional time series generation models often capture spurious correlations because they fail to account for unobserved confounders. This paper introduces CaTSG, a unified diffusion-based framework that elevates time series generation to the interventional and counterfactual levels of Pearl’s causal ladder, enabling reliable "what-if" simulations and scenario planning.

What Problem Does This Paper Address?

Traditional conditional Time Series Generation (TSG) models excel at learning statistical associations—essentially calculating $P(X|C)$, the probability of an outcome given a condition. However, real-world systems are heavily influenced by unobserved variables (confounders) that simultaneously affect both the condition ($C$) and the outcome ($X$).

Figure 1: Motivation for causal time series generation. (a) We observe time series X and C, (b) yet unobserved factors E may affect both. (c) Standard conditional TSG risk learning spurious correlations. (d) We extend this paradigm into a causal TSG family with Int-TSG and CF-TSG. (e) Three tasks yield distinct outputs given same C.

As illustrated in Figure 1, a standard model might observe that high temperatures correlate with low traffic volume and incorrectly conclude that heat directly reduces traffic. In reality, an unobserved confounder—summer holidays—is driving both. Without accounting for these hidden factors, generative models risk replicating spurious correlations, making them unreliable for true decision-making and counterfactual analysis (e.g., "What would the traffic look like if it unexpectedly snowed in July?").

Methods

The authors propose CaTSG (Causality-grounded Time Series Generation), a framework built on top of diffusion probabilistic models that derives unique score functions for all three levels of Pearl's causal ladder:

Figure 2: Structural Causal Models (SCMs) for different conditional time series generation paradigms.
  1. Observational TSG (Association): Replays the world as observed.
  2. Interventional TSG (Intervention): Simulates outcomes under an active intervention ($do(C)$) by applying backdoor adjustment to block confounding paths.
  3. Counterfactual TSG (Counterfactual): Simulates alternative trajectories for a specific instance using the three-step Abduction–Action–Prediction workflow.

Key Technical Components:

  • Latent Environment Bank ($E$): To handle invisible confounders, CaTSG discretizes the continuous confounder space into a finite set of learnable environment embeddings.
  • EnvInfer Module ($q_\phi$): This module infers the posterior weights of the latent environments from observed data. It is trained using a SwAV-style swapped prediction loss to ensure that different augmentations of the same sample map to consistent environment assignments.
  • Causal Score Guidance: During the reverse diffusion process, CaTSG uses a Classifier-Free Guidance (CFG) scheme to blend environment-conditioned noise predictions with unconditional ones, mathematically steering the generation toward causally sound trajectories.

Datasets

The framework was evaluated on both synthetic and real-world datasets:

  • Harmonic-VM & Harmonic-VP (Synthetic): Newly introduced benchmarks simulating damped mechanical oscillators governed by second-order differential equations. Harmonic-VM features variable mass, while Harmonic-VP varies mass, damping, and stiffness simultaneously. These physics-based simulations provide exact ground-truth counterfactuals for rigorous evaluation.
  • Air Quality (Real-World): Four years of hourly PM2.5 concentrations and meteorological data from 12 monitoring stations in Beijing.
  • Traffic (Real-World): Hourly interstate traffic volume data from Minneapolis-St. Paul, USA, paired with weather and holiday indicators.

Key Insights and Ideas

  • Mapping the Causal Ladder to Generative AI: The paper provides a clean, formal vocabulary for time series generation, demonstrating that standard conditional generation is stuck on the lowest rung of causality (Association).
  • Unsupervised Confounder Adjustment: A major hurdle in causal machine learning is that confounders are rarely labeled. CaTSG elegantly bypasses this by treating environments as latent clusters, discovering and adjusting for them completely unsupervised.
  • Preserving Individual Identity: For counterfactuals, the model successfully separates the "environment" (the specific background state of a system) from the "action" (the changed condition). This allows it to alter the condition while keeping the underlying system characteristics fixed.

Key Results

  • Superior Fidelity Under Shift: CaTSG consistently outperformed state-of-the-art baselines (including TimeGAN and TimeWeaver) across all datasets. On interventional tasks, it beat the second-best baseline with relative gains ranging from 2.4% to 98.7% across various distributional metrics (MDD, KL, MMD, J-FTSD).
  • Accurate Counterfactual Generation: On the synthetic harmonic datasets, CaTSG achieved significantly lower error rates against ground-truth counterfactuals compared to ablated versions of the model.
  • High Efficiency: By leveraging an ODE-based DPM-Solver, CaTSG achieved a sampling throughput of 144 sequences per second, vastly outperforming other diffusion-based models like TW-SSSD (14 seq/s) and TW-CSDI (90 seq/s).

Limitations and Future Work

  • Predefined Causal Graphs: CaTSG relies on a predefined Structural Causal Model (SCM) structure. If the real-world system contains unmodeled feedback loops or time-varying confounding, the model's debiasing capabilities may degrade.
  • Single-Modality Conditions: The current framework restricts conditions ($C$) to time series inputs. The authors note that expanding this to multi-modal conditions (such as text guidelines or visual cues) is a promising future direction.
  • The Real-World Evaluation Dilemma: Because counterfactual ground truth is inherently unobservable in real-world data, validating these models outside of synthetic simulations remains a fundamental challenge.

Summary updated

BibTeX
@misc{xia2025causal,
  author = {Yutong Xia and Chang Xu and Yuxuan Liang and Li Zhao and Qingsong Wen and Roger Zimmermann and Jiang Bian},
  title = {{Causal Time Series Generation via Diffusion Models}},
  year = {2025},
  eprint = {2509.20846},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.20846},
}
Figure