DoctorGLM: Fine-tuning your Chinese Doctor is not a Herculean Task

Honglin Xiong, Sheng Wang, Yitao Zhu, Zihao Zhao, Yuxiao Liu, Linlin Huang, Qian Wang, Dinggang ShenarXiv 2023 · DOI

Abstract

DoctorGLM is an open-source, bilingual (Chinese/English) large language model (LLM) specifically fine-tuned for the medical domain. By leveraging parameter-efficient tuning on the ChatGLM-6B architecture, the researchers demonstrated that a specialized healthcare assistant can be trained on a single A100 GPU in just 13 hours for less than $20. This work makes high-quality medical AI accessible to hospitals and researchers with limited budgets, overcoming traditional barriers of cost and language bias.

Introduction

While general-purpose LLMs like ChatGPT and GPT-4 have shown remarkable capabilities, their application in healthcare is hindered by two primary obstacles. First, language and domain bias: most frontier models are trained predominantly on English web data, leading to suboptimal performance in other languages like Chinese and a lack of clinical rigor. Second, the "Herculean" barrier to entry: the assumption that training custom LLMs requires massive supercomputing clusters and millions of dollars often prevents hospitals from utilizing sensitive in-house data for localized tools. DoctorGLM addresses these issues by proving that building a specialized Chinese medical AI is a feasible engineering project using modern optimization techniques.

Methodology

The DoctorGLM pipeline is designed for maximum efficiency and clinical grounding. The system utilizes ChatGLM-6B as its base model, a 6.2-billion-parameter model optimized for bilingual dialogue. To minimize computational overhead, the researchers employed Low-Rank Adaptation (LoRA), updating only 7 million parameters instead of the full 6 billion.

The overall architecture of DoctorGLM, including the Prompt Designer and LoRA-based fine-tuning process.

A key innovation is the Prompt Designer, which extracts keywords from user queries to fetch relevant information from a professional knowledge base (the Merck Manual). This grounding mechanism ensures the model's responses are informed by verified medical literature rather than just internal weights. Additionally, a knowledge distillation process was used where ChatGPT translated high-quality English medical datasets, which were then used to train a BART-based model for large-scale, low-cost translation of remaining data.

Datasets

The model was trained on a diverse collection of medical dialogues to ensure broad clinical coverage. This included the Chinese Medical Dialogue (CMD) dataset, MedDialog, and translated versions of ChatDoctor and HealthcareMagic.

Overview of the datasets used for training DoctorGLM, detailing department coverage, language, and scale.

The CMD dataset alone provided over 800k samples across various departments such as Pediatrics and Internal Medicine, while MedDialog contributed 3.4 million dialogues in both Chinese and English. The inclusion of translated English datasets provided a broader range of clinical scenarios.

Results and Key Insights

The most significant finding is the democratization of medical AI. Fine-tuning on 100,000 QA pairs cost approximately $18.75, shifting the narrative from AI being exclusive to tech giants to being accessible for any research hospital.

  • Training Efficiency: The model was fine-tuned on a single A100 (80G) in just 13 hours.
  • Deployment: Support for INT4 quantization allows the model to run on consumer-grade hardware like an NVIDIA RTX 3060 (12GB), making desktop-level clinical deployment possible.
  • Qualitative Performance: DoctorGLM provided more specific medical suggestions compared to the base ChatGLM, identifying potential conditions like intercostal neuralgia and suggesting specific diagnostic tests (e.g., EKG or MRI).

Limitations and Future Work

Despite its promise, DoctorGLM is an early-stage engineering attempt and not yet ready for clinical use. The researchers identified several limitations:

  • Factual Accuracy: The model occasionally misidentifies disease causes (e.g., G6PD deficiency).
  • Latency: Inference takes 15–50 seconds, which is slower than commercial APIs.
  • Technical Constraints: There are ongoing challenges with quantization bugs on older consumer GPUs when using LoRA-adapted versions.

Future work will focus on improving logical coherence and reducing factual errors through further community-driven refinement.

Summary updated

Abstract

The recent progress of large language models (LLMs), including ChatGPT and GPT-4, in comprehending and responding to human instructions has been remarkable. Nevertheless, these models typically perform better in English and have not been explicitly trained for the medical domain, resulting in suboptimal precision in diagnoses, drug recommendations, and other medical advice. Additionally, training and deploying a dialogue model is still believed to be impossible for hospitals, hindering the promotion of LLMs. To tackle these challenges, we have collected databases of medical dialogues in Chinese with ChatGPT's help and adopted several techniques to train an easy-deploy LLM. Remarkably, we were able to fine-tune the ChatGLM-6B on a single A100 80G in 13 hours, which means having a healthcare-purpose LLM can be very affordable. DoctorGLM is currently an early-stage engineering attempt and contain various mistakes. We are sharing it with the broader community to invite feedback and suggestions to improve its healthcare-focused capabilities: https://github.com/xionghonglin/DoctorGLM.
BibTeX
@misc{xiong2023doctorglm,
  author = {Honglin Xiong and Sheng Wang and Yitao Zhu and Zihao Zhao and Yuxiao Liu and Linlin Huang and Qian Wang and Dinggang Shen},
  title = {{DoctorGLM: Fine-tuning your Chinese Doctor is not a Herculean Task}},
  year = {2023},
  eprint = {2304.01097},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.01097},
}
Figure