Abstract
Identifying immunosuppressed patients using structured data can be challenging. Large language models effectively extract structured concepts from unstructured clinical text. Here we show that GPT-4o outperforms traditional approaches in identifying immunosuppressive conditions and medication use by processing hospital admission notes. We also demonstrate the extensibility of our approach in an external dataset. Cost-effective models like GPT-4o mini and Llama 3.1 also perform well, but not as well as GPT-4o.
Introduction
Accurately identifying immunosuppression is vital for clinical management, particularly in the context of severe infections like pneumonia. Traditionally, researchers have relied on "structured data" within Electronic Health Records (EHRs), such as ICD-9/10 billing codes and pharmacy records. However, this data is often "noisy" and lacks context; for instance, a code might indicate a condition being ruled out rather than a confirmed diagnosis. The true clinical picture is frequently documented in unstructured admission notes, which are rich in detail but difficult to analyze systematically. This study explores whether Large Language Models (LLMs) can bridge this gap by extracting structured insights directly from clinical narratives.
Methods and Datasets
The researchers compared a traditional rules-based approach against three LLMs: GPT-4o, GPT-4o mini, and Llama 3.1 (8B). The traditional approach utilized ICD codes and medication orders, testing various frequency thresholds to optimize baseline performance. In contrast, the LLM approach employed zero-shot prompting to extract specific clinical attributes. Crucially, the models were asked to provide a certainty degree and supporting evidence, facilitating a "chain-of-thought" reasoning process that allowed for auditing of the results.
The study utilized two primary datasets:
- SCRIPT Cohort (Internal): 827 admissions at Northwestern Memorial Hospital involving patients mechanically ventilated for suspected pneumonia, manually adjudicated by experts.
- MIMIC-III (External Validation): 200 admissions from a public database to test the generalizability of the LLM approach across different hospital systems and documentation styles.
Key Results
GPT-4o demonstrated superior accuracy across nearly every category compared to structured data. In the SCRIPT cohort, GPT-4o achieved near-perfect performance for several conditions, including an F1 score of 1.0 for HIV and 0.99 for acute leukemia, outperforming the best-tuned structured data baselines (0.90 and 0.93, respectively).
The advantage extended to medication extraction. For identifying specific immunosuppressive drugs like Azathioprine, GPT-4o achieved significantly higher performance than medication orders alone. Furthermore, the model's performance remained robust during external validation on the MIMIC-III dataset, maintaining F1 scores of 1.0 for several conditions and proving the method's generalizability.
Discussion
The study highlights several key advantages of using LLMs for clinical phenotyping. Unlike traditional codes, LLMs can handle the nuance of clinical language, distinguishing between a patient's history and a current evaluation. The requirement for models to provide supporting evidence revealed specific failure modes, such as misinterpreting certain treatments as definitive indicators of a condition (e.g., IVIG for immunoglobulin deficiency).
While GPT-4o was the top performer, the authors also evaluated the cost-performance tradeoff. GPT-4o mini and the open-source Llama 3.1 were slightly less accurate but significantly more cost-effective, making them viable options for resource-constrained environments. This framework offers a scalable way to automate the creation of large research cohorts, potentially replacing thousands of hours of manual chart review.
Summary updated