PLeaS——通过排列与最小二乘法合并模型
PLeaS -- Merging Models with Permutations and Least Squares
AI总结:
提出PLeaS算法,通过排列对称性匹配节点和最小二乘计算权重,实现不同基础模型微调后的同架构模型合并,支持任意目标大小,在多个任务上超越现有方法。
摘要:
机器学习系统的普及使得微调过程对从业者变得易于使用,从而产生了大量针对专门任务和数据集进行微调的开源模型。近期的工作提出合并此类模型以组合它们的功能。然而,先前的方法通常仅限于从相同基础模型微调得到的模型。此外,最终合并后的模型通常要求与原始模型具有相同的大小。在这项工作中,我们提出了一种新的两步算法来合并模型——称为PLeaS——它放宽了这些约束。首先,利用两个模型中固有的排列对称性,PLeaS通过最大化对齐来部分匹配每一层中的节点。接下来,PLeaS计算合并模型的权重,作为逐层最小二乘解,以最小化合并模型的特征与原始模型的排列特征之间的近似误差。PLeaS允许从业者将共享相同架构的两个模型合并为所需大小的单个高性能模型,即使两个原始模型是从不同的基础模型微调而来。我们还展示了如何将我们的方法扩展到处理微调域中无数据可用的具有挑战性的场景。我们演示了合并具有共享和不同标签空间的ResNet和ViT模型的方法,并显示在合并DomainNet和细粒度分类任务上训练的模型时,对于相同的目标计算量,比最先进的合并方法提高了最多15个百分点。我们的代码已在https://github.com/SewoongLab/PLeaS-Merging开源。
英文摘要:
The democratization of machine learning systems has made the process of fine-tuning accessible to practitioners, leading to a wide range of open-source models fine-tuned on specialized tasks and datasets. Recent work has proposed to merge such models to combine their functionalities. However, prior approaches are usually restricted to models that are fine-tuned from the same base model. Furthermore, the final merged model is typically required to be of the same size as the original models. In this work, we propose a new two-step algorithm to merge models -- termed PLeaS -- which relaxes these constraints. First, leveraging the Permutation symmetries inherent in the two models, PLeaS partially matches nodes in each layer by maximizing alignment. Next, PLeaS computes the weights of the merged model as a layer-wise Least Squares solution to minimize the approximation error between the features of the merged model and the permuted features of the original models. PLeaS allows a practitioner to merge two models sharing the same architecture into a single performant model of a desired size, even when the two original models are fine-tuned from different base models. We also demonstrate how our method can be extended to address a challenging scenario where no data is available from the fine-tuning domains. We demonstrate our method to merge ResNet and ViT models trained with shared and different label spaces, and show improvement over the state-of-the-art merging methods of up to 15 percentage points for the same target compute while merging models trained on DomainNet and fine-grained classification tasks. Our code is open-sourced at https://github.com/SewoongLab/PLeaS-Merging .
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。