arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2407.12514cs.CL
收藏

关于使用预训练嵌入初始化Transformer的研究

On Initializing Transformers with Pre-trained Embeddings

State University of New York, Korea(韩国纽约州立大学);Stony Brook University(石溪大学)

Ha Young Kim, Niranjan Balasubramanian, Byungkon Kang

AI总结:

本研究探讨用预训练嵌入初始化Transformer的效果,发现GloVe、T5和mT5嵌入因分布过宽而劣于随机初始化,标准化后可显著提升,而BERT嵌入因接近Xavier范围表现更好。

摘要:

如今,在从头训练基于Transformer的模型时,使用随机初始化方案而非预训练嵌入已成为常见做法。确实,我们发现来自GloVe的预训练词嵌入,以及从T5和mT5等语言模型中提取的一些子词嵌入,其表现远不如随机初始化。鉴于预训练在表示学习和迁移学习方面的众所周知优势,这一结果违反直觉。有趣的是,我们还发现BERT和mBERT的嵌入表现优于随机初始化,显示出预训练表示的优势。在这项工作中,我们提出两个可能导致这些混合结果的因素:模型对参数分布的敏感性以及嵌入与位置编码的交互。我们观察到预训练的GloVe、T5和mT5嵌入具有更宽的数值分布。正如初始化研究所论证的,这种大数值初始化可能导致输出饱和,从而造成训练效果不佳。此外,较大的嵌入值在相加时实际上可能吸收较小的位置编码值,从而丢失位置信息。将预训练嵌入标准化到较窄范围(例如Xavier初始化所规定的范围)可为GloVe、T5和mT5嵌入带来显著提升。另一方面,BERT预训练嵌入虽然数值较大,但仍相对接近Xavier初始化范围,这可能使其能够有效迁移预训练知识。

英文摘要:

It has become common practice now to use random initialization schemes, rather than the pre-trained embeddings, when training transformer based models from scratch. Indeed, we find that pre-trained word embeddings from GloVe, and some sub-word embeddings extracted from language models such as T5 and mT5 fare much worse compared to random initialization. This is counter-intuitive given the well-known representational and transfer-learning advantages of pre-training. Interestingly, we also find that BERT and mBERT embeddings fare better than random initialization, showing the advantages of pre-trained representations. In this work, we posit two potential factors that contribute to these mixed results: the model sensitivity to parameter distribution and the embedding interactions with position encodings. We observe that pre-trained GloVe, T5, and mT5 embeddings have a wider distribution of values. As argued in the initialization studies, such large value initializations can lead to poor training because of saturated outputs. Further, the larger embedding values can, in effect, absorb the smaller position encoding values when added together, thus losing position information. Standardizing the pre-trained embeddings to a narrow range (e.g. as prescribed by Xavier) leads to substantial gains for Glove, T5, and mT5 embeddings. On the other hand, BERT pre-trained embeddings, while larger, are still relatively closer to Xavier initialization range which may allow it to effectively transfer the pre-trained knowledge.

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

↑