Language Models with Transformers

Chenguang Wang, Mu Li, Alexander J. Smola
4/20/2019
cs.CLcs.AIcs.LG
transformer-attention

Official code: cgraywang/gluon-nlp-1 (22 stars, Python, last commit 2020-09-18).

Abstract

The Transformer architecture is superior to RNN-based models in computational efficiency. Recently, GPT and BERT demonstrate the efficacy of Transformer models on various NLP tasks using pre-trained language models on large-scale corpora.

Show full abstract

Surprisingly, these Transformer architectures are suboptimal for language model itself. Neither self-attention nor the positional encoding in the Transformer is able to efficiently incorporate the word-level sequential context crucial to language modeling. In this paper, we explore effective Transformer architectures for language model, including adding additional LSTM layers to better capture the sequential context while still keeping the computation efficient. We propose Coordinate Architecture Search (CAS) to find an effective architecture through iterative refinement of the model. Experimental results on the PTB, WikiText-2, and WikiText-103 show that CAS achieves perplexities between 20.42 and 34.11 on all problems, i.e. on average an improvement of 12.0 perplexity units compared to state-of-the-art LSTMs. The source code is publicly available.

View on arXivView PDF

Code Implementations(1)

Code repo for "Language Models with Transformers" paper

2213PythonApr 30, 20186 years ago

Similar Papers

Cite this paper

@article{wang2019language,
  title  = {Language Models with Transformers},
  author = {Chenguang Wang and Mu Li and Alexander J. Smola},
  year   = {2019},
  eprint = {1904.09408},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1904.09408}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1904.09408.svg)](https://codeofpaper.com/paper/1904.09408)

Discussion