arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.22697cs.LG
收藏

将你的Transformer更新至最新版本:任务向量的重基

Update Your Transformer to the Latest Release: Re-Basin of Task Vectors

Sapienza, University of Rome(罗马大学)

Filippo Rinaldi, Giacomo Capitani, Lorenzo Bonicelli, Donato Crisostomi, Federico Bolelli, Elisa Ficarra, Emanuele Rodolà, Simone Calderara, Angelo Porrello

AI总结:

提出一种基于权重排列和谱理论的双层模型重基方法,在无数据且无需重新训练的情况下,将Transformer的任务向量无缝迁移至新的预训练骨干网络。

摘要:

基础模型作为骨干,支撑着通过微调开发的大量专用模型。然而,当底层预训练模型被更新或重新训练(例如,基于更大且更精选的数据集)时,微调后的模型就会过时,失去其效用并需要重新训练。这引发了一个问题:是否有可能将微调迁移到模型的新版本中?在这项工作中,我们研究了如何以无数据的方式,将微调迁移到新的checkpoint,而无需重新训练。为此,我们从模型重基(re-basin)中汲取原理,并提供了一种基于权重排列的方案,以重新建立对原始基础模型所做的修改(通常称为任务向量)的基。具体而言,我们的方法针对Transformer模型量身定制了模型重基,考虑了残差连接和多头注意力层的挑战。具体来说,我们提出了一种基于谱理论的双层方法,首先对注意力头进行排列,随后调整选定头对内的参数。通过对视觉和文本任务的广泛实验,我们在不依赖任何训练步骤或数据点的情况下,实现了将微调知识无缝迁移到新的预训练骨干网络。代码可在https://github.com/aimagelab/TransFusion获取。

英文摘要:

Foundation models serve as the backbone for numerous specialized models developed through fine-tuning. However, when the underlying pretrained model is updated or retrained (e.g., on larger and more curated datasets), the fine-tuned model becomes obsolete, losing its utility and requiring retraining. This raises the question: is it possible to transfer fine-tuning to a new release of the model? In this work, we investigate how to transfer fine-tuning to a new checkpoint without having to re-train, in a data-free manner. To do so, we draw principles from model re-basin and provide a recipe based on weight permutations to re-base the modifications made to the original base model, often called task vector. In particular, our approach tailors model re-basin for Transformer models, taking into account the challenges of residual connections and multi-head attention layers. Specifically, we propose a two-level method rooted in spectral theory, initially permuting the attention heads and subsequently adjusting parameters within select pairs of heads. Through extensive experiments on visual and textual tasks, we achieve the seamless transfer of fine-tuned knowledge to new pre-trained backbones without relying on a single training step or datapoint. Code is available at https://github.com/aimagelab/TransFusion.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑