firehose> #llmops

Speculative Decoding

Decode is memory-bound: at each step the GPU reads a large cached context out of VRAM and does comparatively little arithmetic with it, so the compute units sit idle waiting on memory. Speculative decoding spends that idle compute. A small draft model proposes a run of several output tokens; the large model then verifies all of them in a single forward pass, accepting the prefix of proposals it agrees with and correcting the first one it doesn't. Because verification is one batched forward pass over several positions — precisely the compute-dense shape the memory-bound step was wasting — several tokens can emerge for roughly the cost of one.

The property that makes this safe rather than a quality/speed trade is that the accept/reject rule is constructed so the output distribution is identical to the large model's; you are not approximating the big model, you are pipelining it. The property that makes it contextual is that it consumes spare compute — and at high concurrency there is none spare, because a full batch already saturates the GPU. Speculative decoding is therefore a latency technique, not a throughput technique, and its gains shrink exactly as your utilization improves. Reach for it when interactive latency matters more than raw throughput; a variant with no draft model at all (an n-gram speculator, which proposes continuations by matching against text already in context) costs nothing and helps on structured or repetitive output.

Claims


Linked from