Draft and verify: why verification is nearly free
The loop:
1. DRAFT run a cheap model autoregressively for gamma steps,
producing candidate tokens x1..x_gamma and its
distributions q(.|prefix), q(.|prefix,x1), ...
2. VERIFY run the target model ONCE on [prefix, x1, ..., x_gamma].
Because attention is causal, one pass gives you the target's
distribution p at every one of those positions simultaneously.
3. ACCEPT walk left to right, accepting or rejecting each x_i by the
rule in the next concept. Stop at the first rejection.
4. On rejection at position i, sample a corrected token from a residual
distribution. On accepting all gamma, sample one bonus token from
p(.|prefix, x1..x_gamma) -- which you already have.
Step 2 is the crux. A single forward pass over γ+1 positions costs the same weight traffic as a forward pass over one position. You read all 15 GB either way. The extra positions cost extra arithmetic — which you had in surplus.
Per accepted token, the cost falls dramatically. If you accept 3 of 4 drafts plus a bonus token, you produced 4 tokens for one target-model pass instead of four passes. Four times fewer weight reads.
Note also step 4's bonus token. If every draft is accepted, the verification pass has already computed p at the final position, so you get one extra token for free. This is why the expected yield formula has γ+1 in it rather than γ, and it is a meaningful contribution at high acceptance rates.
Two things this does not do, worth being clear about. It does not reduce total FLOPs — it increases them, since drafts that get rejected were computed for nothing. And it does not help when you are already compute-bound, because then there is no idle arithmetic to spend. Both qualifications become important later in this module.
STANDARD DECODE -- 4 tokens, 4 target passes, 4 x 15 GB
[target] -> t1
[target] -> t2
[target] -> t3
[target] -> t4 60 GB moved
SPECULATIVE -- 4 tokens, 1 target pass, 4 draft passes
[draft][draft][draft] -> x1 x2 x3 3 x 0.5 GB
[target on x1,x2,x3 at once] 1 x 15 GB
accept x1 ✓
accept x2 ✓
reject x3 ✗ -> resample t3
16.5 GB moved, 3 tokens
-> 3.6x less traffic per token
REMEMBERChecking gamma guessed tokens costs one forward pass, the same weight traffic as generating one token — so the extra positions ride in idle arithmetic.