acceptodds
Under review as a conference paper at ICLR 2027

Learning Continuous Patient Trajectories from Electronic Health Records

Abstract

Electronic health records provide irregular observations of latent patient states that evolve continuously over time. Recent autoregressive models condition on clinical histories to forecast future events as sequences of discrete observations. Conversely, multi-marginal flow matching provides a continuous-time formulation, but using multiple observations to supervise training paths does not itself give the learned dynamics access to preceding patient history. We introduce EHRFlow, a multi-marginal flow-matching framework that conditions on encoded patient history, thereby allowing future dynamics to depend on the patient's prior clinical trajectory. Our proposed framework accommodates irregular observation times and supports forecasting at arbitrary horizons. Across controlled synthetic benchmarks, EHRFlow improves clinical-code forecasting and latent-state recovery. On real-world clinical datasets comprising more than one million patients, including an independent external validation cohort, EHRFlow improves horizon-averaged top-5 clinical-code accuracy over autoregressive and history-independent flow-matching baselines. Finally, in a controlled counterfactual simulation, conditional guidance approximates the known effect of an antihypertensive intervention without training a task-specific outcome model.

Primary area:
applications to physical sciences (physics, chemistry, biology, etc.)
Keywords:
electronic healthcare records, EHR, medicine, trajecory inference, clinical AI

Reviews

Among:
Shape:
1234this paper, Top 4%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.33 over 3 reviews, above 96% of the others.
Reviewer_7BJ8OpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

Predicting future EHR data can be critical for the survivability of a patient. The paper presents a new approach to condition the generation of the multi-marginal flow to predict future EHR data using the patient's past history. This allows the method to distinguish similar EHR information of different patients at a given timestamp and use the history to guide prediction of future EHR trends, allowing the prior information to guide the prediction.

Critical strengths
  • The proposed approach is intuitive and clearly written and provides good intuition of why considering past history to predict the EHR data can be beneficial.

  • The paper is largely well written; however, the authors should consider improving the flow, especially in the methods section, to improve readability.

Critical weaknesses
  • While the approach provides a good intuition about the need to consider past historical data, the idea about the relevance of the patient's past history is well known in the field. The overall contribution seems incremental and an extension of well known flow based model with a new conditional variable.

  • There is limited clarity about the relevance of the synthetic experiment conducted by the authors and how likely it is to occur in a real-world setting, especially in healthcare.

  • The theoretical analysis provided little insight into the unique role history plays in improving the performance of the model.

  • Experiment section is relatively weak, with not through experiment on real world setting and little justification for synthetic dataset.

Questions for authors
  • [Lines 200–201] Why do the authors use log-normalized timestamps for conditioning? Could this make the model less sensitive to changes over short time intervals and affect its ability to capture rapid changes in a patient's condition? This seems particularly important in critical hospital settings, where changes over short periods can be important for accurate predictions.

  • Why are the same set of baselines not considered in Table 2 and Table 1 ? The baselines used for synthetic datasets are relatively more exhaustive than those used for real-world datasets.

  • Why is the relative improvement on (synthea) publicly available synthetic data lower than the data simulated by the author, and how practical is the simulation process used by the author to be present in a real-world scenario?

  • Can you explain Ablation in table 3 in detail? Why doesn't conditioning on history improve the performance of CFM. Also, how do you isolate the advantage of conditioning on patient history in the model's performance? As per the table, the main advantage comes from the end-to-end training of the model

  • How sensitive is EHRFLOW's prediction to hyperparameters?

  • can you explain the theoretical significance of Theorem 1, the result seems to be generic for any conditioning variable; what's unique about history in it ? I can use any conditioning variable instead of patient history (H) and reach the same conclusion.

  • How to interpret the result in Theorem 2 ? What is its significance, and how to interpret the role of points 1, 2, 3, and 4 ?

  • Synthetic data in Appendix D uses many functional approximations for different diseases; how valid are these assumptions, and how likely is it that real-world EHR data follow a similar pattern

5 comments

We thank the reviewer for the careful assessment of our work. We address each comment with clarifications and new experiments below.


[W1] Contributions

We agree with the reviewer that the predictive value of patient history is well-established in clinical medicine. Our work studies how to model continuously evolving patient states from sparse, irregular EHR observations. Autoregressive transformers have achieved state-of-the-art performance on many tasks in this field, but the application of diffusion and flow-matching models remains underexplored.

Our work investigates how to learn continuous patient trajectories with flow matching. Empirically, we find that flow matching combined with a suitable latent space produces more accurate models that can be trained at a fraction of the computational cost of autoregressive or neural ODE models. We also study how to improve the basic CFM formulation for this task. Established multi-marginal approaches achieve higher performance but do not give the learned dynamics access to patient history before the landmark, which we address through explicit history conditioning. Our ablations show that alternative ways of incorporating this information yield inferior results. Additionally, we find that keeping the pretrained encoders frozen while continuing to train the decoder with a linear endpoint surrogate improves performance (Table 3 in the manuscript).

[W2] and [Q8] Synthetic data validity

We clarify that the objective of the synthetic experiments is to systematically evaluate different clinically relevant data-generating mechanisms, under varying levels of history-dependent progression. We further demonstrate real-world clinical relevance in our three EHR experiments. We have clarified the clinical motivations of these synthetic experiments in the revised manuscript.

We designed the simplified functional forms and parameters to isolate mechanisms motivated by established clinical findings, rather than fitting clinical models or deriving equations from the cited studies. Specifically:

  • Markovian disease progression: Prior work successfully modeled heart failure progression using Markov models [1,2].

  • Delayed treatment response: Therapeutic effects of DMARDs for rheumatoid arthritis have been shown to develop over time, and clinical guidelines recommend reassessment of DMARD response after several months [3], thereby representing a "lagged effect".

  • Patient-specific progression rate: Historical eGFR decline provides prognostic information beyond current eGFR [4], motivating our use of a patient-specific progression rate inferred from preceding observations.

  • Relapse history: Prior relapse activity can inform future relapse risk in relapsing-remitting multiple sclerosis (RRMS) [5], motivating our use of a simplified renewal process for modelling relapses.

  • Cumulative exposure: Doxorubicin-associated heart-failure risk increases with cumulative dose [6], highlighting the relevance of prior treatment exposure beyond current treatment status.

[W3], [Q6], [Q7] Theoretical analysis

We agree that Theorem 1 applies to other conditioning variables. In our setting, conditioning on history is particularly relevant because longitudinal data captures aspects of patient evolution -- such as disease progression rates and cumulative treatment exposure -- that are likely not encoded in the current state alone. Theorem 1 explicitly characterizes when such historical information reduces the optimal flow-matching loss: the improvement is strictly positive when history changes the expected velocity conditional on the current state and time, on a set of positive probability..

Theorem 2 complements Theorem 1 by demonstrating a specific setting where history conditioning is beneficial, i.e., specifically for individual trajectory forecasting. We consider a setting where patients with identical current states may have different health progression related to historical states. Point 1 derives the population-optimal vector fields with and without history conditioning, and point 2 quantifies the reduction in flow-matching loss by incorporating history. Point 3 shows that both models recover the correct population marginals. However, accurately modeling population-level distributions does not necessarily translate to accurate individual forecasting. Point 4 shows that the history-conditioned field produces strictly more accurate individual forecasts.

[W3], [Q6], [Q7] Theoretical analysis

We agree that Theorem 1 applies to other conditioning variables. In our setting, conditioning on history is particularly relevant because longitudinal data captures aspects of patient evolution -- such as disease progression rates and cumulative treatment exposure -- that are likely not encoded in the current state alone. Theorem 1 explicitly characterizes when such historical information reduces the optimal flow-matching loss: the improvement is strictly positive when history changes the expected velocity conditional on the current state and time, on a set of positive probability..

Theorem 2 complements Theorem 1 by demonstrating a specific setting where history conditioning is beneficial, i.e., specifically for individual trajectory forecasting. We consider a setting where patients with identical current states may have different health progression related to historical states. Point 1 derives the population-optimal vector fields with and without history conditioning, and point 2 quantifies the reduction in flow-matching loss by incorporating history. Point 3 shows that both models recover the correct population marginals. However, accurately modeling population-level distributions does not necessarily translate to accurate individual forecasting. Point 4 shows that the history-conditioned field produces strictly more accurate individual forecasts.

[W4] and [Q2] Experimental evaluation on real-world data

We have made three additions to address this concern:

  • Added the remaining baselines from the synthetic experiments to the real-world evaluation.
  • Included MIMIC-IV as a third EHR dataset, following Reviewer 3nMc’s suggestion.
  • Added TrajGPT as a new baseline.

Our results (Table R1) indicate EHRFlow achieves the highest mean top-5 code accuracy on each of the three real-world datasets. Together, these datasets include well over one million patients, with external validation on CPRD Gold.

Table R1. Top-5 code accuracy averaged over forecast horizons.

MethodCPRDAMC-EHRMIMIC-IV
TrajGPT0.310 ± 0.0150.242 ± 0.0180.441 ± 0.052
GRU-ODE-Bayes0.409 ± 0.0210.191 ± 0.0170.518 ± 0.027
Neural CDE0.472 ± 0.0280.241 ± 0.0070.544 ± 0.013
CFM (adjacent)0.546 ± 0.0120.221 ± 0.0050.273 ± 0.025
Metric FM0.501 ± 0.0070.216 ± 0.0110.255 ± 0.057
EHRFlow (GP-CFM)0.640 ± 0.0060.283 ± 0.0130.553 ± 0.022
EHRFlow (MMFM)0.625 ± 0.0110.302 ± 0.0160.553 ± 0.018

[Q1] Log transformation

The log⁡(1+Δ)\log(1+\Delta) in fact is intended to make the model more sensitive to changes over short time intervals: its derivative 1/(1+Δ)1/(1+\Delta) decreases with Δ\Delta. Replacing it with linear elapsed time changed mean top-5 accuracy by at most 0.3 percentage points at 90 and 180 days (Table R2).

Table R2. Top-5 code accuracy at forecasting 90 and 180 days, averaged over the six synthetic datasets.

MethodTime input (years)90 days180 days
EHRFlow (GP-CFM)log(1 + Δt) (paper)0.935 ± 0.0030.919 ± 0.002
EHRFlow (GP-CFM)Linear0.932 ± 0.0010.917 ± 0.001
EHRFlow (MMFM)log(1 + Δt) (paper)0.935 ± 0.0010.918 ± 0.002
EHRFlow (MMFM)Linear0.934 ± 0.0020.919 ± 0.001

[Q3] Synthea results

We test two claims in our experiments. First, continuous flow-based trajectory modelling improves forecasting on synthetic and real-world EHR datasets compared with the evaluated baselines. Second, the benefit of history conditioning depends on how much information the preceding history provides beyond the current state. The smaller gains on Synthea are consistent with a weaker dependence on historical information beyond the current state, as compared to the stronger dependence in our controlled simulations. On real-world data, we observe benefits from both continuous flow-based modelling and history conditioning.

[Q4] Ablation table

Adding history to adjacent CFM increases mean top-5 accuracy from 0.755 to 0.776. Using the same anchor–target windows as MMFM increases history-conditioned CFM accuracy to 0.808. For EHRFlow (GP-CFM), replacing history with zeros while retaining the same architecture reduces accuracy from 0.899 to 0.868, while matching parameter count preserves 0.897. Full end-to-end training achieves 0.876, which is below the proposed multi-stage training procedure.

[Q5] Hyperparameter sensitivity

Across the tested settings, mean top-5 accuracy remained within 0.7 percentage points of the corresponding default (Table R3).

Table R3. EHRFlow hyperparameter sensitivity. Top-5 code accuracy averaged over the six synthetic datasets.

SettingEHRFlow (GP-CFM)EHRFlow (MMFM)
Paper default0.899 ± 0.0010.897 ± 0.002
Learning rate = 3 × 10⁻⁴0.894 ± 0.0030.896 ± 0.001
Learning rate = 3 × 10⁻³0.894 ± 0.0030.898 ± 0.001
GP lengthscale = 90 days0.893 ± 0.003—
GP lengthscale = 365 days0.896 ± 0.005—
GP noise = 10⁻³0.897 ± 0.002—
GP noise = 10⁻¹0.899 ± 0.002—
MMFM path variance = 10⁻²—0.897 ± 0.002
MMFM path variance = 1—0.890 ± 0.002

References

[1] Kazmi et al. Disease progression in chronic heart failure is linear. Eur J Heart Fail, 2025.

[2] Kazmi et al. Dynamic risk stratification using Markov chain modelling in chronic heart failure. ESC Heart Fail, 2022.

[3] Smolen et al. EULAR recommendations for rheumatoid arthritis management: 2022 update. Ann Rheum Dis, 2023.

[4] Kovesdy et al. Past Decline Versus Current eGFR and Subsequent ESRD Risk. J Am Soc Nephrol, 2016.

[5] Madill et al. Multiple sclerosis relapse risk factors across treatment eras. Mult Scler J Exp Transl Clin, 2025.

[6] Swain et al. Congestive heart failure in patients treated with doxorubicin. Cancer, 2003.


We thank the reviewer again for the constructive feedback. We believe the clarified positioning, added baselines and benchmarks materially strengthen the paper. We would be happy to discuss these results further.

Reviewer_3nMcOpenReview ↗
Rating
3
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

The authors tackle the problem of patient trajectory forecasting, from clinical history and prior observations using a multi marginal flow matching approach. Their method, EHRFlow, includes priors from patient history and performs forecasting at arbitrary horizons. The authors evaluate the proposed approach on synthetic and real world datasets and show improved top-5 accuracy.

Critical strengths
  • The paper is very well written and easy to follow along.

  • The motivation of the approach and intuitions are clearly explained.

  • The visualizations are also clear and easy to follow along.

  • The authors have performed comparisons on real world as well as synthetic data, to evaluate their approach.

Critical weaknesses

A few recent patient trajectory forecasting approaches (listed in the next section) do not appear to be benchmarked against. I do understand that these may be more recent, but it would be good to compare against these. In case this is not feasible, kindly provide reasons for the same.

Questions for authors
  1. Is the number of prior observations,mm, assumed to be fixed for all patients?

  2. Does EHRFlow also have the potential to refine/alter the trajectory as we get more observations in the future?

  3. Please elaborate on how the inference rollout in EHRFlow avoids error accumulation. Doesn't the ODEroll out also cause errors to accumulate?

  4. What happens when a specific modality is missing?

  5. Is there a variable/modality specific encoder? How do you ensure that the variables are all in the same space?

  6. Is there a limit on how large Δ\Delta can be for good forecasts? Do you have confidence bounds?

  7. Is log(1 + Δ\Delta) applied to prevent large values from causing issues?

  8. Can the history encoder also potentially include prior visit's data, i.e. prior comorbidities etc? Is there any specific input modality (like clinical notes) that is considered here as history?

  9. Does the result improve when it is unrolled with multiple Euler steps in eq. 10, instead of a single step approximation?

  10. How does this compare against healthcare specific trajectory prediction approaches like transformer based TFT-multi [1], DT-GPT [2], TrajGPT [3] on public datasets like MIMIC-IV?

[1] He, R., & Chiang, J. N. (2025). Simultaneous forecasting of vital sign trajectories in the ICU. Scientific reports, 15(1), 14996.

[2] Makarov, N., Bordukova, M., Quengdaeng, P., Garger, D., Rodriguez-Esteban, R., Schmich, F., & Menden, M. P. (2025). Large language models forecast patient health trajectories enabling digital twins. npj Digital Medicine, 8(1), 588.

[3] Song, Z., Lu, Q., Zhu, H., Buckeridge, D. L., & Li, Y. (2024). TrajGPT: Healthcare time-series representation learning for trajectory prediction. In NeurIPS Workshop on Time Series in the Age of Large Models.

4 comments

We thank the reviewer for the thoughtful and constructive review. We have added TrajGPT as a baseline and MIMIC-IV as a benchmark, alongside analyses of modalities, forecast horizons, and training integration steps.


[W1] + [Q10] Additional baselines and MIMIC

We added TrajGPT to the synthetic and real-world benchmarks and evaluated all methods on MIMIC-IV (Table R1). TFT-multi cannot be applied directly to our setting, as it forecasts regularly sampled vital signs rather than irregular, mixed-type EHR events. Adapting DT-GPT would require additional fine-tuning compute that is difficult to accommodate within our secure data environments, while introducing differences in external pretraining data and model scale relative to our benchmark.

Table R1. Top-5 code accuracy averaged over forecast horizons.

MethodSynthetic averageCPRDAMC-EHRMIMIC-IV
TrajGPT0.539 ± 0.0150.310 ± 0.0150.242 ± 0.0180.441 ± 0.052
EHRFlow (GP-CFM)0.899 ± 0.0010.640 ± 0.0060.283 ± 0.0130.553 ± 0.022
EHRFlow (MMFM)0.897 ± 0.0020.625 ± 0.0110.302 ± 0.0160.553 ± 0.018

[Q1] Number of prior observations

No, the number of prior observations can vary across patients. The history encoder is a recurrent neural network (GRU) that maps a variable-length sequence of observations to a fixed-size history vector. We use at most the mm most recent observations to limit computation. Figure 12 compares different values of this upper bound.

[Q2] Refined rollouts

Yes. Just as autoregressive models can incorporate new observations by appending tokens to the patient’s history, EHRFlow can update its forecast as new clinical information becomes available. We construct and encode the new patient state, update the history embedding, and roll out a new forecast from that state.

[Q3] Error accumulation

Yes, errors can accumulate during ODE integration, and EHRFlow’s forecasting accuracy generally declines at longer horizons. A multi-year autoregressive rollout can require hundreds of clinical event predictions. EHRFlow uses only 16 ODE integration steps for the same horizon. Empirically we observe that autoregressive models can remain competitive at short timescales but decline more sharply with increasing horizon (see Figures 8, 9 and 10).

[Q4] and [Q5] Missing modalities

We use a shared encoder to map day-level observations from structured modalities into a common latent space, using available events without imputing missing modalities. We assess sensitivity to missing inputs by removing selected categories of pre-landmark events from CPRD Gold (Table R2).

Table R2. Change in top-5 code accuracy, in percentage points, relative to the full record.

Input removedPre-landmark tokens removed (%)EHRFlow (GP-CFM) Δ top-5 accuracyEHRFlow (MMFM) Δ top-5 accuracy
Random 10% of tokens10.0−0.5 ± 0.1−0.6 ± 0.1
Labs23.9+1.4 ± 0.4+2.2 ± 0.3
Secondary care8.4−0.4 ± 0.4−0.9 ± 0.3
Frailty and conditions7.5−4.0 ± 0.8−4.0 ± 0.7

[Q6] Forecast horizon

EHRFlow supports forecasting at arbitrary horizons, although reliability depends on the follow-up represented during training. On CPRD, we evaluated extrapolation to five and ten years without retraining; accuracy declined at longer horizons, where fewer patients had sufficient follow-up for evaluation (Table R3).

Table R3. Eligible patients by forecast horizon and top-5 code accuracy.

1 year3 years5 years10 years
Patients with sufficient follow-up (CPRD Gold)33,39522,57214,0333,255
EHRFlow (GP-CFM)0.666 ± 0.0070.540 ± 0.0080.458 ± 0.0120.318 ± 0.081
EHRFlow (MMFM)0.647 ± 0.0120.520 ± 0.0120.443 ± 0.0150.280 ± 0.030

[Q7] Log transformation

We use log⁡(1+Δ)\log(1+\Delta) to compress long forecast durations while preserving finer distinctions at short horizons. The transformation applies only to the total forecast duration Δ\Delta; the relative timing of observations within each training window is scaled linearly (Eq. 6). At 90 and 180 days, replacing the log input with linear elapsed time changed mean top-5 accuracy by at most 0.3 percentage points (Table R4).

Table R4. Top-5 code accuracy at 90 and 180 days, averaged across synthetic datasets.

MethodTime input90 days180 days
EHRFlow (GP-CFM)log(1 + Δt) (paper)0.935 ± 0.0030.919 ± 0.002
EHRFlow (GP-CFM)Linear (years)0.932 ± 0.0010.917 ± 0.001
EHRFlow (MMFM)log(1 + Δt) (paper)0.935 ± 0.0010.918 ± 0.002
EHRFlow (MMFM)Linear (years)0.934 ± 0.0020.919 ± 0.001

[Q8] History encoder and additional modalities

Yes. The history encoder captures the order and timing of prior events, including diagnoses and comorbidities. On MIMIC-IV, adding microbiology data, codes derived from radiology reports, and discharge note embeddings increased mean top-5 accuracy by 0.2 and 0.3 percentage points for GP-CFM and MMFM, respectively (Table R5).

Table R5. Top-5 code accuracy on MIMIC-IV, averaged over forecast horizons.

MethodHospital records only+ Microbiology, radiology reports, and notes
EHRFlow (GP-CFM)0.553 ± 0.0220.555 ± 0.018
EHRFlow (MMFM)0.553 ± 0.0180.556 ± 0.019

[Q9] Number of Euler steps

Using more Euler steps in the decoder term of Eq. 10 slightly improves top-5 accuracy (Table R6), but requires additional vector-field evaluations and backpropagation through the integration steps during training. We therefore retain the single-step approximation to preserve simulation-free training without backpropagating through an ODE solve, unlike NeuralODE training.

Table R6. Top-5 code accuracy averaged across synthetic datasets.

Euler steps during trainingEHRFlow (GP-CFM)EHRFlow (MMFM)
1 (paper)0.899 ± 0.0010.897 ± 0.002
30.901 ± 0.0030.902 ± 0.001
50.904 ± 0.0010.902 ± 0.004

We thank the reviewer again for these comments. We believe these additional experiments address the reviewer’s concerns and clarify the EHRFlow mechanisms. We would be happy to discuss these results further.

Reviewer_3nMcOpenReview ↗

Response to authors

Thank you for your detailed response and for including the additional experiments.

We thank the reviewer for reading our response, and hope the additional experiments have addressed your questions.

Reviewer_reV5OpenReview ↗
Rating
4(+1)
Confidence
3
Informativeness
2
Presentation
2
Soundness
3
Read review
Paper summary

This paper addresses longitudinal patient trajectory forecasting from sparse, irregularly sampled electronic health records (EHRs), with access to preceding clinical history. The authors propose EHRFlow, a framework that operates in the latent space of a pretrianed autoencoder and conditions multi-marginal flow matching. Theoretically, the authors prove that history conditioning strictly reduces optimal flow-matching risk (Theorem 1), and show in a linear-Gaussian setting that history-free flows can match population marginals while still failing to recover individual trajectories (Theorem 2). Empirically, across synthetic benchmarks and two real-world cohorts EHRFlow outperforms baselines in horizon-averaged top-5 clinical-code accuracy while reducing synthetic runtimes drastically.

Critical strengths
  1. The paper is very clearly written and the problem statement, motivation and contributions are easy to follow.
  2. The paper has extensive experiments and ablations which makes empirical isolation and validation of the contributions easy.
  3. The paper shows theoretically why population marginals miss individual paths and improves top-5 code accuracy across over one million patients with external validation.
  4. The contribution of intervention-conditioned forecasting in a controlled simulation verifies that the continuous dynamics can recover a known treatment effect where true counterfactuals exist.
Critical weaknesses

Experimental results are mostly on synthetic dataset, would be interesting to see more of the experiments replicated for real-world datasets or a discussion section why synthetic dataset mimics and covers real-world scenarios adequately.

Questions for authors
  1. Does pretraining the frozen GRU encoder on multi-horizon targets rather than 1-step-ahead code prediction improve long-horizon forecasting gains on AMC-EHR?
  2. Outside controlled simulations, how robust is guided forecasting to time-varying confounding by indication?
  3. How would guidance weight be selected when true counterfactuals are unavailable?
  4. Beyond autoregressive and history-independent flows, how do other baselines perform on real-world benchmarks?
3 comments

We thank the reviewer for recognising the empirical and theoretical contributions of our work. In response to your main concern, we have extended the baseline comparisons to three real-world cohorts, evaluated an alternative history-encoder pretraining objective on AMC-EHR, and tested classifier-free guidance on CPRD.


[W1] and [Q4] Real-world baselines

We have added TrajGPT, GRU-ODE-Bayes, Neural CDE, adjacent CFM, and Metric FM to the real-world evaluation. Following Reviewer 3nMc’s suggestion, we also added a third evaluation setting using MIMIC-IV (Table R1).

Table R1. Top-5 code accuracy averaged over forecast horizons.

MethodCPRDAMC-EHRMIMIC-IV
TrajGPT0.310 ± 0.0150.242 ± 0.0180.441 ± 0.052
GRU-ODE-Bayes0.409 ± 0.0210.191 ± 0.0170.518 ± 0.027
Neural CDE0.472 ± 0.0280.241 ± 0.0070.544 ± 0.013
CFM (adjacent)0.546 ± 0.0120.221 ± 0.0050.273 ± 0.025
Metric FM0.501 ± 0.0070.216 ± 0.0110.255 ± 0.057
EHRFlow (GP-CFM)0.640 ± 0.0060.283 ± 0.0130.553 ± 0.022
EHRFlow (MMFM)0.625 ± 0.0110.302 ± 0.0160.553 ± 0.018

[Q1] GRU pretraining

Yes, multi-horizon pretraining improves forecasting accuracy (Table R2). However, we maintain next-code pretraining because multi-horizon pretraining adds additional horizon-specific supervision not used by the autoregressive baselines.

Table R2. Top-5 code accuracy on AMC-EHR by pretraining objective.

ModelPretraining targetAverage over all prediction horizons3 years only
EHRFlow (GP-CFM)Next-code (1 head)0.291 ± 0.0090.264 ± 0.009
EHRFlow (GP-CFM)Multi-horizon (5 heads)0.314 ± 0.0020.285 ± 0.002
EHRFlow (MMFM)Next-code (1 head)0.312 ± 0.0090.283 ± 0.007
EHRFlow (MMFM)Multi-horizon (5 heads)0.327 ± 0.0090.296 ± 0.008

[Q2] Robustness to time-varying confounding

Time-varying confounding by indication remains a limitation of guided forecasting. Worsening disease can prompt treatment and increase mortality, causing incompletely observed deterioration to be attributed to treatment. We therefore restrict our treatment-effect analysis to the synthetic simulation. In CPRD, we examine the well-established smoking–mortality association through agreement with an adjusted observational estimate.

[Q3] Selecting the guidance weight without counterfactual outcomes

We selected the guidance weight by minimising the validation Brier score for three-year mortality, without counterfactual outcomes or the Cox reference. On CPRD Gold, we compared each current smoker’s forecasts under never-smoker and current-smoker conditioning. Both variants agreed with the adjusted Cox association despite age confounding the crude comparison (crude HR 1.19), while shuffled smoking tokens yielded approximately null contrasts (Table R3).

Table R3. Hazard ratios with 95% CI for 3-year mortality.

MethodRecorded smoking status (HR)Shuffled smoking status (HR)
EHRFlow (GP-CFM)0.77 (0.68–0.85)1.00 (0.98–1.03)
EHRFlow (MMFM)0.78 (0.73–0.87)0.99 (0.92–1.04)
ReferenceAdjusted Cox 0.73 (0.69–0.76)1.00 (expected null)

We thank the reviewer again for their thoughtful feedback, which has helped us improve our work. We would be happy to discuss these results further.

Reviewer_reV5OpenReview ↗

Revision of scores

Thank you for the additional experiments. These have clarified major reservations I had, and I have revised my score accordingly. Q2 still remains a nice-to-have study in the extended version of the work.

We thank the reviewer for raising their score, and are glad we were able to address your reservations. With regards to Q2, we will further explore time-varying confounders and include our findings in future revisions / extensions of this work.

Comments on the paper

1 comment

We thank the reviewers for their thoughtful and constructive feedback. We appreciate their recognition of the clarity of our writing and presentation (reV5, 3nMc, 7BJ8), the motivation of our approach (3nMc, 7BJ8), and the breadth of our empirical evaluation (reV5, 3nMc).

In response to their comments, we have revised the manuscript to incorporate:

  • Expanded real-world comparisons, including TrajGPT and an additional MIMIC-IV cohort.
  • Additional analyses of history encoding, input modalities, and training settings.
  • A real-world classifier-free guidance experiment on smoking–mortality associations.
  • Clarifications of the contributions, theoretical results, and synthetic-data assumptions.

We provide detailed point-by-point responses below and have incorporated the corresponding changes and results into the revised manuscript. Unless otherwise indicated, values are means ± standard deviations across training seeds.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.