Affix Cache for Diffusion Large Language Models
Organizations: KAUST · CUHK · LUMS
Abstract
Diffusion Large Language Models (DLLMs) enable non-autoregressive decoding, but efficient inference support remains immature: unlike autoregressive models, whose requests reuse a shared prefix key-value (KV) cache, DLLMs use bidirectional attention, so a shared context's KV states depend on the tokens still being decoded, leaving directly reused caches stale and full recomputation necessary. We present ACache, a cross-request cache reuse mechanism for shared spans, or affixes, at any position: prefix, infix, or suffix. ACache measures the influence of affix tokens on the masked generation region to identify a small request-specific subset as Anchor Tokens, and recomputes only their KV states while reusing the remaining affix cache. Built on state-of-the-art intra-request caching mechanisms, ACache recovers most of the accuracy lost to direct affix-cache reuse on average when recomputing around 20% of affix tokens, and at that budget preserves more accuracy than selection criteria adapted from prior cross-request cache-reuse systems. We co-design ACache with a modern inference engine, whose attention reads each request's recomputed Anchor KV states alongside one affix cache shared across concurrent requests. Against the same system with only intra-request caching, ACache cuts recompute latency by up to 56.7%, translating to as much as 1.71 end-to-end throughput, while reducing peak KV cache memory by up to 45.8%.
Figures & tables
| Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | ||
| GSM8K | 1 | 56.3 | 38.9 ( ) | 91.2 | 46.1 ( ) | 124.7 | 60.0 ( ) |
| 4 | 62.8 | 43.5 ( ) | 100.6 | 52.3 ( ) | 144.1 | 65.5 ( ) | |
| 16 | 87.9 | 61.9 ( ) | 147.2 | 76.9 ( ) | 213.9 | 92.6 ( ) | |
| MBPP | 1 | 58.2 | 44.3 ( ) | 91.7 | 50.6 ( ) | 133.0 | 65.7 ( ) |
| 4 | 61.7 | 47.1 ( ) | 96.8 | 54.4 ( ) | 145.9 | 69.9 ( ) | |
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |||
| LLaDA | GSM8K | 1 | 104 | 99 ( ) | 94 | 98 ( ) | 85 | 92 ( ) |
| 4 | 263 | 274 ( ) | 206 | 253 ( ) | 166 | 229 ( ) | ||
| 16 | 394 | 433 ( ) | 278 | 378 ( ) | 204 | 329 ( ) | ||
| MBPP | 1 | 209 | 213 ( ) | 168 | 194 ( ) | 123 | 155 ( ) | |
| 4 | 380 | 401 ( ) | 272 | 366 ( ) | 189 | 289 ( ) | ||
| Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | ||
| GSM8K | 1 | 0.38 | 0.38 ( ) | 0.50 | 0.75 ( ) | 0.75 | 0.88 ( ) |
| 4 | 1.50 | 1.12 ( ) | 2.00 | 1.50 ( ) | 3.00 | 2.00 ( ) | |
| 16 | 6.00 | 4.12 ( ) | 8.00 | 4.62 ( ) | 12.00 | 6.50 ( ) | |
| MBPP | 1 | 2.12 | 2.12 ( ) | 2.25 | 2.25 ( ) | 2.50 | 2.62 ( ) |
| 4 | 3.25 | 3.00 ( ) | 3.75 | 3.25 ( ) | 4.75 | 3.75 ( ) | |
| Model | Ratio | Criterion | GSM8K | MBPP | BABILong | Avg. | ||||||
| Pfx. | Inf. | Suf. | Pfx. | Inf. | Suf. | Pfx. | Inf. | Suf. | ||||
| LLaDA | 0.2 | CacheBlend | 71.6 | 69.6 | 69.8 | 35.5 | 7.8 | 22.0 | 99.5 | 82.8 | 63.6 | 57.3 |
| ProphetKV | 75.6 | 69.8 | 70.8 | 33.5 | 13.1 | 25.8 | 99.7 | 98.6 | 43.4 | 60.9 | ||
| BiCache | 71.4 | 69.1 | 68.2 | 33.2 | 3.4 | 8.4 | 99.4 | 73.9 | 98.4 | 53.4 | ||
| ACache | 73.6 | 69.9 | 70.3 | 34.9 | 15.4 | 25.1 | 99.6 | 98.9 | 76.1 | 61.0 | ||
| 0.3 | CacheBlend | 71.9 | 70.4 | 70.9 | 35.6 | 12.3 | 15.2 | 99.4 | 94.7 | 27.8 | 58.8 | |
| Model | Dataset | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|
| BiCache | ACache | BiCache | ACache | BiCache | ACache | ||
| LLaDA | GSM8K | 96 | 99 ( ) | 84 | 98 ( ) | 71 | 92 ( ) |
| MBPP | 192 | 213 ( ) | 165 | 194 ( ) | 118 | 155 ( ) | |
| Dream | GSM8K | 87 | 125 ( ) | 93 | 120 ( ) | 83 | 117 ( ) |
| MBPP | 145 | 190 ( ) | 136 | 183 ( ) | 119 | 171 ( ) | |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Affix | Shots | Model | Share | Jaccard similarity | Mass recall | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Random | Fresh | ACache | Fresh | ACache | |||||||
| 2nd | Last | 2nd | Last | ||||||||
| GSM8K | Prefix | 1 | LLaDA | 62.7 | 11.3 | 71.6 | 56.8 | 38.9 | 98.5 | 95.8 | 76.7 |
| Dream | 71.8 | 11.3 | 78.8 | 57.4 | 54.4 | 97.8 | 89.5 | 89.3 | |||
| 2 | LLaDA | 62.6 | 11.2 | 73.4 | 52.5 | 35.2 | 98.5 | 95.1 | 91.4 | ||
| Dream | 73.4 | 11.2 | 84.9 | 58.2 | 62.8 | 99.4 | 93.6 | 94.3 | |||
| Model | Dataset | Shot | Affix | Preparation | Forward | Top- | Total | Forward share |
|---|---|---|---|---|---|---|---|---|
| LLaDA | GSM8K | 1 | 213 | 0.49 | 50.05 | 0.16 | 50.69 | 98.7% |
| 2 | 549 | 0.52 | 56.46 | 0.16 | 57.14 | 98.8% | ||
| 4 | 981 | 0.57 | 66.02 | 0.18 | 66.76 | 98.9% | ||
| MBPP | 1 | 178 | 0.55 | 54.70 | 0.16 | 55.40 | 98.7% | |
| 2 | 455 | 0.55 | 61.40 | 0.19 | 62.14 | 98.8% | ||
| 4 | 1016 | 0.60 | 71.57 | 0.21 | 72.38 | 98.9% |
| Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | ||
| GSM8K | 1 | 52.8 | 41.6 ( ) | 72.5 | 46.4 ( ) | 111.7 | 54.8 ( ) |
| 4 | 60.7 | 46.6 ( ) | 87.0 | 52.3 ( ) | 132.4 | 63.5 ( ) | |
| 16 | 96.5 | 70.2 ( ) | 147.0 | 80.4 ( ) | 233.5 | 102.3 ( ) | |
| MBPP | 1 | 54.4 | 45.2 ( ) | 72.7 | 49.2 ( ) | 119.0 | 60.3 ( ) |
| 4 | 70.9 | 56.0 ( ) | 96.7 | 62.2 ( ) | 162.5 | 76.7 ( ) | |
| Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | ||
| GSM8K | 1 | 0.04 | 0.04 ( ) | 0.05 | 0.08 ( ) | 0.08 | 0.10 ( ) |
| 4 | 0.16 | 0.12 ( ) | 0.22 | 0.16 ( ) | 0.33 | 0.22 ( ) | |
| 16 | 0.66 | 0.45 ( ) | 0.88 | 0.51 ( ) | 1.31 | 0.71 ( ) | |
| MBPP | 1 | 0.23 | 0.23 ( ) | 0.25 | 0.25 ( ) | 0.27 | 0.29 ( ) |
| 4 | 0.36 | 0.33 ( ) | 0.41 | 0.36 ( ) | 0.52 | 0.41 ( ) | |
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| dKV-Cache | ACache | dKV-Cache | ACache | dKV-Cache | ACache | |||
| LLaDA | GSM8K | 1 | 54.1 | 38.1 ( ) | 88.4 | 44.9 ( ) | 120.4 | 58.3 ( ) |
| 4 | 166.2 | 117.4 ( ) | 285.7 | 152.1 ( ) | 439.5 | 181.9 ( ) | ||
| 16 | 627.4 | 435.2 ( ) | 1053.7 | 533.4 ( ) | 1674.0 | 672.7 ( ) | ||
| MBPP | 1 | 55.8 | 43.1 ( ) | 88.2 | 48.8 ( ) | 129.2 | 63.9 ( ) | |
| 4 | 175.3 | 138.5 ( ) | 263.9 | 162.3 ( ) | 477.1 | 205.1 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| dKV-Cache | ACache | dKV-Cache | ACache | dKV-Cache | ACache | |||
| LLaDA | GSM8K | 1 | 33 | 35 ( ) | 28 | 33 ( ) | 24 | 31 ( ) |
| 4 | 56 | 62 ( ) | 43 | 56 ( ) | 33 | 50 ( ) | ||
| 16 | 68 | 77 ( ) | 51 | 69 ( ) | 38 | 60 ( ) | ||
| MBPP | 1 | 32 | 34 ( ) | 28 | 33 ( ) | 23 | 30 ( ) | |
| 4 | 55 | 59 ( ) | 45 | 55 ( ) | 32 | 48 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| dKV-Cache | ACache | dKV-Cache | ACache | dKV-Cache | ACache | |||
| LLaDA | GSM8K | 1 | 0.38 | 0.38 ( ) | 0.50 | 0.75 ( ) | 0.75 | 0.88 ( ) |
| 4 | 1.50 | 1.12 ( ) | 2.00 | 1.50 ( ) | 3.00 | 2.00 ( ) | ||
| 16 | 6.00 | 4.12 ( ) | 8.00 | 4.50 ( ) | 12.00 | 6.50 ( ) | ||
| MBPP | 1 | 2.12 | 2.12 ( ) | 2.25 | 2.25 ( ) | 2.50 | 2.62 ( ) | |
| 4 | 3.25 | 2.88 ( ) | 3.75 | 3.00 ( ) | 4.75 | 3.75 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |||
| LLaDA | GSM8K | 1 | 56.6 | 42.7 ( ) | 91.6 | 47.3 ( ) | 123.6 | 61.9 ( ) |
| 4 | 62.9 | 50.5 ( ) | 101.7 | 55.5 ( ) | 140.7 | 69.6 ( ) | ||
| 16 | 90.7 | 72.0 ( ) | 148.7 | 80.3 ( ) | 215.0 | 97.9 ( ) | ||
| MBPP | 1 | 61.1 | 49.1 ( ) | 94.2 | 55.8 ( ) | 138.0 | 69.7 ( ) | |
| 4 | 67.6 | 56.0 ( ) | 106.3 | 63.5 ( ) | 152.6 | 77.1 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |||
| LLaDA | GSM8K | 1 | 105 | 98 ( ) | 92 | 95 ( ) | 82 | 88 ( ) |
| 4 | 262 | 250 ( ) | 202 | 234 ( ) | 162 | 207 ( ) | ||
| 16 | 388 | 392 ( ) | 273 | 349 ( ) | 193 | 297 ( ) | ||
| MBPP | 1 | 198 | 186 ( ) | 162 | 178 ( ) | 119 | 146 ( ) | |
| 4 | 368 | 349 ( ) | 265 | 326 ( ) | 183 | 266 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |||
| LLaDA | GSM8K | 1 | 0.38 | 0.62 ( ) | 0.62 | 1.12 ( ) | 0.75 | 1.38 ( ) |
| 4 | 1.50 | 1.38 ( ) | 2.12 | 2.00 ( ) | 3.00 | 2.50 ( ) | ||
| 16 | 6.00 | 4.38 ( ) | 8.12 | 5.50 ( ) | 12.00 | 7.00 ( ) | ||
| MBPP | 1 | 2.12 | 2.25 ( ) | 2.25 | 2.62 ( ) | 2.50 | 3.12 ( ) | |
| 4 | 3.25 | 3.25 ( ) | 3.75 | 3.75 ( ) | 4.88 | 4.25 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |||
| LLaDA | GSM8K | 1 | 56.4 | 39.7 ( ) | 91.3 | 46.4 ( ) | 123.6 | 61.1 ( ) |
| 4 | 62.5 | 46.0 ( ) | 101.7 | 54.1 ( ) | 141.9 | 68.9 ( ) | ||
| 16 | 90.6 | 66.6 ( ) | 150.4 | 80.4 ( ) | 220.0 | 96.8 ( ) | ||
| MBPP | 1 | 59.3 | 45.4 ( ) | 91.7 | 50.8 ( ) | 134.4 | 66.2 ( ) | |
| 4 | 63.3 | 51.6 ( ) | 97.8 | 56.8 ( ) | 148.4 | 73.5 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |||
| LLaDA | GSM8K | 1 | 104 | 99 ( ) | 90 | 95 ( ) | 83 | 88 ( ) |
| 4 | 263 | 253 ( ) | 200 | 236 ( ) | 163 | 212 ( ) | ||
| 16 | 393 | 410 ( ) | 273 | 358 ( ) | 200 | 307 ( ) | ||
| MBPP | 1 | 127 | 111 ( ) | 113 | 138 ( ) | 87 | 100 ( ) | |
| 4 | 290 | 260 ( ) | 225 | 292 ( ) | 161 | 223 ( ) | ||
| Model | Dataset | Batch | 1-shot | 2-shot | 4-shot | |||
|---|---|---|---|---|---|---|---|---|
| Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |||
| LLaDA | GSM8K | 1 | 0.38 | 0.62 ( ) | 0.50 | 1.12 ( ) | 0.75 | 1.38 ( ) |
| 4 | 1.50 | 1.38 ( ) | 2.00 | 2.00 ( ) | 3.00 | 2.50 ( ) | ||
| 16 | 6.00 | 4.38 ( ) | 8.00 | 5.12 ( ) | 12.00 | 7.00 ( ) | ||
| MBPP | 1 | 2.12 | 2.25 ( ) | 2.25 | 2.50 ( ) | 2.50 | 3.12 ( ) | |
| 4 | 3.25 | 3.00 ( ) | 3.75 | 3.38 ( ) | 4.75 | 4.25 ( ) | ||
| Model | Ratio | Variant | GSM8K | MBPP | BABILong | Avg. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Pfx. | Inf. | Suf. | Pfx. | Inf. | Suf. | Pfx. | Inf. | Suf. | ||||
| LLaDA | 0.2 | ACache | 73.6 | 69.9 | 70.3 | 34.9 | 15.4 | 25.1 | 99.6 | 98.9 | 76.1 | 61.0 |
| Anchors only | 71.3 | 69.9 | 69.1 | 2.9 | 6.3 | 4.9 | 99.8 | 99.9 | 15.4 | 53.0 | ||
| 0.3 | ACache | 74.1 | 71.0 | 70.8 | 34.8 | 24.7 | 26.8 | 99.7 | 98.9 | 78.6 | 62.6 | |
| Anchors only | 73.1 | 70.2 | 70.8 | 5.3 | 16.2 | 7.7 | 99.8 | 99.7 | 56.2 | 55.3 | ||
| Dream | 0.2 | ACache | 70.7 | 74.0 | 70.7 | 50.0 | 36.7 | 35.9 | 95.2 | 86.4 | 84.5 | 64.9 |
| Ratio | Selection | GSM8K | MBPP | BABILong | Avg. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Pfx. | Inf. | Suf. | Pfx. | Inf. | Suf. | Pfx. | Inf. | Suf. | |||
| 0.2 | Top | 73.6 | 69.9 | 70.3 | 34.9 | 15.4 | 25.1 | 99.6 | 98.9 | 76.1 | 61.0 |
| Random | 73.2 | 69.0 | 69.0 | 34.1 | 11.1 | 18.6 | 99.6 | 80.4 | 84.5 | 56.9 | |
| Bottom | 71.6 | 69.2 | 68.4 | 34.4 | 4.1 | 8.5 | 99.1 | 74.2 | 98.1 | 53.7 | |
| 0.3 | Top | 74.1 | 71.0 | 70.8 | 34.8 | 24.7 | 26.8 | 99.7 | 98.9 | 78.6 | 62.6 |
| Random | 72.0 | 68.2 | 69.4 | 33.8 | 17.3 | 23.3 | 99.6 | 84.6 | 79.5 | 58.5 | |
| Model | Method | Ratio | Acc. |
|---|---|---|---|
| LLaDA | Direct reuse | 0 | 19.8 |
| ACache | 0.2 | 59.1 | |
| 0.3 | 65.4 | ||
| BiCache † | 0.50 | 66.9 | |
| Full recomputation | 1 | 69.0 | |
| Dream | Direct reuse | 0 | 78.5 |
| Model | Batch 1 | Batch 4 | Batch 16 | ||||
|---|---|---|---|---|---|---|---|
| BiCache † | Fast-dLLM | ACache | Fast-dLLM | ACache | Fast-dLLM | ACache | |
| LLaDA | 62 | 76 | 91 ( ) | 138 | 214 ( ) | 164 | 290 ( ) |
| Dream | 92 | 101 | 126 ( ) | 167 | 273 ( ) | 194 | 357 ( ) |