MoFO:用于缓解 LLM 微调中遗忘的动量滤波优化器
MoFO: Momentum-Filtered Optimizer for Mitigating Forgetting in LLM Fine-Tuning
AI总结:
针对 LLM 微调遗忘预训练知识且常无法访问预训练数据的问题,本文提出 MoFO 优化器,仅更新动量幅值最大的参数,并通过收敛分析与实验验证其有效性。
摘要:
大语言模型(LLM)已在广泛任务中展现出卓越能力。通常,LLM 首先在大规模语料库上进行预训练,随后在特定任务数据集上进行微调。然而,在微调过程中,LLM 可能会遗忘在预训练阶段获得的部分知识,从而导致通用能力下降。现有缓解遗忘的方法通常依赖于访问预训练数据,而在许多现实场景中这可能无法实现——例如仅基于检查点对开源 LLM 进行微调。为应对这一挑战,我们提出了一种名为动量滤波优化器(Momentum-Filtered Optimizer,MoFO)的新型微调算法。MoFO 是贪心块坐标下降(BCD)方法的扩展:在每次迭代中,MoFO 仅更新动量幅值最大的模型参数,同时保持其他所有参数固定。MoFO 在取得与默认微调算法相近微调性能的同时,有效缓解了知识遗忘。我们通过严格的收敛分析和大量实验验证了 MoFO,证明了其在无需预训练数据的情况下缓解遗忘的有效性。
英文摘要:
Large language models (LLMs) have demonstrated remarkable capabilities across a wide range of tasks. Typically, LLMs are first pre-trained on large corpora and subsequently fine-tuned on task-specific datasets. However, during fine-tuning, LLMs may forget some knowledge acquired in the pre-training stage, leading to a decline in general capabilities. Existing approaches to mitigate forgetting often rely on access to pre-training data, which may be unavailable in many real-world scenarios--such as fine-tuning checkpoint-only open-source LLMs. To address this challenge, we propose a new fine-tuning algorithm termed Momentum-Filtered Optimizer (MoFO). MoFO is an extension of greedy block coordinate descent (BCD) methods: in each iteration, MoFO only updates the model parameters with the largest momentum magnitudes, while keeping all other parameters fixed. MoFO achieves similar fine-tuning performance to the default fine-tuning algorithm while effectively mitigating knowledge forgetting. We validate MoFO through rigorous convergence analysis and extensive experiments, demonstrating its effectiveness in mitigating forgetting without pre-training data.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。