仅微调注意力模块:增强任务算术中的权重解耦
Fine-Tuning Attention Modules Only: Enhancing Weight Disentanglement in Task Arithmetic
AI总结:
针对任务算术中权重解耦不足及NTK线性化成本高的问题,提出仅微调Transformer注意力模块以利用核行为,显著提升权重解耦效果并降低开销。
摘要:
近年来,任务算术引起了越来越多的关注。这种方法通过将各种任务微调后的权重组合到一个统一的模型中,直接在权重空间中编辑预训练模型。其高效性和成本效益源于其免训练的组合方式,这与在大型数据集上对多个任务进行模型训练的传统方法形成对比。然而,将这样一个统一的模型应用于单个任务可能会导致来自其他任务的干扰(缺乏权重解耦)。为了解决这个问题,已经采用了神经正切核(NTK)线性化来利用“核行为”,促进权重解耦并减轻来自不相关任务的不利影响。尽管有其优点,NTK线性化也存在缺点,包括训练成本加倍,以及单个模型的性能下降。为了解决这个问题,我们提出了一种简单但有效且高效的方法,即仅微调Transformer中的注意力模块。我们的研究表明,注意力模块表现出核行为,并且仅微调注意力模块能显著改善权重解耦。为了进一步理解我们的方法如何改善任务算术的权重解耦,我们通过区分表示模块和任务特定模块的作用,对任务算术进行了全面的研究。特别是,我们发现表示模块在改善权重解耦方面起着重要作用,而诸如分类头之类的任务特定模块则会使权重解耦性能退化。(代码可在 https://github.com/kyrie-23/task_arithmetic_tangent 获取)
英文摘要:
In recent years, task arithmetic has garnered increasing attention. This approach edits pre-trained models directly in weight space by combining the fine-tuned weights of various tasks into a unified model. Its efficiency and cost-effectiveness stem from its training-free combination, contrasting with traditional methods that require model training on large datasets for multiple tasks. However, applying such a unified model to individual tasks can lead to interference from other tasks (lack of weight disentanglement). To address this issue, Neural Tangent Kernel (NTK) linearization has been employed to leverage a "kernel behavior", facilitating weight disentanglement and mitigating adverse effects from unrelated tasks. Despite its benefits, NTK linearization presents drawbacks, including doubled training costs, as well as reduced performance of individual models. To tackle this problem, we propose a simple yet effective and efficient method that is to finetune the attention modules only in the Transformer. Our study reveals that the attention modules exhibit kernel behavior, and fine-tuning the attention modules only significantly improves weight disentanglement. To further understand how our method improves the weight disentanglement of task arithmetic, we present a comprehensive study of task arithmetic by differentiating the role of the representation module and task-specific module. In particular, we find that the representation module plays an important role in improving weight disentanglement whereas the task-specific modules such as the classification heads can degenerate the weight disentanglement performance. (The code is available at https://github.com/kyrie-23/task_arithmetic_tangent)
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。