arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.05719cs.LGstat.ML
收藏

基于最优传输的Transformer融合

Transformer Fusion with Optimal Transport

ETH Zurich(苏黎世联邦理工学院)

Moritz Imfeld, Jacopo Graldi, Marco Giordano, Thomas Hofmann, Sotiris Anagnostidis, Sidak Pal Singh

AI总结:

本文提出利用Optimal Transport软对齐架构组件的系统方法,实现多个Transformer模型的融合(含异构融合),在图像与语言任务上优于普通融合及父模型,为模型压缩与重组提供新范式。

摘要:

融合是一种合并多个独立训练的神经网络以结合其能力的技术。过去的尝试仅限于全连接、卷积和残差网络。本文提出了一种系统的方法,利用Optimal Transport(最优传输)来(软)对齐各种架构组件,从而融合两个或多个基于Transformer的网络。我们详细阐述了层对齐的抽象概念,原则上可以推广到任意架构,并将其应用于Transformer的关键组件,如multi-head self-attention(多头自注意力)、layer-normalization(层归一化)和residual connections(残差连接),并通过各种消融研究讨论了如何处理它们。此外,我们的方法允许融合不同大小的模型(异构融合),提供了一种压缩Transformer的全新高效方式。所提出的方法通过Vision Transformer在图像分类任务上,以及使用BERT在自然语言建模任务上进行了评估。我们的方法始终优于vanilla fusion(普通融合),并且经过令人惊讶的短暂微调后,也优于各个收敛的父模型。在我们的分析中,我们揭示了在Transformer情况下软对齐重要作用的有趣见解。我们的结果展示了融合多个Transformer从而复合其专业知识的潜力,这在新兴的模型融合与重组范式中具有重要意义。代码可在https://github.com/graldij/transformer-fusion获取。

英文摘要:

Fusion is a technique for merging multiple independently-trained neural networks in order to combine their capabilities. Past attempts have been restricted to the case of fully-connected, convolutional, and residual networks. This paper presents a systematic approach for fusing two or more transformer-based networks exploiting Optimal Transport to (soft-)align the various architectural components. We flesh out an abstraction for layer alignment, that can generalize to arbitrary architectures - in principle - and we apply this to the key ingredients of Transformers such as multi-head self-attention, layer-normalization, and residual connections, and we discuss how to handle them via various ablation studies. Furthermore, our method allows the fusion of models of different sizes (heterogeneous fusion), providing a new and efficient way to compress Transformers. The proposed approach is evaluated on both image classification tasks via Vision Transformer and natural language modeling tasks using BERT. Our approach consistently outperforms vanilla fusion, and, after a surprisingly short finetuning, also outperforms the individual converged parent models. In our analysis, we uncover intriguing insights about the significant role of soft alignment in the case of Transformers. Our results showcase the potential of fusing multiple Transformers, thus compounding their expertise, in the budding paradigm of model fusion and recombination. Code is available at https://github.com/graldij/transformer-fusion.

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

↑