TL;DR
Medical language models (LMs) can inadvertently memorize and leak sensitive patient data, but standard privacy metrics often misjudge this risk by conflating harmless boilerplate text with actual patient secrets. This paper introduces a clinically grounded evaluation framework that tests models against realistic levels of adversarial knowledge, revealing that routine encounter metadata (like billing info) can unlock extensive patient histories and sensitive diagnoses.
What Problem Does This Paper Address?
As language models are increasingly trained on specialized clinical notes to assist with tasks like medical coding and summarization, they bring along a massive compliance headache: the risk of leaking Protected Health Information (PHI).
Existing privacy evaluations fall short in two major ways. First, they typically use general-domain threat models, assuming an attacker either wants to extract arbitrary text or already possesses a snippet of a medical note. In reality, an adversary is more likely to have partial background information, like a patient's name and birthdate from a discarded billing slip. Second, clinical documentation is notoriously repetitive due to standard templates and "copy-forward" practices. Standard exact-match metrics treat all memorized text equally, which overstates privacy harms by counting harmless boilerplate formatting as a data breach, while completely missing semantic leaks where a model paraphrases a sensitive diagnosis.
Methods
The authors propose a black-box evaluation framework that probes clinical LMs along a graded axis of adversarial access (or "priors"), simulating what an attacker might actually know:
The framework evaluates privacy leakage across two distinct dimensions:
- Verbatim Memorization: Measuring exact token overlap ($\tau=30$-gram matches) but critically decomposing the text into templated documentation (via regex rules) versus clinically revealing text, and checking if the text is unique to a single patient ($K=1$) or shared across patients ($K>1$).
- Semantic Leakage: Evaluating whether the model discloses six highly sensitive diagnoses (depression, PTSD, anxiety, bipolar disorder, abortion, and HIV) through paraphrasing or indirect symptoms. This is evaluated using a secure instance of GPT-5 as an LLM judge.
To ensure the model is actually leaking memorized data rather than making educated demographic guesses (e.g., inferring an anxiety diagnosis based on age and sex), the authors implement a Matched Evaluation Cohort Design using Propensity Score Matching to compare trained versus non-trained patient profiles.
Datasets
The framework was tested by continually pretraining a Qwen3.5-9B model on the American Family Cohort, a nationwide collection of primary care electronic health records. The dataset consists of:
- 378,035 clinical notes spanning 2019 to 2025.
- 26,948 patients across 192 small family-medicine practices.
- Approximately 1.0 billion tokens total.
Key Insights and Ideas
- Metadata is a Master Key: Attackers do not need clinical snippets to breach privacy. Routine encounter metadata (name, DOB, visit date, provider name, and location) acts as a highly effective prompt that triggers the model to surface longitudinal records.
- Standard Metrics Cry Wolf: Under the encounter metadata prior, 36% of memorized tokens are actually templates or boilerplate language (e.g., "Negative for chest pain, shortness of breath"). Audits that treat all memorization as equivalent conflate shared documentation artifacts with genuine patient-specific disclosure.
- Stitching Historical Timelines: When prompted with just a single encounter's metadata, the model doesn't just leak that specific visit; it stitches together verbatim text from an average of 2.81 distinct notes across the patient's historical timeline, driven largely by copy-forward documentation practices.
Key Results
- Verbatim Leakage Scales with Access: Verbatim memorization is low (4.8%) when the model is prompted with only public demographics, but skyrockets to 60.7% with basic Encounter Info, and reaches 85.6% when note fragments are provided.
- High-Accuracy Semantic Leakage: With access to routine encounter metadata, the model accurately recovers sensitive diagnoses, achieving an AUROC of 0.91 for abortion and 0.82 for HIV.
- Clear Training-Attributable Gap: The delta between the trained and non-trained cohorts confirms that this diagnostic leakage is a result of training-set memorization rather than population-level inference, peaking sharply at the Encounter Info tier.
- Section-Specific Vulnerabilities: Decomposing the notes shows that sections like the "Review of Systems" are highly memorized but almost entirely benign templates. Conversely, narrative sections like "History of Present Illness" (HPI) and "Past Medical History" (PMH) consist almost entirely of patient-specific, clinically revealing text.
Limitations and Future Work
- Identified vs. De-identified Data: This study evaluated models trained on fully identified clinical notes. While this allowed direct measurement of patient-specific leakage, real-world deployment pipelines often attempt de-identification first. Future work should extend this framework to de-identified corpora.
- Base Models vs. Alignment: The authors evaluated a base pretrained model. Deployed systems typically undergo post-training (alignment, RLHF), which might suppress verbatim text generation but could also make models more compliant with adversarial prompts.
- Scope: The empirical results are tied to a single model family (Qwen3.5-9B) and a single primary care dataset; leakage rates may vary based on model scale, training recipes, and data duplication levels.
Summary updated