arXiv(opens in a new tab)cs.LGOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.02816

Gated Slot Attention-2: Two-Sided Associative Memory Correction in Linear Attention

Ruijie Li, Shengnan Ding, Weimin Zhang, Derick Tang, Zhanpeng Zeng, Qinsong Zeng, Ming Chen, Jiaxi Hu, Yuxuan Liang

ABSTRACT

Linear attention models have emerged as efficient alternatives to standard attention, but effectively managing their fixed-size recurrent memory remains challenging. To improve memory, recent work has explored two distinct directions: delta-rule variants for precise correction of values associated with keys, and slot-based architectures such as Gated Slot Attention for modeling key and value memories in two stages. We observe that these directions are complementary—the delta rule provides effective memory correction, while the two-stage structure provides a natural way to operate on both sides of an association. Building on this insight, we introduce a new Gated Oja Rule 1^{1} for key-side correction and extend it with decoupled erase and write control to obtain Gated Oja Rule-2. We then introduce Gated Slot Attention-2 (GSA2), which combines Gated Oja Rule-2 for key-side correction with Gated Delta Rule-2 for value-side correction through shared latent slots. We further derive a hardware-efficient chunkwise algorithm for parallel training. Experiments demonstrate that GSA2 consistently improves over strong linear-attention baselines across benchmarks while retaining linear-time sequence modeling and constant-memory recurrent decoding.

1 INTRODUCTION

The Transformer (Vaswani et al., 2017) has become the dominant architecture for large language models and sequence modeling due to the strong expressiveness of self-attention and its natural compatibility with parallel training. However, the computational cost of self-attention grows quadratically with sequence length, while the key-value cache grows linearly during autoregressive decoding. Linear attention (Katharopoulos et al., 2020) offers an appealing alternative by compressing the entire history into a fixed-size recurrent state, enabling linear-time sequence modeling and constant-memory recurrent inference. The central challenge, however, is how to effectively organize and update information within this compressed memory.

Recent progress on linear attention has improved fixed-state memory through data-dependent decay, selective gating, and increasingly expressive state transitions (Sun et al., 2023; Yang et al., 2023; Gu & Dao, 2023; Qin et al., 2024; Dao & Gu, 2024; Hu et al., 2025; Lahoti et al., 2026). Within this landscape, Gated Slot Attention (GSA) (Zhang et al., 2024) stands out as an elegant variant: rather than refining the update of a single recurrent state, it maintains separate key and value memories over a shared set of latent slots. This slot-based factorization provides a natural interface for operating on both sides of an association while retaining a compact recurrent memory.

In parallel, another line of work has focused on improving the memory update itself, with delta-rule models providing an effective mechanism for explicit associative correction. DeltaNet (Yang et al., 2024) corrects the value associated with the current key, Gated DeltaNet (GDN) (Yang et al., 2025) adds adaptive forgetting, Kimi Delta Attention (KDA) (Team et al., 2025) extends decay to the channel level, and Gated DeltaNet-2 (GDN2) (Hatamizadeh et al., 2026) further decouples erasing

1^{1}Oja’s rule is a normalized Hebbian learning rule that augments Hebbian association with a self-normalizing correction term (Oja, 1982); our gated Oja rule adapts this structure to recurrent associative memory.

old content from writing new content. Despite these advances, this line still centers on a single key-addressed associative state whose correction primarily acts on the value side.

We observe that these two directions are complementary. GSA provides an explicit two-stage structure spanning both sides, but lacks similarly expressive correction rules; Delta-rule models provide powerful error-correcting memory updates, but primarily correct the value side of an association. This suggests a simple question:

Can we equip both stages of a slot-based associative memory with complementary error-correcting updates?

Building on this insight, we first introduce the Gated Oja Rule (OJA), inspired by Oja's normalized Hebbian update (Oja, 1982), to provide the complementary key-side correction. We then decouple its erase and write operations, yielding Gated Oja Rule-2 (OJA2). Finally, we introduce Gated Slot Attention-2 (GSA2), which combines Gated Oja Rule-2 with the Gated Delta Rule-2 of GDN2 through shared latent slots. The first stage associates keys with latent slots and applies Gated Oja Rule-2 to correct the key side of the association, while the second associates the same slots with values and applies Gated Delta Rule-2 to correct the value side.

Let ktk_t, wtw_t, and vtv_t denote the key, shared slot-space vector, and value at step tt, respectively. GSA2 can then be summarized as

kt←key-side correctionGated Oja Rule-2wt→value-side correctionGated Delta Rule-2vt.k_{t}\xleftarrow[\text{key-side correction}]{\text{Gated Oja Rule-2}}w_{t}\xrightarrow[\text{value-side correction}]{\text{Gated Delta Rule-2}}v_{t}.

Compared with GSA, GSA2 retains the compact two-stage memory structure and gated memory control while introducing explicit, side-specific associative correction.

The resulting recurrence remains compatible with efficient parallel training. We reuse the chunkwise formulation of Gated Delta Rule-2 from GDN2 (Hatamizadeh et al., 2026) and derive a corresponding WY/UT-style formulation for Gated Oja Rule-2. Both exploit low-rank state transformations so that intra-chunk computation remains dominated by dense matrix multiplications (Bischof & Van Loan, 1987; Joffrain et al., 2006). GSA2 therefore retains linear-time sequence modeling and constant-size recurrent memory while supporting efficient parallel training.

Empirically, GSA2 performs strongly across language modeling, commonsense reasoning, retrieval, and long-context benchmarks, with particularly clear gains on RULER and LongBench. Ablations show that pairing key-side Oja correction with value-side Delta correction outperforms correcting either side alone or applying the same correction rule to both memories, with the latter resembling multi-stage fast-weight architectures such as Delta MLPs (Irie et al., 2021) and TRELLIS (Karami et al., 2025). GSA2 also preserves favorable recurrent length scaling with only a modest constant throughput overhead.

References (37)