arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2405.12250cs.LGcs.AIcs.CL
收藏

你的Transformer其实是线性的

Your Transformer is Secretly Linear

AIRI;Skoltech(斯科尔泰克理工学院);Lomonosov Moscow State University(莫斯科罗蒙诺索夫国立大学);HSE University(高等经济大学);SberAI

Anton Razzhigaev, Matvey Mikhalchuk, Elizaveta Goncharova, Nikolai Gerasimenko, Ivan Oseledets, Denis Dimitrov, Andrey Kuznetsov

AI总结:

该研究发现Transformer解码器层间嵌入变换存在近完美线性关系,验证了高线性模块移除/近似对性能影响小,还提出余弦相似度正则化在降低线性度的同时提升基准性能,刷新了对Transformer架构的认知。

摘要:

本文揭示了Transformer解码器(包括GPT、LLaMA、OPT、BLOOM等模型)独有的一种全新线性特性。我们分析了连续层之间的嵌入变换,发现二者存在近乎完美的线性关系(Procrustes相似性得分为0.99)。然而,由于Transformer层的输出范数始终较低,移除残差组件后线性性会下降。我们的实验表明,移除或线性近似Transformer中部分线性度最高的模块,不会对损失值或模型性能产生显著影响。此外,在针对较小模型的预训练实验中,我们引入了一种基于余弦相似度的正则化方法,旨在降低层间线性性。该正则化提升了模型在Tiny Stories和SuperGLUE等基准上的性能指标,同时也成功降低了模型的线性度。本研究挑战了现有对Transformer架构的认知,表明其运行机制可能比此前假设的更具线性特性。

英文摘要:

This paper reveals a novel linear characteristic exclusive to transformer decoders, including models such as GPT, LLaMA, OPT, BLOOM and others. We analyze embedding transformations between sequential layers, uncovering a near-perfect linear relationship (Procrustes similarity score of 0.99). However, linearity decreases when the residual component is removed due to a consistently low output norm of the transformer layer. Our experiments show that removing or linearly approximating some of the most linear blocks of transformers does not affect significantly the loss or model performance. Moreover, in our pretraining experiments on smaller models we introduce a cosine-similarity-based regularization, aimed at reducing layer linearity. This regularization improves performance metrics on benchmarks like Tiny Stories and SuperGLUE and as well successfully decreases the linearity of the models. This study challenges the existing understanding of transformer architectures, suggesting that their operation may be more linear than previously assumed.

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

↑