SpecBound: Adaptive Bounded Self-Speculation with Layer-wise Confidence Calibration
Authors: Zhuofan Wen, Yang Feng
Organizations: Key Laboratory of Intelligent Information Processing, Institute of Computing Technology, Chinese Academy of Sciences (ICT/CAS) · State Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences · University of Chinese Academy of Sciences, Beijing, China
Speculative decoding has emerged as a promising approach to accelerate autoregressive inference in large language models (LLMs). Self-draft methods, which leverage the base LLM itself for speculation, avoid the overhead of auxiliary draft models but face limitations: shallow layers often produce overconfident yet incorrect token predictions, and the presence of difficult tokens in a draft sequence forces redundant computation through deeper layers, undermining both draft acceptance and overall speedup. To address these issues, we propose a novel self-draft framework that suppresses spurious confidence via layer-wise temperature annealing in early-exit decision and adaptively bounds speculation length based on token-wise decoding difficulty. By reprocessing the hidden states of draft tokens in a unified parallel pass through deep layers, our method maintains exact output equivalence with the original model while maximizing computational efficiency. It requires no modifications to the base LLM parameters and achieves up to 2.33x wall-time speedup over standard autoregressive decoding across diverse long-form generation tasks and multiple model architectures.
Figures & tables
Figure 1: Layer-wise token prediction and confidence of a segment with the MT-Bench prompt. Each cell shows the greedy-decoded token and its confidence (color intensity: darker = higher probability) at a given layer. Gray cells indicate that the token has already correctly exited at an earlier layer and is no longer considered for early-exit decisions. This figure reveals the issues of spurious high-confidence predictions and heterogeneous exit depths.
Figure 2: Left: Overview of the BSCS algorithm under the setting dmax=6 and wmax=4 . When token “a” fails to exit by layer 6, speculation is terminated. All hidden states of previously generated tokens (“I”, “am”, “a”) are concatenated and passed to the remaining layers for parallel verification. Right: Detailed illustration of per-token layer-wise computation and hidden-state cache management.
Method
Math
Multi.
QA
RAG
Sum.
Trans.
Overall
CR
SD
CR
SD
CR
SD
CR
SD
CR
SD
CR
SD
Vicuna-7B
Lookahead Fu et al. (2024)
1.92
1.54 ×
1.74
1.49 ×
1.52
1.23 ×
1.53
1.24 ×
1.57
1.38 ×
1.28
1.16 ×
1.35 ×
Medusa Cai et al. (2023)
1.77
1.96 ×
1.72
1.95 ×
1.54
1.67 ×
1.47
1.47 ×
1.53
1.59 ×
1.55
1.63 ×
1.71 ×
REST He et al. (2024)
1.49
1.19 ×
2.04
1.65 ×
1.87
1.64 ×
1.96
1.75 ×
1.60
1.34 ×
1.58
1.33 ×
1.47 ×
Kangaroo Liu et al. (2024)
2.14
1.61 ×
2.22
1.68 ×
1.87
1.43 ×
2.05
1.52 ×
1.87
1.50 ×
1.41
1.24 ×
1.50 ×
Table 1: Performance comparison of SpecBound against other self-drafting methods across multiple base models and diverse text generation tasks on Spec-Bench. We report compression rate (CR, average accepted tokens per draft round) and wall-time speedup (SD) relative to autoregressive decoding.
Figure 3: Hyperparameter Sensitivity Analysis on Vicuna-7B: wall-time speedup (blue) and compression rate (CR, orange) under varying exit threshold γ , annealing coefficient α , depth bound dmax , and width bound wmax .
Figure 4: Ablation study of SpecBound components on wall-time speedup across different base models, comparing the full method against variants that removing the Annealed Confidence Threshold early exit mechanism, the depth bound dmax , or the width bound wmax .
Method
Math
Multi.
QA
RAG
Sum.
Trans.
Overall
greedy decoding
1.89 ×
1.65 ×
2.16 ×
2.31 ×
1.95 ×
2.94 ×
2.15 ×
temperature sampling (T=0.3)
1.82 ×
1.56 ×
2.01 ×
2.20 ×
1.86 ×
2.86 ×
2.08 ×
temperature sampling (T=1.0)
1.71 ×
1.44 ×
1.92 ×
2.08 ×
1.73 ×
2.63 ×
1.88 ×
top-p sampling (p=0.9)
1.78 ×
1.48 ×
1.99 ×
2.15 ×
1.78 ×
2.71 ×
1.94 ×
Table 2: Speedup performance of SpecBound (Vicuna-7B) under different decoding strategies on different tasks of Spec-Bench. We choose greedy docoding, temperature sampling and top-p sampling with different settings.
Metric
AR (Base)
Ours
Improv.
TTFT (ms)
20.8
21.1
-
Per-token latency (ms)
17.5
8.8
1.98 ×
Throughput (tokens/s)
57.3
123.1
2.15 ×
End-to-End Latency (s)
3.31
1.89
1.75 ×
Table 3: Serving latency metrics comparison on Vicuna-7B using a single NVIDIA H800 GPU. "AR" denotes standard autoregressive decoding.
Figure 5: Left: Overview of the BSCS algorithm under the setting dmax=6 and wmax=4 . When token “chat” successfully exits at layer 2 and the total draft length reaches the width bound wmax , speculation is terminated. All hidden states of previously generated tokens (“I”, “am”, “a”, “chat”) are concatenated and passed to the remaining layers for parallel verification. Right: Detailed illustration of per-token layer-wise computation and hidden-state cache management.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Device
Math
Multi-turn
QA
RAG
Summary
Translation
Overall
H800
1.89 ×
1.65 ×
2.16 ×
2.31 ×
1.95 ×
2.94 ×
2.15 ×
RTX 3090
1.81 ×
1.58 ×
2.12 ×
2.13 ×
1.92 ×
2.69 ×
2.01 ×
Appendix
Table 4: Speedup performance of SpecBound (Vicuna-7B) on different GPU devices across various Spec-Bench tasks. The evaluation are conducted on H800 and RTX 3090 with all other settings are the same.
Speedup Range
Number
Percentage
3.54×−4.16× (Max)
16
3.33%
2.93×−3.54×
48
10.00%
2.31×−2.93×
103
21.46%
1.69×−2.31×
197
41.04%
1.07× (Min) −1.69×
116
24.17%
Appendix
Table 5: Empirical speedup distribution of SpecBound on Vicuna-7B across 480 prompts from SpecBench.
Self-speculative decoding is an inference technique for large language models designed to speed up generation without sacrificing output quality. It combines fast, approximate decoding using a compact version of the model as a draft model with selective re-evaluation by the full target model. Some existing methods form the draft model by dynamically learning which layers to skip during inference, effectively creating a smaller subnetwork to speed up computation. However, using heuristic-based approaches to select layers to skip can often be simpler and more effective. In this paper, we propose ConfLayers, a dynamic plug-and-play approach to forming the draft model in self-speculative decoding via confidence-based intermediate layer skipping. The process iteratively computes confidence scores for all layers, selects layers to skip based on an adaptive threshold, evaluates the performance of the resulting set, and updates the best selection until no further improvement is achieved or a maximum number of iterations is reached. This framework avoids the overhead and complexity of training a layer skipping policy and can provide more consistent speed-quality trade-offs while preserving the adaptivity of the draft model to diverse tasks and datasets. The performance evaluation of ConfLayers across different models and datasets shows that our novel approach offers up to 1.4x speedup over vanilla LLM generation.
Walaa Amer, Uday das, Fadi Kurdahi
Department of Electrical Engineering and Computer Sciences, University of California Irvine, Irvine, USA · Advanced Micro Devices, San Jose, USA
Speculative decoding alleviates the memory-bandwidth bottleneck in large language model inference, but its acceleration is jointly constrained by drafting overhead, token acceptance, and speculation length. We present a unified efficiency analysis showing that extending the speculation horizon can reduce rather than improve speedup when the marginal acceptance probability falls below the relative drafting cost. Guided by this analysis, we introduce SparseSpec-L, a training-free self-speculative decoding framework for long-context inference. SparseSpec-L generates lightweight drafts directly from the target model using a dynamically sparsified and recallable KV cache. It recycles per-head attention statistics produced during full-context verification as a no-extra-forward importance signal, allowing critical historical tokens to be recalled without permanently discarding the dense KV cache. An online entropy-based controller further selects the speculation length according to expected step-wise efficiency. Experiments across multiple long-context tasks and model scales show consistent end-to-end acceleration, with up to speedup over autoregressive decoding while preserving the target model's output distribution.
Self-speculative decoding accelerates large language model (LLM) inference by drafting tokens from the target model itself, but faces a sharp tradeoff between the quality and cost of the draft. Early-exit methods produce drafts cheaply by terminating computation at intermediate layers, but forgo the deeper representations that later layers provide and thus suffer in draft quality. Multi-token prediction preserves draft quality by emitting from the model's final hidden states, but pays for a full forward pass to produce those states at every drafting step. We propose self-speculative encoder-decoder (SEED), a self-speculative method that obtains high-quality drafts cheaply by reusing the deep contextual representations already computed during verification. We reinterpret the standard decoder-only transformer as an implicit encoder-decoder: the first layers (encoder) build deep contextual representations, and the last few layers (decoder) emit tokens from them. Encoding and verification are merged into a single step: verification is performed by the full encoder-decoder, and the contextual representations of the verified prefix are cached for reuse during drafting. Drafting is therefore very fast: between verifications, the lightweight decoder drafts multiple tokens autoregressively, each conditioned on the cached representations and on preceding drafts. Experiments across multiple benchmarks show that SEED achieves up to 2.7× average speedup on 4B-scale models, outperforming both early-exit and MTP-style self-speculative baselines and running 28% faster than the state-of-the-art EAGLE-3, while preserving or even improving the generation quality of standard autoregressive fine-tuning. Code is available at https://github.com/lhk2004/SEED.
Hankun Lin, Patrick Pynadath, Ruqi Zhang
Department of Computer Science, Purdue University, USA