Embedding medical pathways for causal inference on healthcare supply shocks and patient outcomes
8 October 2025
| Model name | Model archi. | Pre-train. Task(s) | Fine-tun. task(s) | # Params | Training data size | Vocab size (type) | Generative | Trajectory1 |
|---|---|---|---|---|---|---|---|---|
| Delphi (Shmatko et al. (2025)) | NanoGPT | Next disease event + Time to event | None | 2M | 400k patients | 1,258 (ICD10) | ✅ | ✅ |
| MOTOR (Many Outcome Time Oriented Representation) (Steinberg et al. (2024)) | Transformer (causal masking and local attention) | Time to event (TTE) | TTE for part. disease | 143M | 55M patients, 9B events | 8,192 (ICD10 and other specific codes) | ≅ | ≅ |
| Life2Vec (Savcisens et al. (2023)) | BERT | MLM + SOP | Mortality Prediction | 8M | 3M patients | ~700 (labour + ICD10) |
❌ | ❌ |
| TransformEHR (Yang et al. (2023)) | Encoder-Decoder | Visit masking: Given visits 1-3, predict all codes in visit 4 | Disease (pancreatic cancer) / Outcome (self harm) pred. | ? | 255M visits from 7M patients | ICD10 | ✅ | ❌ |
| BEHRT (Li et al. (2020)) | BERT | MLM | Disease prediction | n.r. (~6L, 12H, h=288) | 1.6M patients | 301 disease codes | ❌ | ❌ |
Several methodological papers:
From T. Le Calvé, PhD Student, CREST
Dataset of medical pathways: For i = 1, \dots, n, X_i \coloneqq (e_i, t_i, f_i), where:
where \theta parametrizes the neural network.
We predict for each token, if it will appear within the next t days.
We consider, simulatenously, several t \in \mathcal{T}, \mathcal{T} being the sorted set of short term horizons, typically 14, 30, 90, 180 days.
We trained a “large” model (40M params) and a “small” one (5M).
ROC curve of the pre-training task for a given specialty on a test set of 10,000 patients.
Still, the models converge quickly, and even small models achieve good convergence. This raises the (open) question of complexifying the task at some point.
Up to a given time t, we have:
We want to estimate the Conditional Average Treatment Effect (CATE): \tau(x, t) \coloneqq \mathbf{E}[Y_t(1) - Y_t(0) | X_{<t} = x]
SUTVA : Y_t(w) = Y_t \quad \textit{ if } W_t = w
Conditional ignorability - Unconfoundedness \forall w \in \{0,1\}, Y_t(w) \perp W_t \mid X_{<t}
Overlap 0 < \mathbb{P}(W_t = w | X_{<t} = x) < 1, \forall (w,x) \in ( \{0,1\}, \mathbb{R}^{d_{embed}})
For a given time t, we define {pos}_t as being the last position in the patient’s pathway before t, and we define the embedding of the pathway: GPT^{\text{path}}(X_{<t}) \coloneqq GPT_{\theta^{*}}(X_{<t})_{{pos}_t} \in \mathbb{R}^{d_{embed}}
We train on the calibration set a head g_{\phi}: \mathbb{R}^{d_{embed}} \times \mathbb{R}_{+} \to [0,1], minimizing the BCE loss on death prediction - to obtain \phi^{*}. \hat{\tau}_{\text{SLearner}}(x) \coloneqq g_{\phi^{*}} (GPT^{\text{path}}(x), 1) - g_{\phi^{*}} (GPT^{\text{path}}(x), 0)
Another approach consists in trying to model the propensity score, the probability of being treated given X.
A first head g_{\phi_{m}}: \mathbb{R}^{d_{embed}} \to [0,1] is trained on the death prediction task, so that for a given pathway x, g_{\phi_{m}^{*}}(GPT^{\text{path}}(x)) is close to the conditional mean outcome m(x) = \mathbb{E}[Y_t | x].
Another head g_{\phi_{e}}: \mathbb{R}^{d_{embed}} \to [0,1] is trained to predict the treatment W_t of a given individual (minimizing a Mean Squared Error).
Finally, we train the CATE estimator training a head g_{\phi_{\tau}}: \mathbb{R}^{d_{embed}} \to [0,1] by minimizing the R-loss: \begin{align*} \phi_{\tau}^{*} \in \arg\!\min_{\phi_{\tau}} \; & Y_t - g_{\phi_{m}^{*}}\left( GPT^{\text{path}}(X_{<t}) \right) \\ & - \left( W_t - g_{\phi_{e}^{*}}\left( GPT^{\text{path}}(X_{<t}) \right) \cdot g_{\phi_{\tau}}\left( GPT^{\text{path}}(X_{<t}) \right) \right) \end{align*}
We have a lot of other meta-learners:
Target pipeline - from Abécassis et al. (2025)
We want ideally to have a generative model.
Trade off between number of training tokens (train dataset size) and number of parameters in the model (model size)
Estimated optimal ratio: \frac{\text{\# training tokens}}{\text{\# parameters}} = 20