让微调后的视觉语言模型恢复预训练知识,提升泛化能力。
MERGETUNE: Continued Fine-Tuning of Vision-Language Models
- 通过线性模式连接性搜索,后处理微调模型以恢复遗忘的预训练知识。
- 在基础-新类别泛化任务上,性能提升5.6%,且无需增加参数。
- 适用于需保持预训练能力的下游任务,尤其适合资源受限场景。
微调视觉语言模型(如CLIP)常导致预训练知识的灾难性遗忘。现有方法主要缓解适应过程中的遗忘问题,但遗忘仍难以避免。本文提出一种新范式——持续微调(CFT),旨在零样本模型完成微调后,恢复其丢失的预训练知识。我们提出一种简单、与模型无关的CFT策略(MERGETUNE),基于线性模式连接性(LMC),可对已有微调模型进行事后处理,无需修改架构。给定一个微调模型,继续微调其可训练参数(如软提示或线性头),寻找一个具有两条低损失路径的持续模型:一条通往零样本(如CLIP)解,另一条通往微调解(如CoOp)。利用损失曲面几何特性,该模型隐式融合两种解,恢复微调中丢失的预训练知识。难点在于原始LMC需重放预训练数据。我们通过二阶近似替代零样本模型的约束,避免大规模数据重放。实验表明,MERGETUNE在基础-新类别泛化任务上使CoOp的调和平均性能提升+5.6%,且不增加参数。在鲁棒微调评估中,经LMC融合的模型优于集成基线,推理成本更低;与零样本模型集成后达到新最优效果。代码已开源:https://github.com/Surrey-UP-Lab/MERGETUNE。
原文摘要 · Abstract (English)
Fine-tuning vision-language models (VLMs) such as CLIP often leads to catastrophic forgetting of pretrained knowledge. Prior work primarily aims to mitigate forgetting during adaptation; however, forgetting often remains inevitable during this process. We introduce a novel paradigm, continued fine-tuning (CFT), which seeks to recover pretrained knowledge after a zero-shot model has already been adapted. We propose a simple, model-agnostic CFT strategy (named MERGETUNE) guided by linear mode connectivity (LMC), which can be applied post hoc to existing fine-tuned models without requiring architectural changes. Given a fine-tuned model, we continue fine-tuning its trainable parameters (e.g., soft prompts or linear heads) to search for a continued model which has two low-loss paths to the zero-shot (e.g., CLIP) and the fine-tuned (e.g., CoOp) solutions. By exploiting the geometry of the loss landscape, the continued model implicitly merges the two solutions, restoring pretrained knowledge lost in the fine-tuned counterpart. A challenge is that the vanilla LMC constraint requires data replay from the pretraining task. We approximate this constraint for the zero-shot model via a second-order surrogate, eliminating the need for large-scale data replay. Experiments show that MERGETUNE improves the harmonic mean of CoOp by +5.6% on base-novel generalisation without adding parameters. On robust fine-tuning evaluations, the LMC-merged model from MERGETUNE surpasses ensemble baselines with lower inference cost, achieving further gains and state-of-the-art results when ensembled with the zero-shot model. Our code is available at https://github.com/Surrey-UP-Lab/MERGETUNE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。