PMC-LLaMA: Further Finetuning LLaMA on Medical Papers

Chaoyi Wu, Xiaoman Zhang, Ya Zhang, Yanfeng Wang, Weidi Xie · OpenReview

Abstract

Large Language Models (LLMs) have showcased remarkable capabilities in natural language understanding in various domains. These models can usually behave well on daily dialog, or question answering scenarios, however, in areas that value precision, for example, in medical applications, they often exhibit unsatisfactory performance due to a lack of domain-specific knowledge. In this report, we introduce PMC-LLaMA, an open-source language model that is acquired by fine-tuning an open-source language model on a total of 4.8 million biomedical academic papers for further injecting medical knowledge, enhancing its capability in medical domain. Our preliminary evaluations are conducted on three biomedical QA datasets, including PubMedQA, MedMCQA, and USMLE, showing that the our model after finetuning, i.e., PMC-LLaMA, demonstrates better understanding of biomedical domain-specific concepts, thus achieving high performance on QA benchmarks. The model and codes, along with an online demo, are publicly available.

Introduction

While general-purpose Large Language Models (LLMs) like ChatGPT are impressive conversationalists, they often stumble in specialized fields like medicine where precision is a matter of life and death. These models frequently lack deep domain-specific knowledge, leading to "hallucinations"—outputs that sound authoritative but are factually incorrect or clinically dangerous.

Existing attempts to address this gap usually fall into two categories: small-scale models (like those based on BERT) that lack reasoning power, or massive closed-source models (like Med-PaLM 2) that are inaccessible to the broader research community. PMC-LLaMA aims to bridge this gap by creating a powerful, open-source foundation model that understands complex medical terminology and can provide well-justified clinical reasoning.

Methodology: A Two-Stage Adaptation

The researchers propose a systematic two-stage adaptation process to transform the base LLaMA model into a medical expert.

Stage I: Data-centric Knowledge Injection

Instead of just fine-tuning on a few examples, the researchers "injected" fundamental knowledge by training the model on a massive corpus called MedC-K. This dataset includes 4.8 million biomedical papers (from S2ORC/PubMed Central) and 30,000 medical textbooks, totaling approximately 79 billion tokens. To prevent "catastrophic forgetting"—where the model loses its general linguistic abilities—they employed a specific sampling ratio of 15:4:1 (Books : Papers : General Text) during training.

Stage II: Medical-specific Instruction Tuning

To transform this knowledgeable model into a functional assistant, it was fine-tuned on MedC-I, a new dataset containing 202 million tokens designed for alignment. This stage focused on three critical areas:

  • Conversational Dialogues: Teaching the model to interact with the professional tone and empathy of a physician.
  • Rationale QA: Using teacher models to generate step-by-step explanations for medical questions, teaching the model why an answer is correct rather than just memorizing the answer.
  • Knowledge Graphs: Leveraging the Unified Medical Language System (UMLS) to help the model understand the structured relationships between different medical entities.
The two-stage adaptation process: Stage I Knowledge Injection and Stage II Medical-specific Instruction Tuning.

Key Insights and Results

The evaluation of PMC-LLaMA focused on three major benchmarks: MedQA (USMLE-style questions), MedMCQA (mock exams), and PubMedQA (research-based questions).

Performance Efficiency

A key finding of this research is that a 13B parameter model, when fed high-quality domain data, can outperform a 175B parameter general model. PMC-LLaMA (13B) achieved an average score of 64.43% across the three benchmarks, significantly higher than ChatGPT’s 54.97% and LLaMA-2 70B’s 51.00%.

Comparison of PMC-LLaMA (13B) against ChatGPT (175B) and LLaMA-2 (70B) across medical QA benchmarks, highlighting the efficiency of domain-specific tuning.

The Role of Textbooks and Rationales

The authors observed that while academic papers provide cutting-edge information, textbooks are superior for building a model's "mental map" of fundamental medical concepts. Furthermore, training on rationales—the "Question -> Rationale -> Answer" flow—was essential. By learning the underlying logic, the model improved its ability to link internal knowledge to specific clinical cases, boosting accuracy on complex exams.

Discussion and Limitations

Despite its success, PMC-LLaMA has limitations. While it is a medical expert, its performance in general, non-medical conversation is lower than that of ChatGPT. Qualitatively, the model occasionally exhibits "clinical overestimation," suggesting more aggressive diagnostic procedures for minor symptoms where a human doctor might suggest a more conservative approach.

The authors emphasize that PMC-LLaMA is a research tool. It requires further safety alignment and clinical validation before it can be considered for real-world applications. Future work will focus on refining conversational nuance and strengthening safety guardrails.

Conclusion

PMC-LLaMA demonstrates that massive-scale knowledge injection combined with rationale-based instruction tuning can create highly capable, specialized models. By making this model open-source, the researchers provide a valuable foundation for the medical AI community to build upon, moving closer to accessible and precise clinical AI assistants.

Summary updated

BibTeX
@misc{wu2023pmc,
  author = {Chaoyi Wu and Xiaoman Zhang and Ya Zhang and Yanfeng Wang and Weidi Xie},
  title = {{PMC-LLaMA: Further Finetuning LLaMA on Medical Papers}},
  year = {2023},
  eprint = {2304.14454},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.14454},
}
Figure