NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Doctor AI: Predicting Clinical Events via Recurrent Neural Networks

Edward Choi, Mohammad Taha Bahadori, Andy Schuetz, Walter F. Stewart, Jimeng Sun

TL;DR

Doctor AI applies Gated Recurrent Unit (GRU) networks to large-scale, longitudinal electronic health records (EHR) to simultaneously predict a patient's future diagnosis codes, medication orders, and time until their next visit. By framing patient history as a multi-label temporal process, it achieves up to 79.6% recall@30 on differential diagnosis and successfully transfers learned clinical representations from a large primary care health system to an unrelated intensive care dataset.

What Problem Does This Paper Address?

Most clinical decision support systems rely on highly specialized predictive models designed for a single disease or adverse event (e.g., readmission risk or sepsis onset). However, actual clinical practice involves an unpredictable mix of hundreds of possible diagnoses and treatments. Building, deploying, and maintaining thousands of bespoke models is impractical.

Furthermore, patient health trajectories are continuous, irregularly sampled, and multivariate. Existing temporal approaches—such as continuous-time Markov chains or Hawkes processes—face significant scalability bottlenecks and impose strong generative assumptions that rarely hold for complex EHR data. The authors set out to develop a single, generalized model capable of processing a patient’s full medical history to anticipate all diagnoses, prescriptions, and visit timings at their next clinical encounter.

Methods

Doctor AI formulates patient history as a sequence of discrete events $(t_i, \mathbf{x}_i)$, where each timestamp $t_i$ records an encounter with a multi-hot vector $\mathbf{x}_i$ spanning tens of thousands of medical codes (ICD-9 diagnoses, GPI medications, and CPT procedures).

[Codes x_i, Interval d_i] 
       │
       ▼
[Embedding Layer (W_emb)]  <── Initialized via Skip-gram or Random Orthogonal
       │
       ▼
 [Recurrent Units (GRU)]   <── 1 or 2 layers (hidden dim: 2000)
       │
       ├──────────────────────────────┐
       ▼                              ▼
[Softmax Output Layer]        [ReLU Output Layer]
Next Dx & Rx Categories        Next Visit Duration (d_hat_{i+1})
(Multi-label cross-entropy)   (Squared error on log-duration)
  • Embedding & Pre-training: To reduce high input dimensionality (~40,000 codes), inputs are projected into a lower-dimensional space. The authors explore random orthogonal initialization as well as pre-trained embeddings initialized using a clinical Skip-gram (Word2vec) model trained on temporal co-occurrences of EHR codes.
  • Recurrence: Multi-layer Gated Recurrent Units (GRU) maintain an evolving latent representation of patient health status $\mathbf{h}_i$, capturing long-term dependencies without the computational overhead of standard LSTMs.
  • Joint Prediction Head:
  • A dense layer with softmax predicts probability distributions across grouped diagnosis and medication categories ($\hat{\mathbf{y}}_{i+1}$).
  • A rectified linear unit (ReLU) branch estimates log-transformed duration to the next encounter ($\hat{d}_{i+1} = \max(\mathbf{w}_{\text{time}}^\top \mathbf{h}_i + b_{\text{time}}, 0)$).
  • Joint Objective: The network optimizes a multi-task loss combining cross-entropy for medical codes and mean squared error on visit intervals: $$\mathcal{L} = \sum_i \left( \text{CrossEntropy}(\mathbf{y}_{i+1}, \hat{\mathbf{y}}_{i+1}) + \frac{1}{2} \| d_{i+1} - \hat{d}_{i+1} \|_2^2 \right)$$

Datasets

  1. Sutter Health Dataset (Primary): De-identified longitudinal records from Sutter Health Palo Alto Medical Foundation (primary care) spanning 8 years:
  2. 263,706 patients with at least two visits (average of 54.6 visits/patient).
  3. Input feature space: 38,594 unique medical codes.
  4. Prediction targets: Grouped into 1,183 3-digit ICD-9 diagnosis codes and 595 GPI medication classes (1,778 target dimensions total).
  5. MIMIC-II (Transfer Learning Benchmark): Publicly available ICU database used to evaluate domain adaptation:
  6. 2,695 patients with $\ge 2$ visits and 767 unique 3-digit ICD-9 codes. Split into 2,290 patients for fine-tuning and 405 for evaluation.

Key Insights and Ideas

  • Representation Beats Hand-Crafted Baselines: The GRU automatically aggregates temporal trends into informative patient state vectors, handily beating logistic regression, multi-layer perceptrons with fixed lag windows ($L=5$), and frequency baselines.
  • Skip-gram Embeddings Accelerate & Stabilize RNNs: Initializing embedding weights with pre-trained Skip-gram representations improves final recall and speeds up convergence, demonstrating that local medical code semantics bootstrap temporal modeling.
  • Cross-Institutional Transfer Learning: Features learned on large ambulatory care EHRs transfer remarkably well to distinct clinical environments. Pre-training on Sutter Health and fine-tuning on MIMIC-II boosted performance by over 10% compared to training directly on MIMIC-II from scratch.
  • Observation History vs. Predictability: Model recall increases noticeably as patient visit history lengthens. The authors note this reflects two phenomena: the RNN refines its internal state over time, and sicker patients visit more frequently, making their chronic trajectories more predictable.

Key Results

Evaluating on an 85/15 train/test split using differential-diagnosis style top-$k$ recall:

Task Metric Most Frequent Baseline Best MLP Baseline Doctor AI (RNN-2-IR)
Dx Only Recall@10 / Recall@30 56.6% / 71.7% 46.7% / 64.0% 64.3% / 79.6%
Rx Only Recall@10 / Recall@30 63.0% / 70.1% 47.6% / 70.9% 68.2% / 85.5%
Joint (Dx + Rx + Time) Recall@10 / Recall@30 48.1% / 66.0% 38.8% / 55.7% 55.0% / 72.5%
Visit Interval Prediction $R^2$ (log duration) — 0.122 0.253

On MIMIC-II transfer experiments, initializing weights from the Sutter-trained network improved Recall@30 by >10 percentage points relative to training purely on MIMIC-II.

Limitations and Future Work

  • Visit Timing Remains Hard to Predict: The model achieved an $R^2 \approx 0.25$ for time interval forecasting. Clinical visits are heavily influenced by unobserved non-clinical variables (socioeconomic status, transport, personal schedules) absent from standard EHR records.
  • Mimicking Average vs. Optimal Care: Doctor AI learns to replicate average physician behavior observed in historical charts, meaning it inherits human diagnostic biases, variations, and potential errors rather than identifying "best-practice" interventions.
  • Asymmetric Prediction Costs: A standard multi-label cross-entropy loss treats all false positives and false negatives equally, whereas in clinical settings, missing a critical, emergent diagnosis carries far greater risk than suggesting an extra diagnostic workup.

Summary updated

BibTeX
@inproceedings{choi2016doctor,
  author = {Edward Choi and Mohammad Taha Bahadori and Andy Schuetz and Walter F. Stewart and Jimeng Sun},
  title = {{Doctor AI: Predicting Clinical Events via Recurrent Neural Networks}},
  booktitle = {MLHC},
  year = {2016},
  url = {https://openreview.net/forum?id=Hq7Zxn7cLs},
}
Figure