TL;DR
This paper introduces MedOdyssey, the first specialized medical domain benchmark designed to evaluate Large Language Models (LLMs) on long-context capabilities up to 200K tokens. Comprising 10 distinct datasets, MedOdyssey reveals that while state-of-the-art models like GPT-4o excel at simple information retrieval in long texts, they still severely struggle with complex medical reasoning and structured data processing over extended contexts.
What Problem Does This Paper Address?
While commercial LLMs now boast massive context windows (ranging from 128K to over 200K tokens), evaluating their performance on long documents has primarily been confined to generic domains (e.g., summarizing books or retrieving trivia). The medical domain frequently requires processing massive volumes of text—such as extensive Electronic Health Records (EHRs), multi-page clinical guidelines, and dense medical textbooks.
Evaluating medical long-context capability introduces unique challenges:
- Domain Expertise: Standard "needle in a haystack" (NIAH) tests only measure simple retrieval, not professional medical reasoning.
- Data Contamination: Models might have already memorized medical textbooks during pre-training, leading to artificially high evaluation scores.
- Evaluation Fairness: Different models use different tokenizers. A 128K token limit might mean one model reads significantly more actual text characters than another, making direct comparisons unfair.
Methods
To tackle these challenges, the authors introduced three core design principles into MedOdyssey:
- Maximum Identical Context (MIC): To ensure a level playing field, the authors analyzed the token-to-character conversion ratios of various LLMs over time. They developed a optimization formula to ensure that all models observe the exact same character-level context text, regardless of their underlying tokenizer.
- Novel Facts Injection (NFI): To prevent models from relying on pre-trained memory, the authors manually crafted "needles" using brand-new medical literature (from The Lancet) and fictional, counter-intuitive facts (e.g., plot points from the recent video game Honkai: Star Rail).
- Counter-intuitive Reasoning (CIR): Instead of asking simple lookup questions, tasks were structured to demand logical processing. For instance, in Knowledge Graph tasks, models must retrieve all connecting triplets that answer a prompt rather than just a single entity.
Datasets
MedOdyssey features 10 complex datasets split across two primary categories, spanning seven context lengths (4K, 8K, 16K, 32K, 64K, 128K, and 200K tokens) in both English (En) and Chinese (Zh):
- Needle in a Haystack (NIAH) & Counting: Naive retrieval and sequential tracking tasks embedded within medical texts (using the Compendium of Materia Medica and NCCN Guides as the "haystack").
- Medical-Related Applications:
- KG QA: Triplet-based relation extraction using UMLS2023ab and CMeKG2.0.
- Term Norm: Medical terminology normalization.
- Table QA: Answering questions based on complex markdown medical tables from the MSD manual.
- Case QA: Clinical reasoning based on real patient EHRs from the iiyi medical forum.
Key Insights and Ideas
- Not a "Hexagonal Warrior": Even the most advanced models, like GPT-4o, are highly asymmetric. They achieve near-perfect scores on naive retrieval (NIAH) but falter significantly when forced to perform structured reasoning or multi-step counting over long contexts.
- The Tokenizer Fairness Trap: The authors demonstrated that token-to-character ratios are steadily decreasing for newer models. Without adjustments like the MIC principle, long-context benchmarks risk evaluating tokenizer efficiency rather than actual context comprehension.
- Contextual Interference: An interesting error analysis revealed that LLMs are actually more likely to make mistakes when retrieving general, non-medical "needles" hidden inside medical text than domain-specific medical needles (with an error ratio of 6:5). The dense medical jargon acts as a stronger distractor for generic information.
Key Results
The authors evaluated several proprietary models (GPT-4, GPT-4o, Claude 3) and open-source models (ChatGLM3, InternLM2, Yi, Yarn-Mistral).
- Proprietary Dominance: GPT-4o was the top performer overall, achieving an F1-score of 72.81 on English Knowledge Graph QA and 76.00 accuracy on Chinese Case QA. However, its performance steadily degraded as the context length scaled up toward 128K.
- Open-Source Struggles: Most open-source models scored close to zero on complex tasks. The primary failure mode wasn't necessarily a lack of medical knowledge, but an inability to maintain JSON formatting constraints when processing long text inputs.
Limitations and Future Work
The authors acknowledge a few key limitations:
- Length vs. Consistency Trade-off: By enforcing the MIC principle to ensure all models saw the same text, they had to cap evaluations at the lowest common denominator length, sacrificing the ability to test the absolute maximum limits of certain models.
- Lack of Open-Ended Evaluation: The benchmark relies heavily on closed-ended, text-based questions to ensure automated evaluation accuracy. Developing reliable metrics for open-ended medical long-context QA remains an open challenge.
Summary updated