Skip to content
Preprint

Maglev: Sliding Recurrent Memory

Aug 2026 · 2 citations · 55 references
Computer Science

TL;DR

A recurrent Transformer architecture with fixed-size memory that generalizes sliding-window attention while remaining parallelizable during training and improves validation loss and downstream pretraining benchmarks over sliding-window and latent recurrent transformer baselines.

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

View source

Similar papers

#machine learning Preprint Aug 2026

Fast Weight Attention for Continual Learning

This framework separates temporal alignment, plasticity, forgetting, and bounded rehearsal in recurrent sequence models, together with numerically stable positive-decay renormalization, to remain competitive in language modeling and improve length extrapolation on variable-digit addition.

Yi-Fan Zhang, Steve Ta, Jasper Zhang et al. · 0 citations
#natural language process... Preprint Sep 2026

Persistent Recurrent Memory Between Transformer Layers - Improves Language Model Generalization

We introduce a simple architectural modification to decoder-only transformers: a persistent recurrent state that observes hidden representations via cross-attention, updates itself through a GRU, and modulates subsequent processing via gated addition. Inserted between the lower and upper halves of a 6-layer transformer...

E. Hering · 0 citations
#artificial intelligence Preprint Sep 2026

RunningTensor: Generalizing Linear Attention to Higher-Order Recurrent States

The RunningTensor is introduced, which generalizes this memory to an order-o tensor, updated by a rank-1 outer product and read by contracting against $o-1$ vector queries, and improves performance on language-understanding and non-synthetic retrieval tasks, suggesting that higher-order recurrent state can provide usef...

Luca Herranz-Celotti, Vincent Guigue · 1 citation
Preprint Aug 2026

p-Spin Glass Network Efficient Single-Batch Continual Learning

The p-Spin Glass Network is introduced, a novel architecture that overcomes limitations, structurally manages optimization variance and yields stability that proves modality-agnostic, establishing a foundation for continuous learning and edge AI.

Vladimer Khasia · 0 citations
#artificial intelligence Preprint Aug 2026

MoNe: Modular Neural Memory for Efficient Long Context Inference

MoNe is a lightweight modular neural memory that attaches to any frozen pretrained Transformer to enable long-context inference without retraining, achieving strong performance on needle-in-a-haystack and word extraction benchmarks from RULER, where ICL degrades sharply.

Won-Yong Cho, Kyubyung Chae, Tribhuvanesh Orekondy et al. · 0 citations
#machine learning Preprint Sep 2026

Low-Rank Friction for Memory-Efficient Transformer Pretraining

iKFAD is a recently proposed optimiser that replaces adaptive learning rates with adaptive friction in the momentum dynamics, yet performs as well as Adam. Its limitation is that the full friction tensor $\xi\in\mathbb{R}^{m\times n}$ carries the same $\mathcal{O}(mn)$ memory overhead per layer as Adam's second-moment...

Rajit Rajpal, B. Leimkuhler · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.