Constructing and Validating Memorisation Audits for EHR Foundation Models

Inigo Stibbe, Joshua Cesare Placidi, Padmanabhan Ramnarayan, Aldo A. FaisalML4H 2026 Poster 2026

TL;DR

When an AI model learns to predict a patient's medical future, how do we know if it's making a smart clinical guess or simply regurgitating a real patient's private record from its training data? This paper tests three privacy-auditing methods on GPT-2-style electronic health record (EHR) models and finds that while the models show weak, cohort-level memorisation of arbitrary "canary" labels, they do not reliably leak individual patient histories under the evaluated attacks.

What Problem Does This Paper Address?

Autoregressive EHR foundation models treat a patient's medical history—diagnoses, medications, lab results, and hospital visits—as a sequence of events, much like words in a sentence. Given the beginning of a patient's timeline, the model predicts what happens next.

This creates an obvious privacy worry: if you prompt the model with a partial medical history, could it spit back sensitive details it memorised during training? Even if names and dates are stripped out, a specific combination of clinical events can still uniquely identify someone.

The tricky part is separating memorisation from clinical generalisation. Medicine is full of predictable patterns—if a patient has certain symptoms and lab results, a good model should predict the standard diagnosis or medication, even for a patient it has never seen before. Standard accuracy or validation metrics can't tell these two apart, and aggregate numbers might hide privacy leaks affecting only a small handful of patients.

Methods

The authors trained matched GPT-2-style autoregressive models on longitudinal patient trajectories and evaluated them at three stages of training: Early (30k steps), Best validation loss (550k steps), and Late (730k steps, when the four-day training budget ran out). They probed for memorisation using three complementary tests:

  1. Sequence Reconstruction: Using 3,000 training and 3,000 held-out patients, the authors fed the model varying amounts of preceding context (ending at token 400) and asked it to greedily reconstruct tokens 401–500. Comparing training vs. held-out accuracy isolates whether the model is doing better on patients it has seen.
  2. Sensitive-Attribute Disclosure: Focusing on depression (chosen for its ~12% prevalence in the dataset), the authors took 300 training and 300 held-out patients with a depression diagnosis. They prompted the model with the shortest prefix that uniquely identified each patient's trajectory (without including the depression token itself) and sampled 20 continuations to see how often the model generated a depression diagnosis. They also ran a matched negative control on patients without depression.
  3. Canary Audit: Inspired by classic language-model privacy audits, the authors trained a separate, matched model where each patient was randomly assigned a binary "canary" label (A or B) appended right before the end of their trajectory. Because these labels are completely random, any ability to recover them above chance on training patients proves the model is memorising arbitrary, patient-specific associations rather than generalising from clinical patterns. They also trained a deliberately overfit "positive control" model on just 1,000 patients to verify the audit could catch strong memorisation.

Datasets

All models were trained and evaluated on MIMIC-IV v2.2, a large, de-identified electronic health record dataset comprising 228,508 patients. The patient histories were tokenised into event sequences using the ETHOS framework.

Key Insights and Ideas

  • Accuracy alone is a terrible privacy metric: In sequence reconstruction, giving the model more context improved its predictions for both training and held-out patients at nearly the same rate. A model getting the next medical event right doesn't mean it's leaking data; it mostly means it understands medicine.
  • Minimal-context prompts don't easily leak sensitive diagnoses: Even when prompted with a prefix that uniquely identifies a patient's trajectory, the model did not disclose depression any more often for training patients than for held-out patients.
  • Canaries expose subtle memorisation that clinical tests miss: Because clinical events are correlated, standard reconstruction tests struggle to separate memory from generalisation. Injecting random binary canaries cleanly bypasses this ambiguity, revealing weak, population-level memorisation that would otherwise be invisible.

Key Results

  • Sequence Reconstruction: Reconstruction accuracy climbed steadily with context length, but the gap between training and held-out patients remained tiny—only 0.6 to 0.7 percentage points at the best and late checkpoints with 320–400 context tokens.
Sequence reconstruction across training
  • Sensitive-Attribute Disclosure: Across all checkpoints, the difference in depression disclosure between training and held-out patients was small (+0.58, −0.47, and −1.45 percentage points), with all 95% confidence intervals including zero.
  • Canary Audit: On the full-scale model, training-patient canary recovery (AUROC) rose from 0.5124 (Early) to 0.5489 (Best) and 0.5484 (Late), while held-out recovery stayed right at chance (~0.50). The excess-tail statistic $\tau(0.1)$—measuring how many patients had their canary strongly favoured—rose from 0.0093 to 0.0360, pointing to weak cohort-level memorisation with few high-confidence examples. Meanwhile, the overfit 1,000-patient positive control hit 0.9999 AUROC on training patients (and 0.4995 on held-out), confirming the audit's sensitivity.

Limitations and Future Work

The authors note two main limitations:

  • Canary audits require retraining: Because the canary audit needs a separately trained model, it doesn't directly prove how much the original, canary-free base model memorised (though nearly identical training losses suggest canary insertion caused minimal disruption).
  • Short prompts may miss delayed disclosures: In the depression-disclosure test, the deliberately short, trajectory-unique prefixes lacked rich clinical context, and depression diagnoses often appear much later in a patient's history—potentially falling outside the 1,000-token generation window.

Looking ahead, the authors call for clinically grounded, inference-time audits that can detect patient-specific memorisation in existing models without needing to retrain them with canaries. They also suggest running longer training schedules and varying model capacity and dataset size to map out exactly when EHR foundation models cross from safe generalisation into risky memorisation.

Summary updated

BibTeX
@inproceedings{stibbe2026constructing,
  author = {Inigo Stibbe and Joshua Cesare Placidi and Padmanabhan Ramnarayan and Aldo A. Faisal},
  title = {{Constructing and Validating Memorisation Audits for EHR Foundation Models}},
  booktitle = {ML4H 2026 Poster},
  year = {2026},
  url = {https://openreview.net/forum?id=0XefalrHNO},
}
Figure