Competing Event Models: Autoregressive Generation Under Interventions on When and What to Do

Yoav Wald, Xiang Gao, Sumit Chopra, Juho Lee, Rajesh RanganathNeurIPS 2026

TL;DR

Standard autoregressive models like Transformers are great at predicting what happens next, and even when, in irregular sequences like medical records. However, they break down if you ask counterfactual timing questions—like "What happens to this patient if we delay their treatment by two weeks?" This paper introduces Competing Event Models (CEMs), which assign an independent "alarm clock" to every possible future event, turning messy causal timing interventions into a clean, scalable race against the clock.

What Problem Does This Paper Address?

Imagine you are modeling electronic health records (EHRs) where events—prescriptions, lab tests, heart attacks—happen at irregular intervals. You want a world model that can simulate "what-if" scenarios (off-policy evaluation), where a doctor changes both what treatment to give and when to give it.

If you train a standard Transformer to predict the next event and its timestamp, you hit a subtle mathematical wall. Standard models typically predict which event happens next, and then predict when it happens conditioned on that choice: $P(\text{Time} \mid \text{Event}) P(\text{Event})$. If you intervene by forcing a medication's timing to be "in two weeks," you only alter the first term; the probability of which event happens next remains weirdly frozen. Delaying a life-saving drug by a month obviously increases the chance that a heart attack happens before the drug is ever given, yet standard factorizations can't naturally express this shift.

Methods

Drawing from classical survival analysis ("competing risks"), the authors reframe sequence generation. Instead of predicting one global "next event time," a CEM uses a Transformer backbone to output a separate probability distribution over latent waiting times for every possible event type in the vocabulary.

Figure 1: The competing events model for a simplified example with E = {💊,🫀,🧪}, correspond- ing to treatment (e.g. statins), lab measurements (cholesterol), and occurrence of cardiovascular disease (myocardial infarction) accordingly. A neural network processes past events Ht and outputs a time distribution qe for each type e ∈E. The next event type is determined by the smallest sampled time (this is (t🧪,🧪) in the image). Interventions replace a specific qe with an alternative distribution.

Think of each event type—say, taking statins, getting a cholesterol test, or having a heart attack—as having its own probabilistic alarm clock.

  • Generation: At each step, you sample a ring time from every event's clock. Whichever clock rings earliest wins! That event occurs, gets appended to the history, and all clocks reset for the next step.
  • Interventions: Answering "What if we treat in two weeks?" is now trivial: you just smash the statin clock and replace its distribution with a fixed timer set for two weeks, leaving the heart attack and lab test clocks untouched to compete naturally. To intervene on what to do (like drug dosage), numerical features are predicted right after the winning event token.
  • Handling Concurrent Events: Real-world data is discretized into time bins, meaning multiple events often happen simultaneously (ties). Evaluating all $L!$ permutations of $L$ simultaneous events during training would be computationally intractable. The authors solve this by introducing a strict tie-breaking ordering ($\prec$) over event types, collapsing a massive factorial sum into a single clean likelihood equation. They train the Transformer to support arbitrary orderings at test time by feeding random permutations as prefix tokens during training.
  • Scaling Up: Predicting separate time distributions for 80,000+ medical codes would melt GPU memory. Because the CEM log-likelihood neatly decomposes across event types, the authors compute exact probabilities for the observed event and randomly subsample just a small fraction ($K=1024$) of the non-occurring events to estimate the survival loss—yielding an unbiased gradient.
Figure 3: (a) Example of a transformer producing distributions over latent times Te. (b) The likelihood that we optimize to train a CEM, where for brevity, Ht is omitted and a discrete timeline is taken. (c) The next event sampling procedure from a trained CEM. The ordering ≺is used to break ties between latent times when the minimum is not unique, and the likelihood is adjusted accordingly.

Datasets

The authors evaluate CEMs on two distinct fronts (no new benchmarks are introduced, though existing ones are adapted to dynamic timing policies):

  1. Cancer Tumor Growth Simulator: A pharmacokinetic model of 10,000 trajectories and 4 event types simulating tumor volume under chemotherapy and radiotherapy, used to test causal off-policy evaluation against ground truth.
  2. MIMIC-IV: A massive, real-world EHR dataset (246,773 patient trajectories and 83,065 event codes) formatted via the MEDS standard, with time intervals discretized into 74 quantile bins.

Key Insights and Ideas

  • Competition isn't just a heuristic; it's inevitable: The authors prove mathematically that if you want a model capable of expressing any event distribution while obeying a "no time-travel" rule (changing a policy after next Tuesday shouldn't alter probabilities before next Tuesday), the next event must be chosen by taking the minimum of latent times.
  • Tie-breaking defines causal meaning: When events happen in the same time bin, the tie-breaking order ($\prec$) isn't just a math trick—it dictates what the intervention knows. Putting "prescribe statins" after "cholesterol test" in the ordering lets a simulated doctor react to a lab result recorded at the exact same timestamp.
  • World models beat one-off estimators: Prior causal methods for irregular time typically train a bespoke value function for one specific policy and one outcome. Because a CEM is a generative world model, you train it once on observational data and can simulate trajectories for any dynamic policy or outcome on the fly.

Key Results

  • Causal Accuracy Under Shift: On the tumor simulator, when trained on one treatment policy and asked to predict final tumor volume under a different intervention policy, standard forecasting (ERM) degrades badly (Normalized RMSE jumps from 0.180 to 0.327). Dynamic programming baselines also struggle (FQE hits 0.707; EDQ hits 0.262). CEMs nail the causal shift, achieving an NRMSE of 0.184—virtually identical to a model trained directly on the target policy. (Ignoring the tie-breaking order ruins this, spiking error to 0.584).
  • Strong Real-World Representations: Pretraining CEMs on MIMIC-IV and fine-tuning on clinical risk tasks beats standard autoregressive, contrastive, and supervised Transformer baselines on 3 out of 4 tasks (achieving top AUROCs of 79.4 on ICU mortality, 86.6 on post-discharge mortality, and 73.1 on 30-day readmission). Standard next-event autoregression (AR) lags behind by over 8 to 14 AUROC points across the board.

Limitations and Future Work

  • No Unobserved Confounding: Like almost all causal inference from observational data, CEMs rely on sequential exchangeability. If an unrecorded factor (like a patient's income) drives both when they get treated and when they have a heart attack, the model's causal estimates will be biased.
  • Careful Clock Interpretation: Because of potential confounding across the thousands of non-intervened events, you cannot interpret an individual learned clock (e.g., the heart attack distribution) in isolation as "the time until a heart attack if all other events were prevented."
  • Real-World Causal Validation: While MIMIC-IV proves CEMs learn great predictive representations at scale, the causal interventions themselves were only validated in simulation; validating timing interventions on real-world clinical effect estimation questions remains an open next step.

Summary updated

Abstract

Modeling interventions that include timing is important in many domains, such as treatments in healthcare and transactions in finance. However, standard next-token predictors, typically implemented using transformers, do not naturally support altering the timing of specific future events. We develop \emph{Competing Event Models} (CEMs), autoregressive world models for events in irregular time: once trained on observational data, a CEM can simulate trajectories under any intervention that can be carried out in practice, i.e.\ any policy that decides what to do and when based on the observed history. Drawing from the competing risks literature, CEMs model independent distributions for latent times of each event type, where the earliest realized time determines the next event. This makes interventions on timing straightforward and sampling efficient, and through appropriate design choices, CEMs also model concurrent events. We evaluate CEMs on a cancer tumor volume simulator and on prediction tasks using the MIMIC-IV dataset. Our results show that CEMs accurately recover causal effects of sequential treatments in simulations while surpassing standard transformer baselines in predictive performance on 3 out of 4 real-world medical data tasks.
BibTeX
@inproceedings{wald2026competing,
  author = {Yoav Wald and Xiang Gao and Sumit Chopra and Juho Lee and Rajesh Ranganath},
  title = {{Competing Event Models: Autoregressive Generation Under Interventions on When and What to Do}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ekD79mlpR7},
}

Loading related content...

Figure