SynthEHR-Eviction: Enhancing Eviction SDoH Detection with LLM-Augmented Synthetic EHR Data

Zonghai Yao, Youxia Zhao, Avijit Mitra, David A. Levy, Emily Druhl, Jack Tsai, Hong Yu

TL;DR

Eviction is a critical social determinant of health (SDoH), but it is rarely captured in structured electronic health record (EHR) data. This paper introduces SynthEHR-Eviction, a human-in-the-loop pipeline that combines LLMs and automated prompt optimization to generate and annotate a fine-grained eviction dataset. Fine-tuning smaller open-source LLMs on this synthetic data yields state-of-the-art performance—matching or beating GPT-4o—while slashing human annotation costs by over 80%.

What Problem Does This Paper Address?

Social Determinants of Health (SDoH)—such as housing instability, food insecurity, and financial strain—contribute to as much as 80%–90% of patient health outcomes. Despite its profound impact, SDoH information is usually buried within unstructured free-text clinical notes rather than structured fields (like ICD-10 codes).

Eviction is a particularly high-impact SDoH category that triggers a cascade of adverse outcomes, including homelessness and mental health crises. However, it is incredibly sparse in standard EHR datasets, appearing in fewer than 1 in 1,000 records. Building machine learning models to extract eviction status faces a severe "cold-start" problem due to this data scarcity and the prohibitive cost of expert manual text annotation.

Methods

The authors propose SynthEHR-Eviction, a scalable pipeline designed to generate high-fidelity, eviction-labeled clinical notes aligned with real-world documentation practices. The pipeline consists of three core components:

  1. LLM-Based Data Augmentation: Label-specific LLM augmenters take raw clinical notes (from the MIMIC database) and rewrite them to reflect specific SDoH categories.
  2. Automated Prompt Optimization (APO): Utilizing the DSPy framework, the system automatically optimizes prompts to generate Chain-of-Thought (CoT) reasoning traces alongside fine-grained labels.
  3. Human-in-the-Loop (HITL) Validation: Clinical experts review the synthetic notes. If the generation accuracy drops below 90%, the feedback is fed back into the LLM to refine the prompts iteratively.

The classification task is structured as a three-step cascade:

  • Step 1: Binary classification (eviction vs. non-eviction).
  • Step 2: Eviction multi-class classification (7 fine-grained subcategories, including pending, hypothetical, current present, and mutual rescission history).
  • Step 3: Non-eviction multi-class classification (7 categories, including homelessness, food insecurity, and transportation insecurity).

Datasets

  • SynthEHR-Eviction Dataset: The primary output of the pipeline, containing 8,000 synthetic training and development instances balanced across 14 fine-grained SDoH categories.
  • Evaluation Test Sets: A diverse testbed of 616 expert-annotated instances spanning three distinct linguistic styles:
  • Synth: Purely synthetic clinical notes generated by the pipeline.
  • MIMIC-IV: Real-world clinical notes filtered and selectively rewritten by humans to introduce eviction scenarios.
  • PMC-Patients: Long, complex case reports from PubMed Central rewritten to include eviction contexts.

Key Insights and Ideas

  • Reasoning Helps Small Models Scale: Including explicit Chain-of-Thought reasoning traces in the training data significantly boosts the performance of smaller models. For instance, LLaMA-3.2-3B saw a +3.8 boost in Macro-F1 when trained with reasoning annotations. Conversely, larger models (7B/8B) showed stable performance regardless of reasoning annotations, indicating they already possess strong inherent reasoning capabilities.
Figure 1. Performance comparison of LLMs trained with and without reasoning annotations on the Eviction Multi-Class task.
  • The 30% Hybrid Rule for Generalization: Models trained purely on synthetic data struggle to generalize to complex, narrative clinical text (like PMC case reports). However, the authors discovered that replacing just 30% of the synthetic training data with real-world notes dramatically improves out-of-domain performance, boosting Qwen2.5-7B's Micro-F1 by +0.302 on PMC data.
  • Data Size Plateaus Early: Across both eviction and non-eviction tasks, model performance gains typically plateaued between 3,000 and 5,000 samples. Beyond 5,000 samples, several models exhibited signs of overfitting, proving that high-density synthetic data removes the need for massive datasets.
Figure 2. Impact of training set size on model performance across eviction and non-eviction classification tasks. Each subplot illustrates how model performance varies with different training set sizes (x-axis) across four classification scenarios: eviction (top two rows) and non-eviction (bottom two rows), evaluated using two metrics—Macro-F1 (first and third rows) and Micro-F1 (second and fourth rows). The y-axis represents the corresponding F1 score. Green vertical dashed lines indicate the training data size at which each model achieves its highest performance. Red solid and Red dashed horizontal lines denote the performance of GPT-4o-APO and GPT-4o-mini-APO, serving as a reference here.
  • Temporal Ambiguity is the Hardest Challenge: The most common classification errors stemmed from implicit timelines in clinical text. Models frequently struggled to differentiate between a completed historical eviction and an active, ongoing eviction crisis due to confusing contextual cues (e.g., a note mentioning a "history of housing instability" but referencing an eviction "two months ago").

Key Results

  • Massive Efficiency Gains: Full manual rewriting and annotation of 8,000 notes took over 266 hours. The SynthEHR-Eviction pipeline achieved comparable data quality with less than 6 hours of human effort—an over 80% reduction in annotation time.
  • Outperforming Closed-Source Giants: Fine-tuned open-source models trained on the dataset achieved outstanding results. Qwen2.5-7B achieved an average Macro-F1 score of 88.8% on eviction subcategories and 90.3% on other SDoH categories, outperforming GPT-4o-APO (87.8% / 87.3%) and vastly outperforming traditional biomedical encoders like BioBERT (60.7% / 68.3%).
  • Edge-Deployable Performance: Smaller 3B-scale models (LLaMA-3.2-3B, Qwen2.5-3B) performed highly competitively, achieving average Micro-F1 scores around 0.87, making them viable for resource-constrained clinical environments.

Limitations and Future Work

  • Distributional Bias: While grounded in real EHR patterns, synthetic data may still fail to capture the full sociolinguistic nuances and documentation variations present across different healthcare institutions.
  • Reasoning Fidelity: The authors noted that a model outputting a correct final label with a plausible-sounding explanation does not guarantee fidelity—sometimes the model arrived at the right label for the wrong reason.
  • Future Directions: The authors suggest exploring explicit temporal tagging or note timestamps to resolve timeline ambiguities. They also advocate for hybrid symbolic-neural architectures and model distillation to make these SDoH extraction tools more equitable and deployable at scale.

Summary updated

Abstract

Eviction is a significant yet understudied social determinants of health (SDoH), linked to housing instability, unemployment, and mental health. While eviction appears in unstructured electronic health records (EHRs), it is rarely coded in structured fields, limiting downstream applications. We introduce SynthEHR-Eviction, a scalable pipeline combining LLMs, human-in-the-loop annotation, and automated prompt optimization (APO) to extract eviction statuses from clinical notes. Using this pipeline, we created the largest public eviction-related SDoH dataset to date, comprising 14 fine-grained categories. Fine-tuned LLMs (e.g., Qwen2.5, LLaMA3) trained on SynthEHR-Eviction achieved Macro-F1 scores of 88.8% (eviction) and 90.3% (other SDoH) on human validated data, outperforming GPT-4o-APO (87.8%, 87.3%), GPT-4o-mini-APO (69.1%, 78.1%), and BioBERT (60.7%, 68.3%), while enabling cost-effective deployment across various model sizes. The pipeline reduces annotation effort by over 80%, accelerates dataset creation, enables scalable eviction detection, and generalizes to other information extraction tasks.
BibTeX
@inproceedings{yao2026synthehr,
  author = {Zonghai Yao and Youxia Zhao and Avijit Mitra and David A. Levy and Emily Druhl and Jack Tsai and Hong Yu},
  title = {{SynthEHR-Eviction: Enhancing Eviction SDoH Detection with LLM-Augmented Synthetic EHR Data}},
  booktitle = {Npj},
  year = {2026},
  doi = {10.1038/s41746-026-02473-0},
}
Figure