Balancing Speciality and Versatility: A Coarse to Fine Framework for Mitigating Catastrophic Forgetting in Large Language Models

📄 arXiv: 2404.10306v6 📥 PDF

作者: Hengyuan Zhang, Yanru Wu, Dawei Li, Sak Yang, Rui Zhao, Yong Jiang, Fei Tan

分类: cs.CL

发布日期: 2024-04-16 (更新: 2025-02-24)

备注: 43 pages, 10 figures, accepted by ACL 2024

🔗 代码/项目: GITHUB


💡 一句话要点

提出CoFiTune框架以解决大语言模型的灾难性遗忘问题

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

关键词: 大语言模型 灾难性遗忘 精细调优 多样性 专业性 软掩蔽机制 经验树搜索 CoFiTune

📋 核心要点

  1. 现有的精细调优方法在提升模型专业性的同时,往往导致灾难性遗忘,影响模型的多样性表现。
  2. 本文提出的CoFiTune框架通过粗到细的调优策略,分别在粗粒度和细粒度层面解决专业性与多样性之间的平衡问题。
  3. 实验结果显示,CoFiTune在多样性和专业性评估中均优于基线方法,尤其在13B模型上实现了14%的多样性提升。

📝 摘要(中文)

对齐的大语言模型(LLMs)展示了显著的多样性,能够处理各种现实任务。然而,针对特定应用的精细调优常常导致灾难性遗忘(CF),影响模型在多样任务中的表现。为此,本文提出了CoFiTune框架,通过粗到细的方式平衡专业性与多样性。在粗粒度层面,采用经验树搜索算法更新关键模块,同时保持其他参数不变;在细粒度层面,使用软掩蔽机制调节LLMs的更新,从而减轻CF问题而不损害专业性。实验结果表明,CoFiTune在多样任务和模型规模上均优于基线方法,13B模型在多样性上提升约14%,专业性损失微乎其微。

🔬 方法详解

问题定义:本文旨在解决大语言模型在精细调优过程中出现的灾难性遗忘问题,现有方法在提升专业性时常导致多样性下降,影响模型的整体性能。

核心思路:CoFiTune框架通过粗到细的调优策略,首先在粗粒度层面识别并更新关键模块,然后在细粒度层面使用软掩蔽机制,确保模型在保持专业性的同时减轻灾难性遗忘。

技术框架:CoFiTune的整体架构分为两个主要阶段:粗粒度调优和细粒度调优。在粗粒度阶段,使用经验树搜索算法识别关键模块并进行更新;在细粒度阶段,通过软掩蔽机制调节参数更新,确保其他参数保持不变。

关键创新:该框架的创新之处在于结合了粗粒度的模块更新与细粒度的软掩蔽机制,有效避免了传统方法中常见的灾难性遗忘问题,同时保持了模型的专业性。

关键设计:在参数设置上,框架通过经验树搜索算法确定需要更新的模块,并在细粒度层面应用软掩蔽机制,确保更新过程中的信息流动不受阻碍,进而提升模型的整体表现。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,CoFiTune在多样性和专业性评估中均优于基线方法,尤其在13B模型上实现了约14%的多样性提升,专业性损失微乎其微,展示了该方法的有效性和实用性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统、文本生成等多种需要平衡专业性与多样性的任务。通过有效减轻灾难性遗忘,CoFiTune能够提升大语言模型在特定应用场景中的表现,具有重要的实际价值和未来影响。

📄 摘要(原文)

Aligned Large Language Models (LLMs) showcase remarkable versatility, capable of handling diverse real-world tasks. Meanwhile, aligned LLMs are also expected to exhibit speciality, excelling in specific applications. However, fine-tuning with extra data, a common practice to gain speciality, often leads to catastrophic forgetting (CF) of previously acquired versatility, hindering the model's performance across diverse tasks. In response to this challenge, we propose CoFiTune, a coarse to fine framework in an attempt to strike the balance between speciality and versatility. At the coarse-grained level, an empirical tree-search algorithm is utilized to pinpoint and update specific modules that are crucial for speciality, while keeping other parameters frozen; at the fine-grained level, a soft-masking mechanism regulates the update to the LLMs, mitigating the CF issue without harming speciality. In an overall evaluation of both speciality and versatility, CoFiTune consistently outperforms baseline methods across diverse tasks and model scales. Compared to the full-parameter SFT, CoFiTune leads to about 14% versatility improvement and marginal speciality loss on a 13B model. Lastly, based on further analysis, we provide a speculative insight into the information forwarding process in LLMs, which helps explain the effectiveness of the proposed method. The code is available at https://github.com/rattlesnakey/CoFiTune.