通过训练扰动+合并模型,缓解持续学习中的遗忘问题。
Train with Perturbation, Infer after Merging: A Two-Stage Framework for Continual Learning
- 训练后将旧模型与新模型按最优比例合并
- 在多个基准数据集上达到当前最佳性能
- 适合需要高效更新、减少遗忘的持续学习场景
持续学习(CL)旨在让模型从任务序列中持续获取新知识,同时避免遗忘已有信息。现有方法仅依赖最新任务参数进行推理,易受灾难性遗忘影响。受模型合并技术启发,我们提出新型框架Perturb-and-Merge(P&M),将模型合并引入CL范式以缓解遗忘。具体而言,在每个任务训练后,通过前序模型与新任务特定模型的凸组合构建新模型。理论分析表明,在温和假设下可推导出合并系数的闭式解,以最小化所有任务上的总损失增加。为进一步提升合并模型性能,我们发现通过任务向量与损失函数海森矩阵构成的正则项可缓解合并带来的性能下降。有趣的是,该正则项可通过二阶对称有限差分高效近似,且设计了一种沿任务向量方向的随机扰动策略,无需额外前向或反向传播即可有效近似该正则项。最后,我们将P&M与LoRA结合,降低内存开销。实验表明,所提方法在多个持续学习基准数据集上取得领先性能。代码已公开于https://github.com/qhmiao/P-M-for-Continual-Learning。
原文摘要 · Abstract (English)
Continual Learning (CL) aims to enable models to continuously acquire new knowledge from a sequence of tasks with avoiding the forgetting of learned information. However, existing CL methods only rely on the parameters of the most recent task for inference, which makes them susceptible to catastrophic forgetting. Inspired by the recent success of model merging techniques, we propose \textbf{Perturb-and-Merge (P\&M)}, a novel continual learning framework that integrates model merging into the CL paradigm to mitigate forgetting. Specifically, after training on each task, P\&M constructs a new model by forming a convex combination of the previous model and the newly trained task-specific model. Through theoretical analysis, We minimize the total loss increase across all tasks and derive a closed-form solution for the merging coefficient under mild assumptions. To further improve the performance of the merged model, we observe that the degradation introduced during merging can be alleviated by a regularization term composed of the task vector and the Hessian matrix of the loss function. Interestingly, we show that this term can be efficiently approximated using second-order symmetric finite differences, and a stochastic perturbation strategy along the task vector direction is accordingly devised which incurs no additional forward or backward passes while providing an effective approximation of the regularization term. Finally, we combine P\&M with LoRA, a parameter-efficient fine-tuning method, to reduce memory overhead. Our proposed approach achieves state-of-the-art performance on several continual learning benchmark datasets. The code is available at https://github.com/qhmiao/P-M-for-Continual-Learning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。