What is the computational model behind a Transformer? Where recurrent neural networks have direct parallels in finite state machines, allowing clear discussion and thought around architecture variants or trained models, Transformers have no such familiar parallel. In this paper we aim to change that, proposing a computational model for the transformer-encoder in the form of a programming language. We map the basic components of a transformer-encoder -- attention and feed-forward computation -- into simple primitives, around which we form a programming language: the Restricted Access Sequence Processing Language (RASP). We show how RASP can be used to program solutions to tasks that could conceivably be learned by a Transformer, and how a Transformer can be trained to mimic a RASP solution. In particular, we provide RASP programs for histograms, sorting, and Dyck-languages. We further use our model to relate their difficulty in terms of the number of required layers and attention heads: analyzing a RASP program implies a maximum number of heads and layers necessary to encode a task in a transformer. Finally, we see how insights gained from our abstraction might be used to explain phenomena seen in recent works.


翻译:变换器背后的计算模型是什么? 当反复出现的神经网络在有限的状态机器中具有直接相似之处,允许围绕建筑变异或经过训练的模型进行清晰的讨论和思考时,变换器没有如此熟悉的相似之处。 在本文中,我们的目标是改变这一模式,以编程语言的形式为变压器-变压器编码器提出一个计算模型。我们将变压器-变压器的基本组成部分 -- -- 注意和进向计算 -- -- 映射成简单的原始体,我们形成一种编程语言:限制存取序列处理语言(RASP)。我们展示了RASP如何用程序来编程解决方案解决由变换器可以想象到的任务,以及如何训练变换器模拟变压器的解决方案。特别是,我们为变压器-变压器-变压器、分排序和Dyck-语言提供了RASP程序。我们进一步使用我们的模型将变压器的难度与所需层次和注意头数联系起来:分析RASP程序意味着在变换器中将任务编码为最多必要的头和层次。我们可以看到如何利用抽象现象。

0
下载
关闭预览

相关内容

专知会员服务
29+阅读 · 2021年7月30日
专知会员服务
58+阅读 · 2021年2月16日
最新《Transformers模型》教程,64页ppt
专知会员服务
274+阅读 · 2020年11月26日
【机器推理可解释性】Machine Reasoning Explainability
专知会员服务
34+阅读 · 2020年9月3日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
97+阅读 · 2020年8月30日
Transformer文本分类代码
专知会员服务
116+阅读 · 2020年2月3日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
30+阅读 · 2019年10月16日
2019年机器学习框架回顾
专知会员服务
35+阅读 · 2019年10月11日
Transformer中的相对位置编码
AINLP
5+阅读 · 2020年11月28日
【论文笔记】通俗理解少样本文本分类 (Few-Shot Text Classification) (1)
深度学习自然语言处理
7+阅读 · 2020年4月8日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【推荐】用Tensorflow理解LSTM
机器学习研究会
36+阅读 · 2017年9月11日
【推荐】GAN架构入门综述(资源汇总)
机器学习研究会
10+阅读 · 2017年9月3日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
10+阅读 · 2015年7月1日
Arxiv
0+阅读 · 2021年9月20日
Arxiv
102+阅读 · 2021年6月8日
Arxiv
19+阅读 · 2020年12月23日
Arxiv
22+阅读 · 2020年9月16日
Universal Transformers
Arxiv
5+阅读 · 2019年3月5日
Star-Transformer
Arxiv
5+阅读 · 2019年2月28日
The Evolved Transformer
Arxiv
5+阅读 · 2019年1月30日
Arxiv
3+阅读 · 2018年3月28日
VIP会员
相关VIP内容
专知会员服务
29+阅读 · 2021年7月30日
专知会员服务
58+阅读 · 2021年2月16日
最新《Transformers模型》教程,64页ppt
专知会员服务
274+阅读 · 2020年11月26日
【机器推理可解释性】Machine Reasoning Explainability
专知会员服务
34+阅读 · 2020年9月3日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
97+阅读 · 2020年8月30日
Transformer文本分类代码
专知会员服务
116+阅读 · 2020年2月3日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
30+阅读 · 2019年10月16日
2019年机器学习框架回顾
专知会员服务
35+阅读 · 2019年10月11日
相关资讯
Transformer中的相对位置编码
AINLP
5+阅读 · 2020年11月28日
【论文笔记】通俗理解少样本文本分类 (Few-Shot Text Classification) (1)
深度学习自然语言处理
7+阅读 · 2020年4月8日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【推荐】用Tensorflow理解LSTM
机器学习研究会
36+阅读 · 2017年9月11日
【推荐】GAN架构入门综述(资源汇总)
机器学习研究会
10+阅读 · 2017年9月3日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
10+阅读 · 2015年7月1日
相关论文
Arxiv
0+阅读 · 2021年9月20日
Arxiv
102+阅读 · 2021年6月8日
Arxiv
19+阅读 · 2020年12月23日
Arxiv
22+阅读 · 2020年9月16日
Universal Transformers
Arxiv
5+阅读 · 2019年3月5日
Star-Transformer
Arxiv
5+阅读 · 2019年2月28日
The Evolved Transformer
Arxiv
5+阅读 · 2019年1月30日
Arxiv
3+阅读 · 2018年3月28日
Top
微信扫码咨询专知VIP会员