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

Manuscript Offprint

arXiv:2610.13778

ReplaySSM: Cache SSM Inputs, Not State

Ze-Wei Liou, Harris Nover, Amey Naik, Andrii Skliar, Igor Shovkun, Ido Shahaf, Tri Dao

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

ABSTRACT

State-space models (SSMs) maintain a fixed-size recurrent state, but reading and writing it at every decoding step can bottleneck hybrid models. This eager state management causes large state I/O with low arithmetic intensity, leaves speculative decoding no cheap rollback, and feeds state quantization error into subsequent recurrent updates. We introduce ReplaySSM, which unrolls the recurrence to represent the state as a checkpoint and a buffer of recent SSM inputs. This separates output computation from checkpoint updates. By updating the checkpoint periodically, ReplaySSM avoids state writes on most steps and roughly halves the dominant state memory traffic. Keeping recent inputs also makes speculative rollback a buffer-pointer operation and enables output-only verification without materializing intermediate states. The same separation allows a low-precision checkpoint to serve output computation on most steps while a higher-precision checkpoint serves recurrent updates, so rounding error in the low-precision copy never enters later updates. We implement ReplaySSM in vLLM for Mamba-2 and Gated DeltaNet. At serving batch size 256, it accelerates standard decoding by 1.20–1.47× over a tuned vLLM baseline across four hybrid models, and delivers about 1.8× the throughput of vLLM's speculative decoding on the two 120B-class models. Separate state precisions also reduce output KL divergence and downstream accuracy losses compared with a shared low-precision checkpoint.

Code: https://github.com/Johnny-Liou/ReplaySSM.

1 INTRODUCTION

Long chain-of-thought reasoning makes decoding a substantial cost in LLM inference. Agent workloads stretch it further through repeated tool calls and reasoning. Transformer attention keeps past keys and values in a key-value (KV) cache whose size and per-step memory traffic grow with sequence length, hurting both throughput and tail latency. State-space models (SSMs), such as Mamba-2 (Dao & Gu, 2024), Gated DeltaNet (GDN; Yang et al., 2025), and Kimi Delta Attention (KDA; Kimi Team, 2025), instead summarize past information into a fixed-size recurrent state. Their state storage and per-step memory traffic remain constant with sequence length, but this compression can degrade exact recall (Jelassi et al., 2024; Waleffe et al., 2024). Hybrid architectures aim to find the sweet spot in between by interleaving SSM and attention layers and are widely adopted in production models, including Nemotron-3 (NVIDIA, 2025), Qwen3.5 through Qwen3.8 (Qwen Team, 2026a;b), Kimi-K3 (Kimi Team, 2026), and GLM-5.3-Flash (Z.ai, 2026a).

A fixed-size state, however, does not make SSM decoding cheap. Current SSM decoding follows the recurrence step by step. Each step loads the state, updates it, computes the output from the updated state, and stores it back. This leads to three challenges. First, the update has low arithmetic intensity. Each step moves the full state for a decay and a rank-1 update. At serving batch sizes, this state traffic can make SSM updates the bottleneck up to 100K tokens even in hybrid models whose attention cost grows with output context length (Figure 1, bottom left). Second, an updated state has no cheap rollback. This becomes a problem for speculative decoding, which verifies multiple draft tokens together and must restore the state to the last accepted token when a suffix is rejected.

Conventional decoding

St=αtSt−1+vtkt⊤S_{t}=\alpha_{t}S_{t-1}+v_{t}k_{t}^{\top}

ReplaySSM

St=γhSckpt+∑j=1hγj+1:hvjkj⊤S_{t}=\gamma_{h}S_{\mathrm{ckpt}}+\sum_{j=1}^{h}\gamma_{j+1:h}v_{j}k_{j}^{\top}

Figure

Figure

(1) Standard decoding State I/O dominates latency

Figure

Full-state writes per L steps

Conventional

ReplaySSM

(2) Speculative decoding No cheap rollback

Rollback: expensive

≈12\approx \frac{1}{2} state memory traffic

ReplaySSM

Rollback = pointer move

No state written on most steps

(3) Low-precision state Rounding error re-enters recurrence

Conventional

Error accumulates

ReplaySSM

Breaks error propagation

Figure 1: ReplaySSM overview. Top: conventional decoding loads and stores the full state at every step. ReplaySSM unrolls the recurrence to separate output computation from checkpoint updates: it caches recent SSM inputs and folds them into the checkpoint periodically, avoiding full-state writes on most steps. Bottom: three challenges of conventional decoding, and how ReplaySSM addresses each. (1) SSM layers can bottleneck hybrid models up to 100K tokens (Nemotron-3-Super-120B-A12B-NVFP4, batch size 256, one B300); ReplaySSM roughly halves their state traffic. (2) State rollback, expensive to support in conventional speculative decoding, becomes a buffer-pointer move. (3) A low-precision checkpoint serves outputs while a high-precision one carries the recurrence, so rounding error no longer re-enters the recurrence.

(Leviathan et al., 2023). Serving systems such as vLLM (Kwon et al., 2023) therefore work around this by storing a separate recurrent-state snapshot for each draft token. These writes slow an already memory-bound kernel, and storing the snapshots caps concurrency, so speculative decoding gains little at serving batch sizes. Third, quantizing the SSM state feeds rounding error into subsequent recurrent updates, where it can accumulate over a long generation. Aggressively reducing state precision can therefore distort the output distribution and degrade downstream accuracy.

These three challenges motivate the question: Why do we store an updated state after every step? Unrolling the recurrence shows that the current state equals a decayed earlier checkpoint plus a short sum over recent inputs. ReplaySSM therefore represents the state as a checkpoint and a bounded buffer of recent SSM inputs (Figure 1, top). This representation separates output computation from checkpoint updates. On most steps (non-flush steps), ReplaySSM appends the new inputs to the buffer and computes the output from the checkpoint and the buffer without storing a state. Only when the buffer fills (flush steps) does it fold the buffered inputs into the checkpoint and start a new window. The outputs match conventional decoding up to floating-point differences.

This separation addresses all three challenges. A non-flush step writes only the new input vectors and decay factors, which are far smaller than the state, so checkpoint writes are amortized over the window and the dominant state traffic roughly halves. Keeping recent inputs also makes speculative rollback cheap. Rejected draft tokens are discarded by moving a buffer pointer, and because non-flush steps need only outputs, verification can compute them directly from the checkpoint and the cached inputs without materializing intermediate states. For low-precision states, the two roles can use different precisions: a low-precision checkpoint serves output computation on non-flush steps, while a higher-precision checkpoint carries the recurrence across flushes, so rounding error in the low-precision copy never enters later updates.

Our contributions are:

• We introduce ReplaySSM, which represents the SSM state as a checkpoint plus a buffer of recent inputs, separating output computation from checkpoint updates and avoiding full-state writes on most decoding steps (Section 4).

• We extend it to speculative decoding, where the cached inputs give pointer-based rollback and output-only verification (Section 5).

• We extend it to low-precision state storage, where the separation lets output computation and recurrent updates use different state precisions (Section 6).

• We implement ReplaySSM in vLLM for Mamba-2 and GDN. At serving batch size 256, it speeds up standard decoding by 1.20−1.47×1.20-1.47\times over a tuned vLLM baseline across four hybrid models, and delivers about 1.8×1.8\times the throughput of vLLM's speculative decoding on the two 120B-class mixture-of-experts (MoE) models. Separate state precisions also reduce output Kullback–Leibler (KL) divergence and downstream accuracy losses compared with a shared low-precision checkpoint (Section 7).

References (29)