arXiv:2502.02797cs.LGcs.AI2025-02ICML被引 19

通过提升简单样本权重,缓解微调时模型遗忘预训练能力

Upweighting Easy Samples in Fine-Tuning Mitigates Forgetting

  • 基于预训练模型损失,对简单样本进行加权
  • 微调后数学任务准确率仅降0.8%,保留5.4%预训练性能
  • 无需原始训练数据,适合资源受限场景

在下游任务上微调预训练模型时常导致其原有能力下降,即“灾难性遗忘”。尤其当无法获取原始训练数据和流程时,现有多数缓解方法失效。为此,我们提出一种仅基于预训练模型损失的样本加权方案:对损失较低的简单样本进行加权,以限制模型偏离预训练状态。该方法与现有参数/梯度空间方法正交互补。理论分析表明,在线性设置下,该方法可抑制特定子空间的学习,避免过拟合目标任务。实验证明其在语言与视觉任务中均有效。例如,在Gemma 2 2B上微调MetaMathQA时,相较于标准微调,其在GSM8K上仅降低0.8%准确率,同时在预训练数据集上多保留5.4%性能。代码已公开于https://github.com/sanyalsunny111/FLOW_finetuning。

原文摘要 · Abstract (English)

Fine-tuning a pre-trained model on a downstream task often degrades its original capabilities, a phenomenon known as "catastrophic forgetting". This is especially an issue when one does not have access to the data and recipe used to develop the pre-trained model. Under this constraint, most existing methods for mitigating forgetting are inapplicable. To address this challenge, we propose a sample weighting scheme for the fine-tuning data solely based on the pre-trained model's losses. Specifically, we upweight the easy samples on which the pre-trained model's loss is low and vice versa to limit the drift from the pre-trained model. Our approach is orthogonal and yet complementary to existing methods; while such methods mostly operate on parameter or gradient space, we concentrate on the sample space. We theoretically analyze the impact of fine-tuning with our method in a linear setting, showing that it stalls learning in a certain subspace which inhibits overfitting to the target task. We empirically demonstrate the efficacy of our method on both language and vision tasks. As an example, when fine-tuning Gemma 2 2B on MetaMathQA, our method results in only a $0.8\%$ drop in accuracy on GSM8K (another math dataset) compared to standard fine-tuning, while preserving $5.4\%$ more accuracy on the pre-training datasets. Our code is publicly available at https://github.com/sanyalsunny111/FLOW_finetuning .

微调遗忘缓解样本加权预训练

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。