Abstract
Recent studies have demonstrated promising performance of ChatGPT and GPT-4 on several medical domain tasks. However, few have assessed their performance using large-scale, real-world electronic health record (EHR) databases or evaluated their utility in providing diagnostic assistance across a full range of disease presentations. We performed two analyses using ChatGPT and GPT-4: one to identify patients with specific medical diagnoses using a real-world EHR database, and another to provide diagnostic assistance in the prospective evaluation of hypothetical patients. Our results show that GPT-4, utilizing chain-of-thought and few-shot prompting, can achieve F1 scores as high as 96% across disease classification tasks. In patient assessment scenarios, GPT-4 accurately diagnosed cases three out of four times. However, we also observed factually incorrect statements, overlooked medical findings, and recommendations for unnecessary investigations. These issues, coupled with privacy concerns, suggest these models are currently inadequate for unsupervised clinical use, though their scalability and minimal configuration requirements highlight significant potential for future healthcare applications.
Introduction
While Large Language Models (LLMs) have successfully passed medical licensing examinations, their utility in the practical, "in-the-trenches" environment of healthcare remains largely unproven. Most existing evaluations focus on generic benchmarks rather than the unstructured, often messy data found in real-world Electronic Health Records (EHRs). This study addresses two critical gaps in the literature: the ability of LLMs to identify specific patient cohorts within massive databases and their capacity to assist clinicians throughout the entire care pathway—from initial history-taking to management planning.
Methodology
The research compared the performance of ChatGPT (GPT-3.5-turbo) and GPT-4 against "classical" machine learning (ML) workflows. These traditional workflows typically involve Natural Language Processing (NLP) to extract features, followed by a classifier such as Random Forest. The evaluation was divided into two distinct analyses:
- Binary Classification: Models were tasked with identifying five specific diseases within EHRs: Chronic Obstructive Pulmonary Disease (COPD), Chronic Kidney Disease (CKD), Primary Biliary Cirrhosis (PBC), Herpes Simplex Virus (HSV), and Cancer Cachexia.
- Prospective Evaluation: The authors mapped an eight-step clinical care pathway and generated 400 unique questions based on 31 complex COPD-related case vignettes to test diagnostic and management reasoning.
A central component of the methodology was prompt engineering. The researchers compared "Baseline" (zero-shot) prompts against "Elaborate" prompts that incorporated Chain-of-Thought (CoT) reasoning and few-shot examples (providing the model with 2–3 example cases to guide its response).
Data Sources
The study utilized two primary datasets:
- MIMIC-III: A large, publicly available database of de-identified ICU records. A subset of 200–380 EHRs per disease was manually labeled by licensed physicians to create a "gold standard" for classification.
- Clinical Case Scenarios: A curated dataset of 31 unique scenarios (including COPD, asthma, and lung cancer) sourced from the BMJ, GOLD guidelines, and published case reports to evaluate diagnostic accuracy.
Key Insights
The Impact of Prompt Engineering
Moving from simple instructions to elaborate prompts (CoT + few-shot) boosted classification performance by up to 30%. This indicates that while LLMs possess vast medical knowledge, specific "nudging" is required to retrieve and apply that knowledge accurately in a clinical context.
The Context Window Constraint
Due to the limited "context window" of current LLMs, researchers could only input discharge summaries. Traditional ML models, which do not face this specific architectural limit, performed better on conditions like HSV where diagnostic clues are often buried in longitudinal nursing or physician notes rather than the final summary.
Interpretability vs. Hallucination
Unlike traditional ML, which uses mathematical tools like SHAP values for interpretability, LLMs provide natural language rationales. While these explanations are often scientifically sound, they are susceptible to "hallucinations"—instances where the model confidently asserts the presence of a symptom or lab result not actually found in the source text.
Results and Performance
GPT-4 emerged as the superior model, frequently matching or exceeding the performance of traditional ML pipelines. In the classification of COPD, GPT-4 achieved a 96% F1 score, and it reached 86.36% for the rare disease PBC. Across all tasks, GPT-4 consistently outperformed GPT-3.5 by an absolute margin of 10–18% in F1 scores.
In the prospective diagnostic evaluation, GPT-4 arrived at the correct diagnosis in 76% of cases (approximately 3 out of 4). Despite these high marks, the model exhibited a tendency to recommend "superfluous" investigations and occasionally overlooked pertinent medical information, which in a real-world setting could lead to overtreatment or delayed diagnosis.
Discussion and Limitations
Despite the impressive technical performance, several "deal-breakers" prevent immediate clinical adoption:
- Safety and Reliability: The fabrication of information (hallucination) is unacceptable in high-stakes medical environments.
- Data Privacy: The necessity of sending sensitive patient data to external servers (e.g., OpenAI) poses significant regulatory and ethical challenges. Local deployment of LLMs is likely a prerequisite for widespread use.
- Scalability vs. Precision: LLMs offer incredible speed of deployment compared to custom ML pipelines. However, they currently lack the fine-tuned "knobs" required to adjust precision and recall—a necessity in medicine where the cost of a false negative (missing a diagnosis) often outweighs the cost of a false positive.
In conclusion, while LLMs demonstrate significant potential as scalable clinical assistants, their current propensity for error and privacy limitations necessitate human oversight and further technical refinement before they can be integrated into routine clinical practice.
Summary updated