HiSpec: Hierarchical Speculative Decoding for LLMs

Avinash Kumar, Sujay Sanghavi, Poulami Das · DOI

Abstract

HiSpec introduces a hierarchical approach to speculative decoding designed to overcome the "verification wall"—the performance bottleneck where large target models spend excessive time validating draft tokens. By leveraging early-exit layers as intermediate verifiers and implementing efficient KV cache and hidden state reuse, HiSpec achieves up to a 2.01× throughput increase. Crucially, this method maintains bit-for-bit identical output accuracy to standard auto-regressive decoding while minimizing memory overhead.

Introduction

Speculative decoding has emerged as a primary strategy for accelerating Large Language Model (LLM) inference. The technique typically employs a small, fast "draft" model to predict a sequence of tokens, which a larger "target" model then verifies in parallel. However, as target models scale to hundreds of billions of parameters (e.g., Llama-3 405B), the verification step itself becomes a massive bottleneck. This "verification wall" can result in verification phases taking over ten times longer than drafting, significantly diminishing the overall speedup potential of speculative methods.

The HiSpec Framework

To address this, HiSpec (Hierarchical Speculative Decoding) transforms the traditional two-stage process into a three-tiered hierarchy. Instead of relying on external auxiliary models which require additional training and VRAM, HiSpec utilizes a single model trained with early-exit (EE) heads. This approach eliminates memory bloat and ensures architectural synergy.

The process is divided into three stages:

  1. Drafting: A very early layer of the EE-model proposes initial tokens.
  2. Intermediate Verification: A slightly deeper layer acts as an intermediate verifier, filtering out obvious mistakes before they reach the full model.
  3. Target Verification: The full model periodically validates the sequence to ensure the final output is exact.
The HiSpec hierarchical workflow (b) compared to standard speculative decoding (a), demonstrating how early verification and KV cache reuse save inference time.

A core innovation of HiSpec is the dynamic reuse of Key-Value (KV) caches and hidden states across all three stages. This prevents redundant computations as tokens progress through the hierarchy. Empirical studies suggest an optimal configuration involves placing the intermediate verifier at roughly 25% of the model's depth and the drafter at 12.5% depth, balancing speed with verification accuracy.

Experimental Evaluation

The researchers evaluated HiSpec across a diverse range of standard LLM benchmarks, including ShareGPT (real-world conversations), CNN/DM and XSum (text summarization), HumanEval (code generation), and GSM8K (mathematical reasoning). Testing was conducted using the Llama-2, Llama-3, and CodeLlama families, ranging from 7B to 70B parameters.

Key Results and Insights

HiSpec consistently outperformed state-of-the-art methods like AdaDecode and LayerSkip across all tested benchmarks. The framework achieved an average throughput improvement of 1.28×, with peak performance reaching 2.01×.

HiSpec achieves superior relative throughput compared to state-of-the-art methods like AdaDecode, Lookahead, and LayerSkip across multiple benchmarks.

Several key insights emerged from the study:

  • The 25% Rule: The first 25% of an LLM's layers are surprisingly capable, correctly verifying up to 69% of tokens. This justifies the use of shallow layers for intermediate checks.
  • Early Rejection is Key: Most prior research focused on faster drafting. HiSpec proves that rejecting bad drafts earlier in the pipeline is a more effective way to scale performance for massive models.
  • Zero Accuracy Trade-off: Unlike approximate methods, HiSpec’s periodic full-model validation ensures the output is identical to standard auto-regressive decoding.

Conclusion and Future Work

HiSpec provides a practical, memory-efficient solution to the verification wall in LLM inference. By integrating verification within the target model's own architecture, it achieves significant speedups without the need for auxiliary model training. Future research may explore dynamic layer selection—adjusting the hierarchy based on prompt complexity—and further hardware-level orchestration to maximize GPU utilization.

Summary updated

BibTeX
@misc{kumar2025hispec,
  author = {Avinash Kumar and Sujay Sanghavi and Poulami Das},
  title = {{HiSpec: Hierarchical Speculative Decoding for LLMs}},
  year = {2025},
  eprint = {2510.01336},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.01336},
}
Figure