# DeepImagine: Clinical Trial Outcome Prediction via Stepwise Local Counterfactual Imaginations

arXiv: https://arxiv.org/abs/2604.23054 · HTML: https://mlsanity.com/paper/2604.23054/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 12 of its 17 references that are in the map.
- First posted on arXiv 24 Apr 2026.

## Builds on (most cited first, 12 of 12)

- [Let's Verify Step by Step](https://mlsanity.com/paper/2305.20050/) (2023)
- [NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding Models](https://mlsanity.com/paper/2405.17428/) (2024)
- [Causal Reasoning and Large Language Models: Opening a New Frontier for Causality](https://mlsanity.com/paper/2305.00050/) (2023)
- [CLadder: Assessing Causal Reasoning in Language Models](https://mlsanity.com/paper/2312.04350/) (2023)
- [CounterBench: Evaluating and Improving Counterfactual Reasoning in Large Language Models](https://mlsanity.com/paper/2502.11008/) (2025)
- [Trial2Vec: Zero-Shot Clinical Trial Document Similarity Search using Self-Supervision](https://mlsanity.com/paper/2206.14719/) (2022)
- [SPOT: Sequential Predictive Modeling of Clinical Trial Outcome with Meta-Learning](https://mlsanity.com/paper/2304.05352/) (2023)
- [Executable Counterfactuals: Improving LLMs' Causal Reasoning Through Code](https://mlsanity.com/paper/2510.01539/) (2025)
- [Automatically Labeling Clinical Trial Outcomes: A Large-Scale Benchmark for Drug Development](https://mlsanity.com/paper/2406.10292/) (2024)
- [PyTrial: Machine Learning Software and Benchmark for Clinical Trial Applications](https://mlsanity.com/paper/2306.04018/) (2023)
- [ExpliCa: Evaluating Explicit Causal Reasoning in Large Language Models](https://mlsanity.com/paper/2502.15487/) (2025)
- [CT Open: An Open-Access, Uncontaminated, Live Platform for the Open Challenge of Clinical Trial Outcome Prediction](https://mlsanity.com/paper/2604.16742/) (2026)

## Abstract (arXiv)

Predicting the outcomes of prospective clinical trials remains a major challenge. Clinical trial outcomes result from complex interactions among experimental factors such as drug interventions, participant demographics, and protocols. Here, we introduce DeepImagine, a framework that predicts target trial outcomes through stepwise counterfactual imagination anchored on historical trials with observed results. Starting from a relevant historical trial, DeepImagine sequentially modifies one differing experimental factor at a time. With each step a large language model (LLM) is posed a local counterfactual: how would the current imagined outcome change with this single perturbation? The updated result is carried forward as the input to the next step, until the historical configuration exactly matches the target, yielding the final prediction. Empirically, DeepImagine consistently outperforms direct one-step prediction across several off-the-shelf LLMs, with further gains when multiple imagination pathways, initiated from different historical anchors, are aggregated. We also construct natural counterfactuals augmented with synthetic reasoning traces and train a family of specialized language models, each dedicated to learning one factor's local counterfactual transition. Integrating these learned local operators into DeepImagine yields substantial improvements over general-purpose LLM baselines. Our findings position stepwise counterfactual imagination, distinct from both correlational prediction and explicit structural causal modeling, as a promising direction for clinical trial outcome prediction. All code, training scripts, and evaluation scripts are available at hrefhttps://github.com/deepimagine-counterfactual/DeepImaginehttps://github.com/deepimagine-counterfactual/DeepImagine.
