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.
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.
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×.
The exact geometric speedup law exact formula
If each drafted token matches the target independently with probability α, the expected tokens emitted per verify pass is a geometric sum. Dividing by the round cost (k draft steps of relative cost c, plus one verify pass of relative cost v) gives the exact speedup.
Speedup(α, k, c, v) = E[tokens] / (k · c + v), E[tokens] = (1 − αk+1) / (1 − α) [or k + 1 when α = 1]
Speedup vs lookahead kexact formula
When c > 0, larger k eventually loses because extra draft steps cost linearly while expected tokens saturate at 1/(1−α).
current (c, v)ideal free draft (c=0, v=1)
Speedup vs acceptance α exact formula
Below the break-even acceptance αmin, speculative decoding is strictly slower than plain greedy decoding.
Stage 7 on Tesla T4. Qwen2.5-0.5B has 0.32× the weights of 1.5B and 0.16× the weights of 3B — yet run eagerly its step takes 21.3 ms vs 25.5 ms (c = 0.84) and 34.7 ms (c = 0.62) because Python & kernel launches dominate. Capturing the draft as a CUDA graph cuts c in half.
weight ratio (ideal)eager draft c (launch-bound)CUDA-graphed draft c
Measured T4 scoreboard: Stages 6, 7 & 9 measured
Compare free n-gram lookup, 0.5B neural draft (eager vs CUDA graph), and int8 self-draft across workloads.
Stages 8 & 9 on Tesla T4 (batch 1). PyTorch's eager/compiled dequantize materializes fp16 weights back in HBM, running 2–3× slower than fp16. Only a fused Triton GEMV kernel that reads int8 bytes directly turns half the bytes into real decode speedup (up to 1.8–2.0× with CUDA graphs).
2. The hidden bottleneck: multi-row verify cost vmeasured
Stages 10 & 11 CUDA-graphed block passes on Tesla T4. In fp16, verifying 5–7 tokens stays flat at 1.01–1.04× a 1-token step. In fused int8, extra rows hit per-weight dequant & FMA ceilings on a power-capped T4: Stage 10's kernel spiked to 2.27–2.55×, and even Stage 11's rewritten multi-row kernel still costs 1.83–2.21×.
3. Non-composition: why int8 × speculation only keeps 48–65% measured
Stage 11 on Tesla T4 (all speedups relative to fp16 graph plain = 1.0×). Because vint8 ≈ 1.6–2.1× instead of 1.0×, combining int8 weights with n-gram speculation delivers roughly half to two-thirds of the naive product Sint8 × Sngram — and on high-acceptance copy it actually loses to fp16 speculation!
4. Best end-to-end single-stream stack on Tesla T4 measured
Stage 11 end-to-end throughput vs fp16 eager baseline. The winning regime splits cleanly by workload: fp16 graph + n-gram dominates repetitive copy (6.3× on 3B), ties int8+n-gram on code (2.0×), while plain int8 graph wins open prose (1.9×) where turning speculation on hurts.