Speculative decoding has to undo the draft tokens the target model rejects. In a model with linear-attention layers, each request keeps a recurrent state that every token overwrites, so vLLM keeps a copy of that state for every draft position. With long drafts we found those copies were the bottleneck: they take most of each request’s memory, so fewer requests fit on the GPU. We implemented our own version of ReplaySSM, which keeps one state and a short log of inputs instead. The same GPU now fits 2.6 times as many requests, and at 256 concurrent requests the median time to first token fell from 22.5 s to 0.4 s.
The deployment
We run the public Qwen3.5 4B with its public DFlash drafter on one B200, at 15 draft tokens per step. The workload asks the model to repeat a passage from its prompt, so most draft tokens are accepted, and we want as many requests as possible running at once.
The model has 8 attention layers and 24 Gated DeltaNet layers, a form of linear attention. An attention layer keeps a KV cache that grows with the request and undoes a rejected token by ignoring its entry. A Gated DeltaNet layer keeps a fixed-size recurrent state that every token overwrites, so by default the engine writes a copy of the state after every verified position and continues from the accepted one.
Where the memory goes
At 15 draft tokens the default keeps 16 state copies per request, in the same memory pool as the KV cache. For an 8k-token request the copies take 960 MiB and the KV cache 455 MiB (Figure 1).
Each copy takes more than the state’s own size, because the cache gives every cache group one page size, set by the largest, and pads each copy to it. Here each copy fills a 2.5 MiB page, and 16 copies in each of 24 layers make the 960 MiB. Each draft token adds 60 MiB per request, so past about 7 draft tokens the copies take more memory than the KV cache of an 8k-token request.
Keeping one state and a log of inputs
ReplaySSM comes from Dao AI Lab, which proposed it for vLLM with NVIDIA. Our version started as a port of that pull request. It keeps one checkpoint state per request and a buffer of the per-token inputs since that checkpoint, and computes each layer’s output from the two. Rolling back rejected draft tokens removes their buffer entries, and the full state is rewritten (the “flush”) only when the buffer fills. Neither vLLM nor SGLang serves it for Gated DeltaNet with DFlash drafts.
We stopped reserving the speculative state copies. Each layer keeps one state and a short input buffer, 72 MiB per request in all.
Sizing the flush to the draft length
The upstream work measured drafts of up to 7 tokens. At 15 draft tokens the buffer fills every step, so the flush runs every step and its kernel sets the speed. Our flush applies the step’s accepted tokens as one block of fp32 tensor-core matrix operations in one launch per layer, instead of one token after another.
Timed alone, the state update takes 0.8 ms per step across the 24 layers, against 3.3 ms by default. The flush works in blocks of 16 rows, the draft length plus one, which also matches the drafter’s blocks of 16 tokens. At 17 rows it takes almost four times as long, and a longer draft needs a 32-row version that takes more than twice as long per layer.
Capacity and throughput at high load
We ran prompts of about 4k tokens with 3,072 output tokens each, at 64 to 320 concurrent requests. Both arms got a prefill budget of 16,384 batched tokens, because at 8,192 ours left requests queued with the cache less than half full.
Concurrent requests
The two results have different causes:
- Capacity shows as waiting. From 128 requests the default’s cache is full, so it runs at most 117 requests and queues the rest. At 256 requests its median time to first token is 22.5 s, against 0.4 s for ours (Figure 2). Ours runs up to 311 requests at once and never evicts one.
- Throughput comes from the shorter step. Ours gave 1.3 to 1.6 times the output tokens per second at every load, and already 1.47 times at 64 requests, where both arms fit. By arithmetic on the state sizes, the default writes about 55 GiB of state per step at 64 requests, and ours writes one copy per request.
At low load, speed per request was 1.16–1.24 times the default. Our version runs on an older nightly of the engine, which alone is 3–4% faster than the release we compare with.
What changes in the outputs
With 512 output tokens, outputs match the default byte for byte as often as two runs of the default match each other. With 3,072 they match about 1.5 points less often, because the fp32 state update sums in a different order. Scored against the source passage, both versions miss 0.246% of words on the 4B model, so the differences cost no copy fidelity. This check covers copying only, not open-ended text.
The same build on larger models
We ran the same build, unchanged, on two more public Qwen3.5 models with their public DFlash drafters, one B200 each. The same memory held 2.6 times as many 8k-token requests on the 9B (249 against 96) and 5.1 times on the 35B-A3B (162 against 32).
The 35B model gains the most because of the page size. Its drafter sets a large page, so each state copy is padded to more than twice its size, and the copies take 85% of each request’s memory. At 64 concurrent requests of about 7k tokens, the default runs only 33 of them on this model.
When state copies limit capacity
You can tell whether the copies matter on your deployment before running anything. Per request they take:
The engine’s startup log lists the page size of each cache group. Here that is (15 + 1) × 24 × 2.5 MiB = 960 MiB. The copies matter most when drafts are long and mostly accepted, requests are short to medium, and enough requests run at once to fill the cache.
What carries over
One state and a log of inputs let the same memory hold 2.6 times as many requests on the 4B model and 5.1 times on the 35B. The method pays here because this deployment fixes its draft length, so the flush is sized to one block of 16 rows and the cache holds one state per request. A general engine has to serve every draft length, and before it merges this method it also needs prefix caching, which our build runs without.