NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Boosting Lossless Speculative Decoding via Feature Sampling and Partial Alignment Distillation

Lujun Gui, Bin Xiao, Lei Su, Weipeng Chen · DOI

Abstract

Lossless speculative decoding accelerates target large language model (LLM) inference by employing a lightweight draft model for generating tree-structured candidates, which are subsequently verified in parallel by the target LLM. Currently, effective approaches leverage feature-level rather than token-level autoregression within the draft model to facilitate more straightforward predictions and enhanced knowledge distillation. In this paper, we reassess these approaches and propose FSPAD (Feature Sampling and Partial Alignment Distillation for Lossless Speculative Decoding), which introduces two straightforward and effective components within the existing framework to boost lossless speculative decoding. Firstly, FSPAD utilizes token embeddings to sample features of the target LLM in high-dimensional space before feeding them into the draft model, due to the inherent uncertainty of the features preventing the draft model from obtaining the specific token output by the target LLM. Secondly, FSPAD introduces partial alignment distillation to weaken the draft model's connection between features and logits, aiming to reduce the conflict between feature alignment and logit confidence during training. Our experiments include both greedy and non-greedy decoding on the largest and smallest models from the Vicuna and LLaMA3-Instruct series, as well as tasks in multi-turn conversation, translation, summarization, question answering, mathematical reasoning, and retrieval-augmented generation. The results show that FSPAD outperforms the state-of-the-art method across all the aforementioned tasks and target LLMs.

Introduction

Inference in Large Language Models (LLMs) is notoriously slow due to its sequential, autoregressive nature. Speculative decoding offers a solution by using a smaller, faster "draft model" to predict multiple future tokens, which are then verified in parallel by the larger "target model." While recent feature-level draft models like EAGLE-2 have improved efficiency, they face two significant challenges: feature uncertainty and distillation conflict. FSPAD (Feature Sampling and Partial Alignment Distillation) is introduced to address these hurdles, delivering state-of-the-art speedups while ensuring bit-for-bit identical outputs.

Methodology

FSPAD enhances the speculative decoding pipeline through two primary architectural innovations.

Feature Sampling (FS)

Draft models typically attempt to predict the continuous hidden states (features) of the target model. However, the inherent uncertainty in token selection makes simple linear combinations of previous states insufficient for accurate prediction. FSPAD employs a Feature Sampler that projects features into a higher-dimensional space and utilizes a gating mechanism (SiLU activation) to better represent the distribution of potential next tokens. This allows the draft model to effectively sample the feature space, capturing the target model's output distribution more precisely.

Partial Alignment Distillation (PAD)

Traditional knowledge distillation often creates a "tug-of-war" during training: forcing the draft model to match the target's features (alignment) can inadvertently degrade its own token prediction confidence (logit confidence). FSPAD resolves this by decoupling these objectives. The draft model's output layer is modified to produce two distinct features: one dedicated to alignment with the target LLM and another used as the input for the subsequent drafting step. This mechanism allows for lower feature-level loss without sacrificing prediction accuracy.

Training curves demonstrating how Partial Alignment Distillation (PAD) resolves the conflict between feature alignment and prediction accuracy.

Key Results and Insights

FSPAD was evaluated across a wide array of benchmarks, including MT-bench, WMT14, CNN/Daily Mail, Natural Questions, GSM8K, and DPR, using the SharedGPT dataset for training.

The results demonstrate that FSPAD consistently outperforms state-of-the-art methods like EAGLE-2, Medusa, and Lookahead across all tasks and models. For instance, on the Vicuna 33B model, FSPAD achieved a 3.80x speedup in multi-turn conversations. In mathematical reasoning tasks with LLaMA3-70B, FSPAD increased the average number of accepted tokens per step by 13.3% compared to EAGLE-2.

Performance comparison of FSPAD against state-of-the-art methods across diverse NLP tasks.

A critical insight from the study is the visualization of the training conflict. As shown in the loss curves, traditional distillation methods often see a drop in prediction accuracy as feature alignment improves. PAD effectively mitigates this, allowing the model to learn internal representations without hampering generation performance. Furthermore, FSPAD remains highly efficient, adding only a tiny fraction of parameters relative to the target models.

Conclusion

FSPAD represents a significant advancement in lossless speculative decoding. By addressing feature uncertainty through high-dimensional sampling and resolving distillation conflicts via partial alignment, it sets a new benchmark for LLM inference acceleration. Future research will explore applying these feature-sampling techniques to lossy speculative decoding and reducing the training overhead for massive target models.

Summary updated

BibTeX
@misc{gui2024boosting,
  author = {Lujun Gui and Bin Xiao and Lei Su and Weipeng Chen},
  title = {{Boosting Lossless Speculative Decoding via Feature Sampling and Partial Alignment Distillation}},
  year = {2024},
  eprint = {2408.15562},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.15562},
}
Figure