From Autoregression to Diffusion: The Division of Labor in Generation Acceleration
This article examines three distinct approaches to accelerating large language model generation and clarifies how they relate to one another. MTP and draft-based speculative decoding leave the autoregressive generation order unchanged and simply add a draft-and-verify mechanism; discrete diffusion changes the generation order itself by denoising whole blocks in parallel; and QAT (quantization-aware training) operates at the numerical-precision layer. The three are mutually compatible and can be stacked. Through code examples, comparison tables, and engineering guidance, the article helps developers select and combine these techniques based on real workload data.
1. Introduction: Why Generation Methods Are Now in Focus
Recently, a model vendor added a diffusion-based language model to its open-source model lineup. This version uses a Mixture-of-Experts (MoE) architecture and denoises block by block rather than generating token by token from left to right. Discussions about “how it relates to the MTP and QAT used by earlier models in the same family” followed.
Here are the conclusions up front:
- The three are not at the same level:
- MTP and draft-based speculative decoding do not change the generation order; they only add “guess-and-verify” at inference time;
- Discrete diffusion changes the generation order itself, replacing token-by-token output with parallel block denoising;
- QAT (quantization-aware training) is an optimization at the numerical-precision level.
- The three are mutually compatible and can be stacked. Speculative decoding can accelerate a diffusion model, and quantization can also apply to a diffusion model. In practice, the likely combination is “one generation paradigm plus several acceleration and compression techniques.”
- Each has a cost:
- The speedup ceiling of speculative decoding is bounded by the acceptance rate of the draft;
- Diffusion brings parallelism but also introduces challenges in decoding quality and inference-engine adaptation;
- Quantization trades an acceptable loss of accuracy for lower memory and bandwidth overhead.
(一) Where the Serial Bottleneck of Autoregression Comes From
Most mainstream language models today are trained autoregressively. Their decoding can be summarized as follows: at each step, they predict the probability distribution of the next token conditioned on all previously generated context, sample that token, append it to the sequence, and move to the next step.
# Token-by-token autoregressive decoding (schematic)for _ in range(max_new_tokens):logits = model.forward(context) # one full forward pass per tokennext_token = sample(logits[:, -1, :])context = context + [next_token] # the new token immediately becomes a condition
Formally, P(x1, x2, ..., xT) = ∏ P(xt | x<t): generating T tokens requires at least T model forward passes, and each later token depends on the already-sampled previous one, so it cannot be determined in advance.
What truly amplifies this bottleneck is hardware behavior. During single-request (batch=1) decoding, each step produces only one token yet must read all weights from memory into the compute units. The operation is memory-bound: expensive memory bandwidth is spent computing a single token, while the GPU’s parallel compute capacity sits largely idle. Increasing the batch in a concurrent-serving scenario can mitigate this, but the per-user perceived time-to-first-token and output speed (often measured as time-per-output-token, TPOT) are still constrained by the serial chain.
In recent years, the industry has addressed this tension along two main lines:
- Speeding up within the autoregressive framework: the typical example is speculative decoding, with multi-token prediction (MTP) as a way to train draft capability.
- Changing the generation paradigm: discrete diffusion lets multiple positions within a block be determined in parallel.
(二) The Essential Difference Between the Two Generation Paradigms
| Dimension | Token-by-token autoregression | Block-level discrete diffusion |
|---|---|---|
| Basic operation | Predict 1 position at a time | Predict many positions in a block at once |
| Generation order | Strictly left to right, cannot be determined in advance | Order within a block not fixed; blocks proceed left to right |
| Serial chain length | Number of tokens T | Approximately number of tokens ÷ block length |
| Per-step compute utilization | Generally low for a single request | Higher parallelism achievable in a single step |
| How output is finalized | Sampling confirms it immediately | Draft in parallel first, then confirm progressively by confidence |
In one sentence: MTP answers “how to take fewer steps within autoregression,” while diffusion answers “whether we can stop walking step by step at all.”
2. MTP and Draft-Based Speculative Decoding: Not Changing the Writing Style, Just Adding a “Draft Accelerator”
(一) The Three-Stage Draft–Verify–Accept Pipeline
Speculative decoding consists of three parts:
- A draft model (or a lightweight draft head) predicts K candidate tokens in a row;
- The target model runs one forward pass over these candidate positions, obtaining the distribution at each position in parallel;
- An acceptance rule decides the length of the prefix that can be accepted and, when necessary, resamples a “correction token” from the target distribution at the rejected position.
Pseudocode:
# Core speculative-decoding loop (sampling details and KV-cache management omitted)draft, d_probs = [], []for _ in range(K): # Stage 1: draftp = draft_model.next_token_probs() # the draft model generates step by stept = sample(p)draft.append(t)d_probs.append(p)target_probs = target_model.forward(context, draft) # Stage 2: verify in parallel with one forward passn = 0 # Stage 3: accept one by onefor t, p, q in zip(draft, target_probs, d_probs):if random() < min(1, p[t] / q[t]):n += 1else:breakbonus = sample(target_probs[n]) # after rejection, resample a correction from the target distributionnew_tokens = draft[:n] + [bonus]
Key property: as long as the acceptance rule and rejection sampling are correct, the final output distribution matches token-by-token sampling from the target model — usually called “lossless acceleration.” Users get not just an “approximately right” answer: it is faster while the output distribution stays the same. This is an important reason speculative decoding is easy to accept in practice.
(二) MTP’s Role
Two levels need to be distinguished:
- Training level: MTP is a multi-token prediction objective. At each position the model predicts not only the next token but also tokens further ahead, producing extra prediction heads or shallow modules.
- Inference level: the above structure can serve as a draft source and, combined with parallel verification, realize speculative decoding.
So MTP’s value is to let the draft share representations with the main model and guess several tokens ahead, speeding up the same “write left to right” process.
Common drafting approaches each fit different scenarios:
- Independent small model: easy to maintain and swap, but occupies extra memory; the closer its distribution to the main model, the higher the acceptance rate.
- Self-draft (MTP prediction heads): no need to maintain a second model; the cost is extra computation for the draft heads, which grows more noticeable as K increases.
- Template fallback: in highly predictable spans such as code and structured data, copying a segment from the preceding context as a draft is cheap, but generalization is limited.
- Tree verification: submit multiple candidate branches at once and keep the longest accepted path, trading more computation for a higher acceptance rate.
(三) The Speedup Ceiling Depends on the Acceptance Rate
Under simplifying assumptions (each draft token is accepted independently with probability α, and draft cost is negligible), one draft-plus-verify round yields about (1 - α^(K+1)) / (1 - α) effective tokens on average, and the ideal theoretical speedup can be estimated the same way.
| K (draft length) | α = 0.5 | α = 0.8 | α = 0.95 |
|---|---|---|---|
| 4 | 1.88 | 2.77 | 3.60 |
| 8 | 1.99 | 3.20 | 5.07 |
The higher the acceptance rate, the more obvious the gains; increasing K further shows diminishing returns. The actual acceptance rate varies greatly by task:
- In routine Q&A, candidate tokens are relatively easy for the target model to accept;
- In long-chain reasoning and open-ended writing, paths diverge more, so the acceptance rate drops;
- Higher temperature flattens the distribution and lowers the acceptance rate;
- In high-concurrency scenarios with a large batch, the compute cost of the verification stage rises, narrowing the net gain.
In addition, speculative decoding relies strictly on the KV cache: verifying multiple candidate positions, rolling back after rejection, and repeated forward passes of the draft head all require precise and rollback-capable cache state. Most mainstream inference frameworks support this natively, which is also why its adoption cost is relatively low.
3. Discrete Diffusion: Turning “Writing Character by Character” into “Drafting Whole Blocks and Revising Step by Step”
(一) From Continuous Diffusion to Masked Denoising
A diffusion model’s generation idea is “recover data from noise”: during training it adds noise to data according to some schedule, and during inference it starts from pure noise and denoises step by step. For continuous data such as images, Gaussian noise is usually added directly to features.
Text is discrete symbols, so the mainstream approach shifts to discrete diffusion, commonly in two forms:
- Uniform noise: replace a token with another token from the vocabulary with some probability;
- Masked diffusion: replace a token with a special [MASK], and train the model to predict the masked positions from context.
In language-model practice, the masked form is more common because it fits “fill-in-the-blank” training closely. Its generation process can be understood as cloze-style completion:
- Set the entire region to be generated to [MASK];
- The model sees the whole region at once;
- It predicts the probability distribution at all positions;
- It confirms only the highest-confidence subset of positions;
- The remaining positions stay [MASK] and go into the next round.
def denoise_block(model, prefix, canvas_len, steps):canvas = [MASK] * canvas_len # initialize the whole block as to-be-filledfor step in range(steps):logits = model.forward(prefix, canvas) # one forward pass sees all positions in the blockconf, best = per_position_confidence(logits)# follow the schedule to gradually reduce the masked fraction, confirming only the most reliable positions this roundkeep = [i for i in range(canvas_len) if canvas[i] is MASK]ratio = remask_ratio(step, steps) # masking-ratio schedule, e.g., linear or cosine decaychosen = set(sorted(keep, key=conf.get)[:int(len(keep) * ratio)])for i in keep:if i not in chosen:canvas[i] = best[i] # confirm the positionreturn canvas
At round t, the model sees a mixture of “already-confirmed spans + remaining [MASK]” and updates all unconfirmed positions at once based on that. This is the fundamental difference from autoregression: the next step is no longer driven by a single token, but jointly determined by the collective state of the whole block.
(二) Block Autoregression and Multi-Canvas Sampling
If arbitrary-length text were repeatedly denoised, the interaction between preceding and following context would get complicated. In practice, models commonly adopt block autoregression (block-autoregressive):
- Set a fixed block length, treating each block as a “canvas,” e.g., 256 tokens;
- Denoise in parallel within the block;
- Only after one block is fully confirmed does the next block begin; between blocks it is still autoregressive;
- Multi-canvas sampling maintains multiple canvases in the same context. Asynchronous generation and producing multiple candidate spans in parallel are both built on this scheduling.
# Block-autoregressive decoding (schematic): parallel within a block, serial across blocksoutput = prefixwhile not finished(output):canvas = denoise_block(model, output, canvas_len=256, steps=steps)output = output + canvas# optionally carry the last few tokens of the previous block as partially visible state for the new block
Thus the number of end-to-end generation passes drops from “number of tokens” to “number of tokens ÷ 256 × denoising steps per block.” Its most direct difference from speculative decoding lies in the granularity of parallelism:
- The unit of parallelism in speculative decoding is “several candidate positions”;
- The unit of parallelism in diffusion is “a large number of positions within a block.”
The longer the block, the shorter the serial chain, but the stronger the model’s ability to model long-range within-block dependencies must be.
(三) An Architecture View: How Public Parameters Support Diffusion Decoding
According to the vendor’s public materials, the diffusion version’s configuration can be summarized as follows:
- About 25.2B total parameters, about 3.8B activated parameters;
- 30 layers;
- 8 experts activated out of 128 at each step, plus 1 shared expert;
- 256K context window;
- canvas length of 256.
Taken together, these parameters can be understood from three angles regarding their design trade-offs:
1. Using sparse activation to lower per-step cost.
Diffusion requires multiple iterative forward passes, and per-step cost directly determines total time. MoE activates only a few experts per step, so each forward pass costs about as much as a small dense model, while a larger parameter set stays resident in memory. Public materials label the activation scale “A4B,” i.e., roughly 4B activated.
2. Using a shared expert as a fallback for general capability.
With many experts and few activated, routing decisions have an amplified effect on results; the shared expert participates in computation for all tokens, carries general language knowledge, and reduces reliance on routing precision. This is also a common practice in sparse MoE.
3. Pairing a long context with a fixed block length.
The context window determines how much information the model can “see,” while block length determines the parallelism granularity. Their combination means the model can, after a very long history, produce output in 256-token blocks.
The above is an analysis at the level of design principles; actual gains still depend on hardware, concurrency level, and inference-engine implementation, and cannot be inferred from parameter scale alone.
(四) New Capabilities and New Costs from Diffusion
New capabilities:
- Parallel infilling: the task naturally supports “filling in content at arbitrary positions,” and filling multiple blanks at once is more natural than autoregressive generation segment by segment;
- Controllable generation: which positions to confirm and which to keep can each serve as generation constraints;
- More flexible rewriting: modifying a local region does not require recomputing everything from the edit point onward.
New costs:
- Quality consistency: parallel confirmation requires the model to make judgments while information is still incomplete, so it is sensitive to confidence calibration, the number of denoising steps, and the masking-ratio schedule;
- Inference-engine adaptation: existing optimizations such as draft verification, KV-cache management, and chunked streaming output may not apply directly;
- Throughput trade-offs: in concurrent scenarios, diffusion has higher compute utilization, but whether it beats autoregression depends on the concurrency scale and scheduling strategy.
4. QAT: A Precision-Layer Optimization Orthogonal to the Generation Method
QAT (quantization-aware training) introduces simulated quantization operations during training or fine-tuning, letting the model “adapt” in advance to the error introduced by low-bit inference.
- In the forward pass it pseudo-quantizes weights and activations to the target precision; in the backward pass it propagates gradients via a straight-through estimator;
- Compared with post-training quantization (PTQ), the accuracy loss is usually smaller;
- The cost is that training data and extra compute are required.
Its role: keep the model’s output distribution close to full precision at a lower numerical precision, thereby reducing memory usage and memory access. It does not change the generation order, so it conflicts with neither MTP nor diffusion:
- A model can be quantized first and then accelerated with a draft approach;
- Or quantized first and then run block-level denoising.
When combined with speculative decoding, two points need special attention:
- The draft source and the target model should share the same precision and decoding parameters; otherwise the strict sense of “lossless” no longer holds;
- A slight shift in the output distribution at low precision directly changes the acceptance rate, so it is best to measure the acceptance rate with the actual-precision model.
When combined with diffusion, confidence is the risk point:
- Diffusion depends on the confidence ranking of “which position is confirmed first at each step”;
- Distribution shifts from quantization change that ranking;
- During quantization, pay attention to the stability of confidence-related outputs, and evaluate final text quality rather than looking only at perplexity.
Moreover, quantizing a sparse MoE requires care with routing. Routing decisions are usually sensitive to numerical perturbation, and picking the wrong expert noticeably perturbs output quality. After quantization, check whether expert load stays balanced and whether the routing distribution drifts.
5. Comparison Summary and Selection Guidance
| Dimension | MTP / draft-based speculative decoding | Block-level discrete diffusion | QAT |
|---|---|---|---|
| Layer of effect | Inference acceleration | Generation paradigm | Numerical precision |
| Generation order | Unchanged, still token by token | Parallel within a block, autoregressive across blocks | Unchanged |
| Source of speedup | Fewer serial forward passes | Whole-block parallelism replaces one-by-one generation | Lower weight access and compute cost |
| Output distribution | Usually the same as the original model | Different from the original model, needs separate evaluation | Close to the original model |
| Dependencies | Draft model or prediction heads, KV cache, accept–reject sampling | Masked or discrete-noise training, denoising schedule, block-level inference support | Calibration data, quantization training pipeline |
| Main cost | Draft overhead; limited gains at low acceptance rates | Scheduling and quality risk of parallel decoding | Training cost and potential accuracy loss |
| Typical fit | Existing autoregressive models that want low-risk speedup | Scenarios that can generate whole blocks and emphasize parallelism and controllable editing | Memory- or bandwidth-constrained cases pursuing lower inference cost |
Selection can follow this order:
- Existing autoregressive model, need low-risk speedup: prefer speculative decoding — low overhead and easy to roll back;
- Memory- or bandwidth-constrained: introduce quantization, but be sure to validate quality on the business evaluation set before deployment;
- Whole-block output is acceptable, need parallel infilling or flexible rewriting: evaluate block-level diffusion models, focusing on decoding quality and long-context stability;
- Pursuing the ultimate combination: quantization + speculative decoding can be stacked; block-level diffusion can also be paired with draft-style parallel verification.
6. Engineering Implementation Guidance
(一) Build a Comparable Baseline
- Fixed inputs: use a fixed prompt set covering short Q&A, long-form generation, code, reasoning, and multi-turn dialogue;
- Fixed parameters: fix temperature, sampling strategy, and maximum length;
- Measure in batches: measure throughput and latency separately at low and high concurrency;
- End-to-end evaluation: look at time-to-first-token, time-per-output-token, total time, and throughput together.
(二) Let Data Drive the Switches
- Speculative decoding should measure the draft acceptance rate against real requests. When the acceptance rate is clearly low, adjust the draft length, switch the draft source, or turn the feature off, to avoid “speedup turning into slowdown.”
- Diffusion should monitor the average number of denoising steps per block, whether the position-confirmation order matches expectations, and whether the same position is being rewritten repeatedly.
(三) Use Evaluation to Guard the Quality Floor
- Speed is not quality.
- Diffusion models: verify whether they are stable under a fixed random seed, and whether differences in information completeness among positions within the same block cause internal contradictions.
- Quantized models: don’t look only at perplexity; also check confidence-related metrics and compare on real tasks.
(四) Put Capabilities in the Right Place
From a deployment perspective, different optimization methods serve different goals:
- Inference layer: KV-cache management, batch scheduling, draft verification, and parallel denoising affect per-request latency and concurrent throughput;
- Precision layer: quantization compression and weight/activation optimization affect the service capacity per unit of compute;
- Platform layer: elastic compute, containerized deployment, canary releases, monitoring and alerting, and log analysis determine whether problems can be found quickly and rolled back after launch.
On Baidu AI Cloud, developers can combine general capabilities such as model services, elastic compute, and monitoring and alerting to turn the strategies above into a configurable, observable inference service, and continuously find the best balance among latency, throughput, and quality through canary releases and before-and-after comparison.
(五) Pay Attention to Ecosystem Compatibility
When choosing a new generation paradigm, assess its level of support in mainstream inference frameworks, inference-acceleration chips, and model-service products, as well as how well it adapts engineering features such as batching, structured output, function calling, and streaming output. Ecosystem maturity often determines whether something can truly go live as much as performance does.
7. Conclusion
From the perspective of technical essence:
- MTP and speculative decoding: they do not change the writing style; instead they equip an autoregressive model with a “draft accelerator,” with good compatibility and, in theory, an unchanged output distribution;
- Block-level diffusion: it changes the writing style, using whole-block parallel denoising to shorten the serial chain, at the cost of challenges in decoding scheduling and quality consistency;
- QAT: it acts at the numerical-precision layer, orthogonal to both, and can be stacked with them.
For developers, rather than asking “which is stronger,” it is better to return to two questions: what are the business’s constraints on latency, throughput, and quality, respectively? How much change can the existing inference pipeline tolerate?
Treating the generation paradigm, inference acceleration, and quantization compression as a set of combinable tools, and benchmarking with real business data, is the sound path to tackling large-model inference-efficiency problems.
