StochCA:一种利用交叉注意力开发预训练模型的新方法
StochCA: A Novel Approach for Exploiting Pretrained Models with Cross-Attention
AI总结:
本文提出随机交叉注意力微调方法StochCA,通过在Transformer各块中按概率用预训练模型的键值执行交叉注意力,有效利用预训练知识,在迁移学习和领域泛化任务上优于现有方法并可与其互补结合。
摘要:
利用大规模预训练模型是提升各种目标任务性能的著名策略,通常通过在目标任务上微调预训练模型来实现。然而,朴素的微调可能无法充分利用预训练模型中嵌入的知识。在本研究中,我们提出了一种新颖的微调方法,称为随机交叉注意力(StochCA),专门针对Transformer架构设计。该方法修改了Transformer的自注意力机制,使其在微调过程中能够选择性地利用预训练模型中的知识。具体而言,在每个块中,根据预定义的概率随机执行交叉注意力而非自注意力,其中键和值从预训练模型的相应块中提取。通过这种方式,目标模型的查询和通道混合多层感知器层被微调到目标任务上,以学习如何有效利用预训练模型的丰富表示。为了验证StochCA的有效性,我们在迁移学习和领域泛化领域的基准上进行了大量实验,在这些领域中预训练模型的利用至关重要。实验结果表明,StochCA在这两个领域均优于最先进的方法。此外,我们证明了StochCA与现有方法是互补的,即它可以与它们结合以进一步提高性能。我们的代码可在https://github.com/daintlab/stochastic_cross_attention获取。
英文摘要:
Utilizing large-scale pretrained models is a well-known strategy to enhance performance on various target tasks. It is typically achieved through fine-tuning pretrained models on target tasks. However, na\"ıve fine-tuning may not fully leverage knowledge embedded in pretrained models. In this study, we introduce a novel fine-tuning method, called stochastic cross-attention (StochCA), specific to Transformer architectures. This method modifies the Transformer's self-attention mechanism to selectively utilize knowledge from pretrained models during fine-tuning. Specifically, in each block, instead of self-attention, cross-attention is performed stochastically according to the predefined probability, where keys and values are extracted from the corresponding block of a pretrained model. By doing so, queries and channel-mixing multi-layer perceptron layers of a target model are fine-tuned to target tasks to learn how to effectively exploit rich representations of pretrained models. To verify the effectiveness of StochCA, extensive experiments are conducted on benchmarks in the areas of transfer learning and domain generalization, where the exploitation of pretrained models is critical. Our experimental results show the superiority of StochCA over state-of-the-art approaches in both areas. Furthermore, we demonstrate that StochCA is complementary to existing approaches, i.e., it can be combined with them to further improve performance. Our code is available at https://github.com/daintlab/stochastic_cross_attention
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。