Skip to main content
QUICK REVIEW

[Paper Review] Fine-Tuning Medical Language Models for Enhanced Long-Contextual Understanding and Domain Expertise

Qimin Yang, Rongsheng Wang|arXiv (Cornell University)|Jul 16, 2024
Topic ModelingComputer Science3 citations
TL;DR

This paper investigates the trade-off between long-context understanding and domain-specific expertise in fine-tuned medical language models. By adjusting the ratio and quantity of general versus medical data during fine-tuning, the study finds that higher proportions of general data significantly improve long-context performance, while data saturation occurs beyond 100k medical Q&A pairs, suggesting optimal balance is achievable through strategic data composition.

ABSTRACT

Large Language Models (LLMs) have been widely applied in various professional fields. By fine-tuning the models using domain specific question and answer datasets, the professional domain knowledge and Q\&A abilities of these models have significantly improved, for example, medical professional LLMs that use fine-tuning of doctor-patient Q\&A data exhibit extraordinary disease diagnostic abilities. However, we observed that despite improvements in specific domain knowledge, the performance of medical LLM in long-context understanding has significantly declined, especially compared to general language models with similar parameters. The purpose of this study is to investigate the phenomenon of reduced performance in understanding long-context in medical LLM. We designed a series of experiments to conduct open-book professional knowledge exams on all models to evaluate their ability to read long-context. By adjusting the proportion and quantity of general data and medical data in the process of fine-tuning, we can determine the best data composition to optimize the professional model and achieve a balance between long-context performance and specific domain knowledge.

Motivation & Objective

  • To investigate why fine-tuned medical LLMs underperform in long-context understanding compared to general LLMs.
  • To identify the optimal balance between general and medical data in fine-tuning to preserve both domain expertise and long-context comprehension.
  • To evaluate the impact of data quantity and composition on model performance in open-book medical exams.
  • To provide data composition strategies that enhance instruction-following and contextual reasoning in medical LLMs.

Proposed method

  • The study evaluates medical LLMs using open-book exams that require models to answer based solely on provided context, simulating long-context reasoning.
  • A diverse set of Chinese medical exams—covering physician, nursing, pharmacist, and postgraduate levels—were used as evaluation benchmarks.
  • Fine-tuning was performed using a mix of publicly available Alpaca Chinese data and custom-curated Chinese and Western medicine Q&A datasets.
  • The ratio of general to medical data was systematically varied to assess its impact on long-context performance.
  • For data quantity analysis, the Qwen1.5-7B model was fine-tuned on medical datasets ranging from 10k to 200k Q&A pairs, with a 1:1 split between traditional and Western medicine.
  • Performance was measured via average accuracy across multiple-choice exams, with results analyzed for trends in data ratio and volume effects.

Experimental results

Research questions

  • RQ1How does the ratio of general to medical data during fine-tuning affect long-context understanding in medical LLMs?
  • RQ2What is the impact of data quantity on the contextual reasoning and instruction-following performance of medical LLMs?
  • RQ3Does fine-tuning with only medical data lead to degradation in long-context comprehension compared to models trained with mixed data?
  • RQ4At what data volume does performance improvement in medical LLMs begin to plateau, indicating data saturation?
  • RQ5Can a balanced data composition strategy preserve domain expertise while restoring long-context capabilities?

Key findings

  • Higher proportions of general data during fine-tuning consistently improved long-context understanding and instruction-following performance across all evaluated models.
  • The Qwen1.5-7B model achieved a peak accuracy of 58.71% on open-book exams when fine-tuned with 100k medical Q&A pairs, outperforming smaller and larger data volumes.
  • Performance degradation was observed at 200k Q&A pairs (56.12%), indicating data saturation beyond optimal thresholds.
  • With limited data (e.g., 10k–20k pairs), model performance fluctuated significantly, highlighting the sensitivity of early-stage fine-tuning to data volume.
  • The study confirms that medical LLMs fine-tuned exclusively on medical data suffer from reduced long-context comprehension, which can be mitigated by incorporating general-domain data.
  • A balanced data composition strategy—particularly maintaining a non-negligible share of general data—significantly enhances contextual reasoning without sacrificing domain-specific accuracy.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.