TL;DR
This paper introduces VersaTune, a novel framework for training Large Language Models (LLMs) to excel across multiple domains simultaneously. By intelligently composing training data based on the LLM's existing knowledge and dynamically adjusting data weights during training, VersaTune significantly boosts multi-domain performance and mitigates catastrophic forgetting, even outperforming frontier models on certain benchmarks.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown impressive capabilities across a wide range of domains like law, medicine, and finance. While supervised fine-tuning (SFT) can further enhance these abilities, existing methods often focus on single domains. This leads to a critical problem: "catastrophic forgetting," where improving performance in one domain causes a significant drop in performance in others. The paper aims to solve this by developing a data composition strategy that allows LLMs to improve across multiple domains concurrently without sacrificing existing knowledge.
Methods
VersaTune tackles this challenge in two main phases:
- Domain Knowledge Detection: The framework first probes the base LLM to understand its existing knowledge distribution across different domains (law, medicine, finance, science, code, etc.). This is done by generating text samples and using a proprietary model to infer their domain probabilities. This step helps align the fine-tuning data with the model's inherent strengths.
- Efficient Fine-Tuning: Based on the detected knowledge distribution, VersaTune composes the training dataset. Crucially, during the SFT process, it dynamically adjusts the weights of data from different domains. These adjustments are guided by two metrics:
- Learnable Potential: Measures how much a domain can still be improved.
-
Forgetting Degree: Quantifies how much knowledge in a domain is being lost.
This dynamic weighting ensures that the model focuses on areas where it can improve the most while minimizing performance degradation in other domains. For specific domain expansion, VersaTune also incorporates a mechanism to set proportion thresholds, preventing over-optimization in one area at the expense of others.
Datasets
The paper utilized several datasets for training and evaluation, covering six domains:
- Law: Lawyer-Instruct
- Medicine: MedQA (training portion)
- Finance: Finance Alpaca
- Science: Sonnet3.5 Science Conversations
- Code: Code Alpaca
- General: Alpaca (with specific exclusions to avoid domain overlap)
For evaluation, they used benchmarks like LegalBench, LawBench, MedQA, MedMCQA, FinEval, FinanceIQ, SciEval, MMLU-Sci, HumanEval, MBPP, AGIEval, and HellaSwag.
Key Insights and Ideas
- Aligning Data with Intrinsic Knowledge is Key: The core idea is that fine-tuning data should complement, not contradict, the LLM's pre-existing knowledge distribution. This "knowledge consistency training" is crucial for efficient and robust multi-domain learning.
- Dynamic Weighting Prevents Forgetting: Simply mixing data isn't enough. VersaTune's dynamic adjustment of domain weights based on learnable potential and forgetting degree is what allows it to balance performance across domains and mitigate catastrophic forgetting.
- Domain Interactions are Complex: The paper highlights that domains aren't always independent; improving one can sometimes boost another (e.g., medicine and science, or law and finance), suggesting a degree of mutual reinforcement.
- Mastery Efficiency Diminishes: As a model gets better at a target domain, its learning efficiency decreases, and the risk of degrading performance in other domains increases. This underscores the need for careful proportion management, especially in domain expansion scenarios.
Key Results
- Overall Multi-Ability Improvement: VersaTune achieved a significant 35.21% improvement in overall multi-ability performance compared to uniform domain weighting strategies.
- Outperforming Frontier Models: A Qwen-2.5-32B model fine-tuned with VersaTune surpassed state-of-the-art models like GPT-40, Claude3.5-Sonnet, and DeepSeek-V3 by 0.86%, 4.76%, and 4.60% respectively on certain benchmarks.
- Flexible Domain Expansion: In scenarios requiring expansion of a specific domain, VersaTune reduced performance degradation in other domains by 38.77% while maintaining training efficacy for the target domain.
- Robustness Across Models: The framework demonstrated effectiveness across various open-source LLMs, from 7B to 32B parameters.
Limitations and Future Work
- Classification Framework Scope: The authors acknowledge that their vertical domain classification framework might not be exhaustive and relies on advanced LLMs, which could introduce classification inaccuracies.
- Proxy Model for Metrics: For computational efficiency, they used a lightweight proxy model to estimate learnable potential and forgetting degree. This might not perfectly represent the target model's performance tendencies.
- Future Work: The paper suggests further research into more comprehensive domain classification and exploring more sophisticated methods for calculating learnable potential and forgetting degree.
Summary updated