← ml-viz mini-vllm repo

Speculative Decoding & Int8 Composition

Speculative decoding guesses k tokens ahead and verifies them in one target pass; weight-only int8 halves the weight bytes read per step. Alone, both accelerate batch-1 decode on a Tesla T4. Together, they refuse to multiply. Every figure tagged measured comes from mini-vllm Stages 6–11 on a Tesla T4; interactive curves and traces are tagged simulated.

Token-by-token draft, verify & rollback simulated

Calibrated to measured Stage 9 Qwen2.5-3B acceptance rates on Tesla T4. One target forward pass checks all k guesses in parallel, keeps the matching prefix plus one bonus/correction token, and rolls back the KV length pointer with zero recompute.
Speculative output stream (green = accepted draft, blue = target bonus/correction)
Plain greedy reference (1 target pass per token — identical tokens, more steps)

Round-by-round breakdown simulated

Each bar is one verification round. Notice how a single rejected token discards the entire drafted suffix after it, because later drafts were conditioned on the wrong token.
accepted draft tokens target bonus / correction token (+1 guaranteed) rolled-back suffix (KV pointer rewound)

Why checking k + 1 tokens in one pass is nearly free measured

Stages 6 & 7 on Tesla T4 (fp16). At batch 1, decode is memory-bandwidth and launch bound, so verifying 5–9 tokens costs only ~1.07–1.16× a single-token step. Once batch hits 64, compute binds and verify cost climbs past 2×.