BlockPilot: Instance-Adaptive Policy Learning for Diffusion-based Speculative Decoding
arXiv · HuggingFace · ▲74
Abstract (verbatim)
Speculative decoding accelerates inference by using a lightweight draft model to generate candidate tokens in parallel, and are then verified by the target model, enabling lossless acceleration. Recently, diffusion-based speculative decoding further improves parallelism by generating multiple tokens per forward pass via block-level diffusion, achieving state-of-the-art (SOTA) performance. However, existing methods adopt a fixed inference block size and assume a uniform optimal decoding strategy across all inputs. In this paper, we show that this assumption is suboptimal, as the optimal block size varies across samples and plays a critical role in speculative decoding performance. Moreover, these values exhibit a clear local structure, concentrating around the training block size, which reduces the problem to a low-dimensional and structured decision space. Based on these insights, we propose BlockPilot, a sample-adaptive policy that predicts the optimal block size from the prefilling representation. Specifically, we formulate block size selection as a lightweight policy learning problem and propose an instance-adaptive decision mechanism that predicts the optimal block size based on the representation of the prefilling stage. The prediction is performed only once after prefilling, allowing for seamless integration. Extensive experiments demonstrate that our method is plug-and-play, introduces minimal overhead, and consistently improves efficiency, achieving an acceptance length of 5.92 and a 4.20times speedup on Qwen3-4B under temperature T=1.
Background
Background Analysis
1. Technical Context and Motivation
Large Language Models (LLMs) excel in various tasks but suffer from inefficiency due to their autoregressive token-by-token generation, which causes high latency and limited parallelism for long-text generation. Speculative decoding accelerates inference by using a lightweight "draft model" to generate candidate tokens in parallel, which are then verified by a target model. Recent advancements in diffusion-based speculative decoding further improve parallelism by leveraging block-level diffusion in dLLMs (diffusion language models), allowing multiple tokens to be generated per forward pass. However, a critical challenge remains: how to balance parallel speed and generation accuracy efficiently?
2. Limitations of Previous Methods
Existing approaches assume a uniform block size for all inputs, inheriting the fixed configuration from training. This ignores input-specific variability—some inputs (e.g., structured tasks like code generation) benefit from larger blocks for efficiency, while others (e.g., open-domain generation) require smaller blocks to avoid error accumulation. Fixed block sizes lead to suboptimal performance. Additionally, while diffusion-based generation exhibits a local structure (optimal block sizes cluster around the training configuration), prior methods failed to exploit this, hindering optimization efficiency.
3. Proposed Solution
The paper introduces BlockPilot, a sample-adaptive block size selection method. The key idea is to treat block size as a learnable policy rather than a static hyperparameter. After the target model completes the "prefilling" stage, BlockPilot uses the prediction distribution of the final token (which reflects context uncertainty and future stability) to train a lightweight predictor for inferring the optimal block size. This process is computationally cheap and seamlessly integrates into existing frameworks without modifying the draft or target models.
4. Key Differences from Prior Work
BlockPilot’s innovations lie in:
- Reframing block size as a learnable component: It demonstrates that fixed strategies are suboptimal across diverse inputs.
- Leveraging local structure: Optimal block sizes cluster locally, reducing the problem to a low-dimensional decision space.
- Lightweight integration: The predictor runs only once after prefilling, avoiding high overhead while maintaining compatibility.
Experiments show BlockPilot achieves a 4.20× speedup on Qwen3-4B without compromising quality, validating the effectiveness of adaptive block size selection.

