Lune

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

74 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Big Bird: Transformers for Longer Sequences cites Compressive Transformers for Long-Range Sequence Modelling
  • In-context Autoencoder for Context Compression in a Large Language Model cites Compressive Transformers for Long-Range Sequence Modelling
  • Perceiver IO: A General Architecture for Structured Inputs & Outputs cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Perceiver IO: A General Architecture for Structured Inputs & Outputs cites Zero-Shot Text-to-Image Generation
  • Think before you speak: Training Language Models With Pause Tokens cites Vision Transformers Need Registers
  • Vision Transformers Need Registers cites Perceiver IO: A General Architecture for Structured Inputs & Outputs
  • Vision Transformers Need Registers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models cites Big Bird: Transformers for Longer Sequences
  • LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models cites Compressive Transformers for Long-Range Sequence Modelling
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers74

  1. Vision Transformers Need RegistersTimothée Darcet, Maxime Oquab, Julien Mairal, Piotr BojanowskiICLR 2024 · 769 citations
  2. Titans: Learning to Memorize at Test TimeAli Behrouz, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 368 citations
  3. LongLoRA: Efficient Fine-tuning of Long-Context Large Language ModelsYukang Chen, Shengju Qian, Haotian Tang, Xin Lai et al.ICLR 2024 · 254 citations
  4. Think before you speak: Training Language Models With Pause TokensSachin Goyal, Ziwei Ji, Ankit Singh Rawat, Aditya Krishna Menon et al.ICLR 2024 · 240 citations
  5. In-context Autoencoder for Context Compression in a Large Language ModelTao Ge, Jing Hu, Lei Wang, Xun Wang et al.ICLR 2024 · 158 citations

Builds on11

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  2. Zero-Shot Text-to-Image GenerationAditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray et al.ICML 2021 · 6,356 citations
  3. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
  4. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations
  5. Perceiver IO: A General Architecture for Structured Inputs & OutputsAndrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch et al.ICLR 2022 · 797 citations

Related papers

  1. Beyond Attention: Breaking the Limits of Transformer Context Length with Recurrent MemoryAydar Bulatov, Yuri Kuratov, Yermek Kapushev, Mikhail BurtsevAAAI 2024 · 22 citations
  2. RMAAT: Astrocyte-Inspired Memory Compression and Replay for Efficient Long-Context TransformersMd Zesun Ahmed Mia, Malyaban Bal, Abhronil SenguptaICLR 2026 · 1 citation
  3. ATLAS: Learning to Optimally Memorize the Context at Test TimeAli Behrouz, Zeman Li, Praneeth Kacham, Majid Daliri et al.ICML 2026 · 57 citations
  4. Segmented Recurrent Transformer: An Efficient Sequence-to-Sequence ModelYinghan Long, Sayeed Shafayet Chowdhury, Kaushik RoyEMNLP Findings 2023
  5. Block-Recurrent TransformersDeLesley Hutchins, Imanol Schlag, Yuhuai Wu, Ethan Dyer et al.NeurIPS 2022 · 163 citations
Dusk over the sea between two cliffs drawn in fine vertical lines