Clear Sky Science · en
SynthEHR-eviction: enhancing eviction SDoH detection with LLM-augmented synthetic EHR data
Why housing troubles belong in medical records
Being pushed out of one’s home can devastate health, yet most medical systems barely notice when it happens. This article describes a new way to teach artificial intelligence to spot signs of eviction and related social struggles inside doctors’ notes. By turning a small amount of expert work into a large, realistic training set, the approach could help health systems find people at risk earlier and connect them with housing and social support.
When a lost home harms health
Eviction does more than change an address. It is tied to homelessness, unemployment, depression, and even higher death rates, with especially heavy impacts on marginalized groups and during crises such as the COVID-19 pandemic. Yet in today’s electronic health records, information about housing loss or threats of eviction usually appears only in free‑text notes, not in standard checkboxes or codes. That makes it hard for hospitals, researchers, and policymakers to see where eviction is happening, who is most affected, and when to intervene.
Building realistic “synthetic” patient stories
Because real medical notes that clearly mention eviction are rare and sensitive, the authors created a pipeline called SynthEHR‑Eviction to generate realistic but fully synthetic examples. They started from social‑history sections of real hospital discharge notes and used large language models—AI systems trained on massive text collections—to rewrite them so that each note reflected a specific housing or social situation. Experts carefully defined 14 categories, including detailed eviction stages such as “pending,” “mutual agreement to end a lease,” and “past vs. current eviction,” as well as related issues like homelessness, food insecurity, and trouble paying bills. Through an iterative human‑in‑the‑loop process, clinicians reviewed sample outputs, flagged mistakes, and fed structured feedback back into the prompting process until each AI “augmenter” produced highly accurate notes with minimal ambiguity. The result was a large public dataset containing 8,000 synthetic training notes plus over 600 carefully labeled test notes that mix synthetic cases with de‑identified real examples drawn from major research databases.

Teaching computers to read between the lines
On top of these synthetic stories, the team built an automated annotation system that not only assigns a category but also produces a step‑by‑step explanation of its reasoning. Using a framework called DSPy, they optimized prompts so that the AI first decides whether a note is about eviction at all, then routes it either to a detailed eviction classifier or to a classifier for other social risks like transportation or food insecurity. This design mirrors how a human reader might first ask “Is eviction mentioned?” and only then sort the case into more specific buckets. To cut manual labor, the researchers compared full human rewriting and labeling of 8,000 notes—over 260 hours of work—with their AI‑assisted workflow, which achieved comparable data quality with under six hours of expert time, an 80‑percent reduction.
How well the models perform
Armed with SynthEHR‑Eviction, the authors then fine‑tuned a range of open‑source language models and compared them with commercial systems and older biomedical models. For the simple task of deciding whether eviction was mentioned at all, many models performed well, but fine‑tuned large language models and a tuned GPT‑4 variant reached the highest scores. The tougher test was to distinguish among seven nuanced eviction statuses and a separate set of non‑eviction social risks across three datasets: synthetic notes, real hospital notes, and long academic case reports. Here, fine‑tuned open models such as Qwen2.5 and LLaMA‑3 matched or slightly exceeded the performance of optimized GPT‑4, achieving macro‑F1 scores—an overall balance of precision and recall—around 0.89 for eviction and over 0.90 for other social risks. Smaller models with only three billion parameters also performed strongly once fine‑tuned, suggesting that capable yet affordable systems can be deployed in settings with limited computing power.

Why reasoning traces and real data still matter
The study reveals that explanations help some models more than others. When training data included short, explicit reasoning about why a note signaled a certain eviction status, smaller models improved noticeably, while the largest models changed little, implying they already encoded much of this logic. These reasoning traces also make model decisions easier for experts to review, though the authors caution that explanations are not always perfectly faithful to how the model truly decides. Another key finding is that models trained only on synthetic notes stumble when faced with messy real‑world writing. Simply mixing in a modest share of real hospital or case‑report notes sharply improved performance on those domains, underscoring that synthetic data is powerful but not sufficient on its own.
From hidden risk to visible help
Overall, the article shows that carefully crafted synthetic data, combined with targeted expert oversight, can turn scattered mentions of eviction and other hardships into structured signals that computers can detect at scale. In plain terms, the system learns to read between the lines of doctors’ notes and flag when a patient is facing or has faced housing loss or related social strains. If integrated into electronic health records, such tools could help clinicians and social workers spot people at risk earlier and connect them with housing aid, financial counseling, or transportation support. By making the invisible social side of illness more visible, SynthEHR‑Eviction offers a path toward health care that sees and responds to the full circumstances of patients’ lives.
Citation: Yao, Z., Zhao, Y., Mitra, A. et al. SynthEHR-eviction: enhancing eviction SDoH detection with LLM-augmented synthetic EHR data. npj Digit. Med. 9, 292 (2026). https://doi.org/10.1038/s41746-026-02473-0
Keywords: eviction, social determinants of health, electronic health records, synthetic data, clinical natural language processing