Text Diffusion, Multi-Token Prediction, and Quantization-Aware Training: How LLM Inference Acceleration Techniques Actually Differ

    A practical breakdown of three frequently confused LLM inference technologies — multi-token prediction and speculative decoding, text diffusion, and quantization-aware training. The article explains what problem each one solves, at which abstraction layer it operates, how they relate to one another, and how to choose and combine them, with pseudocode, cost analysis, and engineering recommendations.

    Introduction

    In large-model inference, there is a cluster of concepts that developers constantly conflate: text diffusion, multi-token prediction, speculative decoding, and quantization-aware training. People tend to line them up side by side and ask “which one is faster?” In reality, these techniques live at different abstraction levels and answer different questions:

    Technique Question it answers
    Multi-token prediction / speculative decoding How can we verify multiple tokens in parallel without changing how generation works?
    Text diffusion Can we fundamentally change the order and dependency structure of token generation?
    Quantization-aware training How can we carry the same model capability at lower numerical precision?

    These techniques can either substitute for one another or be combined. Using “an open-weight experimental text-diffusion model released by a research team” as a starting point, this article systematically reviews the positioning, mechanics, and tradeoffs of the three, and offers actionable engineering advice.


    1. Getting the concepts straight: where each technique sits

    1. Multi-token prediction (MTP)
    Having the model predict multiple future tokens at each position in one shot — during training or inference — rather than only the next one. It can serve as a standalone training objective, or as the “draft” source for speculative decoding.

    2. Speculative decoding
    A lossless inference-acceleration framework:

    1. A lightweight draft source (a small model, an autoregressive head, or an MTP head) proposes K candidate tokens in sequence;
    2. The target model runs a single parallel forward pass over these positions to obtain the true distribution at each one;
    3. Rejection sampling verifies the candidates one by one, accepting the longest matching prefix, after which the target model adds one fresh token.

    “Lossless” here has a strict meaning: under the same sampling parameters, the accept/reject decision rule guarantees that the output distribution is identical to sampling token-by-token from the target model. In other words, it changes only the computation path, not the output distribution. This mechanism is widely implemented across mainstream inference frameworks.

    3. Text diffusion
    Bringing the image-diffusion idea into the discrete token space. At generation time, it starts from a “masked/noised” sequence and updates multiple positions in the sequence in parallel over several iterations. What it changes is the generation paradigm itself.

    4. Quantization-aware training (QAT)
    Introducing simulated-quantization operations (pseudo-quantization) during training so the model adapts to low-bit representations of weights and activations ahead of time. It targets numerical precision and storage/bandwidth, and is orthogonal to the generation method.

    The example below deliberately is not written as runnable code — it only expresses control flow. Concrete implementations of things like the draft source and prefix-tree attention vary by inference framework.

    1. # General flow of speculative decoding (pseudocode)
    2. def speculative_generate(target, draft, prompt, K, temperature):
    3. prefix = prompt
    4. while not is_finished(prefix):
    5. # 1) The draft source proposes K candidate tokens in sequence; multiple candidate branches may be kept
    6. candidates = draft.propose(prefix, K, temperature)
    7. # 2) Target model runs one forward pass: score the next-token distributions at all candidate positions in parallel
    8. target_dist = target.prefill_score(prefix + candidates)
    9. # 3) Rejection-sampling verification: accept if distributions match, truncate at the first mismatch
    10. n_accepted = verify_and_sample(draft, target_dist, temperature)
    11. prefix = prefix + candidates[:n_accepted]
    12. # 4) Fill in 1 token using the target model's true distribution at the mismatch position
    13. prefix = prefix + target.sample_at(prefix, n_accepted)
    14. return prefix
    15. # General flow of masked-diffusion parallel denoising (pseudocode)
    16. def masked_diffusion_generate(model, length, steps, temperature):
    17. canvas = ["[MASK]"] * length # init: a full block of placeholders, with no conditioning information
    18. for t in reversed(steps): # iterative: refresh multiple positions in parallel each step
    19. logits = model(canvas) # one forward pass, predicting all [MASK] positions
    20. confidence = get_confidence(logits)
    21. # decide how many tokens to reveal this round by confidence; fill the outline first, then the details
    22. k = reveal_schedule(t, length)
    23. for idx in select_topk_positions(confidence, k):
    24. canvas[idx] = sample(logits[idx], temperature)
    25. if all_filled(canvas): # optional: a few more refinement steps over already-filled positions
    26. break
    27. return canvas

    2. The bottleneck of autoregressive generation: why everyone wants to “speed up”

    A traditional autoregressive model generates tokens one at a time. Each step does three things: encode the new token into a vector, feed it through the Transformer layers for attention computation, and output the probability distribution for the next token. Generating N tokens requires N such forward passes, and each token depends on the previous one, making it hard to parallelize within a single sequence.

    Inference is usually split into two phases:

    • Prefill phase: processes the entire input in parallel and is compute-intensive;
    • Decode phase: processes only one new token per step. Here the weights and KV cache that must be moved far outweigh the actual computation, making it memory-bandwidth-bound.

    In other words, the decode-phase bottleneck is often not “how fast we compute” but “how much we have to move.” This has two direct consequences:

    1. A single forward pass leaves a lot of compute idle. A modern GPU can easily run the parallel computation for hundreds or thousands of tokens at once, yet token-by-token generation processes only one at a time — inherently low hardware efficiency. This is precisely the shared motivation behind speculative decoding and text diffusion: make every forward pass carry more tokens.
    2. Optimizations need to be viewed in layers. Memory-side optimizations — such as low-precision quantization, KV-cache compression, and operator fusion — reduce the cost per step; parallelism-side optimizations — such as speculative decoding and diffusion denoising — reduce the number of forward passes. The two cannot replace each other, but they can stack.

    It is worth stressing that autoregressive “left-to-right” generation is dictated by the training objective. A standard language model maximizes the conditional probability P(xₜ | x₁…xₜ₋₁) at each position, and the attention mask enforces this causal structure. Therefore, simply accelerating the hardware execution of decode cannot break through the “one at a time” logical constraint. To break through it, you must change the modeling or the sampling method.


    3. Speeding up the autoregressive camp: multi-token prediction and speculative decoding

    3.1 Core idea: draft–verify

    Speculative decoding does not modify the original model. Instead, it attaches a “draft source” alongside it:

    1. It proposes K candidate tokens in sequence;
    2. The target model verifies them all in a single parallel pass;
    3. The longest matching prefix is accepted, and the target model then generates one token of its own.

    This way, one forward pass of the target model can produce up to K+1 tokens, and the actual speedup depends on the acceptance rate of the candidates. In addition, the KV cache from the drafting stage can be reused directly during verification.

    3.2 The mathematical “lossless” guarantee

    Take sampling at temperature 1 as an example. Let the draft distribution be q and the target distribution be p. For a candidate token x proposed by the draft, accept it with probability min(1, p(x)/q(x)); once rejected, resample from the normalized residual distribution norm(max(0, p−q)).

    It can be shown that the final output strictly follows p. With this guarantee, any draft source — even a fairly crude heuristic rule — affects only speed, not the output-quality distribution. This is the fundamental reason speculative decoding has high engineering value.

    3.3 Draft sources and tree verification

    Draft sources fall into roughly three categories:

    • Independent small model: sharing the same origin or a similar architecture as the target model, e.g., using a smaller-scale version as the draft;
    • Self-speculation: skipping several layers of the target model, or using a shallow sub-network as the draft;
    • Multi-token prediction head: adding lightweight prediction heads on top of the backbone to produce candidates for multiple positions at once.

    Inference frameworks also offer “prefix tree + tree attention” verification: at each position, multiple candidate branches are retained to form a tree structure, and one forward pass verifies multiple paths to raise the candidate hit rate. MTP provides a supervision signal during training that teaches the model to give reasonably accurate joint predictions for adjacent positions. In practice, it usually acts as the draft source for speculative decoding.

    3.4 Key engineering variables

    • Draft length K: a larger K raises the theoretical ceiling. But later candidates are more uncertain, and an overly large K makes the cost of drafting itself exceed the gains.
    • Acceptance rate: influenced by the consistency between the draft and target distributions, task entropy, and other factors. Acceptance tends to be higher on low-entropy, highly patterned tasks like code, and relatively lower on open-ended creative work.
    • Batch interaction: speculative decoding reduces single-request latency. But when concurrency is high and the GPU is already compute-saturated, the extra computation from “parallel verification” can actually drag down overall throughput. Single-request latency and cluster throughput must therefore be balanced together.

    3.5 Advantages and limitations

    Advantages:

    • The output distribution is strictly unchanged, with zero quality risk;
    • Low intrusiveness to existing inference stacks — it can be enabled as a decoding-layer feature;
    • Freely combinable with quantization and KV-cache optimizations.

    Limitations:

    • Generation logic is still strictly left-to-right, and the speedup is bounded by the acceptance rate, so order-of-magnitude gains are usually hard to achieve;
    • Depends on a high-quality draft, adding model-maintenance or memory overhead;
    • Gains are diluted in high-concurrency, compute-constrained scenarios.

    4. Rebuilding the generation paradigm: how text diffusion “lays the canvas first, revises later”

    4.1 Starting from “progressive erasure”

    Image diffusion has a clear forward process: repeatedly add a small amount of Gaussian noise to an image until it becomes pure noise; at generation time, a neural network “erases” the noise back into a clear image step by step.

    Text is discrete, so you cannot add Gaussian noise directly. Discrete-diffusion methods in the literature instead build the forward process by “progressively replacing tokens with [MASK]”: starting from a complete text, repeatedly replace some tokens with masks according to a schedule, until the whole sequence becomes masked. The generation process is exactly the reverse: start from a fully masked sequence and have the model “fill in the blanks” in parallel over multiple rounds. This is the basic form of a masked diffusion language model.

    Dimension Autoregressive generation Text diffusion
    Generation order Strictly left-to-right Any order, multiple positions in parallel
    Generation process Determines 1 token at a time Refreshes multiple positions per pass, iterating over several rounds
    Conditional dependency Depends only on left-side context Can use both left- and right-side context simultaneously
    Correspondence to image diffusion — canvas ≈ canvas, denoising step ≈ diffusion step

    4.2 Training objective

    Taking masked diffusion as an example, each training step randomly picks a mask ratio and applies masking to the corresponding positions in the sequence. The model encodes the entire sequence with bidirectional attention and computes cross-entropy loss only over the masked positions. The training method follows in the lineage of BERT-style masked language modeling, with three main differences:

    1. The mask ratio varies randomly, rather than being a fixed small proportion;
    2. The model is conditioned on the mask ratio, so it adapts to different denoising stages;
    3. The objective covers reconstruction ability across various degrees of missingness.
    1. Input : Today [MASK] released a [MASK] model
    2. Predict: text diffusion generative

    4.3 Generation process

    Each denoising step of text diffusion typically involves three stages:

    1. The model predicts, in parallel, all positions on the canvas that are still masked;
    2. Based on confidence, it decides which positions to “reveal” this round;
    3. It fills the selected positions with sampled tokens and moves to the next round.

    The whole process can be summarized as “outline first, details later.” Autoregressive generation is like writing stroke by stroke; diffusion is more like laying out a draft sheet, drafting the whole thing at once, and then repeatedly revising the grammar, filling in details, and smoothing the context.

    A common misconception is that “diffusion = arbitrary-order autoregression.” Both can condition on arbitrary order; the key difference is whether they can run in parallel:

    1. Arbitrary-order autoregression: pos 9 → pos 2 → pos 7 → … (1 token per step, can go left or right)
    2. Masked diffusion: ┌─ Round 1: fill positions 2, 9, 15 at the same time
    3. ├─ Round 2: fill positions 1, 7, 12 at the same time
    4. └─ Round 3: fill positions 3, 5, 8 at the same time (parallel + iterative)

    What truly determines the value of diffusion-style generation is precisely multi-position parallel updating and iterative refinement.

    4.4 Block autoregression and multi-canvas sampling

    If an entire document were fully masked and denoised at once, the model would lack sufficient conditioning information, and long-text consistency would be hard to guarantee. A more common practice is a block-based composition:

    1. Split the canvas into fixed-length blocks (e.g., 256 tokens);
    2. Denoise in parallel within each block to quickly obtain a fairly complete draft;
    3. Advance left-to-right block by block, using the already-completed content as conditioning.

    The industry commonly calls this “block diffusion” or “block autoregressive sampling.” It is like creating a comic: complete the current panel first while keeping it coherent with the previous panels, rather than filling an entire book at once and going back to revise.

    Block length is the core hyperparameter:

    • Shorter blocks carry more of the autoregressive component between blocks — more stable quality, but less parallel gain;
    • Longer blocks offer more room for parallelism, but model cross-block long-range dependencies more weakly, requiring additional mechanisms to compensate.

    5. Reducing it to compute: what each approach “saves”

    It helps to break the cost of each forward pass into two parts:

    • C: the cost of one full forward pass (in decode mode), determined mainly by moving weights and the KV cache;
    • m: the marginal cost of processing one token in parallel. When compute is not yet saturated, m is far smaller than C.
    Approach Forward passes (to output N tokens) Parallel per pass Approx. compute Primary optimization target
    Baseline autoregressive N 1 N · C —
    Speculative decoding / MTP ≈ N / (1+α), α = average accepted 1+K ≈ N·C / (1+α) Fewer forward passes
    Masked diffusion N / k (k = positions revealed per step) k ≈ N·C / k + N·m Fewer forward passes
    Low-bit quantization N 1 N · (C − Δ) Lower per-step cost

    From this, several important conclusions follow:

    1. The acceleration mechanisms of speculative decoding and diffusion are structurally identical in the formula: both trade more work per step for fewer forward passes. The essential difference is that speculative decoding changes the computation path while leaving the output distribution unchanged; diffusion changes the generation paradigm, and the output distribution changes accordingly.
    2. Acceleration shows diminishing returns. When the per-step workload k grows until compute begins to saturate, C and m converge, and further increases in k yield diminishing gains. At that point the bottleneck shifts from memory to compute, and the value of low-bit quantization rises accordingly.
    3. The two can stack. Quantization lowers C, parallelism reduces the number of forward passes — a multiplicative relationship. But first confirm that the target inference framework supports the required parallel-verification masks or bidirectional-attention modes, then evaluate the combined gains.
    4. Local single-GPU setups benefit especially. On a single card, weight reads are hard to amortize, so the per-step parallel gain is more pronounced; gains are relatively limited in high-concurrency serving scenarios.

    6. Quantization-aware training: a route orthogonal to the generation method

    6.1 Principle

    At deployment, FP16/FP32 weights consume a great deal of memory and memory bandwidth. Quantization represents weights and activations in lower-bit formats such as INT8 and INT4 to reduce storage and movement costs, and falls into roughly two categories:

    • Post-training quantization (PTQ): uses a small amount of calibration data to measure the activation distribution and determine quantization parameters — low cost, easy to start; but at very low bit-widths, accuracy loss is typically noticeable.
    • Quantization-aware training (QAT): inserts “pseudo-quantization” operators during the training or fine-tuning stage. The forward pass simulates quantization error, and the backward pass uses a straight-through estimator (STE) to let gradients flow through the rounding operation, so the model adapts to low precision during training. The cost is extra training overhead, in exchange for smaller accuracy loss at low bit-widths.

    The key point: what QAT optimizes is “how cheaply each step is done,” which has nothing to do with whether you work “step by step” or “block by block.” It can be applied to autoregressive models, diffusion models, and even lightweight draft models alike.

    6.2 Especially valuable for draft models

    In speculative decoding, the speed of the draft model directly determines the overall gain, so it usually needs to be “small enough and fast enough.” Low-bit quantization makes the draft model lighter while not losing too much of the “alignment” with the main model’s distribution (alignment directly affects the candidate acceptance rate). The prerequisite is that the calibration data is close to the task distribution at inference time.

    6.3 The interaction between quantization and diffusion

    • Weights: for diffusion-style models built on a Transformer backbone, weight-quantization methods are essentially the same as for autoregressive models.
    • Activations: masked diffusion applies bidirectional attention over the entire canvas, and the representation distributions of masked and already-filled positions within the same layer may differ. When quantizing activations, calibration samples covering different denoising stages and mask ratios are needed.
    • KV cache: bidirectional attention generally has no strict causal KV cache; attention is often recomputed each step, so caching strategies need to be designed separately.

    These are all points to verify empirically in engineering — you cannot assume that “an autoregressive model’s quantization recipe can be copied over directly.”

    6.4 Summary: how the three relate

    Technique Layer it operates on Changes output distribution? Primary benefit Primary cost Relationship to the other two
    Multi-token prediction / speculative decoding Decoding strategy No (strictly lossless) Fewer forward passes Draft overhead; gains drop at high concurrency Can serve as a parallel “draft” source for diffusion
    Text diffusion Generation paradigm Yes Parallel denoising, bidirectional modeling Immature ecosystem, iteration overhead, quality uncertainty Introduces a new parallel structure for inference
    Quantization-aware training Numerical precision Approximately preserved Lower memory, bandwidth, and power Training cost, accuracy loss Fully orthogonal to both

    7. Engineering selection advice

    Scenario Preferred choice
    Online serving, strict quality requirements, framework already supports speculative decoding Autoregressive + speculative decoding (MTP or an independent draft)
    Edge devices, local single-GPU, constrained memory and power Low-bit quantization (QAT/PTQ) + block-based parallel diffusion denoising
    Tasks like dialogue and writing that need rewriting and polishing Diffusion-style bidirectional refinement worth trying
    Large-batch offline tasks, throughput-first First work out the boundary between single-request latency and cluster throughput, then decide whether to introduce a new paradigm

    Before going live, it helps to answer four questions:

    1. Does the inference framework support it?
    2. Can it meet the business’s requirement for output determinism (reproducibility under a fixed random seed)?
    3. Is there a mature evaluation set?
    4. Does the team have the corresponding training and fine-tuning capabilities?

    Beyond that, the supporting capabilities of cloud deployment matter:

    • Elastic container platforms to host inference instances and auto-scale with traffic;
    • Object storage to hold model weights and evaluation datasets;
    • Log services and monitoring/alerting to track first-token latency, per-token latency, acceptance rate, and error rate;
    • General product categories such as model-serving to provide standardized inference access.

    These general capabilities also apply to model inference services on cloud platforms such as Baidu AI Cloud.


    8. Evaluating results: tokens/s alone is not enough

    Speed numbers across different paradigms are not directly comparable:

    • Speed for autoregressive + speculative decoding usually means “output tokens / end-to-end wall-clock time”;
    • Diffusion-style models often report the equivalent speed from “revealing several positions in parallel per step.”

    So an evaluation should answer at least three questions:

    1. Under what hardware and concurrency conditions was it measured? Single-request latency, batch throughput, and first-token latency must each be reported separately.
    2. Under what generation budget are you comparing? The inference compute should be fixed — e.g., total forward passes or total FLOPs — or quality compared under a fixed latency budget.
    3. How is quality measured? Both automatic metrics and human evaluation are needed, covering long-text consistency, instruction following, code generation, domain knowledge, and other tasks.

    There are also three points of practical experience:

    • Diffusion models involve random schedules and random sampling, so a fixed random seed is needed to reproduce results;
    • Speculative decoding requires the draft and target to share a tokenizer; if a draft is added to a diffusion model, you also need a coordination mechanism between “partially filled drafts” and “bidirectional verification masks”;
    • If the business has strict determinism requirements (e.g., an auditable generation pipeline), the lossless property of speculative decoding is more advantageous.

    Conclusion

    Back to the original question:

    • MTP / speculative decoding: does not change the generation logic — it just bolts a “draft accelerator” onto an autoregressive model, with the output distribution strictly unchanged;
    • Quantization-aware training: reduces per-step cost at the numerical-precision level, orthogonal to the generation method;
    • Text diffusion: genuinely changes the generation paradigm. It denoises in parallel block by block with multiple rounds of refinement, which is friendlier to local deployment and parallel hardware — though ecosystem maturity, training recipes, and quality stability are still evolving.

    The three are not substitutes. It is foreseeable that the inference stack of the future will likely be a combination of “low-precision weights + parallel decoding + task-adaptive scheduling.” For developers, rather than chasing a single “fastest model,” it is better to understand where each technique sits in the compute pipeline, and find the combination that best fits the business among latency, throughput, quality, and engineering cost.