Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

R-Transformer: Recurrent Neural Network Enhanced Transformer

About

Recurrent Neural Networks have long been the dominating choice for sequence modeling. However, it severely suffers from two issues: impotent in capturing very long-term dependencies and unable to parallelize the sequential computation procedure. Therefore, many non-recurrent sequence models that are built on convolution and attention operations have been proposed recently. Notably, models with multi-head attention such as Transformer have demonstrated extreme effectiveness in capturing long-term dependencies in a variety of sequence modeling tasks. Despite their success, however, these models lack necessary components to model local structures in sequences and heavily rely on position embeddings that have limited effects and require a considerable amount of design efforts. In this paper, we propose the R-Transformer which enjoys the advantages of both RNNs and the multi-head attention mechanism while avoids their respective drawbacks. The proposed model can effectively capture both local structures and global long-term dependencies in sequences without any use of position embeddings. We evaluate R-Transformer through extensive experiments with data from a wide range of domains and the empirical results show that R-Transformer outperforms the state-of-the-art methods by a large margin in most of the tasks. We have made the code publicly available at \url{https://github.com/DSE-MSU/R-transformer}.

Zhiwei Wang, Yao Ma, Zitao Liu, Jiliang Tang• 2019

Related benchmarks

TaskDatasetResultRank
Language ModelingPenn Treebank (test)
Perplexity84.38
411
Character-level Language ModelingPenn Treebank (test)
BPC1.24
113
Word-level predictionPTB word-level (test)
Perplexity84.38
19
Polyphonic music modelingNottingham (Nott)
NLL (nats)2.24
14
Polyphonic music modelingJSB Chorales
Negative Log-Likelihood (nats)8.26
14
Polyphonic music modelingPiano-midi.de
NLL (nats)7.44
12
Polyphonic music modelingMuseData (Muse)
Negative Log-Likelihood (nats)7
12
Polyphonic Music GenerationNottingham (test)
NLL2.37
11
Music ModelingNottingham
Average Loss2.37
7
Sequence ClassificationMNIST (test)
Accuracy (Test)99.1
6
Showing 10 of 11 rows

Other info

Code

Follow for update