Introduction
In modern clinical practice, physicians are increasingly overwhelmed by documentation. Between 2018 and 2019, the length of outpatient notes grew by over 60%, driven by templated data and redundant information. While Large Language Models (LLMs) offer a potential solution for navigating these "walls of text," existing medical benchmarks like MedQA or PubMedQA are insufficient. These benchmarks typically focus on short snippets or general medical knowledge rather than the "long-context" reality of clinical care—searching through thousands of words across shuffled discharge summaries, radiology reports, and lab results.
To address this gap, we introduce LongHealth, a rigorous evaluation framework designed to test LLMs against lengthy, realistic clinical documents. Our findings suggest that while top-tier models can retrieve specific facts, they struggle with multi-patient records and frequently hallucinate when information is missing.
Methods and Benchmark Design
The LongHealth benchmark consists of 20 fictional but medically authentic patient cases. Each case is a compilation of 2 to 15 discharge notes, totaling between 5,090 and 6,754 words. This structure simulates the complexity of real-world electronic health records (EHRs).
To evaluate model performance, we designed three distinct tasks:
- Information Retrieval: Locating a specific fact (e.g., a medication dose) within a single patient's shuffled records.
- Multi-Patient Distraction: Extracting information for a target patient when their records are interspersed with those of other patients.
- Identifying Missing Information: Determining if a model can correctly identify when required information is absent, rather than generating a hallucinated answer.
We evaluated 11 open-source models (including Mistral, Llama, and Yi variants) alongside OpenAI’s GPT-3.5 Turbo, ensuring all models supported a minimum context window of 16,000 tokens.
The LongHealth Dataset
The benchmark includes 400 multiple-choice questions based on 20 patient cases covering a wide array of diseases, such as Melanoma, Acute Myeloid Leukemia (AML), and Chronic Kidney Disease. Unlike traditional datasets that assess general medical knowledge, LongHealth specifically targets the ability to retrieve and synthesize information from long-form clinical documentation.
Key Insights and Results
Our evaluation revealed several critical challenges for LLMs in clinical settings:
The Hallucination Trap
Models are generally fine-tuned to be helpful, which can be detrimental in medicine. In Task 3 (missing information), models frequently hallucinated answers instead of admitting the information was missing. This failure of negation represents a significant safety concern for clinical deployment.
The Distraction Tax
Performance for most mid-sized models dropped significantly when records from multiple patients were mixed. This suggests that while a model may process a single file effectively, it struggles to maintain patient-specific boundaries within a larger, heterogeneous dataset.
Context Length vs. Accuracy
We observed a "lost in the middle" phenomenon: as prompt length increased from 4,000 to 16,000 tokens, several models showed a steady decline in accuracy. More context does not necessarily lead to better performance if the model cannot effectively prioritize information buried deep within the text.
Performance Comparison
- Top Performers: Mistral-Small-24B-Instruct-2501 and Llama-4-Scout-17B-16E-Instruct led the field. Mistral achieved 84% accuracy on single-patient retrieval and improved to 93% on multi-patient tasks.
- GPT-3.5 Gap: While GPT-3.5 Turbo performed reasonably on simple retrieval (67%), its accuracy plummeted to 27% when faced with distracting documents.
- Open-Source Dominance: Notably, top open-source models significantly outperformed proprietary models like GPT-3.5 Turbo in complex retrieval scenarios.
Limitations and Future Directions
While LongHealth provides a necessary step toward evaluating long-context clinical AI, it has limitations. The benchmark's 20 cases may not capture the full linguistic diversity of clinical notes. Furthermore, the multiple-choice format simplifies clinical queries, which are typically open-ended and require nuanced reasoning.
Future research should compare these long-context models against Retrieval-Augmented Generation (RAG) systems, which may handle multi-patient distractors more efficiently. Additionally, model-specific prompt engineering could improve the "I don't know" responses essential for clinical safety.
The benchmark and evaluation code are publicly available on GitHub to support the development of safe, effective clinical AI.
Summary updated