Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:1901.02860

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Machine Learning

arXiv:1901.02860 (cs)
[Submitted on 9 Jan 2019 (v1), last revised 2 Jun 2019 (this version, v3)]

Title:Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context

Authors:Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, Ruslan Salakhutdinov
View a PDF of the paper titled Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context, by Zihang Dai and 5 other authors
View PDF
Abstract: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.
Comments: ACL 2019 long paper. Code and pretrained models are available at this https URL
Subjects: Machine Learning (cs.LG); Computation and Language (cs.CL); Machine Learning (stat.ML)
Cite as: arXiv:1901.02860 [cs.LG]
  (or arXiv:1901.02860v3 [cs.LG] for this version)
  https://doi.org/10.48550/arXiv.1901.02860
arXiv-issued DOI via DataCite

Submission history

From: Zihang Dai [view email]
[v1] Wed, 9 Jan 2019 18:28:19 UTC (2,124 KB)
[v2] Fri, 18 Jan 2019 18:38:00 UTC (2,126 KB)
[v3] Sun, 2 Jun 2019 21:21:48 UTC (2,457 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context, by Zihang Dai and 5 other authors
  • View PDF
  • TeX Source
  • Other Formats
license icon view license
Current browse context:
cs.LG
< prev   |   next >
new | recent | 2019-01
Change to browse by:
cs
cs.CL
stat
stat.ML

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

4 blog links

(what is this?)

DBLP - CS Bibliography

listing | bibtex
Zihang Dai
Zhilin Yang
Yiming Yang
Jaime G. Carbonell
Quoc V. Le
…
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
IArxiv Recommender (What is IArxiv?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack