G-Transformer for Conditional Average Potential Outcome Estimation over Time

Konstantin Hess, Dennis Frauen, Valentyn Melnychuk, Stefan Feuerriegel · Submission to ICLR 2025 · Rejected

TL;DR

The G-Transformer (GT) is the first neural end-to-end framework for estimating conditional average potential outcomes (CAPOs) across sequential treatments that combines proper time-varying confounding adjustment with a low-variance, fully regression-based objective. By re-framing G-computation as iterative pseudo-outcome regression, GT eliminates the need for unstable inverse propensity weighting or high-dimensional future covariate density modeling.

What Problem Does This Paper Address?

In precision medicine, clinicians frequently ask: "What would happen to patient $X$ if we administered treatment sequence $A \to B \to C$ over the next few days given their history?" Estimating these conditional average potential outcomes (CAPOs) from observational Electronic Health Records (EHRs) is notoriously difficult due to time-varying confounding: past treatments affect future patient vitals, which subsequently influence future treatment choices.

Existing deep learning approaches suffer from a major dilemma:

  1. Methods lacking proper adjustment (e.g., CRN, CT, TE-CDE): Rely on representation balancing. While balancing reduces finite-sample variance, it does not target the true causal estimand in the presence of intermediate time-varying confounders, resulting in irreducible confounding bias.
  2. Methods with proper adjustment (e.g., RMSNs, G-Net): Suffer from high variance. RMSNs use Inverse Propensity Weighting (IPW), where multiplying propensities across horizons causes exploding variance and sensitivity to positivity violations. G-Net uses distribution-based G-computation, which requires estimating the entire joint distribution of all future covariates and outcomes via Monte Carlo rollouts—a severe victim of the curse of dimensionality.

Methods

The authors re-frame classic Robins G-computation not as an integral over future covariate distributions, but as an iterative sequence of conditional expectations (pseudo-outcome regressions):

$$\mathbb{E}[Y_{t+\tau}[a_{t:t+\tau-1}] \mid \bar{H}_t = \bar{h}_t] = g_t^a(\bar{h}_t)$$ where $G_{t+\tau}^a = Y_{t+\tau}$ and $G_{t+\delta}^a = g_{t+\delta}^a(\bar{H}_{t+\delta}^t) = \mathbb{E}[G_{t+\delta+1}^a \mid \bar{H}_{t+\delta}^t, A_{t:t+\delta}=a_{t:t+\delta}]$.

To realize this inside a neural network, GT couples a multi-input transformer with multiple read-out heads trained via an alternating two-step schedule:

  • Architecture: A multi-input transformer backbone with three specialized encoder streams (for historical outcomes $Y$, covariates $X$, and actions $A$) interacting via self- and cross-attention, feeding into $\tau$ dedicated G-computation prediction heads $\{g_\phi^\delta\}_{\delta=0}^{\tau-1}$.
  • Generation Step (A): Given factual data and target interventions, the network rolls backwards to generate intermediate pseudo-outcomes $\tilde{G}_{t+\delta}^a$ from $g_\phi^\delta$, detached from the gradient graph.
  • Learning Step (B): The network regresses the hidden state at each step on the next generated pseudo-outcome $\tilde{G}_{t+\delta+1}^a$ using mean squared error. Because the final head targets the ground-truth factual outcome $Y_{t+\tau}$, training signal propagates backward across heads, refining pseudo-outcomes epoch-by-epoch.
  • Inference: Computing the CAPO simply requires a single forward pass through $g_\phi^0(z_\theta(\bar{h}_t), a_t)$ at runtime.

Datasets

The authors evaluated GT on three benchmarks:

  1. Synthetic PK-PD Tumor Growth Model: Simulates tumor volume dynamics under combined radiation and chemotherapy, parameterized with varying confounding strengths ($\gamma \in [6, 20]$) and horizons up to $\tau=6$.
  2. Semi-Synthetic MIMIC-III Extract: Real-world ICU patient records ($d_x = 25$ time-varying vitals, 3 static demographics) coupled with synthetic non-linear responses and $d_a = 3$ concurrent binary treatments across horizons up to $\tau=12$ and sample sizes $N \in \{1000, 2000, 3000\}$.
  3. Real-World MIMIC-III: Evaluates factual trajectory forecasting for diastolic blood pressure under vasopressors and mechanical ventilation.

Key Insights and Ideas

  • First-Moment Regression vs. Full Density Estimation: Rather than modeling the full distribution (all moments) of a $(d_x + d_y) \times (\tau - 1)$-dimensional space as G-Net does, GT only models $\tau$ scalar/low-dimensional expectations (the first moment).
  • Provably Lower Variance than IPW: The authors prove that regression pseudo-outcomes have lower variance than IPW pseudo-outcomes (which scale by $1/\pi(X) \ge 1$), shielding GT from severe variance inflation and overlap issues across long sequences.
  • Ablations Verify Causal Mechanics:
  • Replacing the transformer with an LSTM (G-LSTM) preserves most gains, proving the core benefit stems from the iterative G-computation formulation itself.
  • Removing the iterative pseudo-outcome loop (Biased Transformer (BT)) leads to dramatic error spikes, demonstrating that modern transformer architectures cannot bypass causal adjustment via brute-force feature extraction alone.

Key Results

  • Synthetic Tumor Model: GT consistently outperformed all baselines across all confounding strengths, achieving up to a 17.4% relative RMSE reduction over the best baseline (e.g., at $\gamma=18$, GT achieved RMSE $3.41 \pm 0.29$ vs. $4.13 \pm 0.90$ for CT and $4.22 \pm 0.53$ for G-Net).
  • Semi-Synthetic MIMIC-III: In high-dimensional settings, GT surpassed the strongest baseline by up to 26.7% (e.g., $N=3000, \tau=2$: RMSE 0.24 vs. 0.32 for CT). While G-Net and RMSNs degraded significantly over extended horizons ($\tau \ge 4$), GT retained low variance and error.
  • Factual Real-World ICU Data: Even on purely observational next-step prediction where causal adjustment is unnecessary, GT matched or outperformed purely predictive baselines (CT and CRN), confirming it incurs no optimization penalty on observational tasks.

Limitations and Future Work

  • Standard Causal Assumptions: GT relies on consistency, positivity, and sequential ignorability (no unmeasured time-varying confounders). While standard, unobserved confounding remains a threat in clinical datasets unless paired with sensitivity analyses.
  • Discrete-Time Setup: The model operates over discrete, regularly spaced observation steps rather than continuous, irregularly sampled time points.
  • Deterministic Policy Sequences: The framework evaluates pre-specified sequences of treatments; extending GT to arbitrary closed-loop dynamic treatment regimes (adaptive policies) is a natural next milestone.

Summary updated

BibTeX
@misc{hess2024g,
  author = {Konstantin Hess and Dennis Frauen and Valentyn Melnychuk and Stefan Feuerriegel},
  title = {{G-Transformer for Conditional Average Potential Outcome Estimation over Time}},
  year = {2024},
  eprint = {2405.21012},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.21012},
}
Figure