KNN-SSD: Enabling Dynamic Self-Speculative Decoding via Nearest Neighbor Layer Set Optimization

Read full text
Authors: Mingbo Song, Heming Xia, Jun Zhang, Chak Tou Leong, Qiancheng Xu, Wenjie Li, Sujian Li
Cited by: 2

Abstract

Speculative Decoding (SD) has emerged as a widely used paradigm to accelerate the inference of large language models (LLMs) without compromising generation quality.It works by efficiently drafting multiple tokens using a compact model and then verifying them in parallel using the target LLM.Notably, Self-Speculative Decoding proposes skipping certain layers to construct the draft model, which eliminates the need for additional parameters or training.Despite its strengths, we observe in this work that drafting with layer skipping exhibits significant sensitivity to domain shifts, leading to a substantial drop in acceleration performance.To enhance the domain generalizability of this paradigm, we introduce KNN-SSD, an algorithm that leverages K-Nearest Neighbor (KNN) search to match different skipped layers with various domain inputs.We evaluated our algorithm in various models and multiple tasks, observing that its application leads to 1.3×∼1.6×speedup in LLM inference.1

Fields of Study & Subjects

Advanced Data Storage Technologies Network Packet Processing and Optimization Caching and Content Delivery

Publication details

Journal / source
Findings of the Association for Computational Linguistics: EACL 2026
Publisher
Association for Computational Linguistics
Pages
641–655
Publication date
1 January 2026