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

自注意力层的模仿初始化

Mimetic Initialization of Self-Attention Layers

Carnegie Mellon University(卡内基梅隆大学);Bosch Center for AI(博世人工智能中心)

Asher Trockman, J. Zico Kolter

AI总结:

针对小数据集训练Transformer困难的问题,提出模仿预训练模型权重模式的闭式初始化方案,显著提升了原始Transformer在视觉任务上的训练速度与准确率。

摘要:

众所周知,在小数据集上训练 Transformer 非常困难;通常,将大型预训练模型作为起点。我们探索了此类预训练 Transformer(尤其是视觉领域)的权重,试图找出造成这种差异的原因。令人惊讶的是,我们发现只需初始化自注意力层的权重,使其“看起来”更像预训练的对应层,就能让我们更快地训练原始 Transformer 并达到更高的最终准确率,特别是在 CIFAR-10 和 ImageNet 分类等视觉任务上,我们分别看到准确率提升了超过 5% 和 4%。我们的初始化方案是闭式、无需学习且非常简单的:我们将 query 和 key 权重的乘积近似设为单位矩阵,将 value 和 projection 权重的乘积近似设为负单位矩阵。由于这模仿了我们在预训练 Transformer 中观察到的模式,我们将该技术称为“模仿初始化(mimetic initialization)”。

英文摘要:

It is notoriously difficult to train Transformers on small datasets; typically, large pre-trained models are instead used as the starting point. We explore the weights of such pre-trained Transformers (particularly for vision) to attempt to find reasons for this discrepancy. Surprisingly, we find that simply initializing the weights of self-attention layers so that they "look" more like their pre-trained counterparts allows us to train vanilla Transformers faster and to higher final accuracies, particularly on vision tasks such as CIFAR-10 and ImageNet classification, where we see gains in accuracy of over 5% and 4%, respectively. Our initialization scheme is closed form, learning-free, and very simple: we set the product of the query and key weights to be approximately the identity, and the product of the value and projection weights to approximately the negative identity. As this mimics the patterns we saw in pre-trained Transformers, we call the technique "mimetic initialization".

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

↑