Skip to main content
Back

Cyber Monday Deal: Get 20% off all AlphaSignal Pro subscriptions. Ends soon.

Princeton's ReplaySSM Boosts AI Serving Speed 1.8x by Slashing Memory Traffic

Dao AI Lab and NVIDIA show that caching SSM inputs instead of recurrent state cuts memory traffic and unlocks quantization for hybrid models.

Pro

  • Dao AI Lab and NVIDIA release ReplaySSM, caching SSM inputs instead of recurrent state during decoding.
  • Standard decoding runs 1.20 to 1.47x faster than tuned vLLM across four hybrid models at batch 256.
  • Speculative decoding reaches ~1.8x vLLM's throughput on 120B-class hybrid models via pointer-based rollback.
  • Separate precisions for output reads and recurrence cut 128K-token KL divergence by 36x versus shared NVFP4 state.
  • Integrated in TensorRT-LLM, vLLM, FlashInfer; production in GLM-5.3-Flash and Kimi-K3.
  • Joint blog post details how decoupling output computation from state updates breaks the quantization error loop.

State-space models (SSMs) and recurrent linear-attention layers can decode long sequences without an attention key-value (KV) cache that grows with every token. Each layer compresses prior tokens into a fixed-size recurrent state, keeping per-token storage and computation constant as context length grows. Hybrid models built with Mamba-2 or Gated DeltaNet still face a costly operation: every decoding step reads and rewrites that state in high-bandwidth memory (HBM), which can make recurrent layers the latency bottleneck.

Researchers from Princeton’s Dao AI Lab and NVIDIA propose ReplaySSM in a new arXiv paper. The method caches a short window of layer inputs in a ring buffer, reconstructs the current state when producing outputs, and commits buffered inputs to the recurrent state periodically. The authors report integrations with NVIDIA TensorRT-LLM, vLLM, and FlashInfer, plus production use in GLM-5.3-Flash and Kimi-K3.

Fixed state, expensive traffic

Conventional recurrent decoding eagerly commits every token to state. A fused kernel loads the previous state, applies the new input, computes the layer output, and writes the updated state to HBM. The state stays constant in size, but transferring it across many layers and concurrent sequences consumes substantial memory bandwidth.

  • State updates are memory-bound. Each step moves the full state while performing relatively little arithmetic. In the hybrid architectures studied, SSM layers outnumber attention layers by roughly five to one, so their aggregate traffic dominates at many practical context lengths.
  • Speculative rollback is expensive. Speculative decoding proposes several tokens and verifies them together. When verification rejects a suffix, an eagerly updated SSM state already includes those tokens, requiring restoration of an earlier state or recomputation.
  • Quantization errors feed the recurrence. A quantized state produces the current output and becomes the input to the next update. Rounding error therefore re-enters the computation at every step, which helps explain why production SSM states often remain in FP32 even when KV caches use FP8.

Replay a short window

ReplaySSM gives each sequence a checkpoint state and a ring buffer containing recent layer inputs. For Mamba-2, the buffer holds each step’s v and k values along with the decay factors required to reconstruct the transition.

  1. Append the input. Each decoded token adds its recurrent inputs to the ring buffer without immediately rewriting the checkpoint state.
  2. Produce the output. The kernel loads the last committed checkpoint and replays the buffered transitions to reconstruct the state needed for the current token.
  3. Commit periodically. Once the replay window reaches its configured limit, a flush folds the buffered inputs into the checkpoint and clears the buffer.

Fewer eager commits reduce dominant state traffic by roughly half on most decoding steps. Replaying a small window adds arithmetic, but the target workloads are constrained by HBM bandwidth rather than compute. The implementation flushes before loading the growing buffer becomes more expensive than writing a new checkpoint.

Speculative decoding also gains a cheaper rollback path. Draft inputs remain uncommitted in the ring buffer, so rejecting a suffix requires moving the buffer’s tail pointer instead of restoring a recurrent state.

Quantization without error feedback

ReplaySSM separates the precision used for recurrence from the precision used to calculate outputs. It maintains an FP32 checkpoint, using 32-bit floating point for future state updates, and a low-precision copy for output reconstruction. Only the FP32 path feeds subsequent recurrence, so rounding from the output path affects the current replay window without accumulating across the full sequence.

On the PG-19 long-document corpus at sequence lengths up to 128K tokens, an FP32 recurrent checkpoint paired with NVFP4 output reads produced 36 times lower KL divergence than a shared NVFP4 state. NVFP4 is NVIDIA’s 4-bit floating-point format, while KL divergence measures how far the quantized model’s token distribution moves from the FP32 baseline.

KL divergence for shared and separated low-precision SSM states on PG-19
Separating recurrent and output precision keeps token distributions closer to the FP32 baseline over long contexts.

The same pattern appears on GPQA-Diamond, a graduate-level science benchmark, when running Nemotron-3-Super-NVFP4. A shared NVFP4 state matched FP32 on short responses but scored 23% on the longest-generation quartile, compared with 51% for FP32. The separated-precision configuration remained within a few percentage points of FP32 across generation lengths.

B300 throughput reaches 1.8×

The authors benchmarked ReplaySSM implementations for Mamba-2 and Gated DeltaNet in vLLM at batch size 256 on an NVIDIA B300. The reported figures measure end-to-end serving throughput against tuned vLLM baselines.

Reported ReplaySSM serving results
Decoding mode Models tested Throughput
Standard decoding Four hybrid models ranging from 4B to 550B parameters 1.20× to 1.47× the tuned vLLM baseline
Speculative decoding Two models in the 120B class About 1.8× vLLM’s speculative-decoding throughput
ReplaySSM speculative-serving throughput across hybrid models
ReplaySSM improves speculative-serving throughput by keeping rejected draft inputs out of committed recurrent state.

Where the curve bends

ReplaySSM delivers its largest gains when recurrent layers dominate serving latency. In the tested hybrid models, that pattern generally holds through contexts of roughly 80K tokens. At longer lengths, attention consumes a larger share of runtime, reducing the end-to-end benefit. The crossover depends on model architecture, hardware, batch size, and request mix.

The replay-window length L controls the main implementation trade-off. Larger windows amortize checkpoint writes across more tokens but require more buffered data to reconstruct each output. The paper reports L = 16 as a strong setting across its tested configurations.

A practical rollout checklist

Deployment decisions should follow measurements from the target serving workload because kernel speedups vary with context length, batching, and the ratio of recurrent to attention layers.

  • Profile HBM traffic and per-layer latency at production batch sizes and context lengths.
  • Start replay-window tuning near L = 16, then measure end-to-end throughput and memory use.
  • Keep the recurrence checkpoint in high precision when quantizing the output path, especially for workloads with long generated responses.
  • Test speculative rejection paths across every recurrent layer to verify that buffer pointers and sequence lengths remain aligned.
  • Evaluate full serving performance because attention can become the bottleneck before recurrent-kernel gains are exhausted.

ReplaySSM is landing in serving stacks

Source code is available on GitHub, and the authors report support in TensorRT-LLM, vLLM, and FlashInfer. An upstream integration is also tracked in the SGLang issue. For deployments using Mamba-2, Gated DeltaNet, or Kimi Delta Attention hybrids, these integrations provide a path to lower state traffic without changing model weights or retraining.