BlockPilot: Instance-Adaptive Policy Learning for Diffusion-Based Speculative Decoding

Hao Zhang, Yiming Hu, Yong Wang, Mingqiao Mo, Xin Xiao, Xiangxiang Chu

BlockPilot dynamically selects optimal block sizes for diffusion-based speculative decoding to maximize inference speedup.

How can we dynamically adjust the number of tokens (block size) a diffusion-based draft model proposes to maximize inference speedup for each specific input?

Diffusion-based speculative decoding accelerates inference by generating token blocks in parallel, but existing methods rely on a fixed block size that is often suboptimal for diverse input samples. BlockPilot treats block size as a learnable control variable, using a lightweight predictor to select the optimal size for each input based on the prefilling stage's predictive distribution. This adaptive approach consistently outperforms fixed-block strategies, achieving up to 4.20× speedup on Qwen3-4B without modifying the underlying model architecture.

Paper Primer

Speculative decoding relies on a draft model to propose tokens that a target model verifies in parallel. While diffusion-based drafters improve parallelism, they typically use a static block size inherited from training, which fails to account for the fact that some inputs are highly predictable and support large blocks, while others accumulate errors quickly and require smaller, more conservative blocks.

BlockPilot is a plug-and-play policy network: it maps the target model's final prefilling-stage predictive distribution to an optimal block size chosen from a local candidate interval. The core insight is that optimal block sizes exhibit a "local interval property," concentrating near the training-time configuration, which allows the system to treat selection as a simple, low-dimensional classification task rather than an expensive online search.

BlockPilot consistently improves inference speedup and acceptance length across diverse model scales and benchmarks.

On Qwen3-4B at temperature T=1, the method achieves a 4.20× speedup and an average acceptance length of 5.92, outperforming the strongest fixed-block baseline (DFlash).

Why is a fixed block size suboptimal for speculative decoding?

Inputs vary in semantic constraints and predictability; larger blocks improve efficiency for constrained continuations but cause error accumulation for less predictable trajectories, making a single static block size misaligned with input-level characteristics.

Does this method require retraining the target or draft models?

No. The predictor is a lightweight, separate multilayer perceptron that runs once after the prefilling stage, allowing it to integrate into existing frameworks without modifying the generation pipeline or the original model weights.

Decoding policy is a critical, learnable dimension of inference efficiency; by treating block size as a sample-adaptive decision, practitioners can extract significant speedups from existing diffusion-based speculative decoding frameworks.

Introduction to Speculative Decoding

Fixed block sizes limit diffusion‑based speculative decoding, motivating an adaptive solution.

Speculative decoding speeds up inference by letting a lightweight draft model generate candidate tokens in parallel, which the target model then verifies losslessly. Diffusion‑based variants further boost parallelism by generating whole token blocks via block‑level diffusion, achieving state‑of‑the‑art performance. However, all existing approaches fix the block size during inference, ignoring that the optimal size varies with each input.

It uses a fast draft model to propose a batch of candidate tokens, while the target model verifies each candidate in parallel, allowing multiple tokens to be accepted per step without changing the final distribution.

A dLLM treats token generation as a denoising diffusion process, enabling it to produce an entire block of tokens in a single forward pass.

A fixed block size treats decoding as a static hyperparameter, but the predictability of the next tokens differs across samples, making a single size suboptimal. This mismatch limits the throughput gains of diffusion‑based speculative decoding. BlockPilot addresses the issue by predicting an instance‑adaptive block size from the prefilling representation.

**Figure 1.** Diffusion-based speculative decoding with a dLLM draft model. The dLLM proposes a block of tokens in parallel, while the target LLM verifies the block and accepts the longest consistent prefix.

The bottleneck of fixed‑size speculative decoding is its inability to adapt block size to input‑specific predictability.

The BlockPilot Inference Pipeline

Methodology introduces BlockPilot Predictor to adaptively select block size per input, improving speculative decoding throughput.

Using a fixed block size $B$ during speculative decoding ignores the fact that token predictability varies across inputs. This mismatch leads to suboptimal acceptance lengths and wasted parallel compute. The method must therefore adapt $B$ per sample to recover efficiency.

A tiny neural network consumes the predictive distribution of the last token after prefilling and instantly outputs the block size that will maximize the expected acceptance length for that sample.

Compute logits for each candidate: $o_3=0.45$, $o_4=0.70$, $o_5=0.30$ (higher logit means higher predicted acceptance).

Apply softmax: $P(3)=0.25$, $P(4)=0.60$, $P(5)=0.15$.

Take the argmax → $\hat{B}=4$.

Run speculative decoding with block size 4; the measured acceptance length $\tau(4)=3.2$ tokens per step.

If we had mistakenly used $B=5$, $\tau(5)$ would drop to $2.1$, showing the predictor avoided a costly overshoot.

The predictor selects the block size that balances parallelism (larger $B$) against verification failures (smaller $\tau$), achieving the highest effective throughput.

How does BlockPilot differ from a simple heuristic that always picks the training block size $B$?

Heuristics ignore the per‑sample predictive distribution and therefore cannot react to variations in context difficulty. BlockPilot reads the full distribution, evaluates the expected acceptance length for each candidate, and picks the size that maximizes that expectation, which can be smaller or larger than the training $B$ depending on the input.

Acceptance length is the average number of tokens that survive verification for a given block size; it quantifies how much parallel work actually contributes to the final output.

Why is acceptance length more informative than raw latency when choosing a block size?

Latency $L(B)$ combines both compute costs and acceptance length, but the compute terms $T_{\text{draft}}$ and $T_{\text{verify}}$ are nearly constant across $B$. Therefore variations in $L(B)$ are driven almost entirely by $\tau(B)$. Maximizing $\tau$ directly improves throughput, while latency is just a derived metric.

Inference pipeline with BlockPilot Predictor

Table 1 shows that the BlockPilot predictor adds only 0.32 B parameters and 7.34 ms latency, a negligible overhead compared with the multi‑billion‑parameter backbone models.

**Figure 4.** Overview of the BlockPilot inference pipeline. Given an input sequence, the target LLM performs prefilling and produces the predictive distribution of the last token, which serves as a compact representation of the decoding state. This distribution is then fed into a lightweight block size predictor to determine an instance-specific block size. Based on the predicted block size, the diffusion-based draft model generates a block of draft tokens in parallel.

Experimental Setup

We describe models, baselines, metrics, and implementation details for evaluating BlockPilot.

We evaluate BlockPilot on four LLMs—Qwen3‑4B, Qwen3‑8B, Llama‑3.1‑8B‑Instruct, and Qwen3‑Coder‑30B‑A3B—covering both general‑purpose and code‑specialized domains, across three task categories: mathematical reasoning (GSM8K, MATH‑500, AIME24), code generation (HumanEval, MBPP, SWE‑Bench), and conversational generation (MT‑Bench).

Baselines include standard autoregressive decoding, the classic speculative decoding with an autoregressive drafter, EAGLE‑3, and the diffusion‑based SOTA method DFlash (with varying block sizes).

We report efficiency using Average Acceptance Length $\\tau$—the mean number of draft tokens accepted per cycle—and Speedup Ratio, the factor by which inference time improves over standard autoregressive decoding.

Experiments run on PyTorch with Hugging Face Transformers on NVIDIA H100 80 GB GPUs; the training set combines ShareGPT, WSC, and COPA, training for 100 epochs with Adam (lr 1e‑5). The predictor network has two hidden layers of size 2048 and uses $k$ = 2.

Performance and Ablation Studies

BlockPilot delivers up to 0.24× speedup over the strongest fixed‑block baseline.

Diffusion‑based speculative decoding fixes the draft block size, ignoring per‑sample predictability. BlockPilot instead selects the block size adaptively for each input step.

BlockPilot improves speedup by 0.24× on Qwen3‑8B (temperature = 0) compared to the strongest fixed‑block baseline DFlash(16).

On Qwen3‑8B, speedup rises from 4.42× (DFlash(16)) to 4.66× (BlockPilot).

**Figure 2.** Speedup comparison across models under temperature $T = 1$. Our method achieves the highest acceleration across all settings. Here, DFlash($n$) denotes DFlash with block size $n$.

**Figure.** (Left) Bar chart showing the proportion of cases where $B^* = B$ (dark blue) versus $B^* \neq B$ (tan) across five datasets: GSM8K, MT-Bench, AIME24, MBPP, and Alpaca. (Middle and Right) Histograms showing the distribution of values relative to $B$, with a superimposed fitting curve, illustrating different probability density patterns.

Ablation studies (Tables 3–5) confirm that a two‑layer MLP with hidden size 2048, a candidate interval radius k = 2, and raw prefilling distributions as predictor input together yield the best speedup and acceptance length.

Theoretical Analysis

Analyzes the theoretical basis of adaptive block size and its practical limits.

We first formalize acceptance length as a prefix‑survival process, then examine how block size interacts with predictability and finally bound the regret of imperfect block‑size prediction.

The event that the first $i$ drafted tokens are all accepted is denoted $A_i$.

Conditioning on the prefix that has already survived, we define the per‑position acceptance probability.

Increasing the block size $b$ extends the summation horizon but also changes the conditional probabilities $q_j$, creating a trade‑off between more candidate positions and harder verification.

Next we separate the influence of sample predictability from the degradation caused by deviating from the training block size.

If predictability is roughly constant across positions, the expression collapses to a geometric series.

The optimal block size for a given sample is the one that maximizes $\tau$ over a candidate set $\mathcal{B}$.

Finally we bound the loss incurred when the predictor selects a sub‑optimal block size.

Empirically, the predictor’s lightweight design suffices because the regret bound guarantees that near‑optimal choices already yield most of the possible speedup.

Performance evaluation on Llama‑3.1‑8B‑Instruct and Qwen3‑Coder‑30B‑A3B shows consistent speedups (up to 4.12×) and competitive acceptance lengths across temperature settings.

Limitations stem from the offline data‑construction cost: evaluating five block sizes for a 32 B model takes ≈ 25 s per training sample, which, while acceptable offline, motivates future work on more efficient search strategies.

Related Work and Conclusion

We situate BlockPilot among prior speculative decoding and diffusion approaches, and highlight DFlash as the leading diffusion‑based method.

Speculative decoding reduces the sequential bottleneck of autoregressive generation by drafting multiple tokens in parallel and verifying them with a larger target model. Diffusion Language Models (dLLMs) replace autoregression with parallel masked token prediction, but fixed‑length blocks limit their efficiency. Recent diffusion‑based speculative decoding methods, such as TiDAR and DiffuSpec, still suffer from high memory and latency costs, whereas DFlash achieves state‑of‑the‑art draft quality and acceptance length.

DFlash improves block‑diffusion speculative decoding by injecting the target model’s hidden states into the diffusion drafter, which raises draft quality and extends the acceptance length.

The conclusion emphasizes that block size is the dominant factor for inference efficiency, varies per sample, and can be predicted from the prefilling distribution. BlockPilot leverages this insight to select an adaptive block size per step, demonstrating that the decoding policy—not just model architecture—drives performance gains.

**Table.** Performance comparison of different methods across various benchmarks and models, measured by speedup and $\tau$ (tau).

Questions & answers

What is the main contribution of BlockPilot?

BlockPilot introduces an instance-adaptive block-size selection policy for diffusion-based speculative decoding, using a lightweight multilayer perceptron (MLP) predictor that reads the target model's prefilling-stage predictive distribution and selects the optimal block size from a local candidate interval for each input sample.

What problem does BlockPilot address?

BlockPilot addresses the suboptimality of fixed block sizes in diffusion-based speculative decoding, where a single static block size fails to account for the varying predictability of different input samples, leading to either error accumulation (block too large) or wasted parallelism (block too small).

Why is a fixed block size suboptimal for diffusion-based speculative decoding?

Inputs vary in semantic constraints and predictability; larger blocks improve efficiency for highly constrained, predictable continuations but cause error accumulation for less predictable trajectories, making a single static block size misaligned with input-level characteristics.

How does BlockPilot work mechanically?

BlockPilot maps the target model's final prefilling-stage predictive distribution through a two-layer MLP (hidden size 2048) to select an optimal block size from a local candidate interval of radius k=2 around the training-time block size, running once after the prefilling stage before generation begins.

Does BlockPilot require retraining the target or draft models?

No. BlockPilot is a plug-and-play predictor — a lightweight, separate MLP that runs once after the prefilling stage — and integrates into existing frameworks without modifying the generation pipeline or the original model weights.

What is the 'local interval property' that BlockPilot exploits?

The local interval property refers to the empirical observation that optimal block sizes concentrate near the training-time block size configuration, which allows BlockPilot to treat block-size selection as a low-dimensional classification problem over a small candidate set rather than an open-ended search.

What models and tasks were used to evaluate BlockPilot?

BlockPilot was evaluated on four LLMs — Qwen3-4B, Qwen3-8B, Llama-3.1-8B-Instruct, and Qwen3-Coder-30B-A3B — across mathematical reasoning (GSM8K, MATH-500, AIME24), code generation (HumanEval, MBPP, SWE-Bench), and conversational generation (MT-Bench).

What baselines does the paper compare BlockPilot against?

The baselines include standard autoregressive decoding, classic speculative decoding with an autoregressive drafter, EAGLE-3, and the diffusion-based state-of-the-art method DFlash evaluated at varying fixed block sizes.

What metrics are used to evaluate performance?

The paper reports Average Acceptance Length (τ), defined as the mean number of draft tokens accepted per cycle, and Speedup Ratio, the factor by which inference time improves over standard autoregressive decoding.

What are the key quantitative results of BlockPilot?

BlockPilot achieves up to 4.20× speedup on Qwen3-4B and up to 4.12× speedup on Llama-3.1-8B-Instruct and Qwen3-Coder-30B-A3B, consistently outperforming fixed-block strategies across all evaluated models and tasks.

How much overhead does the BlockPilot predictor add?

The BlockPilot predictor adds only 0.32 billion parameters and 7.34 ms of latency, which the paper describes as negligible compared to the multi-billion-parameter backbone models.

Why does the paper use acceptance length rather than raw latency as the primary optimization target?

Because the compute costs for drafting (T_draft) and verification (T_verify) are nearly constant across different block sizes, variations in latency L(B) are driven almost entirely by acceptance length τ(B), making τ the more direct and informative signal for optimizing throughput.

What does the theoretical analysis in BlockPilot establish?

The theoretical analysis formalizes acceptance length as a prefix-survival process, characterizes the trade-off between extending the block size and harder per-position verification, and derives a regret bound showing that near-optimal block-size choices already recover most of the possible speedup even when the predictor is imperfect.

What are the limitations of BlockPilot?

The primary limitation is the offline data-construction cost: evaluating five block sizes for a 32-billion-parameter model takes approximately 25 seconds per training sample, which the paper acknowledges motivates future work on more efficient search strategies.

What training setup and data does BlockPilot use?

The predictor is trained for 100 epochs using the Adam optimizer (learning rate 1e-5) on a dataset combining ShareGPT, WSC, and COPA, and experiments are run on NVIDIA H100 80 GB GPUs using PyTorch with Hugging Face Transformers.

What do ablation studies reveal about BlockPilot's design choices?

Ablation studies (Tables 3–5) confirm that a two-layer MLP with hidden size 2048, a candidate interval radius k=2, and raw prefilling distributions as predictor input together yield the best speedup and acceptance length among the configurations tested.

How does BlockPilot relate to prior diffusion-based speculative decoding methods like TiDAR and DiffuSpec?

TiDAR and DiffuSpec are prior diffusion-based speculative decoding methods that still use fixed-length blocks during inference; BlockPilot is designed as a complementary, plug-and-play policy layer on top of such frameworks that adds adaptive block-size selection without altering their core mechanisms.

What is the venue and date of the BlockPilot paper?

The paper is available on arXiv (arxiv.org/abs/2606.31315); the paper does not specify a conference or journal venue, and the exact submission date is not stated in the provided text.

Key terms

speculative decoding
An inference acceleration technique where a lightweight draft model proposes candidate tokens in parallel, which a larger target model then verifies losslessly, reducing the number of sequential generation steps.
diffusion-based speculative decoding
A variant of speculative decoding where the draft model uses block-level diffusion (masked token prediction) to generate entire token blocks in parallel, improving throughput over autoregressive drafters.
block size (B)
The number of tokens generated in a single parallel draft step during diffusion-based speculative decoding; larger values increase parallelism but risk more verification failures.
acceptance length (τ)
The average number of draft tokens accepted by the target model per decoding cycle, used as the primary measure of speculative decoding efficiency.
speedup ratio
The factor by which a method reduces total inference time compared to standard autoregressive decoding, used as the main end-to-end efficiency metric.
prefilling stage
The initial phase of language model inference where the model processes the full input prompt and produces a predictive distribution over the next tokens before generation begins.
local interval property
The empirical observation that the optimal block size for a given input tends to fall within a small range around the training-time block size, enabling efficient low-dimensional selection.
instance-adaptive policy
A decision-making strategy that selects a configuration (here, block size) individually for each input sample rather than using a single fixed setting for all inputs.
multilayer perceptron (MLP)
A feedforward neural network with one or more hidden layers, used in BlockPilot as the lightweight predictor that maps prefilling distributions to block-size decisions.
candidate interval radius (k)
A hyperparameter defining how many block sizes above and below the training block size are considered as candidates by the BlockPilot predictor; set to k=2 in the paper.
prefix-survival process
A probabilistic formalization used in the paper where acceptance of a block of draft tokens is modeled as each successive token surviving verification conditioned on all prior tokens having been accepted.
regret bound
A theoretical guarantee on the maximum performance loss incurred when a predictor selects a suboptimal block size instead of the true optimal, used to justify BlockPilot's lightweight design.
DFlash
A diffusion-based speculative decoding method used as the primary baseline in BlockPilot's experiments, representing the prior state of the art with fixed block sizes.
EAGLE-3
A speculative decoding baseline used in the paper's comparisons that employs an autoregressive drafter rather than a diffusion-based one.
plug-and-play
A design property meaning the component (here, the BlockPilot predictor) can be added to an existing system without modifying the system's original architecture or weights.
autoregressive decoding
The standard language model generation process where tokens are produced one at a time sequentially, each conditioned on all previously generated tokens.

Read the original paper

Open the simplified reader on Paperglide

Browse all simplified papers