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

Transformer 变得稳定:语言模型的端到端信号传播理论

Transformers Get Stable: An End-to-End Signal Propagation Theory for Language Models

Samsung Research(三星研究院);Carnegie Mellon University(卡内基梅隆大学)

Akhil Kedia, Mohd Abbas Zaidi, Sushil Khyalia, Jungho Jung, Harshith Goka, Haejun Lee

AI总结:

本文提出统一的信号传播理论及 DeepScaleLM 初始化缩放方案,使 Transformer 可训练至 1000 层,并在多项任务上以更少参数超越浅层模型。

摘要:

尽管取得了巨大的成功,Transformer 模型在深度扩展方面仍然面临困难。在这项工作中,我们发展了一个统一的信号传播理论,并提供了控制 Transformer 模型中前向和反向信号矩的公式。我们的框架可用于理解和缓解梯度消失/爆炸、秩塌缩以及与高注意力分数相关的不稳定性。我们还提出了 DeepScaleLM,一种初始化和缩放方案,该方案在整个模型中保持单位输出/梯度矩,从而能够训练具有 1000 层的非常深的模型。我们发现 Transformer 模型可以更深——我们的深层模型在参数更少的情况下,在语言建模、语音翻译和图像分类任务中,在仅编码器、仅解码器和编码器-解码器变体,以及 Pre-LN 和 Post-LN Transformer 上,在多个数据集和模型规模下,均优于浅层模型。这些改进还转化为在下游问答任务上的性能提升和图像分类鲁棒性的增强。

英文摘要:

In spite of their huge success, transformer models remain difficult to scale in depth. In this work, we develop a unified signal propagation theory and provide formulae that govern the moments of the forward and backward signal through the transformer model. Our framework can be used to understand and mitigate vanishing/exploding gradients, rank collapse, and instability associated with high attention scores. We also propose DeepScaleLM, an initialization and scaling scheme that conserves unit output/gradient moments throughout the model, enabling the training of very deep models with 1000 layers. We find that transformer models could be much deeper - our deep models with fewer parameters outperform shallow models in Language Modeling, Speech Translation, and Image Classification, across encoder-only, decoder-only and encoder-decoder variants, for both Pre-LN and Post-LN transformers, for multiple datasets and model sizes. These improvements also translate into improved performance on downstream Question Answering tasks and improved robustness for Image Classification.

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

↑