Manuscript Offprint

arXiv:2610.34180

Write What Matters: Disentangling Token Selection from Slot Allocation in Recurrent Memory

Chen Chen, Rui Cheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Long-sequence models must retain earlier information. Full attention keeps all past tokens but grows expensive, and recurrent-memory models compress history into fixed slots for linear-time processing. Limited capacity makes writes consequential: distractors can interfere with useful content, while skipped evidence cannot be recalled. Existing multi-slot memories write every token to the same number of slots, merging whether to store it with how many slots to update. We introduce Factorized Write Routing (FWR), which first keeps or skips each token and then chooses a fixed or token-adaptive number of slots. Queries still read all slots. Across ten seeds on two synthetic tasks that query facts after long contexts, we observe a density-dependent reversal. With four slots per write, long-context accuracy favors always writing on dense Feature Recall (0.472 vs 0.337), but learned selective writing on sparse-fact Passkey (0.222 vs 0.048). The tested adaptive rule underperforms fixed allocation under the learned gate on both tasks. A diagnostic oracle given fact labels unavailable at deployment reaches 0.372 on Passkey, showing headroom in filtering distractors. The results suggest avoiding missed writes in information-dense contexts and filtering distractors when they dominate.

1 Introduction

Transformer attention provides random access to past tokens but incurs quadratic cost in sequence length (Vaswani et al., 2017). Linear attention, state-space models, and recurrent memory architectures instead compress history into a bounded state (Katharopoulos et al., 2020; Schlag et al., 2021; Gu and Dao, 2024; Dao and Gu, 2024). This compression enables constant-memory decoding, yet it creates a harder problem: once an update overwrites or contaminates the state, the original token may no longer be recoverable. Empirical and theoretical work has consequently identified retrieval and copying as persistent weaknesses of fixed-state models (Arora et al., 2024a; Jelassi et al., 2024; Wen et al., 2024). Multi-slot recurrent memories mitigate this bottleneck by maintaining several independently updated states. Recent systems route each token to a small Top-K subset of slots (Zhang et al., 2024; Afzal et al., 2026). Top-K is an effective answer to where a token should be written, but the usual fixed-K rule silently assumes that every token should be written and deserves the same update budget. That assumption is mismatched to long-context retrieval. A context may be information-dense, in which nearly every token can be queried later, or information-sparse, in which a few facts are surrounded by distractors. The same routing sparsity need not suit both regimes.

This paper asks a narrower and, we argue, more fundamental question: In a bounded multi-slot memory, how should the model separate whether to write a token from how many slots to update, when the future query is not yet known? We study this question through Factorized Write Routing (FWR), which decomposes routing into a binary write variable ztz_{t} and a conditional slot count KtK_{t}. The decomposition organizes controls along two explicit axes: always-write versus learned or oracle token selection, and fixed versus adaptive slot allocation. It therefore exposes the two routing choices instead of packaging them in an inseparable “adaptive router.”

Our results challenge two tempting generalizations. First, sparse writing is not universally beneficial: on high-density Feature Recall, dense K=M=16K=M=16 writing significantly outperforms K=2K=2 at long lengths across ten paired seeds. Second, token-adaptive KK is not sufficient by itself. Prespecified paired contrasts in the ten-seed mechanism study show a task-dependent reversal: at the same fixed width K=4K=4, learned gating is worse than always writing on Feature Recall but better on sparse-fact Passkey. Under learned gating, fixed allocation is favored over the tested adaptive rule on both tasks. At K = 4, an oracle token-type gate also outperforms the learned gate on Passkey, revealing headroom in fact–distractor selection without assuming knowledge of the eventual query. Holding K constant makes the fixed-family comparisons controlled tests of the gate policy within the tested recurrence.

Our contributions are threefold:

• We formulate multi-slot writing as two decisions: token selection and slot allocation, and provide FWR, an implementation-compatible framework for independently controlling them.

• We give a ten-seed counterexample to the idea that a small fixed K is a robust default: K=2K=2 harms long recall when most context tokens remain relevant.

• Through pre-specified matched-K paired contrasts and token-type oracle controls, we document a task-dependent reversal between learned and always-write gates, and show that our adaptive-K rule underperforms validation-selected fixed K under learned gating on both tasks.

References (19)