TL;DR
H-Spec introduces a novel hybrid target-context injection method for parallel speculative decoding that completely eliminates the need for a separate drafter-side KV cache. By combining in-place target KV reuse with target hidden states from only the last input position, H-Spec achieves up to a 13.3% improvement in mean accepted length and significantly higher throughput under concurrent serving workloads.
What Problem Does This Paper Address?
Speculative decoding accelerates Large Language Model (LLM) inference by using a small, fast "draft" model to predict a sequence of tokens, which a larger "target" model then verifies in parallel. Recent advances use block diffusion drafters to predict multiple tokens simultaneously, further reducing latency.
However, these block drafters suffer from a major efficiency bottleneck: they project the target model's hidden states at every single input position into a separate, dedicated drafter-side KV cache.
This extra cache increases per-token memory usage by 1.1× to 1.8× and introduces substantial KV-write overhead. Crucially, as the number of concurrent requests grows, this overhead scales poorly, severely limiting throughput in high-concurrency serving environments.
Simply reusing the target model's KV cache directly without this extra injection step doesn't work either; it causes the draft quality to sharply degrade at later positions in the block because the drafter lacks a holistic contextual summary of the input prefix.
Methods
The authors propose H-Spec, a block-parallel drafter designed around a hybrid target-context injection mechanism that avoids the $O(N)$ memory overhead of a separate drafter cache. H-Spec feeds two complementary context sources into distinct architectural modules:
- Mamba Modules (State Initialization): Under causal attention, the hidden state at the very last input position acts as a compact summary of the entire prefix. H-Spec projects this single last-token hidden state to initialize the recurrent state of a Mamba-2 layer. Because Mamba utilizes a linear state recurrence, it can process all draft positions in a single pass via a parallel scan, preserving block-parallel drafting capabilities.
- Attention Modules (In-Place KV Reuse): To complement the compact last-token summary with fine-grained, position-wise information, H-Spec includes attention modules that directly reuse the target model's existing KV cache in place.
A lightweight causal correction head (specifically, a first-order Markov head) follows this hybrid backbone to refine inter-token dependencies.
Datasets
- Training: All models were trained for 5 epochs on a unified corpus of 100k samples drawn from Magpie and Ultrachat (60:40 ratio). For Qwen3 targets, the training data used reasoning-enabled responses.
- Evaluation: The drafters were evaluated across diverse domains using Spec-Bench (covering math, QA, chat, RAG, summarization, and translation), HumanEval (coding), and BFCL (tool calling). Long-context robustness was tested using the
citeandlongQAtasks from the HELMET benchmark. Serving performance was benchmarked on MATH, LiveCodeBench, and Alpaca workloads.
Key Insights and Ideas
- The Power of the Last Token: In causal models, the final token's hidden state naturally compresses the entire history. Storing and processing only this last token incurs an $O(1)$ storage cost relative to sequence length, effectively bypassing the memory bottleneck.
- Complementary Architectures: Direct KV reuse provides fine-grained retrieval capabilities but lacks global context, causing draft quality to decay for later tokens.
Initializing Mamba with the last-token summary perfectly patches this gap, sustaining high draft acceptance across the entire block.
- High Concurrency Scaling: By eliminating the per-request drafter-side KV cache, H-Spec scales exceptionally well. While traditional block drafters slow down due to memory bandwidth bottlenecks during concurrent serving, H-Spec's runtime scaling flips to become faster as concurrency and input lengths increase.
Key Results
H-Spec was evaluated against strong parallel drafting baselines (P-Eagle, DFlash, DSpark) using Llama3.1-8B-IT, Qwen3-4B, and Qwen3-8B target models.
- Draft Quality and Speedup: At batch size 1, H-Spec improved the Mean Accepted Length (MAL) by 5.0% to 13.3% and achieved an inter-token latency speedup of 5.3% to 12.6% over the best baseline.
- Serving Throughput: When integrated into a vLLM serving framework, H-Spec consistently achieved the highest throughput and lowest KV cache utilization across all concurrency levels (from 8 to 128 concurrent requests). Peak throughput improved by 7.6% to 17.3% depending on the target model.
Limitations and Future Work
- Architectural Constraints: Because H-Spec reuses the target model's KV cache directly, its attention modules must strictly match the target model's Key and Value dimensions. This limits architectural flexibility compared to traditional drafters that can project hidden states to arbitrary dimensions.
- Low Concurrency Overhead: At very low concurrency or short input lengths, H-Spec can draft slightly slower than vanilla block diffusion models due to its deeper computational graph (combining both Mamba and attention layers).
- Future Directions: The authors plan to explore partial target-KV head reuse to further reduce attention overhead, alternative target-layer selection strategies, and more advanced causal correction schemes.
Summary updated