HFT: Half Fine-Tuning for Large Language Models

📄 arXiv: 2404.18466v1 📥 PDF

作者: Tingfeng Hui, Zhenyu Zhang, Shuohuan Wang, Weiran Xu, Yu Sun, Hua Wu

分类: cs.CL

发布日期: 2024-04-29

备注: Work in progress


💡 一句话要点

提出半精调方法以解决大语言模型遗忘问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 半精调 灾难性遗忘 参数选择 自然语言处理 模型优化 持续学习

📋 核心要点

  1. 现有的全精调方法在连续训练中容易导致灾难性遗忘,影响模型性能。
  2. 本文提出半精调(HFT)方法,通过冻结一半参数来保留原有知识,同时学习新任务。
  3. 实验结果显示,HFT在多个基准测试中性能优于全精调,且训练时间显著减少。

📝 摘要(中文)

大语言模型(LLMs)通过一个或多个精调阶段来解锁多种能力,但在连续训练中存在灾难性遗忘的风险。本文提出半精调(HFT)方法,通过定期重置部分参数,帮助LLMs恢复原有知识。HFT在不改变模型架构的情况下,选择一半参数进行新任务学习,另一半保持冻结,从而有效缓解遗忘问题。实验结果表明,HFT在多个下游基准测试中表现优异,训练时间减少约30%。

🔬 方法详解

问题定义:本文解决的是大语言模型在连续训练中面临的灾难性遗忘问题。现有的全精调方法在引入新数据时,容易覆盖之前学习的知识,导致模型性能下降。

核心思路:论文提出的半精调(HFT)方法,通过定期重置一部分参数,使得模型能够在学习新任务的同时,保留之前的知识。这样设计的目的是为了减轻遗忘现象,提高模型的适应性和性能。

技术框架:HFT方法的整体架构包括参数选择、冻结与更新阶段。具体而言,模型的一半参数在学习新任务时被解冻,另一半则保持不变,以确保原有知识的保留。

关键创新:HFT的主要创新在于其通过选择性冻结参数的方式,有效缓解了灾难性遗忘问题。这一方法与传统的全精调方法相比,能够在不改变模型架构的情况下,提升模型的学习效率和效果。

关键设计:在HFT中,参数选择操作被视为一种正则化项,优化过程中通过特定的损失函数来实现。此外,HFT的设计允许与现有的精调框架无缝集成,增强了其实用性。

📊 实验亮点

实验结果表明,HFT在多个下游基准测试中表现优于全精调方法,显著减轻了遗忘问题,且训练时间减少约30%。这一结果展示了HFT在实际应用中的高效性和有效性,具有重要的研究和应用价值。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统和个性化推荐等。通过有效解决遗忘问题,HFT可以提升大语言模型在实际应用中的表现,增强其适应性和灵活性,未来可能对智能助手和自动化系统的发展产生深远影响。

📄 摘要(原文)

Large language models (LLMs) with one or more fine-tuning phases have become a necessary step to unlock various capabilities, enabling LLMs to follow natural language instructions or align with human preferences. However, it carries the risk of catastrophic forgetting during sequential training, the parametric knowledge or the ability learned in previous stages may be overwhelmed by incoming training data. In this paper, we find that by regularly resetting partial parameters, LLMs can restore some of the original knowledge. Inspired by this, we introduce Half Fine-Tuning (HFT) for LLMs, as a substitute for full fine-tuning (FFT), to mitigate the forgetting issues, where half of the parameters are selected to learn new tasks while the other half are frozen to remain previous knowledge. We provide a feasibility analysis from the perspective of optimization and interpret the parameter selection operation as a regularization term. Without changing the model architecture, HFT could be seamlessly integrated into existing fine-tuning frameworks. Extensive experiments and analysis on supervised fine-tuning, direct preference optimization, and continual learning consistently demonstrate the effectiveness, robustness, and efficiency of HFT. Compared with FFT, HFT not only significantly alleviates the forgetting problem, but also achieves the best performance in a series of downstream benchmarks, with an approximately 30% reduction in training time.