The transformer is the most popular neural architecture for language modeling. The cornerstone of the transformer is its global attention mechanism, which lets the model aggregate information from all preceding tokens before generating the next token. One common variant of attention is called local attention, which restricts each token to aggregating information from a bounded window of predecessors, reducing the quadratic cost of global attention to linear. Although this restriction is usually motivated by efficiency, it has also been found to improve model quality, a phenomenon that has so far lacked a satisfactory explanation. We provide a formal account of this phenomenon in terms of recognizer expressivity. It has been shown that fixed-precision transformers with global attention correspond to a fragment of linear temporal logic containing a single past operator. We additionally prove that adding local attention introduces a second temporal operator, strictly enlarging the class of recognizable regular languages. Moreover, global and local attention are expressively complementary: neither subsumes the other, and combining them yields the richest fragment. Experiments on formal language recognition and natural language modeling corroborate the theory, showing that hybrid global--local transformers outperform their global-only counterparts.


翻译:暂无翻译

0
下载
关闭预览

相关内容

【ICML2024】揭示Graph Transformers 中的过全局化问题
专知会员服务
21+阅读 · 2024年5月27日
144页ppt!《Transformers》全面讲解,附视频
专知会员服务
118+阅读 · 2023年1月1日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
最新《Transformers模型》教程,64页ppt
专知会员服务
326+阅读 · 2020年11月26日
Transformer模型-深度学习自然语言处理,17页ppt
专知会员服务
108+阅读 · 2020年8月30日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
BERT大火却不懂Transformer?读这一篇就够了
大数据文摘
12+阅读 · 2019年1月8日
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
31+阅读 · 2023年1月8日
Arxiv
35+阅读 · 2022年3月14日
Arxiv
17+阅读 · 2022年2月23日
Arxiv
39+阅读 · 2021年11月11日
Arxiv
11+阅读 · 2021年10月26日
Arxiv
103+阅读 · 2021年6月8日
Arxiv
19+阅读 · 2020年12月23日
VIP会员
最新内容
DeepSeek 版Claude Code,免费小白安装教程来了!
专知会员服务
5+阅读 · 5月5日
《美空军条令出版物 2-0:情报(2026版)》
专知会员服务
9+阅读 · 5月5日
帕兰提尔 Gotham:一个游戏规则改变器
专知会员服务
5+阅读 · 5月5日
【综述】 机器人学习中的世界模型:全面综述
专知会员服务
10+阅读 · 5月4日
伊朗的导弹-无人机行动及其对美国威慑的影响
相关VIP内容
相关资讯
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
BERT大火却不懂Transformer?读这一篇就够了
大数据文摘
12+阅读 · 2019年1月8日
相关论文
Arxiv
31+阅读 · 2023年1月8日
Arxiv
35+阅读 · 2022年3月14日
Arxiv
17+阅读 · 2022年2月23日
Arxiv
39+阅读 · 2021年11月11日
Arxiv
11+阅读 · 2021年10月26日
Arxiv
103+阅读 · 2021年6月8日
Arxiv
19+阅读 · 2020年12月23日
相关基金
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员