It has been observed that transformers with greater depth (that is, more layers) have more capabilities, but can we establish formally which capabilities are gained? We answer this question with a theoretical proof followed by an empirical study. First, we consider transformers that round to fixed precision except inside attention. We show that this subclass of transformers is expressively equivalent to the programming language C-RASP and this equivalence preserves depth. Second, we prove that deeper C-RASP programs are more expressive than shallower C-RASP programs, implying that deeper transformers are more expressive than shallower transformers (within the subclass mentioned above). The same is also proven for transformers with positional encodings (like RoPE and ALiBi). These results are established by studying a temporal logic with counting operators equivalent to C-RASP. Finally, we provide empirical evidence that our theory predicts the depth required for transformers without positional encodings to length-generalize on a family of sequential dependency tasks.


翻译:已有研究表明,层数更多(即深度更大)的Transformer模型具备更强的能力,但我们能否从形式化角度明确界定具体获得了哪些能力?本文通过理论证明与实证研究相结合的方式对此问题作出解答。首先,我们考察了除注意力机制内部外均采用固定精度舍入的Transformer子类,证明其在表达能力上等价于编程语言C-RASP,且该等价关系保持深度不变。其次,我们证明深度更大的C-RASP程序比浅层程序具有更强的表达能力,从而推导出在上述子类中,深层Transformer比浅层Transformer更具表达力。对于包含位置编码(如RoPE和ALiBi)的Transformer模型,我们也证明了相同的结论。这些结论是通过研究一种与C-RASP等价的带计数运算符时序逻辑而建立的。最后,我们通过实验证据表明,本文提出的理论能够预测无位置编码Transformer在序列依赖任务族上实现长度泛化所需的深度。

0
下载
关闭预览

相关内容

Transformer是谷歌发表的论文《Attention Is All You Need》提出一种完全基于Attention的翻译架构

知识荟萃

精品入门和进阶教程、论文和代码整理等

更多

查看相关VIP内容、论文、资讯等
非Transformer不可?最新《状态空间模型(SSM)》综述
专知会员服务
75+阅读 · 2024年4月16日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
【NeurIPS 2021】流形上的注意力机制:规范等变的Transformer
华为等发布《视觉Transformer转换器》综述论文,21页pdf
专知会员服务
86+阅读 · 2020年12月25日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
深度学习中的注意力机制
CSDN大数据
24+阅读 · 2017年11月2日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员