How Abilities in Large Language Models are Affected by Supervised Fine-tuning Data Composition

📄 arXiv: 2310.05492v4 📥 PDF

作者: Guanting Dong, Hongyi Yuan, Keming Lu, Chengpeng Li, Mingfeng Xue, Dayiheng Liu, Wei Wang, Zheng Yuan, Chang Zhou, Jingren Zhou

分类: cs.CL, cs.AI, cs.LG

发布日期: 2023-10-09 (更新: 2024-06-07)

备注: Accepted to ACL 2024 Main Conference


💡 一句话要点

提出双阶段混合微调策略以优化大语言模型能力

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 监督微调 数据组成 能力学习 双阶段混合微调 数学推理 代码生成 灾难性遗忘

📋 核心要点

  1. 现有的监督微调方法在提升大语言模型多种能力时面临数据组成的挑战,尤其是在数据量有限的情况下。
  2. 本文提出的双阶段混合微调策略旨在通过优化数据组成和学习策略,解决多种能力学习中的冲突与遗忘问题。
  3. 实验结果显示,较大的模型在相同数据量下表现更优,数学推理和代码生成能力随着数据量增加而提升,而一般能力在数据量达到一定阈值后趋于平稳。

📝 摘要(中文)

大型语言模型(LLMs)通过大量的预训练数据和参数展现出多样的能力,包括数学推理、代码生成和指令跟随。这些能力通过监督微调(SFT)进一步增强。本文研究了在SFT过程中,数据组成对数学推理、代码生成和人类对齐能力的影响。我们提出了四个研究问题,探讨模型性能与数据量、组成比例、模型规模和SFT策略等因素的关联。实验结果表明,不同能力的扩展方式不同,较大的模型在相同数据量下表现更优。数学推理和代码生成能力随着数据量增加而提升,而一般能力在约一千个样本后趋于平稳。此外,数据组成在有限数据条件下能增强能力,但在数据充足时可能导致性能冲突。我们的研究还发现,组成数据的数量对性能的影响大于组成比例。

🔬 方法详解

问题定义:本文旨在解决大语言模型在监督微调过程中,数据组成对不同能力学习的影响,现有方法在数据量有限时难以有效提升模型多种能力。

核心思路:提出双阶段混合微调策略,通过优化数据组成和学习顺序,减少能力间的冲突,避免灾难性遗忘。

技术框架:整体架构包括数据预处理、能力分层学习和双阶段微调三个主要模块。首先对数据进行分类,然后分阶段进行微调以提升不同能力。

关键创新:最重要的创新在于提出双阶段混合微调策略,该策略通过分阶段学习不同能力,显著减少了灾难性遗忘现象,与传统的单一微调方法形成鲜明对比。

关键设计:在参数设置上,采用动态调整学习率和损失函数,网络结构上结合了多任务学习的思想,以适应不同能力的学习需求。

🖼️ 关键图片

img_0

📊 实验亮点

实验结果表明,较大的模型在相同数据量下的表现优于小模型,数学推理和代码生成能力随着数据量的增加而显著提升。具体而言,模型在一千个样本后,一般能力趋于平稳,而数据组成的数量对性能的影响显著大于组成比例。

🎯 应用场景

该研究的潜在应用领域包括教育、编程辅助和人机交互等场景。通过优化大语言模型的多种能力,能够提升智能助手的表现,使其在处理复杂任务时更为高效,未来可能对自动化和智能决策系统产生深远影响。

📄 摘要(原文)

Large language models (LLMs) with enormous pre-training tokens and parameters emerge diverse abilities, including math reasoning, code generation, and instruction following. These abilities are further enhanced by supervised fine-tuning (SFT). While the open-source community has explored ad-hoc SFT for enhancing individual capabilities, proprietary LLMs exhibit versatility across various skills. Therefore, understanding the facilitation of multiple abilities via SFT is paramount. In this study, we specifically focuses on the interplay of data composition between mathematical reasoning, code generation, and general human-aligning abilities during SFT. We propose four intriguing research questions to explore the association between model performance and various factors including data amount, composition ratio, model size and SFT strategies. Our experiments reveal that distinct capabilities scale differently and larger models generally show superior performance with same amount of data. Mathematical reasoning and code generation consistently improve with increasing data amount, whereas general abilities plateau after roughly a thousand samples. Moreover, we observe data composition appears to enhance various abilities under limited data conditions, yet can lead to performance conflicts when data is plentiful. Our findings also suggest the amount of composition data influences performance more than the composition ratio. In analysis of SFT strategies, we find that sequentially learning multiple skills risks catastrophic forgetting. Our proposed Dual-stage Mixed Fine-tuning (DMT) strategy offers a promising solution to learn multiple abilities with different scaling patterns.