An autoregressive AI model trained on over 300,000 patients and 400 million patient timeline entries can generate realistic counterfactual medical trajectories — simulating how a patient's clinical course might have differed under alternative conditions — according to new research published on arXiv.

The work, posted in April 2025, addresses a long-standing challenge in clinical research: understanding what would have happened to a patient under different circumstances. Standard clinical trials are expensive, slow, and ethically constrained. Counterfactual simulation — running hypothetical scenarios on synthetic patient data — offers a potential alternative approach, but previous methods have struggled to produce results that match real clinical behaviour.

How the Model Was Built and Tested

The researchers trained their model in a self-supervised manner on a large corpus of real-world electronic health records, allowing it to learn the sequential patterns of how clinical events unfold over time. No explicit labels or outcome annotations were required during training; the model learned by predicting the next entry in a patient timeline, much like a language model learns to predict the next word.

To validate the approach, the team applied the model to patients hospitalised with COVID-19 in 2023. They then systematically modified three variables — patient age, serum C-reactive protein (CRP), a marker of systemic inflammation, and serum creatinine, an indicator of kidney function — and asked the model to simulate 7-day outcomes under each altered scenario.

Counterfactual trajectories reproduced known clinical patterns, suggesting autoregressive generative models can establish a foundation for counterfactual clinical simulation.

The results aligned with established medical knowledge. Simulations involving older patients, higher CRP, or elevated creatinine all produced increased in-hospital mortality. Prescription patterns also shifted in clinically sensible ways: the antiviral drug remdesivir appeared more frequently in simulations with higher CRP values, and less frequently when kidney function was impaired — consistent with real-world clinical guidance, since remdesivir is generally avoided in patients with significant renal dysfunction.

Why Self-Reported Benchmarks Deserve Scrutiny

It is important to note that the validation results reported here are self-reported by the study authors and have not yet undergone formal peer review. The primary benchmark used is internal consistency — whether the model reproduces patterns already known to clinicians — rather than a prospective test against real patient outcomes. This is a meaningful step, but it is not the same as demonstrating that the model can predict outcomes for specific patients in a clinical setting.

The study also does not disclose the specific dataset used for training, beyond the patient count and entry volume. Dataset composition, including which hospital systems contributed, the time span covered, and demographic representation, can significantly affect how well a model generalises to other populations.

The Case for In Silico Trials

Despite these caveats, the research points toward a potentially valuable application: in silico clinical trials, where candidate treatments are tested on synthetic patient populations before or alongside traditional trials. Such an approach could reduce costs, accelerate drug development, and allow researchers to explore subgroup effects — how a treatment performs in elderly patients or those with comorbidities, for instance — that are often underpowered in standard trials.

Personalised medicine represents another target application. If a model could reliably simulate how an individual patient's trajectory might change under different treatment choices, clinicians could use it as a decision-support tool at the bedside. The gap between that aspiration and current capability remains substantial, but research of this kind begins to close it.

Autoregressive models — the same architectural family behind large language models — have shown a consistent ability to learn complex sequential dependencies across domains. Applying this architecture to longitudinal health records is a natural extension, and the sheer scale of the training data here (400 million timeline entries) positions the model to capture rare clinical events that smaller datasets would miss.

Methodological Hurdles Still to Clear

The core difficulty with counterfactual inference in any setting is the fundamental problem of causal inference: we can never observe both the factual and counterfactual outcome for the same patient. Validating counterfactual models is therefore inherently indirect. The researchers' approach — checking whether simulated outcomes match known clinical patterns — is a reasonable proxy, but future work will need to develop more rigorous evaluation frameworks, potentially using natural experiments or randomised trial data as ground truth.

Regulatory acceptance is another hurdle. Before in silico trial data could support drug approval decisions, agencies such as the FDA and EMA would need agreed standards for model validation, audit trails, and bias assessment. That infrastructure does not yet exist in a standardised form, though both agencies have begun preliminary work in this area.

What This Means

This research demonstrates that large-scale generative models trained on real-world health records can reproduce clinically coherent counterfactual scenarios — making AI-assisted virtual trials a more credible near-term research tool, provided validation standards keep pace with the technology.