Abstract
Large Language Models (LLMs), although powerful in general domains, often perform poorly on domain-specific tasks such as medical question answering (QA). In addition, LLMs tend to function as "black-boxes", making it challenging to modify their behavior. To address the problem, our work employs a transparent process of retrieval augmented generation (RAG), aiming to improve LLM responses without the need for fine-tuning or retraining. Specifically, we propose a comprehensive retrieval strategy to extract medical facts from an external knowledge base, and then inject them into the LLM's query prompt. Focusing on medical QA, we evaluate the impact of different retrieval models and the number of facts on LLM performance using the MedQA-SMILE dataset. Notably, our retrieval-augmented Vicuna-7B model exhibited an accuracy improvement from 44.46% to 48.54%. This work underscores the potential of RAG to enhance LLM performance, offering a practical approach to mitigate the challenges posed by black-box LLMs.
Introduction
While Large Language Models (LLMs) like LLaMA and GPT-4 have demonstrated remarkable capabilities across general domains, their performance often falters in specialized fields such as medicine. Medical knowledge is not only vast but also subject to frequent updates, making it difficult for static pre-trained models to maintain accuracy. Furthermore, LLMs are frequently criticized for being "black boxes," where correcting specific factual errors or updating domain knowledge requires expensive retraining or fine-tuning.
Preliminary probing of models like Vicuna-7B reveals a significant disparity in knowledge: while the model achieves 42.1% accuracy on general-domain facts, its accuracy drops precipitously to just 9.6% in the medical domain. This gap leads to hallucinations or overly generalized responses in clinical scenarios. To bridge this gap, we introduce MKRAG (Medical Knowledge Retrieval Augmented Generation), a transparent, plug-and-play framework that enhances LLMs by injecting precise medical facts directly into the inference prompt.
Methodology: The MKRAG Framework
The MKRAG framework addresses the limitations of standard RAG, which often struggles with the noise inherent in long clinical questions and the ambiguity of medical terminology. We propose a "Broad-to-Refined" search strategy consisting of four distinct phases:
- Preparation (0th Phase): We utilize an external Disease Database containing 44,561 medical facts formatted as triplets (head, relation, tail). These facts are converted into vector embeddings to facilitate efficient retrieval.
- Broad Search (1st Phase): Unlike traditional RAG that searches using the question, MKRAG first embeds the answer candidates. It retrieves a broad set of facts ($F_I$) related to every possible answer choice, ensuring the model has context for all potential solutions.
- Refined Search (2nd Phase): The system then uses the specific clinical question to filter the initial fact set ($F_I$), selecting the top-$k$ facts ($F_R$) most relevant to the patient's specific symptoms and history.
- Input Augmentation (3rd Phase): These refined facts are prepended to the user's query, allowing the LLM to use its in-context learning capabilities to reason through the evidence and select the correct diagnosis or treatment.
Experimental Results
We evaluated the MKRAG framework using the Vicuna-7B model on the MedQA-USMLE dataset, which comprises multiple-choice questions from professional medical licensing exams. Our results demonstrate that the retrieval-augmented model significantly outperforms the vanilla version and several specialized baselines.
As shown in the results, MKRAG Vicuna achieved an accuracy of 48.54%, a substantial improvement over the vanilla Vicuna's 44.46%. Notably, this approach also outperformed specialized medical models such as BioBERT-large (36.7%) and SapBERT (37.2%), as well as graph-based methods like QA-GNN (38.0%).
Discussion and Analysis
A key finding of our study is the effectiveness of the "Answer-First" retrieval strategy. By retrieving facts for all candidates, the model is better equipped to distinguish between similar medical conditions that might share overlapping symptoms.
We also investigated the impact of different retrieval models. Interestingly, Contriever (a general-domain retriever) slightly outperformed SapBERT (a medical-specific model). This suggests that Contriever’s broader linguistic foundation may be more effective at mapping the diverse natural language descriptions found in clinical case studies to structured database facts. Furthermore, we observed a positive correlation between the number of facts injected and model accuracy, with performance scaling from 41.86% at 4 facts to 48.54% at 16 facts.
Conclusion
MKRAG provides a robust and transparent method for "editing" the behavior of black-box LLMs in the medical domain without the need for retraining. By leveraging a two-stage retrieval process, we can significantly improve the accuracy of general-purpose models on complex medical exams. Future work will explore the scalability of this approach to even larger knowledge bases and its applicability to other specialized domains such as law and engineering.
Summary updated