Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Recurrent Memory Transformer

About

Transformer-based models show their effectiveness across multiple domains and tasks. The self-attention allows to combine information from all sequence elements into context-aware representations. However, global and local information has to be stored mostly in the same element-wise representations. Moreover, the length of an input sequence is limited by quadratic computational complexity of self-attention. In this work, we propose and study a memory-augmented segment-level recurrent Transformer (RMT). Memory allows to store and process local and global information as well as to pass information between segments of the long sequence with the help of recurrence. We implement a memory mechanism with no changes to Transformer model by adding special memory tokens to the input or output sequence. Then the model is trained to control both memory operations and sequence representations processing. Results of experiments show that RMT performs on par with the Transformer-XL on language modeling for smaller memory sizes and outperforms it for tasks that require longer sequence processing. We show that adding memory tokens to Tr-XL is able to improve its performance. This makes Recurrent Memory Transformer a promising architecture for applications that require learning of long-term dependencies and general purpose in memory processing, such as algorithmic tasks and reasoning.

Aydar Bulatov, Yuri Kuratov, Mikhail S. Burtsev• 2022

Related benchmarks

TaskDatasetResultRank
Language ModelingWikiText-103 (test)
Perplexity23.99
579
Long-range sequence modelingLong Range Arena (LRA) (test)
Accuracy (Avg)63.6
158
Long-text classificationHyperpartisan news detection (test)
F1 Score98.11
21
Long-sequence generative recommendationMerRec
H@114.65
16
Question AnsweringbAbI--
16
3D Visual NavigationViZDoom-Two-Colors
Return53.53
8
Offline Reinforcement LearningMemory Maze 9x9
Return7.27
7
Language ModelingLanguage Modeling (LM)
CE (128-255 tokens)2.91
7
Question AnsweringSQuAD short
Exact Match (EM)42.6
7
Showing 9 of 9 rows

Other info

Code

Follow for update