Abstract
Numerous medical systems powered by Large Language Models (LLMs) have achieved remarkable progress in diverse healthcare tasks. However, research on their medication safety remains limited due to the lack of real-world datasets, constrained by privacy and accessibility issues. Moreover, evaluation of LLMs in realistic clinical consultation settings, particularly regarding medication safety, is still underexplored. To address these gaps, we propose a framework that simulates and evaluates clinical consultations to systematically assess the medication safety capabilities of LLMs. Within this framework, we generate inquiry-diagnosis dialogues with embedded medication risks and construct a dedicated medication safety database, RxRisk DB, containing 6,725 contraindications, 28,781 drug interactions, and 14,906 indication-drug pairs. A two-stage filtering strategy ensures clinical realism and professional quality, resulting in the benchmark RxSafeBench with 2,443 high-quality consultation scenarios. We evaluate leading open-source and proprietary LLMs using structured multiple-choice questions that test their ability to recommend safe medications under simulated patient contexts. Results show that current LLMs struggle to integrate contraindication and interaction knowledge, especially when risks are implied rather than explicit. Our findings highlight key challenges in ensuring medication safety in LLM-based systems and provide insights into improving reliability through better prompting and task-specific tuning.
Introduction
While Large Language Models (LLMs) are increasingly being integrated into healthcare for tasks like diagnosis and documentation, their ability to ensure medication safety remains a critical blind spot. Most existing medical benchmarks test general knowledge but fail to simulate the "messy" reality of a clinical consultation where a patient might mention a pre-existing condition or a current medication in passing. Recommending a drug requires complex reasoning: matching a symptom to a cure while simultaneously checking for contraindications (reasons a patient shouldn't take a drug) and drug-drug interactions (harmful effects when two medications are combined).
Methodology and Framework
To bridge the gap between static medical knowledge and dynamic clinical reasoning, we developed a novel framework that automates the creation of high-quality medical safety benchmarks.
RxRisk DB Construction
We first built RxRisk DB, a massive structured database of over 35,000 entries sourced from authoritative medical sites. This database serves as the foundation for generating realistic risks, covering indications, contraindications, and drug-drug interactions.
Consultation Simulation and Risk Injection
Using LLMs, we generated realistic inquiry-diagnosis dialogues. We employed "department-specific" prompting (e.g., simulating a surgeon vs. an internist) to ensure the tone and focus were clinically plausible. During these simulations, we intentionally "injected" medication risks. For example, a patient might mention symptoms of an enlarged prostate, which serves as a contraindication for certain medications.
Two-Stage Filtering
To ensure professional quality, we applied a two-stage filtering strategy:
- Indication-Based Filtering and Sampling: Ensures the scenarios are comprehensive and balanced across medical departments.
- Automatic Scoring Mechanism: Uses a GPT-4-based scoring system to evaluate clinical realism, logical flow, and professional accuracy.
This process resulted in RxSafeBench, consisting of 2,443 high-quality consultation scenarios split between contraindication cases (1,063) and drug interaction cases (1,380).
Key Results and Insights
We evaluated several state-of-the-art models, including GPT-4, Llama-3.1, and DeepSeek-R1, using a multiple-choice format where models must choose the "safe" drug over unrelated or unsafe options.
- The Safety Gap: Even the top-performing model, DeepSeek-R1, achieved only 59.27% accuracy on contraindication tasks and 38.12% on drug interaction tasks. This indicates that even advanced models fail to identify safety risks a significant portion of the time.
- The "Implicit" Challenge: LLMs struggle significantly when risks are implied. If a patient describes a symptom rather than naming a condition, the model must perform multi-step logical leaps to identify the contraindication. Most models failed these complex reasoning paths.
- Interactions vs. Contraindications: Across all models, performance was consistently lower for drug-drug interactions than for patient-specific contraindications. Understanding the relationship between two different chemicals appears more complex for current architectures than matching a drug to a patient's health status.
- Open-Source Performance: Notably, the specialized open-source model DeepSeek-R1 outperformed proprietary giants like GPT-4 in these specific medical reasoning tasks, suggesting that model architecture and specialized tuning are critical for safety-sensitive domains.
Conclusion
The modest scores across all tested LLMs suggest that general-purpose models are not yet ready for autonomous clinical use without significant task-specific fine-tuning and rigorous auditing. RxSafeBench provides the first comprehensive benchmark for evaluating these risks, offering a path forward for developing safer, more trustworthy AI-driven clinical decision support systems.
Summary updated