Blockwise and Semi-Autoregressive Generation › Worked Example With an Early Disagreement

Michael BrenndoerferNovember 17, 20263 min read
Language AI HandbookAll chapters
Part 19 of 67Alternative Sequence and Generative Architectures
Chapter 137Blockwise and Semi-Autoregressive Generation › Worked Example With an Early Disagreement
Reading section 7 of 11 · Worked Example With an Early Disagreement · 3 minSection 7 of 11 · 3 min

Section 7 of 11 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

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 PP and a draft model QQ, 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 PP from <bos> gives a, c, <eos>. Greedy decoding under QQ gives a, b, <eos>.

Start with the verified prefix <bos>, block size γ=3\gamma = 3, 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 said c).
  • 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:

PositionConditioning contextTarget argmax
1<bos>a
2<bos>, ac
3<bos>, a, b<eos>

Compare with the draft:

  • Position 1: a vs a. Agree.
  • Position 2: b vs c. Disagree.

Longest agreeing prefix has length m=1m = 1. 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, m=1m = 1. 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 b and 0.70 after c. EOS is the greedy choice in both contexts. The verifier uses the distribution after c once 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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy