paper-with-me

홈 › Papers

SWIFT: On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration

2024-10-09 · Heming Xia, Yongqi Li, Jun Zhang, Cunxiao Du, Wenjie Li

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 first employing a compact model to draft multiple tokens efficiently and then using the target LLM to verify them in parallel. While this technique has achieved notable speedups, most existing approaches necessitate either additional parameters or extensive training to construct effective draft models, thereby restricting their applicability across different LLMs and tasks. To address this limitation, we explore a novel plug-and-play SD solution with layer-skipping, which skips intermediate layers of the target LLM as the compact draft model. Our analysis reveals that LLMs exhibit great potential for self-acceleration through layer sparsity and the task-specific nature of this sparsity. Building on these insights, we introduce SWIFT, an on-the-fly self-speculative decoding algorithm that adaptively selects intermediate layers of LLMs to skip during inference. SWIFT does not require auxiliary models or additional training, making it a plug-and-play solution for accelerating LLM inference across diverse input data streams. Our extensive experiments across a wide range of models and downstream tasks demonstrate that SWIFT can achieve over a 1.3x-1.6x speedup while preserving the original distribution of the generated text.

📄 PDF Abstract BibTeX arXiv:2410.06916

Code (1)

hemingkx/SWIFT 공식 구현 pytorch

Similar Papers 제목 키워드 기반

CAS-Spec: Cascade Adaptive Self-Speculative Decoding for On-the-Fly Lossless Inference Acceleration of LLMs

2025-10-30 · Zhiyuan Ning, Jiawei Shao, Ruge Xu, Xinfei Guo 외 arxiv

Speculative decoding has become a widely adopted as an effective technique for lossless inference acceleration when deploying large language models (LLMs). While on-the-fly self-speculative methods offer seamless integra…

Pipeline Parallelism is All You Need for Optimized Early-Exit Based Self-Speculative Decoding

2025-09-19 · Ruanjun Li, Ziheng Liu, Yuanming Shi, Jiawei Shao 외 arxiv

Large language models (LLMs) deliver impressive generation quality, but incur very high inference cost because each output token is generated auto-regressively through all model layers. Early-exit based self-speculative …

QuantSpec: Self-Speculative Decoding with Hierarchical Quantized KV Cache

2025-02-05 · Rishabh Tiwari, Haocheng Xi, Aditya Tomar, Coleman Hooper 외

Large Language Models (LLMs) are increasingly being deployed on edge devices for long-context settings, creating a growing need for fast and efficient long-context inference. In these scenarios, the Key-Value (KV) cache …

GPU

SwiftSpec: Ultra-Low Latency LLM Decoding by Scaling Asynchronous Speculative Decoding

2025-06-12 · Ziyi Zhang, Ziheng Jiang, Chengquan Jiang, Menghan Yu 외

Low-latency decoding for large language models (LLMs) is crucial for applications like chatbots and code assistants, yet generating long outputs remains slow in single-query settings. Prior work on speculative decoding (…

A Theoretical Perspective for Speculative Decoding Algorithm

2024-10-30 · Ming Yin, Minshuo Chen, Kaixuan Huang, Mengdi Wang

Transformer-based autoregressive sampling has been the major bottleneck for slowing down large language model inferences. One effective way to accelerate inference is \emph{Speculative Decoding}, which employs a small mo…

Language ModelingLanguage ModellingLarge Language Model