TL;DR
This paper introduces HuatuoGPT-II, a novel one-stage domain adaptation method for large language models (LLMs) in the medical field. By unifying heterogeneous pre-training and fine-tuning data into a single format and employing a priority sampling strategy, HuatuoGPT-II achieves state-of-the-art performance on Chinese medical benchmarks, even surpassing proprietary models like GPT-4 in certain areas, particularly Traditional Chinese Medicine.
What Problem Does This Paper Address?
Adapting general-purpose LLMs to specialized domains like medicine is crucial for leveraging their capabilities in specific fields. Traditional domain adaptation typically involves a two-stage process: continued pre-training and supervised fine-tuning (SFT). However, this two-stage approach suffers from several drawbacks:
- Complexity: It requires meticulous tuning of hyperparameters for each stage, making the process intricate and time-consuming.
- Data Distribution Shifts: The transition between pre-training and SFT stages introduces shifts in data distribution and optimization objectives, which can lead to "catastrophic forgetting," where the model loses previously learned knowledge.
- Inefficiency: The sequential nature of the two stages can be less efficient in knowledge injection and can limit scalability.
The authors aim to simplify this process and mitigate its issues by proposing a more streamlined, one-stage domain adaptation protocol.
Methods
The core innovation of this paper lies in their one-stage domain adaptation protocol. This protocol unifies the traditional two-stage process into a single, more efficient stage. The key components are:
- Data Unification: Heterogeneous data from both pre-training (e.g., encyclopedias, books, literature) and SFT stages are transformed into a consistent, simple instruction-output pair format. This is achieved by using LLMs (like ChatGPT) to generate questions from raw medical text and then generate corresponding answers. This process aims to align the data with the SFT format, making it more digestible for the model.
- Priority Sampling Strategy: To effectively guide the learning process, a data priority sampling strategy is introduced. This strategy prioritizes learning domain-specific knowledge from pre-training data initially and then gradually shifts focus to downstream fine-tuning data. This approach is designed to prevent catastrophic forgetting and ensure a smoother learning curve. The sampling priority is controlled by a hyperparameter $\beta$, where higher values favor more sequential sampling.
Datasets
- Pre-training Corpus: 1.1TB of Chinese and English medical data, sourced from encyclopedias, books, academic literature, and web corpora. This includes general corpora like C4 and specialized corpora like PubMed. The collected data consists of 5,252,894 premium medical documents.
- Fine-Tuning Instructions: 142K real-world medical questions sourced from Huatuo-26M, with responses generated by GPT-4.
- Evaluation Datasets:
- Medical Benchmarks: MedQA, MedMCQA, CMB, CMExam (specifically their medical components).
- General Benchmarks: C-Eval, CMMLU (specifically their medical components).
- Chinese National Pharmacist Licensure Examination (2023): A novel benchmark used to assess the model's performance on recent, untouched exam data, mitigating concerns of test data leakage.
- USMLE (United States Medical Licensing Examination): Used to evaluate performance in an English-centric medical context.
- CMB-Clin: A dataset for evaluating clinical diagnostic capabilities.
Key Insights and Ideas
- Simplicity is Key: The one-stage adaptation protocol significantly simplifies the complex two-stage process, leading to improved training stability and domain generalization.
- Data Unification is Crucial: Transforming diverse data into a unified format is essential for effective domain adaptation, especially when dealing with varied languages and genres.
- Priority Sampling for Focused Learning: The priority sampling strategy effectively guides the model to first acquire foundational medical knowledge before focusing on instruction following, preventing knowledge loss.
- Chinese Medical Domain Strength: HuatuoGPT-II demonstrates exceptional performance in Chinese medical contexts, even outperforming powerful proprietary models like GPT-4, suggesting that specialized adaptation can yield superior results in specific domains.
- LLMs as Data Augmentors: LLMs like ChatGPT can be effectively used not just for generating responses but also for unifying and preparing diverse datasets for training, bridging gaps in language and format.
Key Results
- State-of-the-Art Performance: HuatuoGPT-II achieved state-of-the-art performance on multiple Chinese medical benchmarks, including the 2023 Chinese National Pharmacist Licensure Examination.
- Competitive with Proprietary Models: HuatuoGPT-II (7B and 13B variants) showed competitive performance against ChatGPT and GPT-4. In expert manual evaluations, HuatuoGPT-II had a 38% win rate and a 38% tie rate against GPT-4.
- Superiority in Traditional Chinese Medicine: The model showed particular strength in Traditional Chinese Medicine, leading in the TCM Pharmacy track of the licensure exam.
- Improved Training Stability: The one-stage protocol resulted in more stable training loss compared to the two-stage approach, which exhibited fluctuations.
- Cross-Domain Applicability: The one-stage protocol demonstrated effectiveness beyond the medical domain, showing improved performance on English medical and law datasets.
Limitations and Future Work
- Limitations:
- The paper acknowledges that while HuatuoGPT-II shows promising results, it should not be used to provide medical advice due to the inherent limitations of LLMs in generating plausible but potentially inaccurate information.
- The English-centric nature of the USMLE imposes constraints on HuatuoGPT-II, which is primarily designed for Chinese medical contexts.
- Future Work:
- The authors believe their one-stage adaptation protocol offers valuable insights and a methodological framework for future LLM domain adaptation tasks in various specialized areas and languages.
- Further exploration of the priority sampling hyperparameter $\beta$ could lead to more optimized training strategies.
- The ethical considerations of using LLMs in healthcare, particularly regarding accuracy and data privacy, are highlighted as ongoing concerns.
Summary updated