通过知识感知空间净化任务向量,提升模型融合效果
Purifying Task Vectors in Knowledge-Aware Subspace for Model Merging
- 基于任务相关样本构建知识感知子空间,定位关键权重
- 通过奇异值分解分离出任务相关与冗余成分,精准修剪冗余
- 可即插即用,适用于多种融合方法,显著提升性能
模型融合旨在将微调后模型的任务能力整合到单一模型中,无需额外训练。当前方法中,任务向量作为核心组件,能封装微调带来的残差信息。然而,由于任务无关的冗余存在,合并模型常出现性能下降。现有通过随机丢弃参数空间元素来缓解冗余的方法缺乏知识引导且带有随机性。为此,本文提出在知识感知子空间中净化任务向量(PAVE)的方法。具体地,从每个任务采样训练样本,输入对应微调模型以获取前线性层的协方差矩阵,并进行面向上下文的奇异值分解,突出与目标知识最相关的权重成分。由此可在知识感知子空间中分离出任务相关与冗余成分,并通过剪枝去除冗余部分。为确保各模型间剪枝力度均衡,进一步引入谱秩分配策略,通过优化归一化激活剪枝误差实现。该方法作为即插即用方案,适用于多种基于任务向量的融合方法,在多个任务和模型架构上均验证了有效性。
原文摘要 · Abstract (English)
Model merging aims to integrate task-specific abilities from individually fine-tuned models into a single model without extra training. In recent model merging methods, task vector has become a fundamental building block, as it can encapsulate the residual information from finetuning. However, the merged model often suffers from notable performance degradation due to the conflicts caused by task-irrelevant redundancy in task vectors. Existing efforts in overcoming redundancy by randomly dropping elements in the parameter space involves randomness and lacks knowledge awareness. To address these challenges, in this study, we propose Purifying TAsk Vectors (PAVE) in knowledge-aware subspace. Concretely, we sample some training examples from each task, and feed them into their corresponding fine-tuned models to acquire the covariance matrices before linear layers. We then perform a context-oriented singular value decomposition, which accentuates the weight components most relevant to the target knowledge. As a result, we can split fine-tuned model weights into task-relevant and redundant components in the knowledge-aware subspace, and purify the task vector by pruning the redundant components. To induce fair pruning efforts across models, we further introduce a spectral rank allocation strategy by optimizing a normalized activated pruning error. The task vector purification by our method as a plug-and-play scheme is applicable across various task vector-based merging methods to improve their performance. In experiments, we demonstrate the effectiveness of PAVE across a diverse set of merging methods, tasks, and model architectures.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。