Diffusion Language Models and Multi-Token Prediction: Comparing Two Paradigms for Faster LLM Inference
This article compares two ways to reduce large language model inference latency. Multi-token prediction with speculative decoding keeps the left-to-right autoregressive structure but proposes several tokens per step. Discrete diffusion language models generate text in blocks and refine each block in parallel. The article explains how each method works, how the acceptance rate determines the speedup of speculative decoding, and the trade-offs of each approach.
Inference cost and latency have become the main constraints on deploying large language models in production. When generating text, mainstream models produce one token at a time, from left to right, and feed each token back as input for the next step. This autoregressive approach is intuitive and trains stably, but each token must wait for the previous one to be determined. Serial computation makes it hard to use parallel hardware fully. The industry has developed two main approaches to this bottleneck. One keeps the autoregressive structure and lets the model propose several candidates at once, reducing the number of forward passes. The other changes the generation paradigm and uses a diffusion process to refine a span of text in parallel. Understanding the mechanisms and limits of both helps in choosing the right approach for a specific application.
1. The Bottleneck of Autoregressive Generation
An autoregressive model factorizes the joint probability of a sequence into a product of conditional probabilities:
P(x₁, x₂, …, xₙ) = ∏ P(xᵢ | x₁, …, xᵢ₋₁)
During inference, the model runs a full forward pass for every token it generates, and each pass depends on the result of the previous step. Generating n tokens therefore requires n serial forward passes, and the total latency is roughly n times the latency of a single step.
The key-value (KV) cache avoids recomputing attention intermediates for past positions, which significantly lowers the cost of each step. However, it cannot remove the dependency between steps. In addition, during small-batch decoding, each step must read a large amount of model weights from GPU memory. Compute units often sit idle while waiting for data, so hardware utilization is low. The core idea for speeding up autoregressive decoding is therefore to reduce the number of serial steps, or to make each step produce more useful output.
2. Multi-Token Prediction and Speculative Decoding
2.1 The Basic Idea of Multi-Token Prediction
Multi-Token Prediction (MTP) adds several extra prediction heads to the model backbone, so that the same hidden state predicts tokens at multiple future positions. During training, these extra heads are optimized together with the main model. During inference, they can propose candidate sequences at low cost.
Multi-token prediction does not change the left-to-right logic of generation. It provides a set of “drafts,” which must still pass verification by the main model before they are written to the output.
2.2 The Verification Process in Speculative Decoding
Speculative decoding splits generation into two stages: proposal and verification.
- A draft module, which can be a small model or a multi-token prediction head, proposes k candidate tokens at once.
- The target model runs one parallel forward pass over the existing prefix plus the candidate sequence, producing a probability distribution for each position.
- The candidate tokens are checked one by one, from front to back. If the target model accepts a token, it is kept. If it rejects a token, a replacement is sampled from the adjusted distribution, and all candidates after it are discarded.
In a standard rejection-sampling implementation, the output distribution matches the distribution the target model would produce through direct autoregressive sampling. The speedup therefore does not change the statistical properties of the final output.
Below is an illustrative pseudocode for the control flow of a single step:
def speculative_decode_step(target, draft, prefix, k=4):# 1. The draft module proposes k candidate tokenscandidates, draft_probs = draft.propose(prefix, k)# 2. One forward pass of the target model gives the target# distribution at each candidate positiontarget_probs = target.next_token_probs(prefix, candidates)accepted = []for i, tok in enumerate(candidates):p_t = target_probs[i][tok]p_d = draft_probs[i][tok]# Accept the candidate with probability min(1, p_t / p_d)if random_uniform() < min(1.0, p_t / p_d):accepted.append(tok)else:# Rejected: resample from the adjusted distribution and end this roundaccepted.append(target.sample_residual(target_probs[i], draft_probs[i]))return accepted# If all candidates are accepted, the target model also produces one extra tokenaccepted.append(target.sample(target_probs[k]))return accepted
The code omits engineering details such as batching, cache management, and probability normalization. It keeps only the core logic.
2.3 Estimating the Speedup
Let α be the acceptance rate of the draft candidates, assuming each position is independent and identically distributed, and let each round propose k candidates. The expected number of tokens produced per round is approximately:
E = (1 − α^(k+1)) / (1 − α)
For example, when α = 0.8 and k = 4, each round produces about 3.4 tokens on average. The actual speedup must also account for the cost of the draft module, and it depends on batch size, hardware, and task type. A higher acceptance rate gives a larger speedup. When the acceptance rate falls below a certain threshold, the draft overhead can cancel out the gains.
2.4 Advantages and Limitations
Multi-token prediction combined with speculative decoding is compatible with existing setups. It can be attached to an existing autoregressive model, its output quality matches the target model, and the engineering changes are relatively contained.
Its limits are equally clear. The outer loop still runs left to right, so the speedup per round is capped by the acceptance rate and the draft cost. If the task output is highly uncertain, the acceptance rate drops and the speedup weakens.
3. The Discrete Diffusion Language Model Approach
3.1 From Image Diffusion to Discrete Tokens
Diffusion models were first developed for continuous data such as images. Training has two processes. The forward process gradually adds noise to the data, and the reverse process learns to recover the data from noise step by step. Text consists of discrete symbols, so “adding noise” must be reformulated as masking or randomly replacing tokens. The reverse process of discrete diffusion starts from a corrupted sequence and gradually predicts the masked or replaced positions.
3.2 Block-Autoregressive Generation and Parallel Denoising Within Blocks
Generation often uses block-autoregressive decoding:
- Blocks are generated from left to right. Each later block uses the finalized content of earlier blocks as context.
- Within a block, tokens are not generated one at a time. Instead, all positions are first set to mask, and the model predicts all positions in parallel. The output is then refined over several iterations.
- In each iteration, positions with high confidence are fixed, while positions with low confidence remain masked or continue to be refined.
This approach moves the serial dimension from the token level to the block level. Computation within a block can be completed in a single model call, and the number of denoising steps becomes a setting that trades speed against quality.
Below is an illustrative denoising loop within a block:
MASK = Nonedef block_denoise(model, context, block_len, num_steps, conf_threshold):block = [MASK] * block_lenfor step in range(num_steps):# Take the context and the current block as input, and predict all positions in parallelprobs = model(context, block) # shape: [block_len, vocab]best_tok = probs.argmax(dim=-1)best_conf = probs.max(dim=-1).valuesfor i in range(block_len):# Fix only positions whose confidence is high enough; keep the rest for the next stepif block[i] is MASK and best_conf[i] >= conf_threshold(step):block[i] = best_tok[i]if all(tok is not MASK for tok in block):break# If any positions remain undetermined, fill them with the predictions from the last stepreturn [tok if tok is not MASK else best_tok[i] for i, tok in enumerate(block)]
Practical systems also typically add a remasking step.
