arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.10306cs.CL
收藏

平衡专业性与通用性:一种用于缓解大型语言模型灾难性遗忘的从粗到细框架

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

Tsinghua University(清华大学);SenseTime Research(商汤科技研究院);University of California, San Diego(加利福尼亚大学圣迭戈分校)

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

AI总结:

提出CoFiTune框架,通过粗粒度模块更新和细粒度软掩蔽机制,在微调中平衡专业性与通用性,缓解灾难性遗忘,提升通用性约14%。

摘要:

对齐的大型语言模型(LLMs)展现出卓越的通用性,能够处理各种现实世界任务。同时,对齐的LLMs也被期望表现出专业性,在特定应用中表现出色。然而,为了获得专业性而使用额外数据进行微调(一种常见做法)往往会导致先前获得的通用性发生灾难性遗忘(CF),从而阻碍模型在各种任务上的性能。为了应对这一挑战,我们提出了CoFiTune,一个从粗到细的框架,旨在平衡专业性与通用性。在粗粒度层面,利用经验树搜索算法来定位并更新对专业性至关重要的特定模块,同时保持其他参数冻结;在细粒度层面,一种软掩蔽机制调节对LLMs的更新,在不损害专业性的情况下缓解CF问题。在对专业性和通用性的整体评估中,CoFiTune在多种任务和模型规模上始终优于基线方法。与全参数SFT相比,CoFiTune在13B模型上带来了约14%的通用性提升和轻微的专业性损失。最后,基于进一步分析,我们对LLMs中的信息转发过程提供了推测性见解,这有助于解释所提出方法的有效性。代码可在https://github.com/rattlesnakey/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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑