Lune

ICLR2025Top-tier venue

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

Heming Xia, Yongqi Li, Jun Zhang, Cunxiao Du, Wenjie Li

Abstract

Speculative decoding (SD) has emerged as a widely used paradigm to accelerate LLM inference without compromising 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 plugand-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.3×∼1.6× speedup while preserving the original distribution of the generated text. We release our code in https://github.com/hemingkx/SWIFT .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LongSpec: Long-Context Lossless Speculative Decoding with Efficient Drafting and Verification cites Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads
  • LongSpec: Long-Context Lossless Speculative Decoding with Efficient Drafting and Verification cites Fast Inference from Transformers via Speculative Decoding
  • Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Time cites Training data-efficient image transformers & distillation through attention
  • CAS-Spec: Cascade Adaptive Self-Speculative Decoding for On-the-Fly Lossless Inference Acceleration of LLMs cites Fast Inference from Transformers via Speculative Decoding
  • Faster Speculative Decoding via Effective Draft Decoder with Pruned Candidate Tree cites Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads
  • Faster Speculative Decoding via Effective Draft Decoder with Pruned Candidate Tree cites Fast Inference from Transformers via Speculative Decoding
  • Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads cites Fast Inference from Transformers via Speculative Decoding
  • See the Forest for the Trees: Loosely Speculative Decoding via Visual-Semantic Guidance for Efficient Inference of Video LLMs cites Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads
  • See the Forest for the Trees: Loosely Speculative Decoding via Visual-Semantic Guidance for Efficient Inference of Video LLMs cites Fast Inference from Transformers via Speculative Decoding
  • See the Forest for the Trees: Loosely Speculative Decoding via Visual-Semantic Guidance for Efficient Inference of Video LLMs cites SpecVLM: Enhancing Speculative Decoding of Video LLMs via Verifier-Guided Token Pruning
  • SpecVLM: Enhancing Speculative Decoding of Video LLMs via Verifier-Guided Token Pruning cites Fast Inference from Transformers via Speculative Decoding
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. LongSpec: Long-Context Lossless Speculative Decoding with Efficient Drafting and VerificationPenghui Yang, Cunxiao Du, Fengzhuo Zhang, Haonan Wang et al.ACL 2026 · 12 citations
  2. Faster Speculative Decoding via Effective Draft Decoder with Pruned Candidate TreeHuanran Zheng, Xiaoling WangACL 2025 · 6 citations
  3. CAS-Spec: Cascade Adaptive Self-Speculative Decoding for On-the-Fly Lossless Inference Acceleration of LLMsZhiyuan Ning, Jiawei Shao, Ruge Xu, Xinfei Guo et al.NeurIPS 2025 · 5 citations
  4. See the Forest for the Trees: Loosely Speculative Decoding via Visual-Semantic Guidance for Efficient Inference of Video LLMsYicheng Ji, Jun Zhang, Jinpeng Chen, Cong Wang et al.ACL 2026 · 4 citations
  5. SpecVLM: Enhancing Speculative Decoding of Video LLMs via Verifier-Guided Token PruningYicheng Ji, Jun Zhang, Heming Xia, Jinpeng Chen et al.EMNLP 2025 · 1 citation

Builds on27

  1. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
  2. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
  3. Fast Inference from Transformers via Speculative DecodingYaniv Leviathan, Matan Kalman, Yossi MatiasICML 2023 · 1,472 citations
  4. Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding HeadsTianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng et al.ICML 2024 · 669 citations
  5. Deja Vu: Contextual Sparsity for Efficient LLMs at Inference TimeZichang Liu, Jue Wang, Tri Dao, Tianyi Zhou et al.ICML 2023 · 318 citations

Related papers

  1. CLaSp: In-Context Layer Skip for Self-Speculative DecodingLongze Chen, Renke Shan, Huiming Wang, Lu Wang et al.ACL 2025
  2. Draft& Verify: Lossless Large Language Model Acceleration via Self-Speculative DecodingJun Zhang, Jue Wang, Huan Li, Lidan Shou et al.ACL 2024
  3. FractalLLM: Lossless Self-Speculative Decoding with Layer Embedded Self-CompressionJuhyeong Kim, Sangyeon Yu, Gyunyeop Kim, Sangwoo KangEMNLP Findings 2025
  4. LayerSkip: Enabling Early Exit Inference and Self-Speculative DecodingMostafa Elhoushi, Akshat Shrivastava, Diana Liskovich, Basil Hosmer et al.ACL 2024 · 22 citations
  5. Draft on the Fly: Adaptive Self-Speculative Decoding using Cosine SimilarityMichael R. Metel, Peng Lu, Boxing Chen, Mehdi Rezagholizadeh et al.EMNLP Findings 2024 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines