SketchSSM: Write to the Full State, Read from a Compact Sketch
Organizations: Seoul National University · UC Berkeley · KAIST
Abstract
Hybrid-attention models replace most softmax attention layers with linear attention, reducing KV-cache growth and enabling larger decode batches where recurrent-state access becomes a major bottleneck. ReplaySSM amortizes state updates by buffering keys and values, but each new query still requires a full-state read even though the state remains unchanged between state updates. We observe that low-rank state-weighted query approximation accurately preserves state-read outputs. Although future queries are unknown, the basis vectors used to approximate them can be fixed offline. Based on this observation, we introduce SketchSSM, which preserves full-state updates while approximating reads. At each state update, SketchSSM reads the full state once to precompute outputs for these basis vectors, storing them in a compact sketch. Each subsequent decode step combines the sketch vectors with query-dependent coefficients to reconstruct the output without a full-state read. Across four Mamba-2-, GDN-, and KDA-based models, SketchSSM at a mean sketch rank of 8 reduces state-access traffic by approximately 10 while matching the average accuracy of the FP32 full-state baseline across four decode benchmarks, and preserves recall on four RULER retrieval tasks. At this rank on one NVIDIA B300, linear-attention kernel speedups over the Standard vLLM baseline reach 7.30, 5.02, and 5.24 for Mamba-2, GDN, and KDA, respectively, with up to 2.77 higher decode throughput on Nemotron 3 Super.
Figures & tables
| Method | Setting | Traffic | Nemotron Nano | Nemotron Super | Qwen3.8 Flash-Next | GLM 5.3 Flash |
| Standard | full-state | 98.29 | 100.00 | 100.00 | 99.40 | |
| ReplaySSM | full-state | 98.25 | 100.00 | 100.00 | 99.46 | |
| SketchSSM | – | 98.03 | 100.00 | 100.00 | 99.74 | |
| SketchSSM | – | 97.92 | 100.00 | 100.00 | 99.70 | |
| State pruning | 50% | 93.65 | 97.36 | 99.89 | 95.23 | |
| State pruning | 62.5% | 82.40 | 83.26 | 98.59 | 91.14 |
| Ablation | Method | MATH-500 | AIME25 | GPQA-D | LCB | Average |
| Full method | SketchSSM | 96.73 | 70.42 | 58.25 | 62.33 | 71.93 |
| Sketch basis | Random orthogonal | 94.73 ( ) | 53.33 ( ) | 53.54 ( ) | 53.23 ( ) | 63.71 ( ) |
| Coefficient vector | Offline coefficient map | 90.87 ( ) | 42.08 ( ) | 53.20 ( ) | 27.72 ( ) | 53.47 ( ) |
| Sketch-rank allocation | Uniform allocation | 93.13 ( ) | 48.33 ( ) | 55.22 ( ) | 50.90 ( ) | 61.90 ( ) |
| Error-only score | 94.13 ( ) | 59.17 ( ) | 57.58 ( ) | 54.39 ( ) | 66.32 ( ) | |
| Gradient-only score | 90.53 ( ) | 35.83 ( ) | 51.68 ( ) | 44.76 ( ) | 55.70 ( ) |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Exact ( s) | ( s) | Speedup | |
| Nemotron 3 Super | 8 | 2,076.21 | 460.31 | |
| Qwen3.8 Flash-Next | 8 | 1,705.90 | 414.02 | |
| GLM 5.3 Flash | 8 | 2,650.73 | 675.79 |
| Method | Read | Write | Total | Reduction |
| Standard | ||||
| ReplaySSM | ||||
| Quant./Pruning | ||||
| SketchSSM |
| MATH-500 | AIME25 | GPQA-D | LiveCodeBench | Average | |||||||
| Method | Setting | Traffic | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. |
| Standard | full-state | 5,257 | 18,868 | 13,499 | 14,073 | ||||||
| ReplaySSM | full-state | 5,142 | 18,344 | 13,288 | 14,174 | ||||||
| SketchSSM | 5,548 | 19,341 | 13,969 | 14,915 | |||||||
| SketchSSM | 5,801 | 20,336 | 14,257 | 16,705 | |||||||
| SketchSSM | 6,510 | 21,692 | 14,673 | 18,963 | |||||||
| MATH-500 | AIME25 | GPQA-D | LiveCodeBench | Average | |||||||
| Method | Setting | Traffic | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. |
| Standard | full-state | 3,439 | 22,635 | 18,868 | 19,445 | ||||||
| ReplaySSM | full-state | 3,309 | 23,683 | 18,650 | 19,572 | ||||||
| SketchSSM | 3,148 | 23,456 | 17,142 | 18,249 | |||||||
| SketchSSM | 3,512 | 23,134 | 17,578 | 18,634 | |||||||
| SketchSSM | 4,111 | 25,879 | 15,677 | 18,807 | |||||||
| MATH-500 | AIME25 | GPQA-D | LiveCodeBench | Average | |||||||
| Method | Setting | Traffic | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. |
| Standard | full-state | 1,434 | 19,455 | 14,736 | 22,039 | ||||||
| ReplaySSM | full-state | 1,456 | 19,714 | 14,921 | 21,819 | ||||||
| SketchSSM | 1,474 | 19,560 | 14,232 | 21,665 | |||||||
| SketchSSM | 1,786 | 22,457 | 15,947 | 25,061 | |||||||
| SketchSSM | 2,819 | 29,609 | 21,334 | 30,263 | |||||||
| MATH-500 | AIME25 | GPQA-D | LiveCodeBench | Average | |||||||
| Method | Setting | Traffic | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. | Tokens | Acc. |
| Standard | full-state | 1,239 | 22,038 | 10,790 | 24,524 | ||||||
| ReplaySSM | full-state | 1,165 | 18,556 | 10,797 | 25,005 | ||||||
| SketchSSM | 1,119 | 18,984 | 10,014 | 18,647 | |||||||
| SketchSSM | 1,170 | 17,298 | 10,720 | 18,153 | |||||||
| SketchSSM | 1,717 | 19,880 | 12,944 | 18,740 | |||||||
| Method | Setting | Traffic | Single UUID | Multi-key | Multi-value | Multi-query | Average |
| Standard | full-state | 100.00 | 99.80 | 97.45 | 95.90 | 98.29 | |
| ReplaySSM | full-state | 100.00 | 99.80 | 97.20 | 96.00 | 98.25 | |
| SketchSSM | 100.00 | 99.80 | 96.75 | 95.55 | 98.03 | ||
| SketchSSM | 100.00 | 99.80 | 94.90 | 97.00 | 97.92 | ||
| GHOST | 50% | 100.00 | 85.60 | 93.45 | 95.55 | 93.65 | |
| GHOST | 62.5% | 99.80 | 39.40 | 96.10 | 94.30 | 82.40 |
| Method | Setting | Traffic | Single UUID | Multi-key | Multi-value | Multi-query | Average |
| Standard | full-state | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | |
| ReplaySSM | full-state | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | |
| SketchSSM | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | ||
| SketchSSM | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | ||
| GHOST | 50% | 100.00 | 90.20 | 99.60 | 99.65 | 97.36 | |
| GHOST | 62.5% | 99.40 | 44.80 | 93.65 | 95.20 | 83.26 |
| Method | Setting | Traffic | Single UUID | Multi-key | Multi-value | Multi-query | Average |
| Standard | full-state | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | |
| ReplaySSM | full-state | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | |
| SketchSSM | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | ||
| SketchSSM | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | ||
| DRRQR | 50% | 99.80 | 100.00 | 99.75 | 100.00 | 99.89 | |
| DRRQR | 62.5% | 99.40 | 98.60 | 97.10 | 99.25 | 98.59 |
| Method | Setting | Traffic | Single UUID | Multi-key | Multi-value | Multi-query | Average |
| Standard | full-state | 99.80 | 100.00 | 97.80 | 100.00 | 99.40 | |
| ReplaySSM | full-state | 99.80 | 100.00 | 98.05 | 100.00 | 99.46 | |
| SketchSSM | 100.00 | 100.00 | 98.95 | 100.00 | 99.74 | ||
| SketchSSM | 100.00 | 100.00 | 98.80 | 100.00 | 99.70 | ||
| GHOST | 50% | 100.00 | 98.80 | 82.10 | 100.00 | 95.23 | |
| GHOST | 62.5% | 99.80 | 95.00 | 73.20 | 96.55 | 91.14 |
| Method | Update | Read | Traffic | MATH-500 | AIME25 | GPQA-D | LCB | Average |
| Baseline | full state | full state | 97.33 | 71.67 | 59.43 | 68.99 | 74.36 | |
| Baseline | 6-bit state | 6-bit state | 70.60 | 8.30 | 27.80 | 12.70 | 29.85 | |
| Ours | full state | 4-bit state copy | 97.40 | 68.33 | 55.05 | 63.49 | 71.07 | |
| Ours | full state | low-rank state, | 94.93 | 57.92 | 49.83 | 45.61 | 62.07 | |
| Ours (SketchSSM) | full state | sketch, | 97.07 | 71.67 | 60.77 | 68.15 | 74.41 | |
| Baseline | 4-bit state | 4-bit state | 9.40 | 0.00 | 0.00 | 5.40 | 3.70 |