Memory Transformer
By Mikhail S. Burtsev, Grigory V. Sapunov. 2020
99 citations recorded by the source corpus.
Transformer-based models have achieved state-of-the-art results in many natural language processing (NLP) tasks. The self-attention architecture allows us to combine information from all elements of a sequence into context-aware representations. However, all-to-all attention severely hurts the scaling of the model to large sequences. Another limitation is that information about the context is stored in the same element-wise representations. This makes the processing of properties related to the sequence as a whole more difficult. Adding trainable memory to selectively store local as well as global representations of a sequence is a promising direction to improve the Transformer model. Memory-augmented neural networks (MANNs) extend traditional neural architectures with general-purpose memory for representations. MANNs have demonstrated the capability to learn simple algorithms like Copy or Reverse and can be successfully trained via backpropagation on diverse tasks from question answering to language modeling outperforming RNNs and LSTMs of comparable complexity. In this work, we propose and study two extensions of the Transformer baseline (1) by adding memory tokens to store non-local representations, and (2) creating memory bottleneck for the global information. We evaluate these memory augmented Transformers on machine translation task and demonstrate that memory size positively correlates with the model performance. Attention patterns over the memory suggest that it improves the model's ability to process a global context. We expect that the application of Memory Transformer architectures to the tasks of language modeling, reading comprehension, and text summarization, as well as other NLP tasks that require the processing of long contexts will contribute to solving challenging problems of natural language understanding and generation.
Subfields: Biomedical Engineering, Electrical and Electronic Engineering, Model Architectures
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Biomedical Engineering
- Michael C. Mozer
- Amirkeivan Mohtashami
- Yoshua Bengio
- Anirudh Goyal
- Maxime Oquab
- Timothée Darcet
- Piotr Bojanowski
- Martin Jaggi
In Electrical and Electronic Engineering
- Anirudh Goyal
- Nan Rosemary Ke
- Sanjiv Kumar
- Amirkeivan Mohtashami
- Charles Blundell
- Jonathan Binas
- Yoshua Bengio
- Maxime Oquab
In Model Architectures
- Anirudh Goyal
- Nan Rosemary Ke
- Michael C. Mozer
- Yoshua Bengio
- Charles Blundell
- Martin Jaggi
- Aniket Rajiv Didolkar
- Alex Lamb
Citations in the corpus
- Landmark Attention: Random-Access Infinite Context Length for Transformers (2023, methodology): “Memory Transformers [6] introduce special memory tokens that are prepended to the input, and their representation at the final layer of the model is used for the next input.”
- Scalable Adaptive Computation for Iterative Generation (2022, neutral): “Recurrent Interface Networks bear resemblance to architectures that leverage auxiliary memory to decouple computation from the input structure such as Memory Networks (Weston et al., 2014; Sukhbaatar et al., 2015), Neural Turing Machines (Graves et al., 2014), Stack-RNN (Joulin & Mikolov, 2015), Set”
- Coordination Among Neural Modules Through a Shared Global Workspace (2021, background): “In the context of transformers, Burtsev and Sapunov (2020) introduce memory tokens that are processed in addition to sequence tokens, whereas Dai et al. (2019) (Transformer-XL) propose to partition a long sequence to smaller segments and use the activations of the previous segment in memory while…”
- Vision Transformers Need Registers (2023, methodology): “This mechanism was first proposed in Memory Transformers (Burtsev et al., 2020), improving translation tasks in NLP. Interestingly, we show here that this mechanism admits a natural justification for vision transformers, fixing an interpretability and performance issue that was present otherwise.…”
- Think before you speak: Training Language Models With Pause Tokens (2023, background): “…only as an input has found its use in various forms, most commonly as <cls> (Chang et al., 2023; Liu, 2019; Devlin et al., 2019), <sep> or <mask> in BERT (Devlin et al., 2019) and in a line of work on adding memory to transformers (Burtsev et al., 2020; Bulatov et al., 2022; Darcet et al., 2023).”
- Recurrent Memory Transformer (2022, unknown): “Memory augmented Transformers such as GMAT, ETC, Memory Transformer (Gupta and Berant, 2020; Ainslie et al., 2020; Burtsev et al., 2020) proposed to use special global tokens as storage for representations.”