← [ ABORT TO HUD ]
SEQ. 1

Draft-Target Speculative Decoding

🚀 Speculative Decoding & Multi-Model Harnesses25 min225 BASE XP⌨ HANDS-ON LAB

Breaking the Autoregressive Speed Barrier

Autoregressive decoding generates one token per forward pass. Because modern GPUs have massive parallel compute, running a single token through a 70B parameter model severely underutilizes the GPU's execution units.

The Two-Phase Speculative Mechanism

  1. Speculative Drafting: A small, ultra-fast Draft Model (e.g. Llama 3.2 1B), a multi-head prediction head (Medusa / Hydra), or a feature-level recurrent draft engine (EAGLE-3) generates (K) candidate tokens in a tree structure.
  2. Target Verification: The large Target Model (e.g. Llama 3.3 70B) evaluates all (K+1) candidate tokens in a single parallel forward pass using tree-attention masks.
  3. Acceptance Criterion: Using modified rejection sampling, the harness accepts tokens along the tree path up to the first disagreement. Accepted tokens are emitted simultaneously, yielding a 2.5x to 3.8x wall-clock speedup with mathematically identical output distribution!

Next-Gen Speculative Architectures: EAGLE-3 & Medusa

ArchitectureMechanismDraft OverheadAcceptance Rate
EAGLE-3Feature-level recurrence; drafts at the second-to-last hidden layer~10% VRAM of standard draft modelUp to 82% token acceptance
Medusa HeadsMulti-head linear decoders atop target model; zero auxiliary draft model0 auxiliary model parameters (heads only)2.2x – 2.8x speedup
Independent DraftSeparate small model (e.g., Llama 1B drafting for 70B)Requires dedicated GPU memory for draft KV cache65% – 75% acceptance
⌨ HANDS-ON LABConfigure Speculative Decoding Engine
⭐ +250 XP

Pair a 1B draft model with a 70B target model and measure candidate acceptance rate.

1Initialize dual-model speculative decoding harness.
2Run benchmark request and compute acceptance rate.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 2 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 1
Why does speculative decoding produce the exact same mathematical probability distribution as standard sampling?
Because rejection sampling adjusts candidate logits so the joint probability strictly equals the target model's distribution
Because it uses quantum computing
Because the draft model is an exact clone of the target model
It does not; speculative decoding is always lossy