Abstract Recent advances in large language models (LLMs) have demonstrated exceptional performance in various natural language processing (NLP) tasks. However, their effective application in the medical domain is hampered by a lack of medical domain knowledge. In this study, we present SA-MDKIF, a scalable and adaptable framework that aims to inject medical knowledge into general-purpose LLMs through instruction tuning, thereby enabling adaptability for various downstream tasks. SA-MDKIF consists of two stages: skill training and skill adaptation. In the first stage, we define 12 basic medical skills and use AdaLoRA to train these skills based on uniformly formatted instructional datasets that we have constructed. In the next stage, we train the skill router using task-specific downstream data and use this router to integrate the acquired skills with LLMs during inference. Experimental results on 9 different medical tasks show that SA-MDKIF improves performance by 10-20% compared to the original LLMs. Notably, this improvement is particularly pronounced for unseen medical tasks, showing an improvement of up to 30%.
Introduction
Large Language Models (LLMs) like Llama 2 and GPT-4 have revolutionized natural language processing, yet their deployment in specialized fields remains challenging. In the medical domain, tasks such as ICD coding, medication recommendation, and readmission prediction require deep, nuanced domain knowledge that general-purpose pre-training often fails to capture.
Current approaches to bridge this gap typically involve continuous pre-training on medical corpora or task-specific fine-tuning. However, these methods face significant hurdles: continuous pre-training is computationally expensive and risks "catastrophic forgetting" of general reasoning abilities, while task-specific fine-tuning lacks the flexibility to generalize across the diverse landscape of clinical scenarios. To address these limitations, we propose the Scalable and Adaptable Medical Domain Knowledge Injection Framework (SA-MDKIF).
The SA-MDKIF Framework
SA-MDKIF is designed as a modular, two-stage system that decouples the acquisition of medical knowledge from its application to specific tasks. This modularity ensures that the model remains efficient and adaptable.
Stage I: Skill Training
In the first stage, we define 12 fundamental medical skills, including Question Answering, Named Entity Recognition (NER), Relation Extraction, and Medical Conversation. Rather than fine-tuning the entire model, we employ AdaLoRA (Adaptive Low-Rank Adaptation) to train small, incremental weight matrices for each skill. By keeping the base LLM frozen and only updating these parameter-efficient "skill modules," we preserve the model's core reasoning capabilities while injecting specialized knowledge.
Stage II: Skill Adaptation
The second stage focuses on applying these learned skills to downstream clinical tasks. Instead of relying on a single skill, SA-MDKIF utilizes a Skill Router. This router dynamically learns how to weight and fuse the 12 pre-trained skills to optimize performance for a given task. For instance, a complex task like ICD coding might require a combination of "Entity Attribute" and "Relation Extraction" skills.
For tasks with sufficient data, the router is optimized via standard gradient descent. In "few-shot" scenarios where data is scarce, the framework employs the Covariance Matrix Adaptation Evolution Strategy (CMA-ES) to find the optimal skill combination without extensive training data.
Experimental Evaluation
We evaluated SA-MDKIF using a variety of public medical datasets. For skill training, we utilized 12 datasets, including MedQuAD, USMLE, and UMLS. Evaluation was conducted across 9 downstream tasks, categorized into "Unseen Data" (new samples of known tasks like PubMedQA) and "Unseen Tasks" (entirely new clinical challenges like 30-day readmission prediction using the MIMIC-III database).
Key Results and Insights
The experimental results demonstrate the efficacy of the SA-MDKIF framework across several dimensions:
- Performance Gains: SA-MDKIF consistently improved performance by 10–20% over the base Llama 2-7B model across most tasks.
- Zero-Shot Generalization: The most striking improvements—up to 30%—were observed in "unseen tasks." This suggests that the framework enables the model to develop domain-specific reasoning that generalizes to novel clinical workflows it wasn't explicitly trained for.
- Parameter Efficiency: The framework achieved state-of-the-art results while tuning only approximately 8 million parameters, a fraction of the 7 billion parameters required for full fine-tuning.
- Clinical Robustness: On complex MIMIC-III tasks, SA-MDKIF outperformed established medical models like ClinicalBERT and MedM-PLM in both AUC and F1 scores.
Conclusion
SA-MDKIF provides a scalable and efficient pathway for adapting general-purpose LLMs to the medical domain. By treating medical knowledge as a library of functional skills that can be dynamically combined, the framework achieves superior performance with minimal computational overhead. Future work will explore automated skill discovery and the potential application of this architecture to other high-stakes fields like law or finance.
Summary updated