mlsanityData to 14 Oct 2026

Diagonal Batching Unlocks Parallelism in Recurrent Memory Transformers for Long Contexts

arXiv 2506.05229 ↗First posted 5 Jun 2025cs.LG cs.CLcited by 2

Not on the map. Why?

Abstract (arXiv)

Transformer models struggle with long-context inference due to their quadratic time and linear memory complexity. Recurrent Memory Transformers (RMTs) offer a solution by reducing the asymptotic cost to linear time and constant memory usage. However, their memory update mechanism leads to sequential execution, causing a performance bottleneck. We introduce Diagonal Batching, a scheduling scheme that unlocks parallelism across segments in RMTs while preserving exact recurrence. This approach eliminates the sequential constraint, enabling efficient GPU inference even for single long-context inputs without complex batching and pipelining techniques. Because the technique is purely a run-time computation reordering, existing RMT models adopt it with no retraining. Applied to a LLaMA-1B ARMT model, Diagonal Batching yields a 3.3x speedup over standard full-attention LLaMA-1B and a 1.8x speedup over the sequential RMT implementation on 131,072-token sequences. By removing sequential bottleneck, Diagonal Batching reduces inference cost and latency, thereby strengthening RMTs as a practical solution for real-world, long-context applications.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 30 of its 35 references that are in the map. First posted on arXiv 5 Jun 2025.

Builds on

30 of 35 references.

References · 30

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  5. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  6. 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,224
  7. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  8. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,465
  9. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  10. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
  11. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
  12. 2023AWQ: Activation-aware Weight Quantization for LLM Compression and Accelerationcited by 1,298
18 more
  1. 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,135
  2. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 827
  3. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
  4. 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 717
  5. 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 613
  6. 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 502
  7. 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 457
  8. 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 396
  9. 2014Memory Networkscited by 363
  10. 2023DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Modelscited by 245
  11. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
  12. 2024BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystackcited by 215
  13. 2022Recurrent Memory Transformercited by 203
  14. 2024The Illusion of State in State-Space Modelscited by 187
  15. 2022Speculative Decoding: Exploiting Speculative Execution for Accelerating Seq2seq Generationcited by 171
  16. 2023What Formal Languages Can Transformers Express? A Surveycited by 124
  17. 2022Block-Recurrent Transformerscited by 110
  18. 2024Associative Recurrent Memory Transformercited by 15

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.