Policy evaluation using Transformer-based medical pathway embeddings
31 March 2026
Dataset of medical pathways: For i = 1, \dots, n, X_i \coloneqq (e_i, t_i, f_i), where:
These pathways are:
To feed downstream estimators, we need to represent those pathways as vectors (embeddings)
\text{logits}_{i, c, v} = (W \cdot GPT_{\theta}(X))_{i, c, v}
\text{BCE}_{i, c} \coloneqq - \sum_v y_{i, c, v} \log \frac{\lambda_{i, c, v}}{1 + \lambda_{i, c, v}} + (1-y_{i, c, v}) \log \frac{1}{1 + \lambda_{i, c, v}}
\text{TTE}_{i, c} \coloneqq - \log(\sum_v \lambda_{i, c, v}) + t^{*} \sum_v \lambda_{i, c, v}
We are matching the ~2,000 optimal ratio \frac{\text{\# training tokens}}{\text{\# parameters}} found in Waxler et al. (2025).

A policy \pi: \mathcal{S} \to \Delta(\mathcal{A}) is a mapping from states to distributions over actions (\pi(a|s) is the probability of taking action a in state s under policy \pi).
A T-step trajectory \tau generated by policy \pi is a sequence of states, actions and rewards: \tau \coloneqq (s_0^i, a_0^i, r_0^i \dots s_{T-1}^i, a_{T-1}^i, r_{T-1}^i, s_T^i) where:
The return of a trajectory \tau is the discounted sum of rewards: G(\tau) = \sum_{t=0}^{T-1} \gamma^t r_t^i.
We are interested in the value of a policy \pi, defined as the expected return of trajectories generated by \pi: V^{\pi} = \mathbb{E}_{\tau \sim P^{\pi}}[G(\tau)] where P^{\pi}(\tau) is the distribution of trajectories generated by policy \pi.
See Farajtabar et al. (2018) for more details on OPE estimators and their properties.
First step of the OPE pipeline: regress a_{i,t} (PCP affiliation) on s_{i,t} (embeddings) to estimate \hat{\pi}_b(a|s), the behavioral policy.
The value of the behavioral policy can be estimated using the trajectories in the dataset \mathcal{D}:
V^{\pi_b} \approx V^{\hat{\pi}_b} \coloneqq \frac{1}{N} \sum_{i=1}^N \sum_{t=0}^{T-1} \gamma^t r_t^i
The policies we want to study: \pi_e^\eta(1|s) = \max(\eta, \hat{\pi}_b(1|s)) for \eta = 0 \dots 0.99
| Subpopulation | Emergency (%) | Hospit. (%) | Size | PCP |
|---|---|---|---|---|
| General Population | (31.8–18.8) | (35.0–23.7) | 10.39 | 87.4% |
| Age Group | ||||
| 20–29 | (25.1–22.5) | (29.3–16.1) | 1.38 | 72.9% |
| 30–39 | (1.1)–0.1 | (0.5)–3.0 | 1.65 | 84.6% |
| 40–49 | 0.4–1.5 | 2.0–7.9 | 1.65 | 88.4% |
| 50–59 | (4.9)–1.3 | (4.7)–3.0 | 1.70 | 91.2% |
| 60–69 | (18.5–7.7) | (20.0–8.3) | 1.55 | 92.7% |
| 70–79 | (16.3–6.6) | (17.5–7.9) | 1.26 | 93.8% |
| 80–89 | (37.9–17.1) | (37.6–18.6) | 0.76 | 92.1% |
| 90+ | (18.5–14.2) | (19.3–15.2) | 0.39 | 82.7% |
| Sex | ||||
| Male | (19.3–17.0) | (24.2–21.6) | 5.00 | 85.2% |
| Female | (33.1–19.5) | (35.3–24.4) | 5.38 | 89.5% |
| Subpopulation | Emergency (%) | Hospit. (%) | Size | PCP |
|---|---|---|---|---|
| General Population | (31.8–18.8) | (35.0–23.7) | 10.39 | 87.4% |
| Clinical (ALD) | ||||
| Type 2 diabetes | (30.5–21.2) | (34.0–25.5) | 0.59 | 87.4% |
| Primary hypertension | (32.9–17.3) | (36.2–21.5) | 0.16 | 87.4% |
| Mal. neoplasm of breast | (17.2–9.6) | (21.9–13.9) | 0.18 | 87.4% |
| Mal. neoplasm of prostate | (25.2–5.1) | (28.5–14.7) | 0.12 | 87.4% |
| Depressive episodes | (18.7–4.3) | (25.6–16.9) | 0.11 | 87.6% |
| Stroke | (15.2–3.7) | (23.7–15.1) | 0.09 | 87.4% |
| Dementia in Alzheimer | (20.1–7.8) | (25.6–14.0) | 0.08 | 87.4% |
| Heart failure | (15.2)–1.9 | (24.4–13.2) | 0.08 | 87.4% |