TL;DR
Speculative decoding speeds up LLM inference, but its throughput is bottlenecked when the lightweight drafter falls out of sync with the larger verifier. This paper introduces $\text{SD}^2$ (Steered Speculative Decoding), a technique that extracts a lightweight steering vector from the verifier’s intermediate hidden states and injects it as an MLP bias into a pretrained drafter during candidate generation. This dynamic guidance improves accepted tokens by up to 35% under standard sampling with negligible computational overhead, offering a modular drop-in enhancement over standard offline distillation.
What Problem Does This Paper Address?
Auto-regressive LLM inference is notoriously memory-bandwidth bound. Speculative decoding tackles this by pairing a large "verifier" model with a smaller "drafter" model: the drafter quickly proposes a chunk of $k$ tokens, and the verifier checks them simultaneously in a single forward pass.
Existing approaches fall into two main camps:
- Dependent draft heads (e.g., Medusa, EAGLE): Small layers attached directly to the verifier and trained from scratch. They are fast, but lack standalone language modeling depth and struggle out-of-distribution.
- Independent pretrained drafters: Standalone smaller LLMs from the same family. They generate coherent long-range text, but their offline alignment with the verifier is static, leading to misalignments and rejected tokens.
When verification latency dominates—such as with remote/distributed models or massive frontier verifiers—maximizing the number of accepted tokens per round (block efficiency, $\tau$) is paramount. $\text{SD}^2$ bridges the gap by dynamically steering a pretrained, independent drafter using the verifier’s latent state without replacing the drafter's core architecture.
Methods
Rather than relying purely on offline fine-tuning (like knowledge distillation), $\text{SD}^2$ injects dynamic guidance at inference:
- Extracting the Steering Vector ($g_t$): At the point where the verifier rejects a drafted token, representations from three verifier depths—low ($l_t$), middle ($m_t$), and high ($h_t$) layers—are concatenated and projected via a linear layer: $$g_t = W_{hml} [h_t, m_t, l_t]^\top$$
-
Injecting Dynamic Bias: During the next drafting phase, $g_t$ is linearly mapped via $W_s$ and injected directly into the SwiGLU activation blocks across all drafter MLP layers: $$a_{t+i}^{(l)}, g_t \mapsto W_d \Big(\big(W_u a_{t+i}^{(l)} + W_s g_t\big) \odot \sigma(W_g a_{t+i}^{(l)})\Big)$$ Because $W_s g_t$ depends only on the verifier’s state and not the draft position $i$, it is computed only once per drafting block, adding virtually zero runtime overhead.
-
Training Strategy: The verifier remains frozen. The drafter parameters, $W_s$, and $W_{hml}$ are fine-tuned using KL divergence against the verifier’s output distributions on synthetic text. To simulate drafting at arbitrary positions, the training procedure samples a random offset $\delta \in [1, k]$ and predicts tokens conditioned on $g_{t-\delta}$.
Datasets
- Training: Synthetic data generated by the verifier using prompts from UltraChat_200k, followed by an additional epoch on ShareGPT synthetic samples.
- Evaluation: Evaluated across diverse reasoning, coding, and dialogue tasks using 96 samples each from:
- UltraChat_200k (in-domain validation split)
- HumanEval (code generation)
- XSum (extreme summarization)
- Alpaca (instruction-following)
- GSM8K (math word problems)
Key Insights and Ideas
- LLMs Encode Future Token Signals: Auto-regressive verifiers implicitly capture future trajectory information in intermediate activations beyond the current token. Linear projections can extract this signal and guide a separate drafter.
- Steering Preserves Out-of-Domain Generalization: Standard knowledge distillation often causes drafters to overfit to the alignment data (e.g., conversational text in UltraChat), degrading performance on downstream tasks like GSM8K or HumanEval. Dynamic steering avoids this pitfall, preserving the drafter's baseline capabilities while boosting in-domain block efficiency.
- Unfreezing the Drafter Matters: Ablations show that while steering a completely frozen drafter doubles token acceptance compared to a naive baseline, jointly fine-tuning drafter weights with the steering projections yields the strongest performance.
- Position-Invariant Up-Projection is Optimal: Adding the projected steering vector directly inside the MLP up-projection outperformed simpler post-MLP additions and heavier conditioned multi-layer perceptrons.
Key Results
Experiments evaluated several verifier-drafter pairs, including Vicuna 1.3 13B + LLaMA 160M, Qwen3 14B/8B + Qwen3 0.6B, and Llama 3.1 8B + Llama 3.2 1B:
- Token Acceptance Boost: $\text{SD}^2$ improves token acceptance per block $(\tau - 1)$ by an average of 21% over distilled drafters and 31% (up to 35%) over pretrained drafters under $T=1$ sampling.
- Throughput & Speedup:
- For models with large capacity gaps (e.g., Vicuna 1.3 13B with LLaMA 160M), $\text{SD}^2$ achieved a +61% wall-clock speedup under standard sampling ($T=1$) and +43% under greedy decoding ($T=0$).
- Across all configurations, $\text{SD}^2$ yielded an average speedup of +16.3% for $T=1$ and +19.5% for $T=0$.
- Negligible Overhead: On tasks where alignment was already near-optimal (such as Qwen3 8B on HumanEval), $\text{SD}^2$ incurred only a 1% latency difference, confirming that computing $W_s g_t$ once per block introduces minimal compute burden.
Limitations and Future Work
- Diminishing Returns on Well-Aligned Pairs: When the drafter and verifier are already strongly aligned out-of-the-box (e.g., Llama 3.1 8B with Llama 3.2 1B), block efficiency gains translate into minimal wall-clock speedups.
- Requires Verifier White-Box Access: Unlike vanilla independent speculative decoding (which can treat the verifier as an external API), $\text{SD}^2$ requires extracting intermediate hidden layers from the verifier.
- Sensitivity of Latent Steering: Large or misdirected perturbations in hidden activations risk producing gibberish tokens, making careful initialization ($W_s = 0$) vital.
- Scope: Tested exclusively on chain drafting and SwiGLU architectures; generalizing to tree-based decoding schemes (like dynamic draft trees) and non-gated activation functions remains an open question.
Summary updated