cs.LGAug 3, 2026

Maglev: Sliding Recurrent Memory

Authors: Bo LiuQiang Liu

Organizations: The University of Texas at Austin

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 QQ, which leverages full attention\footnote{In practice, we use interleaved full and sliding-window attention for QQ, as this yields stronger performance. The essential requirement is that QQ be more expressive than PP, with access to the full history.} to produce memory targets mtm'_t, and a decoder PP, which uses only sliding-window attention and recurrent K/V injection to produce decoder memories mtm_t for next-token prediction. We train \ours{} with a memory consistency loss that aligns mtm_t with mtm'_t, allowing inference to use PP alone. Empirically, \ours{} improves validation loss and downstream pretraining benchmarks over sliding-window and latent recurrent transformer baselines. Moreover, sharing parameters between PP and QQ reduces parameter memory while preserving most of the gains.

Explore similar work

CardsList