Continuous-Time Modeling of Counterfactual Outcomes Using Neural Controlled Differential Equations

Nabeel Seedat, Fergus Imrie, Alexis Bellot, Zhaozhi Qian, Mihaela van der Schaar

TL;DR

Researchers have developed TE-CDE (Treatment Effect Neural Controlled Differential Equation), a novel framework that uses continuous-time mathematics to estimate "what-if" healthcare outcomes from messy, irregularly sampled patient data. By modeling patient health as a continuous latent trajectory rather than a series of discrete steps, TE-CDE significantly outperforms existing methods in predicting how patients will respond to different treatment plans over time.

What Problem Does This Paper Address?

In personalized medicine, clinicians often ask: "What would happen to this patient's tumor if I gave them chemotherapy today versus next week?" Answering this requires estimating counterfactual outcomes—results of actions that weren't actually taken.

Most current AI models for this task assume data is collected at regular, fixed intervals (e.g., every Monday at 9 AM). However, real-world Electronic Health Records (EHRs) are notoriously irregular: patients miss appointments, sicker patients are monitored more frequently, and different treatments require different follow-up schedules.

Comparison of regular vs. irregular sampling paradigms.

Furthermore, these models must navigate time-dependent confounding. This occurs when past treatments affect future patient health, which in turn influences future treatment decisions. If a model doesn't account for this "feedback loop," it might mistakenly conclude that a life-saving drug is harmful simply because it's only given to the sickest patients.

Methods

The authors propose TE-CDE, which departs from standard Recurrent Neural Networks (RNNs) in favor of Neural Controlled Differential Equations (CDEs).

Key technical innovations include:

  1. Continuous Latent Path: Instead of updating a hidden state only when a new data point arrives, TE-CDE learns a continuous latent representation ($Z_t$) of the patient's state. This allows the model to evaluate potential outcomes at any arbitrary point in time.
  2. CDE-based Encoder/Decoder: The encoder processes irregular historical data to build the latent path, while the decoder simulates future trajectories under hypothetical treatment plans. Because CDEs are "driven" by external signals (like new lab results or treatments), they naturally handle incoming information at irregular times.
  3. Adversarial Balancing: To solve the confounding problem, the authors use domain adversarial training. They force the model to learn a representation that is predictive of the outcome but agnostic to the treatment assigned. This "balances" the data, breaking the biased link between patient severity and treatment choice.
The TE-CDE architecture showing continuous encoding and decoding.

Datasets

Since counterfactuals (the "road not taken") are never observed in real-world data, the authors built a sophisticated controllable simulation environment:

  • PK-PD Tumor Model: Based on established bio-mathematical models of lung cancer, simulating how tumors grow and respond to chemotherapy and radiotherapy.
  • Hawkes Process: A self-exciting point process used to generate realistic, irregular observation patterns where the frequency of check-ups depends on the patient's clinical stage.
  • Benchmarks: They compared TE-CDE against state-of-the-art discrete models like CRN (Counterfactual Recurrent Network) and RMSN (Recurrent Marginal Structural Networks), as well as Gaussian Process-based methods.

Key Insights and Ideas

  • Biological Realism: Modeling health as a continuous process is more biologically intuitive than discrete-time steps. CDEs provide the mathematical rigor to handle this continuity while still being trainable via standard backpropagation.
  • Guaranteed Invertibility: A unique strength of CDEs is that they are mathematically invertible. This ensures that no information is lost when mapping from raw data to the latent representation, leading to more consistent and reliable causal estimates.
  • Data Efficiency: TE-CDE proved to be more data-efficient than RNN-based models. Because it learns the underlying continuous dynamics, it requires fewer "discrete" examples to understand how a patient's state evolves.

Key Results

TE-CDE consistently outperformed all benchmarks across various levels of sampling irregularity and confounding:

  • Error Reduction: In high-confounding scenarios, TE-CDE achieved a 36% to 40% reduction in Root Mean Square Error (RMSE) compared to the next best method (CRN).
  • Treatment Selection: When used to choose the "best" treatment (the one resulting in the smallest tumor), TE-CDE was significantly more accurate, showing a 10% absolute improvement in selection accuracy over competitors in difficult scenarios.
  • Robustness: The model maintained its performance even when the sampling rate was conditioned on the treatment itself (e.g., treated patients being monitored 10x more than untreated ones).

Limitations and Future Work

The authors acknowledge that while TE-CDE handles irregular timing, it only partially addresses informative sampling—the idea that the fact a doctor ordered a test is itself a strong signal of the patient's health.

Future work could involve:

  • Integrating more complex "human-in-the-loop" paradigms to combine model predictions with clinical expertise.
  • Exploring how to better model the "intensity" of sampling as a direct feature of the latent state.
  • Testing the framework on a wider variety of diseases beyond tumor growth.

Summary updated

Abstract

Estimating counterfactual outcomes over time has the potential to unlock personalized healthcare by assisting decision-makers to answer "what-if" questions. Existing causal inference approaches typically consider regular, discrete-time intervals between observations and treatment decisions and hence are unable to naturally model irregularly sampled data, which is the common setting in practice. To handle arbitrary observation patterns, we interpret the data as samples from an underlying continuous-time process and propose to model its latent trajectory explicitly using the mathematics of controlled differential equations. This leads to a new approach, the Treatment Effect Neural Controlled Differential Equation (TE-CDE), that allows the potential outcomes to be evaluated at any time point. In addition, adversarial training is used to adjust for time-dependent confounding which is critical in longitudinal settings and is an added challenge not encountered in conventional time series. To assess solutions to this problem, we propose a controllable simulation environment based on a model of tumor growth for a range of scenarios with irregular sampling reflective of a variety of clinical scenarios. TE-CDE consistently outperforms existing approaches in all scenarios with irregular sampling.
BibTeX
@inproceedings{seedat2022continuous,
  author = {Nabeel Seedat and Fergus Imrie and Alexis Bellot and Zhaozhi Qian and Mihaela van der Schaar},
  title = {{Continuous-Time Modeling of Counterfactual Outcomes Using Neural Controlled Differential Equations}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=Ar6HnuMHnT_},
}
Figure