Accelerating LLM Decoding: Multi-Token Prediction and Diffusion-Based Block Generation
Mainstream large language models generate text token by token, which creates strict serial dependencies and heavy memory-bandwidth overhead during inference. This article examines two mainstream approaches to reducing serial decoding steps: multi-token prediction with speculative decoding, which verifies multiple candidate tokens in a single forward pass, and diffusion-based block generation, which denoises an entire block of text in parallel. It compares their acceleration mechanisms, output quality guarantees, integration costs, and limitations, and offers practical guidance on technology selection, evaluation, KV cache management, and safe deployment.
1. Background: The Efficiency Bottleneck of Token-by-Token Generation
Mainstream large language models (LLMs) generate text autoregressively. The model outputs one token at a time, and each output is fed back as input for the next prediction. This approach is straightforward to model and stable to train, but it has an obvious drawback: generating a text of length N requires N forward passes, and these steps are strictly dependent on one another, so they cannot be parallelized.
During inference, the bottleneck comes from two main sources.
- Serial dependency: Token t depends on the result of token t-1, making it hard to fully utilize the GPU’s parallel compute capacity.
- Memory access overhead: Every generated token requires reading a large volume of model weights and the key-value cache (KV cache). Since the computation per step is small, memory bandwidth often becomes the limiting factor.
As a result, the industry has converged on two main strategies for “reducing the number of serial steps”: either produce more results per forward pass within the autoregressive framework, or change the generation paradigm so that a span of text is updated in parallel within a single iteration.
2. Approach 1: Multi-Token Prediction and Speculative Decoding
2.1 Basic Principle
The core idea of speculative decoding is “propose first, verify later.” A lightweight draft mechanism proposes k candidate tokens at once; the original model then verifies these candidates in a single parallel forward pass. If a candidate matches the original model’s judgment at that position, the segment is accepted. As soon as a mismatch occurs, the sequence is truncated at the first incorrect position and replaced with the original model’s output.
Multi-Token Prediction (MTP) is a common implementation of this idea: during training, the model additionally learns to predict tokens at multiple future positions, and at inference time these extra prediction heads are used directly to generate the draft.
The workflow can be described in pseudocode as follows:
def speculative_decode(target_model, draft_head, prefix, k=4, max_len=512):tokens = list(prefix)while len(tokens) < max_len:# 1. Drafting: propose k candidate tokens at oncecandidates = draft_head.propose(tokens, num_tokens=k)# 2. Verification: the target model runs one parallel forward pass over the candidatesverified = target_model.verify(tokens, candidates)# 3. Acceptance: keep the longest prefix that matches the target modelaccepted = 0for c, v in zip(candidates, verified):if c == v:accepted += 1else:breaktokens.extend(candidates[:accepted])# The first mismatched position is replaced by the target model's correct tokentokens.append(verified[accepted])return tokens
This code only illustrates the workflow. A real implementation must also handle sampling temperature, probability comparison, batched request scheduling, and other details.
2.2 Performance and Quality Characteristics
The advantages of this approach include:
- Controllable output distribution: Final tokens are still confirmed by the original model. With a strict acceptance criterion, the output distribution matches that of the original model.
- Low integration cost: The original model architecture and training pipeline can be reused, with only a few additional prediction heads or a draft module added.
- Good compatibility: It integrates smoothly with existing inference frameworks, cache management, and sampling strategies.
Its limitations are equally clear. Generation still proceeds strictly left to right, and the speedup depends on the draft acceptance rate. The further ahead the draft predicts, the lower its accuracy, and the fewer tokens can be accepted per step on average. Therefore, the speedup ceiling is usually constrained by the acceptance rate, making order-of-magnitude improvements difficult to achieve.
3. Approach 2: Diffusion-Based Block Generation
3.1 Basic Principle
Diffusion-based language models borrow the denoising idea from image generation. Instead of writing tokens one by one, the model first prepares a fixed-length “canvas,” whose contents may be blanks, mask placeholders, or random noise. In each iteration, the model observes the entire canvas simultaneously, predicts a more appropriate token for every position, and revises existing content. After several denoising rounds, the canvas converges into readable text.
Compared with pure autoregressive generation, this paradigm brings three notable changes:
- Intra-block parallelism: All positions within a block are updated in the same round of computation.
- Revisable content: Tokens written earlier can still be rewritten in later iterations; they are no longer fixed once emitted.
- Block-level progression: Blocks are still generated in sequence, which is why this is often called block autoregressive generation. The transition between blocks is one of the core problems these methods must solve.
3.2 The Iterative Denoising Process
Below is a simplified illustrative flow of intra-block iteration:
def block_denoise(model, prompt_ids, block_len=256, steps=16):# Initialization: fill the entire block with placeholders for undecided contentcanvas = [MASK_ID] * block_lenfor step in range(steps):# Given the context and the current canvas, predict every position in the block at oncelogits = model(prompt_ids, canvas) # shape: [block_len, vocab]proposal = logits.argmax(dim=-1)# Use confidence to decide which positions to fix this round; the rest keep being revisedconfidence = logits.softmax(dim=-1).max(dim=-1).valueskeep = confidence > threshold_for(step, steps)canvas = [p if k else c for p, c, k in zip(proposal, canvas, keep)]if all(k for k in keep):breakreturn canvas
This example captures two key actions in code: parallel prediction within the block and progressively fixing positions by confidence. Scheduling strategies, confidence thresholds, and sampling methods vary across real systems, so refer to the specific implementation.
3.3 Advantages and Challenges
The potential advantages of diffusion-based block generation include:
- High parallelism: A block of text can be completed within a limited number of iterations, theoretically reducing the total number of forward passes.
- Stronger global consistency: The model sees the entire block’s context in every round, which helps with content that requires long-range coherence.
- A natural correction mechanism: Early mistakes can be fixed in later iterations.
At the same time, there are clear challenges:
- Balancing iteration count and quality: Too few rounds degrade text quality; too many rounds erode the speed advantage.
- Block boundary issues: Transitions between blocks require special design, otherwise sentences may read incoherently across boundaries.
- Training and inference costs: The diffusion-style training objective differs from standard language modeling, so both the training pipeline and evaluation methods must be redesigned.
- Long-text adaptation: Block length, canvas organization, and context management directly affect the stability of long-form generation.
4. Comparing the Two Approaches
| Dimension | Multi-Token Prediction & Speculative Decoding | Diffusion-Based Block Generation |
|---|---|---|
| Generation order | Strictly left to right | Parallel within blocks, sequential across blocks |
| Source of speedup | Verifying multiple candidate tokens at once | Parallel intra-block updates reducing iteration steps |
| Output quality guarantee | Confirmed token by token by the original model | Depends on iterative convergence and training objective |
| Integration cost | Low; reuses the original model | High; usually requires retraining |
| Modification of generated content | Not possible | Possible during iterations |
| Main constraint on speedup ceiling | Draft acceptance rate | Iteration count and inter-block transitions |
| Ecosystem compatibility | Good | Still developing; tooling is not yet unified |
The two approaches are not mutually exclusive. Speculative decoding can be applied to any autoregressive model, while diffusion-based methods represent a new modeling direction. From an engineering perspective, the former is well suited for quickly gaining benefits on existing services, while the latter is a long-term architectural exploration.
5. Selection Recommendations
In practice, you can evaluate options in the following order.
- Identify the bottleneck first: Use profiling to confirm where time is actually spent. If the bottleneck lies in the decoding phase and the model is already in production, prioritize speculative-decoding-style solutions.
- Measure the acceptance rate: Measure the average accepted draft length on real business data. When the acceptance rate falls below expectations, the speedup benefit drops quickly.
- Establish a quality baseline: Run automatic evaluations and manual spot checks on outputs to confirm that semantic accuracy, format stability, and safety compliance have not noticeably regressed after acceleration.
- Consider the runtime environment: Batch size, memory footprint, and concurrency patterns all affect the final gains. Low-latency, small-batch scenarios and high-throughput scenarios call for different optimization priorities.
- Keep a fallback path: If the acceleration module misbehaves, the service should be able to switch back to standard decoding to prevent failures from escalating.
6. Practical Considerations for Deployment
1. Define metrics consistently
Throughput, time to first token, and end-to-end generation time are three different metrics. When reporting performance, state the test conditions clearly—including input length, output length, batch size, and hardware configuration—and avoid comparing different metrics against each other.
2. Pay attention to KV cache management
Whichever approach you adopt, the cache is a critical resource at inference time. Speculative decoding requires rolling back rejected drafts, so the cache management logic must handle truncation correctly. Diffusion-based methods recompute the entire block repeatedly during iterations, so cache reuse also needs a dedicated design.
3. Build reproducible evaluation sets
Sampling temperature, random seeds, and iteration strategies all affect outputs. Fix these parameters during evaluation and keep complete logs so that issues can be reproduced and versions compared.
4. Maintain content safety and review
Changing the generation method does not change safety requirements. Whether output is produced token by token or block by block, it should go through the same content filtering and review pipeline, with alerts configured for abnormal outputs.
5. Keep tracking technical progress
Both categories of methods are evolving rapidly. Establish a regular evaluation mechanism and judge, based on your own business data and metrics, whether a new method is worth adopting—rather than relying on a single benchmark result.
7. Conclusion
The core problem in LLM acceleration is how to reduce the waiting caused by serial computation. Multi-token prediction and speculative decoding increase per-step output through a draft-and-verify scheme while preserving the autoregressive framework; they are cheap to integrate and highly compatible, but their speedup ceiling is bounded by the acceptance rate. Diffusion-based block generation changes the text generation paradigm itself, denoising block by block in parallel with global revision capability, but it places higher demands on training and engineering implementation.
When choosing a technology, first locate the bottleneck, then weigh quality requirements, integration costs, and the runtime environment together. For services already in production, speculative decoding is usually the safer starting point. For systems that need long-term evolution, diffusion-based generation can be added to the technology roadmap, with its benefits and risks continuously validated in a controlled environment.
