Skip to main content
Interactive 3D/Speculative Decoding
Generation Timeline
Standard (Target Model only) - 1 token per forward pass
step 1
step 2
step 3
step 4
4 steps
Speculative - Draft proposes k=4 tokens, Target verifies all in 1 pass
d1
d2
d3
d4
verify ×1
1 step
Acceptance Rate per Step
Run steps to see acceptance rate
Avg α
0%
Speedup
1.00×
Steps
0
Tokens out
0
Controls
Draft tokens k4
18
Draft quality0.7
0.1 poor1.0 perfect
Speculative decoding uses a small draft model to propose k tokens, then the large model verifies all k in one parallel pass.

Theoretical speedup = k·α + 1 − α where α is acceptance rate. At α=0.8, k=4: 3.4× faster.

Speculative Decoding - Interactive Visualization

Speculative decoding accelerates LLM inference by using a small fast draft model to propose k tokens, which the large target model verifies in a single parallel forward pass. Accepted tokens are free; rejected tokens fall back to the target model's distribution. At high acceptance rates, this yields 2–3× speedup with identical output distribution.

  • See the draft-then-verify loop: draft model proposes k tokens, target model scores all k in one pass
  • Acceptance rate visualization - which draft tokens are accepted vs rejected by the target model
  • Speedup calculator - see how acceptance rate and draft model speed translate to wall-clock speedup
  • Understand why rejected tokens still produce a valid sample from the target distribution (no quality loss)
  • Compare speculative decoding vs standard autoregressive decoding latency on the same sequence

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.