Transformers have a potential of learning longer-term dependency, but are limited by a fixed-length context in the setting of language modeling. We propose a novel neural architecture Transformer-XL that enables learning dependency beyond a fixed length without disrupting temporal coherence. It consists of a segment-level recurrence mechanism and a novel positional encoding scheme. Our method not only enables capturing longer-term dependency, but also resolves the context fragmentation problem. As a result, Transformer-XL learns dependency that is 80% longer than RNNs and 450% longer than vanilla Transformers, achieves better performance on both short and long sequences, and is up to 1,800+ times faster than vanilla Transformers during evaluation. Notably, we improve the state-of-the-art results of bpc/perplexity to 0.99 on enwiki8, 1.08 on text8, 18.3 on WikiText-103, 21.8 on One Billion Word, and 54.5 on Penn Treebank (without finetuning). When trained only on WikiText-103, Transformer-XL manages to generate reasonably coherent, novel text articles with thousands of tokens. Our code, pretrained models, and hyperparameters are available in both Tensorflow and PyTorch.


翻译:变异器具有学习长期依赖性的潜力,但在语言模型设置中受固定时间背景的限制。 我们提议一个新的神经结构变异器- XL, 使学习依赖性超过固定长度, 且不会破坏时间的一致性。 它由部分级重现机制和一个新颖的定位编码计划组成。 我们的方法不仅能够捕捉长期依赖性, 而且还能解决背景碎裂问题。 因此, 变异器- XL 学习依赖性比RNN 长80%, 比香草变异器长450%, 在短长序列上都取得更好的性能, 在评估期间比香草变异器快1 800+倍。 值得注意的是, 我们把最先进的bpc/plislity结果改进到0. 99 enwiki8, 1.08 在文本8, 18.3 在WikitText-103, 21.8 在一亿字W, 21.8, 和 Penn Treebank (不作微调) 54.5 。 当只受过Wikit- 103 的训练时, 变异器XL 管理着合理一致的新文本和上千件。

11
下载
关闭预览

相关内容

基于多头注意力胶囊网络的文本分类模型
专知会员服务
76+阅读 · 2020年5月24日
Transformer文本分类代码
专知会员服务
116+阅读 · 2020年2月3日
【MIT深度学习课程】深度序列建模,Deep Sequence Modeling
专知会员服务
75+阅读 · 2020年2月3日
BERT进展2019四篇必读论文
专知会员服务
64+阅读 · 2020年1月2日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
54+阅读 · 2019年10月17日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
52+阅读 · 2019年9月29日
GitHub超9千星:一个API调用27个NLP预训练模型
新智元
17+阅读 · 2019年7月22日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Transformer-XL:释放注意力模型的潜力
谷歌开发者
31+阅读 · 2019年2月19日
CMU、谷歌提出Transformer-XL:学习超长上下文关系
机器之心
9+阅读 · 2019年1月18日
Arxiv
21+阅读 · 2019年8月21日
Arxiv
6+阅读 · 2019年7月11日
The Evolved Transformer
Arxiv
5+阅读 · 2019年1月30日
Music Transformer
Arxiv
5+阅读 · 2018年12月12日
QuAC : Question Answering in Context
Arxiv
4+阅读 · 2018年8月21日
VIP会员
相关论文
Arxiv
21+阅读 · 2019年8月21日
Arxiv
6+阅读 · 2019年7月11日
The Evolved Transformer
Arxiv
5+阅读 · 2019年1月30日
Music Transformer
Arxiv
5+阅读 · 2018年12月12日
QuAC : Question Answering in Context
Arxiv
4+阅读 · 2018年8月21日
Top
微信扫码咨询专知VIP会员