ReplaySSM: Cache SSM Inputs, Not State
Organizations: Princeton University · NVIDIA
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 -- over a tuned vLLM baseline across four hybrid models, and delivers about 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.
Figures & tables
| Checkpoint configuration | MMLU-Pro | GPQA-Diamond | Math-L5 |
|---|---|---|---|
| Conventional FP32 (reference) | |||
| ( / / / ) | ( / / / ) | ( / / / ) | |
| Shared FP16+SR | |||
| ( / / / ) | ( / / / ) | ( / / / ) | |
| Shared FP8+SR | |||
| ( / / / ) | ( / / / ) | ( / / / ) |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | R/W | Model (GB) | Nsight (GB) | Note |
|---|---|---|---|---|
| vLLM snapshots | – | – | grows with | |
| The Mamba in the Llama | – | one fused launch | ||
| Snakes and Ladders, Activation Replay | – | replay, copy, verify | ||
| Snakes and Ladders, Joint Attainment | – | two rows, then a gather | ||
| STree, algorithm | – | replay, read-only verify | ||
| STree, released path | – | two extra copies |
| Symbol | Meaning (Mamba-2) | GDN |
|---|---|---|
| Checkpoint state in HBM; the recurrent state at the end of the last flushed window. | same | |
| , | High- and low-precision copies of the checkpoint. HP carries the recurrence across flushes; LP serves non-flush output computation. | same |
| Working state on chip; written to HBM only at a flush, as the new checkpoint. | same | |
| , | SSM inputs of one token: decay, value, key, and query (Eq. 1 ). | Inputs are with write strength (Eq. 2 ). Records store the correction in place of ; two-precision records are . |
| , , | – | Correction (Eq. 3 ); committed and draft corrections as matrix columns (Eq. 10 ). |
| , | Replay buffer and its records at positions to ; position is the oldest record since the last flush. | same |
| Model | Weights | SSM / Attn. layers | Key heads | Value heads | ||
|---|---|---|---|---|---|---|
| Nemotron-3-Nano-4B | BF16 | 21 / 4 | 8 | 96 | 128 | 80 |
| Nemotron-3-Super-120B-A12B | NVFP4 | 40 / 8 | 8 | 128 | 128 | 64 |
| Qwen3.5-4B | BF16 | 24 / 8 | 16 | 32 | 128 | 128 |
| Qwen3.5-122B-A10B | NVFP4 | 36 / 12 | 16 | 64 | 128 | 128 |
| Model | Weights | ||||||
|---|---|---|---|---|---|---|---|
| Nemotron-3-Nano-4B | BF16 | ||||||
| Nemotron-3-Super-120B-A12B | NVFP4 | ||||||
| Qwen3.5-4B | BF16 | ||||||
| Qwen3.5-122B-A10B | NVFP4 |
| Nemotron-3-Super-120B-A12B-NVFP4 | Qwen3.5-122B-A10B-NVFP4 | |||
| Conventional | ReplaySSM | Conventional | ReplaySSM | |
| Generation length | |||||
|---|---|---|---|---|---|
| Model | Precision | 1K | 8K | 32K | 128K |
| Nemotron-3-Nano-4B | FP8 | 0.59 | 1.3 | 6.6 | – |
| NVFP4 | 0.51 | 0.67 | 0.90 | – | |
| Nemotron-3-Super-120B-A12B | FP8 | 1.1 | 1.4 | 2.0 | 2.2 |
| NVFP4 | 0.44 | 0.45 | 1.4 | 0.95 | |
| Qwen3.5-4B | FP8 | 0.76 | 1.2 | 2.2 | div. |
| MMLU-Pro | GPQA-Diamond | Math-L5 | ||||
| Configuration | (pp) | Tokens (K) | (pp) | Tokens (K) | (pp) | Tokens (K) |
| Nemotron-3-Nano-4B | ||||||
| FP32 accuracy (%) | 2.9 / 6.9 | 10.3 / 26.7 | 2.1 / 4.5 | |||
| Shared FP16+SR | 2.9 / 6.8 | 10.7 / 29.9 | 2.2 / 4.9 | |||
| Shared FP8+SR | 3.0 / 6.9 | 10.7 / 29.0 | 2.2 / 4.9 | |||
| Shared NVFP4+SR | 2.1 / 3.6 | 4.3 / 5.0 | 1.7 / 3.2 | |||
| Configuration | Nemotron-3- Nano-4B | Nemotron-3-Super- 120B-A12B-NVFP4 | Qwen3.5-4B | Qwen3.5-122B- A10B-NVFP4 |
|---|---|---|---|---|
| FP32 score | ||||
| Shared FP16+SR | ||||
| Shared FP8+SR | ||||
| Shared NVFP4+SR | ||||
| Separate FP8 / FP16+SR | ||||
| Separate NVFP4 / FP16+SR |