Existing expressivity results for transformers typically rely on hardmax attention, high precision, and other architectural modifications that disconnect them from the models used in practice. We bridge this gap by analyzing standard transformer decoders with softmax attention and rounding of activations and attention weights, while allowing depth and width to grow logarithmically with the context length. As an intermediate step, we construct hardmax transformers with ternary activations and well-separated attention scores that simulate Turing machines using Chain-of-Thought (CoT). This lets us convert the constructions to equivalent softmax transformers without the unrealistic parameter magnitudes or activation precision that prior approaches would require. Using the same technique, we analyze a recently proposed summarized CoT paradigm and show that it simulates Turing machines more efficiently, with model size scaling logarithmically in a space bound rather than a time bound. We empirically test predictions made by our results on a Sudoku reasoning task and find better alignment with learnability than for prior high-precision results. Our code is available at https://github.com/moritzbroe/transformer-expressivity.


翻译:现有关于Transformer表达能力的研究大多依赖于硬注意力(hardmax attention)、高精度运算以及其他架构改进,这使得这些研究与实际使用的模型存在脱节。本文通过分析标准Transformer解码器(采用softmax注意力机制,并对激活值和注意力权重进行四舍五入)来弥合这一差距,同时允许深度和宽度随上下文长度对数增长。作为中间步骤,我们构建了具有三元激活值和良好分离注意力分数的硬注意力Transformer,这些Transformer利用思维链(Chain-of-Thought, CoT)模拟图灵机。这使我们能够将构造转化为等效的softmax Transformer,而无需像先前方法那样引入不现实的参数幅度或激活精度。运用相同技术,我们分析了近期提出的摘要式思维链(summarized CoT)范式,并证明它能更高效地模拟图灵机,其模型规模随空间界限而非时间界限对数增长。我们在数独推理任务上对我们的结果进行了实证检验,发现与先前高精度结果相比,其与可学习性的对齐度更高。我们的代码开源在https://github.com/moritzbroe/transformer-expressivity。

0
下载
关闭预览

相关内容

【ICML2023】Transformer编码器表达能力的更严格界限
专知会员服务
31+阅读 · 2023年4月27日
144页ppt!《Transformers》全面讲解,附视频
专知会员服务
119+阅读 · 2023年1月1日
【ICML2022】Transformer是元强化学习器
专知会员服务
56+阅读 · 2022年6月15日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
【Tutorial】计算机视觉中的Transformer,98页ppt
专知
21+阅读 · 2021年10月25日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月15日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员