arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.15552cs.CL
收藏

揭示Transformer模型中的多语言性:探索前馈网络中的语言特异性

Unveiling Multilinguality in Transformer Models: Exploring Language Specificity in Feed-Forward Networks

Institute of Formal and Applied Linguistics(形式与应用语言学研究所);Faculty of Mathematics and Physics(数学与物理学院);Charles University(查理大学)

Sunit Bhattacharya, Ondrej Bojar

AI总结:

本研究探索多语言Transformer模型前馈网络中的语言特异性,发现靠近输入和输出的层比中间层表现出更强的语言特定行为。

摘要:

最近的研究表明,Transformer中的前馈模块可以被视为一组键值记忆,其中键学习基于训练示例从输入中捕获特定模式。然后,值组合来自键的“记忆”的输出,以生成关于下一个token的预测。这导致了一个增量预测过程,逐渐收敛到接近输出层的最终token选择。这个有趣的视角引发了关于多语言模型如何利用这种机制的问题。具体而言,对于在两种或更多语言上训练的自回归模型,是否所有神经元(跨层)对所有语言的响应都相同?并非如此!我们的假设围绕这样一个概念:在预训练期间,某些模型参数学习强烈的语言特定特征,而其他参数学习更语言无关(跨语言共享)的特征。为了验证这一点,我们利用模型最初预训练所用的两种语言的平行语料库进行了实验。我们的发现表明,与中间层相比,最接近网络输入或输出的层倾向于表现出更多的语言特定行为。

英文摘要:

Recent research suggests that the feed-forward module within Transformers can be viewed as a collection of key-value memories, where the keys learn to capture specific patterns from the input based on the training examples. The values then combine the output from the 'memories' of the keys to generate predictions about the next token. This leads to an incremental process of prediction that gradually converges towards the final token choice near the output layers. This interesting perspective raises questions about how multilingual models might leverage this mechanism. Specifically, for autoregressive models trained on two or more languages, do all neurons (across layers) respond equally to all languages? No! Our hypothesis centers around the notion that during pretraining, certain model parameters learn strong language-specific features, while others learn more language-agnostic (shared across languages) features. To validate this, we conduct experiments utilizing parallel corpora of two languages that the model was initially pretrained on. Our findings reveal that the layers closest to the network's input or output tend to exhibit more language-specific behaviour compared to the layers in the middle.

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

↑