Maglev Introduces Sliding Recurrent Memory for Transformers

Bo Liu, Qiang Liu· August 5, 2026 View original

Key takeaways

  • Maglev is a recurrent Transformer architecture that generalizes sliding-window attention.
  • It uses a fixed-size memory and remains parallelizable during training.
  • The architecture improves validation loss and pretraining benchmarks.
  • Parameter sharing between its components reduces memory footprint.

Who benefits

AI/ML DevelopmentNatural Language ProcessingSpeech RecognitionComputer VisionData Science

Summary

Researchers present Maglev, a recurrent Transformer architecture with fixed-size memory that generalizes sliding-window attention while maintaining parallelizability during training. It uses two coupled models—a prefiller and a decoder—trained with a memory consistency loss, showing improved validation loss and benchmark performance.

A new research paper introduces Maglev, an innovative recurrent Transformer architecture designed to enhance long-context processing while maintaining computational efficiency. Maglev features a fixed-size memory mechanism that extends the concept of sliding-window attention, crucially remaining parallelizable during the training phase. This architecture comprises two interconnected models: a "prefiller" (Q) that uses full or interleaved attention to generate memory targets, and a "decoder" (P) that relies on sliding-window attention and recurrent K/V injection to produce memories for predicting the next token. The training process for Maglev involves a memory consistency loss, which ensures that the decoder's memories align with those generated by the prefiller. This alignment allows the decoder (P) to operate independently during inference, leveraging its efficient sliding-window and recurrent mechanisms. Empirically, Maglev has demonstrated improvements in validation loss and performance on downstream pretraining benchmarks compared to existing sliding-window and latent recurrent transformer baselines. Furthermore, sharing parameters between the prefiller and decoder helps reduce memory footprint while largely preserving performance gains.

Why it matters

Maglev offers a more efficient way to handle long sequences in Transformer models, potentially leading to more powerful and scalable AI applications with reduced computational costs for training and inference.

How to implement this in your domain

  1. 1Evaluate current Transformer architectures for limitations in handling long contexts or high computational costs.
  2. 2Explore Maglev's approach to sliding recurrent memory for potential integration into large language models or sequence processing tasks.
  3. 3Investigate the benefits of coupled model training with memory consistency loss for improving model efficiency.
  4. 4Consider adopting Maglev's parameter sharing strategy to optimize memory usage in large-scale AI deployments.
  5. 5Benchmark Maglev against existing sliding-window and recurrent Transformer baselines for specific use cases.

Original post by Bo Liu, Qiang Liu

"arXiv:2608.02870v1 Announce Type: new Abstract: We introduce \ours{}, a recurrent Transformer architecture with fixed-size memory that generalizes sliding-window attention while remaining parallelizable during training. \ours{} consists of two coupled models: a prefiller $Q$, whi…"

View on X

Originally posted by Bo Liu, Qiang Liu on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses