We show that Transformer encoder architectures can be massively sped up, with limited accuracy costs, by replacing the self-attention sublayers with simple linear transformations that "mix" input tokens. These linear transformations, along with standard nonlinearities in feed-forward layers, prove competent at modeling semantic relationships in several text classification tasks. Most surprisingly, we find that replacing the self-attention sublayer in a Transformer encoder with a standard, unparameterized Fourier Transform achieves 92-97% of the accuracy of BERT counterparts on the GLUE benchmark, but trains nearly seven times faster on GPUs and twice as fast on TPUs. The resulting model, FNet, also scales very efficiently to long inputs. Specifically, when compared to the "efficient" Transformers on the Long Range Arena benchmark, FNet matches the accuracy of the most accurate models, but is faster than the fastest models across all sequence lengths on GPUs (and across relatively shorter lengths on TPUs). Finally, FNet has a light memory footprint and is particularly efficient at smaller model sizes: for a fixed speed and accuracy budget, small FNet models outperform Transformer counterparts.


翻译:最令人惊讶的是,我们发现,在变换器编码器中,以标准的、非参数化的 Fourier 变换器取代自控子层,其精度成本有限,可以用简单的线性变换取代自控子层,即“混合”输入符号。这些线性变换,加上标准的fef-forward层非线性变换,证明在多个文本分类任务中有能力模拟语义关系。最令人惊讶的是,我们发现,用标准的、非参数化的 Fourier 变换器取代自控子层,可以在GLUE 基准中使BERT对应方的精度达到92- 97%,但在GPUs上培训速度快近7倍,在TPUs上培训速度快一倍。由此产生的模型 FNet 也非常高效到长输入速度。 具体地说, 当与长距离基准线上的“ 高效” 变换器相比, FNet 匹配最精确的模型,但比GPUS上所有序列长度的最快模型(在TPUPUs上的较短长度上)更快。 最后, FNet有较小型的内存留足迹,在更小的模型上特别高效的模型变换码。

0
下载
关闭预览

相关内容

机器学习系统设计系统评估标准
注意力图神经网络的多标签文本分类
专知会员服务
111+阅读 · 2020年3月28日
强化学习最新教程,17页pdf
专知会员服务
167+阅读 · 2019年10月11日
2019年机器学习框架回顾
专知会员服务
35+阅读 · 2019年10月11日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
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日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
强化学习族谱
CreateAMind
26+阅读 · 2017年8月2日
SHAQ: Single Headed Attention with Quasi-Recurrence
Arxiv
0+阅读 · 2021年8月18日
Arxiv
6+阅读 · 2018年6月20日
VIP会员
相关VIP内容
相关资讯
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
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日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
强化学习族谱
CreateAMind
26+阅读 · 2017年8月2日
Top
微信扫码咨询专知VIP会员