TL;DR
This paper investigates why fine-tuning Large Language Models (LLMs) for medical expertise often degrades their ability to understand long contexts. They propose that a balanced fine-tuning approach, incorporating both general and medical data, is crucial for maintaining strong long-contextual understanding while preserving domain-specific knowledge.
What Problem Does This Paper Address?
LLMs have shown remarkable success in various professional fields, including medicine, by fine-tuning them on domain-specific data. This process significantly enhances their knowledge and question-answering capabilities, enabling them to assist with tasks like clinical decision-making. However, the authors observed a concerning trend: while medical LLMs become adept at specialized medical tasks, their ability to process and understand long, complex texts (long-context understanding) often declines, sometimes drastically, compared to general-purpose LLMs. This is problematic because real-world medical scenarios, like patient consultations, often involve lengthy dialogues and require understanding a history of symptoms and information. The paper aims to understand this trade-off and find a way to optimize medical LLMs for both deep domain expertise and robust long-contextual understanding.
Methods
The researchers designed a series of experiments to evaluate LLMs' long-contextual understanding and instruction-following abilities. They used an "open-book" professional knowledge exam format. In this setup, the model is given a question along with the relevant text needed to answer it, and it must select the correct option based solely on the provided information.
Their methodology involved:
- Baseline Evaluation: Testing both general LLMs and existing medical LLMs on this open-book exam.
- Fine-tuning with General Data: Taking medical LLMs and further fine-tuning them on general-purpose data to see if this improves their long-context understanding.
- Fine-tuning with Mixed Data: Experimenting with different ratios of general data to medical data during fine-tuning to find an optimal balance. They also explored the impact of data quantity.
Datasets
The paper utilized a combination of datasets for fine-tuning and evaluation:
- Evaluation Dataset: A collection of Chinese medical exams, including physician, nursing, pharmacist, medical technology, professional knowledge, and medical postgraduate exams. These were used in an open-book format.
- Fine-tuning Datasets:
- Publicly available Alpaca Chinese dataset.
- A large collection of Chinese and Western medicine datasets (both Q&A and book data).
- Private datasets including cleaned open-source data, forum Q&A, and data from collaborating hospitals.
- For specific experiments, they used Qwen1.5 models and varied the proportion and quantity of general and medical data.
Key Insights and Ideas
- The "Trade-off" Phenomenon: There appears to be an inherent trade-off between a medical LLM's specialized domain knowledge and its general long-contextual understanding ability. Over-specialization can lead to a decline in the latter.
- General Data is Crucial for Context: Fine-tuning medical LLMs with general-purpose data can significantly improve their long-context understanding capabilities. This suggests that general data provides a broader linguistic foundation.
- Data Ratio Matters: The proportion of general data to medical data during fine-tuning is critical. A higher ratio of general data generally leads to better performance on long-context tasks.
- Data Saturation: While increasing the amount of training data generally improves performance, there's a point of "data saturation" where further increases yield diminishing returns. Blindly increasing data volume isn't always the solution.
- Medical LLMs Lag Behind General LLMs in Context: Even highly capable medical LLMs struggle with long-context understanding compared to general LLMs, highlighting the need for targeted improvements.
Key Results
- General LLMs: Achieved an average accuracy of over 50% on the open-book medical exams, demonstrating good contextual understanding.
- Medical LLMs (Baseline): Showed varied performance, with some models like HuatuoGPT-II, despite strong medical abilities, achieving very low accuracy (e.g., 4.37%) on the long-context exam.
- Fine-tuning with General Data: Improved the performance of medical LLMs. For instance, HuatuoGPT-II saw a significant improvement, indicating that general data can compensate for its specialized focus.
- Fine-tuning with Mixed Data (Qwen1.5): The study found that as the proportion of general data increased in the fine-tuning mix, the model's performance on the open-book exam improved. For example, Qwen1.5-14B achieved 68.81% accuracy with a 9:1 ratio of general to medical data, compared to 64.85% with a 1:9 ratio.
- Data Quantity Impact: For the Qwen1.5-7B model, in the early stages of limited data size, changes in data volume had a significant impact. As data volume increased, performance showed a steady upward trend, but eventually plateaued.
Limitations and Future Work
- Trade-off Acknowledged: The authors explicitly acknowledge the trade-off between domain expertise and long-contextual understanding, suggesting that achieving a perfect balance is challenging.
- Data Saturation: The concept of a "data saturation point" implies that simply adding more data isn't a guaranteed path to better performance, and optimal data strategies are needed.
- Future Work: The paper strongly suggests that retaining a certain proportion of general data during the fine-tuning of professional models is crucial for maintaining comprehensive language understanding. Future work could focus on developing more sophisticated data mixing strategies and exploring techniques to mitigate the performance degradation in long-context understanding without sacrificing domain expertise. The authors also imply that further investigation into the "data saturation point" and how to effectively manage data volume is warranted.
Summary updated