During pretraining, the Pre-LayerNorm transformer suffers from a gradient magnitude mismatch: gradients at early layers are much larger than at later layers. These issues can be alleviated by our proposed NormFormer architecture, which adds three normalization operations to each layer: a Layer Norm after self attention, head-wise scaling of self-attention outputs, and a Layer Norm after the first fully connected layer. The extra operations incur negligible compute cost (+0.4% parameter increase), but improve pretraining perplexity and downstream task performance for both causal and masked language models ranging from 125 Million to 2.7 Billion parameters. For example, adding NormFormer on top of our strongest 1.3B parameter baseline can reach equal perplexity 24% faster, or converge 0.27 perplexity better in the same compute budget. This model reaches GPT3-Large (1.3B) zero shot performance 60% faster. For masked language modeling, NormFormer improves fine-tuned GLUE performance by 1.9% on average. Code to train NormFormer models is available in fairseq https://github.com/pytorch/fairseq/tree/main/examples/normformer .


翻译:在预训练期间,LayerNorm前变压器存在一个梯度错差:早期层的梯度比后层的梯度要大得多。这些问题可以通过我们提议的NormFormer结构来缓解。 我们提议的NormFormer结构为每个层增加了三个正常化操作: 自我关注后的层圈, 自我注意后头视的输出尺度和第一个完全连接的层之后的层圈。 额外操作产生可忽略不计的计算成本( +0. 4% 参数增加), 但对于从125万到2. 7 10 亿的因果和遮蔽语言模型, 培训前的难度和下游任务性能都有所改善。 例如, 在我们1.3B 最强的参数基线之上添加NormFormer可以更快地达到相等的复度 24%, 在同一计算预算中将0. 27 的复度集中得更好。 这个模型达到 GPT3- Large (1.3B) 零射速性能60% 。 对于蒙语言模型来说, NormFormers 平均将精调GLUE的性表现提高1.9%。培训NormFormer模型的代码可以在 https://gistrebub/ report/ report/ report/formormormexx/ regres/ regreystrystry/

0
下载
关闭预览

相关内容

最新《Transformers模型》教程,64页ppt
专知会员服务
326+阅读 · 2020年11月26日
专知会员服务
47+阅读 · 2020年10月31日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
专知会员服务
16+阅读 · 2020年7月27日
【伯克利】再思考 Transformer中的Batch Normalization
专知会员服务
41+阅读 · 2020年3月21日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
61+阅读 · 2019年10月17日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
32+阅读 · 2019年10月16日
深度卷积神经网络中的降采样
极市平台
12+阅读 · 2019年5月24日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
已删除
将门创投
6+阅读 · 2019年1月2日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
强化学习 cartpole_a3c
CreateAMind
9+阅读 · 2017年7月21日
Arxiv
11+阅读 · 2021年10月26日
Arxiv
17+阅读 · 2021年3月29日
VIP会员
最新内容
《人工智能赋能的适应性多功能电磁战》
专知会员服务
11+阅读 · 9月29日
俄乌战场实验室:全面战争如何重塑现代作战
专知会员服务
8+阅读 · 9月29日
2026年美空军协会会议上的无人机系统趋势
专知会员服务
10+阅读 · 9月28日
反制无人机:乌克兰提供的五点启示
专知会员服务
16+阅读 · 9月23日
《各指挥层级均亟需红队能力》报告
专知会员服务
11+阅读 · 9月23日
《航电任务系统框架(FAMOS)》50页报告
专知会员服务
9+阅读 · 9月22日
《对抗行动中的人工智能与自主性》智库报告
专知会员服务
15+阅读 · 9月22日
《从数据到胜利:战争中的分析优势之争》
专知会员服务
18+阅读 · 9月22日
相关VIP内容
最新《Transformers模型》教程,64页ppt
专知会员服务
326+阅读 · 2020年11月26日
专知会员服务
47+阅读 · 2020年10月31日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
专知会员服务
16+阅读 · 2020年7月27日
【伯克利】再思考 Transformer中的Batch Normalization
专知会员服务
41+阅读 · 2020年3月21日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
61+阅读 · 2019年10月17日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
32+阅读 · 2019年10月16日
相关资讯
深度卷积神经网络中的降采样
极市平台
12+阅读 · 2019年5月24日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
已删除
将门创投
6+阅读 · 2019年1月2日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
强化学习 cartpole_a3c
CreateAMind
9+阅读 · 2017年7月21日
相关论文
Top
微信扫码咨询专知VIP会员