Scaling LLM Speculative Decoding: Non-Autoregressive Forecasting in Large-Batch Scenarios

Luohe Shi, Zuchao Li, Lefei Zhang, Baoyuan Qi, Liu Guoming, Hai ZhaoarXiv 2025 · DOI

Abstract

Speculative decoding (SD) has emerged as a powerful technique to accelerate Large Language Model (LLM) inference by leveraging the memory-bound nature of single-request processing. However, in production environments where large-batch processing is standard, the computational "slack" required for traditional SD often vanishes, leading to the "Batching Paradox." We introduce SpecFormer, a non-autoregressive forecasting architecture designed to maintain high efficiency in these compute-constrained, large-batch scenarios. SpecFormer utilizes a hybrid attention mechanism and position-independent forecasting to achieve consistent speedups of up to 1.81x, outperforming existing state-of-the-art methods under heavy batching.

Introduction: The Batching Paradox

Standard LLM inference is typically memory-bound; the hardware spends more time moving weights from memory to the processor than performing actual computations. Speculative decoding exploits this idle compute time by using a lightweight "draft" model to predict future tokens, which are then verified in parallel by the "target" LLM.

However, a significant challenge arises in production: batching. To maximize throughput, servers process many requests simultaneously, which increases hardware utilization and consumes the idle compute time that SD relies on. As batch sizes grow, traditional autoregressive draft models or complex draft trees become too computationally expensive, sometimes even slowing down the overall system. SpecFormer addresses this "Batching Paradox" by providing a lightweight, non-autoregressive alternative that scales efficiently with batch size.

Methods: The SpecFormer Architecture

SpecFormer replaces traditional small language models with a non-autoregressive (NAR) forecasting module. The architecture is designed for maximum parameter efficiency and parallel execution.

The SpecFormer architecture combines context causal attention with a positional FFN and bidirectional attention for non-autoregressive draft generation.

Key Components

  • Context Causal Attention: SpecFormer extracts hidden states from multiple levels of the base LLM (embedding, middle, and final layers) to create a comprehensive context summary.
  • Positional FFN: Instead of a full transformer for each draft position, SpecFormer uses a linear projection to decompose hidden states into position-specific components. This approach is significantly more efficient than previous methods like Medusa.
  • Draft Bi-directional Attention: After initial token guesses, a bidirectional attention layer allows draft tokens to refine their predictions in parallel, capturing inter-token dependencies without the latency of autoregressive generation.
  • Triton Optimizations: Custom GPU kernels were developed for "Grouped RMS Norm" operations to eliminate profiling bottlenecks.

Experimental Setup

The model was trained on UltraChat 200K using self-distillation. By training the draft model on the base LLM's own outputs rather than human "gold" data, the draft model learns to mimic the specific distribution of the target model, which is critical for high acceptance rates.

Evaluation was conducted across a diverse suite of benchmarks, including MT-Bench, HumanEval, GSM8K, Alpaca, and CNN/DM, using models such as Qwen2.5 and LLaMA-3.1.

Results and Discussion

SpecFormer demonstrates superior robustness in large-batch scenarios compared to state-of-the-art methods like EAGLE-3 and HASS.

Performance comparison of SpecFormer against other speculative decoding methods across various batch sizes.

As shown in the results table, SpecFormer achieves a consistent speedup of 1.78x to 1.81x on Qwen2.5-3B across batch sizes ranging from 1 to 128. While other methods may perform well at small batch sizes, their relative gains often degrade as computational resources become constrained. SpecFormer's efficiency is quantified by a new metric, κ, which measures the ratio of accepted tokens to the computational cost of the draft model.

Conclusion

SpecFormer provides a scalable solution for speculative decoding in high-throughput environments. By moving away from autoregressive drafting and focusing on position-independent forecasting, it maintains significant speedups even when hardware utilization is high. Future work will explore further reducing parameter counts and addressing the memory bottlenecks associated with large vocabulary sizes in the draft model's output head.

Summary updated

BibTeX
@misc{shi2025scaling,
  author = {Luohe Shi and Zuchao Li and Lefei Zhang and Baoyuan Qi and Liu Guoming and Hai Zhao},
  title = {{Scaling LLM Speculative Decoding: Non-Autoregressive Forecasting in Large-Batch Scenarios}},
  year = {2025},
  eprint = {2511.20340},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.20340},
}
Figure