Blockwise and Semi-Autoregressive Generation

Michael BrenndoerferNovember 17, 20262 min read
Language AI HandbookAll chapters
Part 19 of 67Alternative Sequence and Generative Architectures
Chapter 137Blockwise and Semi-Autoregressive Generation
Reading section 1 of 11 · Blockwise and Semi-Autoregressive Generation · 2 minSection 1 of 11 · 2 min

Section 1 of 11 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

A target decoder would greedily emit a, c, <eos>. The draft proposes a, b, <eos>, and the target scores all three positions in one pass. It accepts a and uses its second score to replace b with c. The third score was computed after b. The decoder needs a score after the corrected prefix to choose its next token.

There are two design choices to keep distinct in this chapter:

  • Train a model to generate blocks. In the semi-autoregressive translation system we will study, the model predicts positions inside a group independently given the earlier groups and source text. Other block-autoregressive models allow dependence within a group through an iterative sampler.
  • Verify blocks against an existing target model. A fast proposal process supplies potential future tokens, and the target checks their prefixes together. A greedy verifier can reproduce the target's baseline sequence. An exact stochastic verifier can preserve the target's sampling distribution.
Semi-Autoregressive Generation

The sequence probability factorizes over ordered blocks. What happens inside a block is a separate modeling choice. A one-shot block predictor can use independent token distributions, and a block diffusion model can refine the same block across multiple rounds.

Blockwise Parallel Decoding

Stern, Shazeer, and Uszkoreit (2018) predict several positions in parallel. They use the original model to check the longest contiguous prefix that matches its greedy choices. A related greedy draft-and-verify algorithm can also emit a target correction at the first disagreement.

Speculative Decoding

Leviathan, Kalman, and Matias (2023) draw a block of proposals from a draft distribution and score it with the target. An acceptance rule and a residual distribution recover the intended target distribution at each output position.

A trained block model specifies how its tokens depend on each other. In draft verification, an existing target model uses each hypothetical prefix to evaluate the corresponding proposal.

Part XXVIII, Inference Optimization, introduces Speculative Decoding for deployment. Speculative Decoding Math develops the acceptance and speedup formulas further.

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