Abstract
As Large Language Models (LLMs) are increasingly integrated into clinical workflows, ensuring their adherence to medical ethics is paramount. This paper introduces MedSafetyBench, the first comprehensive benchmark designed to evaluate and improve the medical safety of LLMs. Our research reveals that many current medical-specific LLMs fail basic ethical tests, often inadvertently stripping away safety guardrails during the medical specialization process. We demonstrate that targeted fine-tuning on safety demonstrations can significantly reduce harmful outputs without sacrificing clinical accuracy.
Introduction
While general-purpose LLMs are equipped with safety filters to prevent the generation of harmful content (e.g., hate speech or instructions for illegal acts), these guardrails often fail to address the unique ethical complexities of the medical domain. A model might refuse to assist in a crime but willingly provide instructions on how a physician might falsify patient records to conceal a medical error.
Medical ethics—encompassing patient confidentiality, informed consent, and the duty to report incompetence—requires a specialized evaluation framework. This paper addresses the lack of formal definitions for "medical safety" in AI and provides a pathway for aligning models with professional standards like the American Medical Association (AMA) Principles of Medical Ethics.
Methodology
Defining Medical Safety
The researchers grounded their safety definitions in the nine core tenets of the AMA Principles of Medical Ethics. These principles provided a structured basis for identifying what constitutes a "harmful" medical request.
Dataset Development: MedSafetyBench
The study introduced MedSafetyBench, a dataset containing 1,800 unique harmful medical requests and their corresponding safe, ethical responses.
- MedSafety-Eval (900 prompts): Reserved for testing model safety.
- MedSafety-Improve (900 prompts): Used for safety-oriented fine-tuning.
To generate these prompts, the team utilized GPT-4 and Llama-2-7b-chat. For the latter, a Greedy Coordinate Gradient (GCG) jailbreaking algorithm was employed to bypass existing filters and produce diverse, high-quality adversarial medical requests.
Evaluation and Alignment
Models were evaluated using a harmfulness score ranging from 1 (total refusal) to 5 (full compliance with a harmful request). To improve safety, the authors used Low-Rank Adaptation (LoRA) to fine-tune models on safety demonstrations, teaching them to recognize and refuse unethical clinical requests.
Results and Key Insights
The "Specialization Tax"
A significant finding was the existence of a "specialization tax." In the process of fine-tuning base models on medical corpora to improve clinical knowledge, developers often inadvertently remove the safety alignment of the original base model. Consequently, many specialized medical LLMs (e.g., Medalpaca, Meditron) were found to be significantly less safe than their general-purpose counterparts.
Effectiveness of Fine-Tuning
Fine-tuning with MedSafetyBench led to dramatic improvements in safety. As shown in the evaluation metrics, harmfulness scores for several models dropped from over 3.0 (indicating partial compliance with harmful prompts) to near 1.0 (indicating full refusal).
Performance Preservation
Crucially, the alignment process did not degrade the models' clinical capabilities. The fine-tuned models maintained their performance on standard medical benchmarks such as MedQA and PubMedQA. This suggests that safety and clinical utility are not mutually exclusive; a model can be both a competent diagnostic aid and a staunch upholder of medical ethics.
Conclusion and Future Work
MedSafetyBench provides a vital tool for the development of responsible medical AI. While the current framework is based on U.S.-centric AMA principles, it establishes a methodology that can be adapted to different cultural and legal contexts. Future research will focus on specialty-specific alignment (e.g., emergency medicine vs. psychiatry), the integration of Reinforcement Learning from Human Feedback (RLHF) from expert clinicians, and the incorporation of international ethical standards to ensure global applicability.
Summary updated