[论文解读] Fine-Tuning Medical Language Models for Enhanced Long-Contextual Understanding and Domain Expertise
本文研究了微调后的医学语言模型在长上下文理解与领域专业知识之间的权衡。通过调整微调过程中通用数据与医学数据的比例和数量,研究发现,通用数据比例越高,长上下文性能显著提升;而当医学问答对数量超过10万对时,性能出现饱和,表明通过战略性地组合数据可实现最优平衡。
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.
研究动机与目标
- 探究为何微调后的医学大模型在长上下文理解方面表现不如通用大模型。
- 确定微调过程中通用数据与医学数据的最优平衡,以同时保持领域专业知识与长上下文理解能力。
- 评估数据数量与构成对模型在开放书考试中表现的影响。
- 提供可提升医学大模型指令遵循与上下文推理能力的数据组合策略。
提出的方法
- 本研究使用开放书考试评估医学大模型,要求模型仅基于提供的上下文作答,以模拟长上下文推理能力。
- 采用涵盖医师、护理、药剂师及研究生水平的多样化中文医学考试作为评估基准。
- 微调使用公开可用的中文Alpaca数据与自建的中西医问答数据集组合。
- 系统性地调整通用数据与医学数据的比例,以评估其对长上下文性能的影响。
- 在数据量分析中,Qwen1.5-7B模型在10,000至200,000对医学问答对的数据集上进行微调,其中中医与西医数据各占50%。
- 通过多项选择考试的平均准确率衡量性能,并分析数据比例与数据量影响的趋势。
实验结果
研究问题
- RQ1微调过程中通用数据与医学数据的比例如何影响医学大模型的长上下文理解能力?
- RQ2数据量对医学大模型的上下文推理与指令遵循性能有何影响?
- RQ3仅使用医学数据进行微调是否会导致长上下文理解能力相比混合数据训练模型出现退化?
- RQ4医学大模型的性能在何种数据量下开始趋于平稳,表明数据饱和?
- RQ5是否可通过平衡的数据组合策略,在保持领域专业知识的同时恢复长上下文能力?
主要发现
- 在所有评估模型中,微调过程中通用数据比例越高,长上下文理解与指令遵循性能均持续提升。
- 当使用100,000对医学问答对进行微调时,Qwen1.5-7B模型在开放书考试中达到58.71%的峰值准确率,优于更小或更大的数据量。
- 在200,000对问答对时性能下降至56.12%,表明性能在最优阈值后出现数据饱和。
- 在数据量有限(如10,000–20,000对)时,模型性能波动显著,凸显早期微调对数据量的敏感性。
- 研究证实,仅在医学数据上微调的医学大模型会因长上下文理解能力下降,而通过引入通用领域数据可有效缓解此问题。
- 平衡的数据组合策略——特别是保持一定比例的通用数据——可显著提升上下文推理能力,且不损害领域特定准确率。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。