TL;DR
Researchers have developed PretexEval, a novel framework that uses formal logic transformations to stress-test Large Language Models (LLMs) on medical knowledge. Their findings reveal a "consistency gap": while models excel at standard benchmarks, they often fail when the same medical fact is rephrased or presented in a clinical context, suggesting they haven't truly mastered the underlying knowledge.
The Problem: Memorization vs. Mastery
Large Language Models like GPT-4 and Llama 3 perform remarkably well on medical exams like the USMLE. However, researchers worry these scores are inflated by data leakage (models seeing test questions during training) and surface-level pattern matching (recognizing specific wordings rather than understanding medical facts).
Existing evaluation methods are either static, making them easy to memorize, or rely on LLMs to generate new questions. As illustrated below, direct generation often introduces factual errors (e.g., hallucinating wrong relationships) or lacks structural variety (e.g., only replacing synonyms). There is a critical need to verify if an LLM actually understands a medical relationship. For instance, if it knows that "Drug A treats Disease B," it should also comprehend that "Disease B is treated by Drug A" and that "It is false that Drug A cannot treat Disease B."
Methods: The PretexEval Framework
To address these shortcomings, the authors introduce PretexEval, a "predicate-to-text" evaluation framework. Instead of simply prompting an LLM for a question, it follows a rigorous three-step pipeline:
- Predicate Expression: A medical fact (triplet) from a knowledge base, such as
(Aspirin, may_treat, Headache), is converted into a formal logical predicate. - Predicate Transformation: The framework applies logical transformations to create variants of the same fact:
- Inversion: Reversing the relationship (e.g., "Headache may be treated by Aspirin").
- Instantiation: Placing the fact in a clinical scenario.
- Double Negation: Creating a logically equivalent negative statement.
- Prototype-based Text Generation: To ensure the final questions are both factually accurate and natural-sounding, the system uses human-verified templates to create "prototypes," which are then polished by an LLM for lexical diversity.
The researchers also introduce a stricter metric called Joint Accuracy: a model only "masters" a knowledge point if it answers all transformed variants correctly.
Datasets and Evaluation
The study evaluated 12 prominent LLMs (including GPT-4o, Llama 3, and medical-specific models like Med42) using two major knowledge bases:
- MedLAMA: A large-scale biomedical knowledge base with 19 types of relations (genes, tissues, diseases).
- DiseK: A clinical knowledge base focused on high-frequency diseases, symptoms, and treatments.
Key Insights and Results
- The Consistency Illusion: LLMs are surprisingly inconsistent. A model might correctly identify a treatment in a simple sentence but fail when the same fact is presented as a clinical "instantiation" or a "double negation."
- The Negation Hurdle: Models struggle significantly with double negation. Including these logical variants caused an average performance drop of about 5% compared to other transformations, highlighting a weakness in LLM logical reasoning within the medical domain.
- Performance Drop on Diverse Tests: When tested with PretexEval, models saw a relative performance degradation of up to 50% compared to simpler "Direct" template-based evaluations.
- Joint Accuracy Decay: As the number of variants per knowledge point increased from 1 to 8, the joint accuracy of even the best models (GPT-4o) plummeted from ~80% to ~50%. For weaker models, it dropped to near zero.
- Llama 3's Dominance: Among open-source models, the Llama 3 series showed significantly higher medical knowledge mastery than its predecessors and competitors, sometimes outperforming models 10x its size.
- Depth vs. Breadth: Medical-specific fine-tuning (e.g., ClinicalCamel, Med42) doesn't always improve "breadth" (average accuracy), but it significantly improves "depth" (joint accuracy), meaning these models are more robust when the phrasing changes.
Limitations and Future Work
The authors acknowledge that while PretexEval is excellent for factual mastery, it does not yet cover complex clinical reasoning, such as multi-step differential diagnosis. Additionally, while the LLM rephrasing step improves readability, it could theoretically introduce subtle linguistic ambiguities.
Future work aims to expand the framework to more complex medical tasks and explore how dynamic evaluation can be integrated into the training loop of future medical AI. In a pilot study, the authors found that fine-tuning a model on PretexEval-generated samples improved its performance on unseen medical expressions by ~20-30%, suggesting this framework can be used to effectively "harden" model knowledge.
Summary updated