Skip to content

Two levers for faster LLM serving: sharper drafts and lossless KV compression

#speculative-decoding #kv-cache #llm-serving #inference-optimization #vllm #lmcache

Three papers landed this month that hit the same serving bottleneck from opposite ends. Two of them squeeze more output tokens out of every target-model forward pass by improving speculative decoding. The third shrinks the KV cache without changing a single output token. Between them they cover the two costs that dominate decode: verification work and memory footprint.

If you run vLLM or SGLang in production and your p99 is set by decode rather than prefill, all three apply directly.

Where decode time goes ​

Prefill is one big matmul. Decode is a long stream of small ones. At batch size 1, generating each token requires reading the full weight matrix plus the entire KV cache, so you're bandwidth-bound, not compute-bound. Batching helps for exactly this reason. So does anything that cuts either the number of forward passes or the bytes each pass touches.

Speculative decoding attacks the first cost. KV compression attacks the second. Neither is free, and both have a failure mode that looks like "it works, but not as well as the paper claims." That gap is the interesting part.

Speculative decoding is a bet on the draft distribution ​

A small draft model proposes k tokens. The target model verifies all k in one forward pass. Accepted tokens are essentially free. The first rejection costs you a rewind and a resample from the residual distribution.

Speedup is governed entirely by how many tokens survive verification. The calibration paper states the relationship precisely: acceptance depends on the L1 distance between the target distribution p and the draft distribution q. Small gap, high acceptance. Large gap, and you're paying for a draft forward pass while getting almost nothing back.

The observation that should bother you: open-source draft models usually get the top-1 token right and then go flat. The argmax matches. The distribution around it does not. That underconfidence shows up consistently across tasks, which means it isn't a quirk of one checkpoint. It's what you get when you distill a large model into a small one with a standard cross-entropy objective.

Temperature scaling recovers about 10% for free ​

The fix is almost trivial. Apply standard temperature scaling to the draft logits before sampling from them. No retraining, no new parameters, one scalar per draft model (or per head if you want to be precise about it).

The paper reports up to roughly 10% longer acceptance length with almost no added cost, across tasks. Read that as roughly one extra accepted token for every ten verification rounds your server currently runs. Because decode throughput tracks acceptance length close to linearly in the memory-bound regime, that translates to something near a 10% throughput bump for the price of a multiply.

Token-wise calibration performs better in some settings, but the runtime overhead is real and the gains are less stable across tasks. Standard temperature scaling is the version I'd put in a serving config today.

Quick take: before you retrain or swap a draft model, sweep the temperature. The gap between an off-the-shelf draft and a calibrated one is often larger than the gap between two draft checkpoints.

There's a second-order lesson too. The paper's diagnostic, plotting log-probability gaps between draft and target, is cheap to run and tells you quickly whether your acceptance problem is distributional or architectural. I've started running that check before touching anything else.

LEGOSpec turns draft design into a search problem ​

The second paper asks a harder question. If calibration buys 10%, how much is left in the draft architecture itself?

LEGOSpec decomposes a draft into four swappable parts. Context is what the draft conditions on. Backbone is the network. Proposal is how tokens get proposed. Objective is the training loss. All four share one training stack, so you can vary a single component and measure its effect under matched conditions instead of comparing complete recipes trained under different budgets.

Three findings came out of the systematic sweep:

  • Backbone choice is workload-dependent. Long contexts reward within-block dependency modeling, which is why the DFlux backbone pairs sliding-window attention with grouped-query attention and adds a convolution.
  • Proposal design trades acceptance against latency. A proposal head that accepts more tokens but adds 30% to draft latency is a net loss at small batch sizes.
  • The objective needs to match the token distribution locally and optimize acceptance length across the whole block. Optimizing per-token accuracy alone leaves acceptance on the table.

DFlux is the balanced general-purpose configuration that falls out of this: a convolution-equipped SWA-GQA hybrid backbone, a Residual Corrector, and hierarchical supervision. The Residual Corrector is the part that directly addresses the underconfidence problem the first paper identified, which makes the two results stack rather than compete.

What the benchmarks show ​

Evaluated across Qwen and Gemma model families, DFlux improves acceptance length over the strongest baseline by up to 13.7% on regular benchmarks and 34.7% on long-context workloads. The long-context number matters more, because that's where within-block dependency modeling pays off and where most off-the-shelf drafts fall apart. A 34.7% longer acceptance on a 32K-token agent request is the difference between four verification passes per chunk and three.

Training efficiency got attention too. Metadata-aware scheduling and asynchronous execution raise training throughput by up to 79%, and offline supervision preparation runs up to 3.11x faster than SpecForge. A 79% throughput gain means you can iterate on draft design roughly 1.8x as many times inside the same GPU budget, which matters more than the headline acceptance number if you actually plan to train your own draft.

Key numbers across the two draft papers: 10% acceptance length from temperature scaling alone, 13.7% and 34.7% from DFlux, 79% higher training throughput, and 3.11x faster supervision prep than SpecForge.

Here's how the three papers line up:

PaperWhat it changesMechanismHeadline resultWhat it costs
Draft CalibrationThe draft's output distributionPost-hoc temperature scaling+10% acceptance lengthOne multiply per draft step
LEGOSpec / DFluxThe draft's architecture and trainingComposable components plus hierarchical supervision+13.7% regular, +34.7% long-contextA draft retraining run
LoomKVKV cache storage formatLossless 3-bit code over BF16 high bytes2.7 to 3.6x goodput at the eviction cliffUp to 2.2% throughput where raw already fits

Two ceilings in the KV cache ​

Offloading KV to host DRAM and NVMe is standard practice now. Multi-turn chat and agent loops reuse long prompt prefixes, and keeping them resident on the GPU is impossible at any realistic scale.

Capacity limits you at two levels, and they fail at different times. External tiers govern how long a prefix can survive before eviction, so they set your cache hit rate for prefix reuse. The GPU pool bounds how many concurrent long requests you can hold in flight. A serving engine can be perfectly healthy on one and collapsing on the other.

LoomKV compresses both ceilings losslessly ​

The third paper goes after both. LoomKV uses a calibrated per-head, two-level 3-bit code over the BF16 high bytes, meaning the sign bit and the upper seven exponent bits, while the low mantissa byte stays raw. Reconstruction is bit-exact, so the outputs are unchanged. The compressed representation stores BF16 KV at 0.71 of its raw size across nine models, and FP8 KV at 0.85 to 0.87.

The two deployment modes map directly onto the two ceilings. In tier mode, TileStream writes exact-length records with length readback taken off the load path, so tier storage, eviction, and prefetch logic stay untouched. Fetched records decompress straight into scattered GPU pages. In pool mode, FragPack packs variable-length records into smaller shared-budget GPU pages, read in place by a fused decode-attention kernel that runs faster than FlashAttention-3 on BF16.

MetricRaw baselineTier modePool mode
Effective capacity1.0x1.4x larger tier1.31 to 1.34x GPU tokens
Goodput at AgentX eviction cliff1.0x2.7 to 3.6xNot applicable
Mean TTFT at the cliff1.0x0.32 to 0.53xNot applicable
Storage ratio, BF16 KV1.000.710.71
Throughput cost where raw fits0Up to 2.2%Up to 2.2%
Numerical accuracyBaselineBit-exactMatches FlashAttention-3

The 1.4x effective tier capacity is the number that changes system behavior. Standard LRU eviction falls off a cliff once the working set exceeds tier capacity: prefixes that were about to be reused get evicted, hit rate collapses, and TTFT spikes. A 1.4x larger tier delays that cliff, and once you're past the raw cliff but under the compressed one, goodput jumps by 2.7 to 3.6x with mean TTFT dropping by a factor of 1.9 to 3.1. The cliff shifts identically under other replacement policies the authors simulated, so it isn't an artifact of LRU specifically. SSD-to-DRAM promotion also cuts repeated-prompt TTFT by up to 1.7x.

Pool mode is the one I'd test first on agent workloads. Fitting 1.31 to 1.34x as many GPU tokens means admitting 12 long requests where raw capacity admits 8, at roughly the same queue depth and goodput. On an AI IDE trace where both tiers and the GPU pool are constrained at the same time, tier mode lifts goodput by 1.24x and pool mode by 1.59x.

The cost is honest: where raw capacity already suffices, compression costs at most 2.2% throughput. That's the number to measure before you flip it on.

What trips people up ​

Fitting the calibration temperature on the wrong distribution is the most common mistake. A temperature tuned on ShareGPT-style chat prompts is not the right temperature for code completion or tool-calling traces. Fit it on the traffic you actually serve, and refit per workload class if you serve more than one.

Treating acceptance rate as a single number is the second. Your draft acceptance on 2K-token chat turns and on 32K-token agent traces are two different numbers, and averaging them hides the one that's costing you money. I've watched teams report a healthy overall acceptance rate while their long-context path was running at half that. Slice the metric by context length before you conclude anything.

Forgetting the tokenizer constraint bites people who mix and match components. Draft and target must share a tokenizer, full stop. DFlux and similar composable frameworks make it easy to swap backbones, and easy to swap one that does not match your target's vocabulary.

Expecting the same compression ratio on FP8 KV is another quiet one. LoomKV gives you 0.71 on BF16 but 0.85 to 0.87 on FP8, because the mantissa structure is different. If your plan assumed 1.4x capacity on an FP8 deployment, the real number is closer to 1.15x, and your capacity planning is off by a fifth.

Finally, measuring pool mode with raw-fit workloads. If your working set already fits in the GPU pool, you will see the 2.2% throughput cost and none of the benefit. Pool mode pays off specifically when concurrency is the binding constraint. Benchmark it on a trace where you're actually evicting.

Calibration before architecture ​

One thing to remember: the cheapest intervention in this entire stack is a single scalar applied to draft logits, and it's the one most teams skip. Teams reach for a new draft checkpoint or a new serving engine before they've confirmed their existing draft is calibrated. The paper's own numbers say the order is usually wrong. Sweep the temperature first, measure the distribution gap second, and only then decide whether you need a new backbone.

The Bottom Line ​

If you already run speculative decoding in production with an uncalibrated draft, do the temperature sweep this week. It's a config change, it needs one scalar fitted on your real traffic, and it's worth roughly 10% of your decode throughput. There is no other optimization on this list with that ratio of effort to return.

If your draft acceptance falls off a cliff past 8K tokens on long-context or agent workloads, the architecture is the problem and DFlux is the configuration to beat. The convolution-equipped SWA-GQA backbone plus hierarchical supervision gets 34.7% longer acceptance on long context, and the training throughput gain of 79% means you can afford to train it yourself if no released checkpoint matches your target model.

If your prefix cache hit rate collapses under multi-turn load, try LoomKV tier mode before you buy more DRAM. A 1.4x effective capacity moves the eviction cliff, the lossless guarantee means you're not trading output quality for it, and 2.7 to 3.6x goodput past the cliff is a bigger win than most hardware upgrades. One thing to watch: pool mode is the higher-ceiling option at 1.59x on mixed traces, but it only pays when concurrency is binding. Measure eviction before you enable it.