Increasing the input length has been a driver of progress in language modeling with transformers. We identify conditions where shorter inputs are not harmful, and achieve perplexity and efficiency improvements through two new methods that decrease input length. First, we show that initially training a model on short subsequences before moving on to longer ones both reduces overall training time and, surprisingly, substantially improves perplexity. Second, we show how to improve the efficiency of recurrence methods in transformers, which let models condition on previously processed tokens when generating sequences that exceed the maximal length the transformer can handle at once. Existing methods require computationally expensive relative position embeddings; we introduce a simple alternative of adding absolute position embeddings to queries and keys instead of to word embeddings, which efficiently produces superior results. We show that these recurrent models also benefit from short input lengths. Combining these techniques speeds up training by a factor of 1.65, reduces memory usage, and substantially improves perplexity on WikiText-103, without adding any parameters.


翻译:增加输入长度是变压器语言建模进步的驱动力。 我们找出了较短输入无害的条件, 并通过两种新的方法实现了混乱和效率改进, 从而降低输入长度。 首先, 我们显示, 最初先在短次序列上培训一个模型, 然后再进行长次序列, 一方面会减少整个培训时间, 令人惊讶的是, 还会大大地改善变压器的重复处理方法。 其次, 我们展示了如何提高变压器中重现方法的效率, 使模型在生成超过变压器所能同时处理的最大长度的序列时, 以先前处理过的符号为条件。 现有方法需要计算昂贵的相对位置嵌入; 我们引入了一个简单的替代方案, 即添加绝对位置嵌入查询和键, 而不是插入文字嵌入, 从而产生更高的效果。 我们显示, 这些重复模式也得益于短输入长度。 将这些技术加速培训的速度乘以1.65 系数, 减少记忆用量, 并大幅改进WikText- 103 103 的不增加参数 。

1
下载
关闭预览

相关内容

神经常微分方程教程,50页ppt,A brief tutorial on Neural ODEs
专知会员服务
74+阅读 · 2020年8月2日
【MIT深度学习课程】深度序列建模,Deep Sequence Modeling
专知会员服务
78+阅读 · 2020年2月3日
[综述]深度学习下的场景文本检测与识别
专知会员服务
78+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
104+阅读 · 2019年10月9日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Disentangled的假设的探讨
CreateAMind
9+阅读 · 2018年12月10日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
Hierarchical Imitation - Reinforcement Learning
CreateAMind
19+阅读 · 2018年5月25日
【推荐】用TensorFlow实现LSTM社交对话股市情感分析
机器学习研究会
11+阅读 · 2018年1月14日
干货|从LSTM到Seq2Seq
全球人工智能
15+阅读 · 2018年1月9日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
强化学习 cartpole_a3c
CreateAMind
9+阅读 · 2017年7月21日
Arxiv
6+阅读 · 2019年7月11日
Universal Transformers
Arxiv
5+阅读 · 2019年3月5日
Arxiv
27+阅读 · 2018年4月12日
Arxiv
5+阅读 · 2017年9月8日
VIP会员
相关资讯
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Disentangled的假设的探讨
CreateAMind
9+阅读 · 2018年12月10日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
Hierarchical Imitation - Reinforcement Learning
CreateAMind
19+阅读 · 2018年5月25日
【推荐】用TensorFlow实现LSTM社交对话股市情感分析
机器学习研究会
11+阅读 · 2018年1月14日
干货|从LSTM到Seq2Seq
全球人工智能
15+阅读 · 2018年1月9日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
强化学习 cartpole_a3c
CreateAMind
9+阅读 · 2017年7月21日
Top
微信扫码咨询专知VIP会员