Blockwise and Semi-Autoregressive Generation › Worked Example With an Early Disagreement
Language AI HandbookAll chapters We'll build a minimal deterministic trace of blockwise decoding before touching the code, so the logic is clear.
Suppose we have a target model and a draft model , both bigram distributions over the tiny vocabulary [<bos>, a, b, c, <eos>]. The draft approximates the target and prefers a different continuation after the token a. Greedy decoding under from <bos> gives a, c, <eos>. Greedy decoding under gives a, b, <eos>.
Start with the verified prefix <bos>, block size , and let the draft propose next tokens one at a time:
- Draft from
<bos>:a. - Draft from
a:b(here the draft disagrees with the target, which would have saidc). - Draft from
b:<eos>.
So the draft proposes [a, b, <eos>]. Now run the target in one teacher-forced pass over the prefix plus this draft:
| Position | Conditioning context | Target argmax |
|---|---|---|
| 1 | <bos> | a |
| 2 | <bos>, a | c |
| 3 | <bos>, a, b | <eos> |
Compare with the draft:
- Position 1:
avsa. Agree. - Position 2:
bvsc. Disagree.
Longest agreeing prefix has length . The first drafted token is accepted. The second is rejected. The third was scored, but its conditioning context included b, which is about to be rejected. It is a score for the discarded branch. It cannot be used to justify committing <eos> at position 3, because the prefix to position 3 will not contain b. If the model wanted to claim that <eos> is the right continuation, it would have to be re-run under the correct prefix <bos>, a, c. It hasn't been.
Now read the correction. The target's argmax after the accepted prefix <bos>, a is position 2's score, which is c. That prediction was computed inside the same pass, and it is guaranteed to match the greedy target sequence. Commit it. The verified prefix becomes <bos>, a, c. One step produced two tokens.
Second iteration. Prefix <bos>, a, c. Draft from c gives <eos>. Target from c gives <eos>. Full agreement, . Commit <eos>. Sequence complete. The runtime committed three new tokens including <eos> in two verification rounds. The greedy baseline makes three serial decisions. The supplied <bos> counts in neither output length nor decision count.
Two things are worth extracting from the trace.
- The score/commit gap. The first iteration checked three candidate positions and committed two tokens. Position 2's target score was useful, even though the draft token at position 2 was rejected. Position 3's score belonged to the discarded branch.
- The next iteration. The target gives EOS probability 0.40 after
band 0.70 afterc. EOS is the greedy choice in both contexts. The verifier uses the distribution afterconce it commits the correction.
We now encode the same trace in two small bigram tables. Then we use different tables to show why stochastic verification needs its probability correction, even on a single position.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!