Feed-forward layers constitute two-thirds of a transformer model's parameters, yet their role in the network remains under-explored. We show that feed-forward layers in transformer-based language models operate as key-value memories, where each key correlates with textual patterns in the training examples, and each value induces a distribution over the output vocabulary. Our experiments show that the learned patterns are human-interpretable, and that lower layers tend to capture shallow patterns, while upper layers learn more semantic ones. The values complement the keys' input patterns by inducing output distributions that concentrate probability mass on tokens likely to appear immediately after each pattern, particularly in the upper layers. Finally, we demonstrate that the output of a feed-forward layer is a composition of its memories, which is subsequently refined throughout the model's layers via residual connections to produce the final output distribution.


翻译:Feed-forward 层构成变压器模型参数的三分之二,但它们在网络中的作用仍未得到充分探索。 我们显示,以变压器为基础的语言模型的 feed-forward 层作为关键值记忆发挥作用,其中每个关键值与培训示例中的文本模式相关,每个值都诱发输出词汇的分布。 我们的实验显示,所学模式是人类可解释的,低层倾向于捕捉浅层模式,而上层则学习更多的语义模式。 这些数值通过吸引输出分布来补充键的输入模式,这种输出分布将概率集中在每个模式之后可能立即出现的符号上层。 最后,我们证明, 进料前层的输出是其记忆的构成, 随后通过剩余连接在整个模型层中进行改进,以产生最终输出分布。

0
下载
关闭预览

相关内容

专知会员服务
38+阅读 · 2021年5月15日
最新《Transformers模型》教程,64页ppt
专知会员服务
326+阅读 · 2020年11月26日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
82+阅读 · 2020年7月26日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
61+阅读 · 2019年10月17日
开源书:PyTorch深度学习起步
专知会员服务
51+阅读 · 2019年10月11日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
BERT大火却不懂Transformer?读这一篇就够了
大数据文摘
12+阅读 · 2019年1月8日
TensorFlow seq2seq中的Attention机制(续)
深度学习每日摘要
15+阅读 · 2017年11月16日
【推荐】用Tensorflow理解LSTM
机器学习研究会
36+阅读 · 2017年9月11日
论文共读 | Attention is All You Need
黑龙江大学自然语言处理实验室
15+阅读 · 2017年9月7日
已删除
将门创投
8+阅读 · 2017年7月21日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Arxiv
6+阅读 · 2019年7月11日
Sparse Sequence-to-Sequence Models
Arxiv
5+阅读 · 2019年5月14日
Arxiv
29+阅读 · 2017年12月6日
VIP会员
最新内容
乌克兰纵深打击如何重塑俄罗斯的战略选择
专知会员服务
1+阅读 · 今天12:25
俄乌战争中关于中程打击无人机部署的经验启示
专知会员服务
0+阅读 · 今天12:08
《基于强化学习的自动化红队测试》
专知会员服务
4+阅读 · 7月23日
伊朗不对称防空战略的演进
专知会员服务
4+阅读 · 7月23日
对抗环境下超视距目标打击的情报支援
专知会员服务
10+阅读 · 7月22日
相关VIP内容
专知会员服务
38+阅读 · 2021年5月15日
最新《Transformers模型》教程,64页ppt
专知会员服务
326+阅读 · 2020年11月26日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
82+阅读 · 2020年7月26日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
61+阅读 · 2019年10月17日
开源书:PyTorch深度学习起步
专知会员服务
51+阅读 · 2019年10月11日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
相关资讯
BERT大火却不懂Transformer?读这一篇就够了
大数据文摘
12+阅读 · 2019年1月8日
TensorFlow seq2seq中的Attention机制(续)
深度学习每日摘要
15+阅读 · 2017年11月16日
【推荐】用Tensorflow理解LSTM
机器学习研究会
36+阅读 · 2017年9月11日
论文共读 | Attention is All You Need
黑龙江大学自然语言处理实验室
15+阅读 · 2017年9月7日
已删除
将门创投
8+阅读 · 2017年7月21日
相关论文
Top
微信扫码咨询专知VIP会员