CLaSp: In-Context Layer Skip for Self-Speculative Decoding

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Chen, Longze, Shan, Renke, Wang, Huiming, Wang, Lu, Liu, Ziqiang, Luo, Run, Wang, Jiawei, Alinejad-Rokny, Hamid, Yang, Min
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866909628383625216
author Chen, Longze
Shan, Renke
Wang, Huiming
Wang, Lu
Liu, Ziqiang
Luo, Run
Wang, Jiawei
Alinejad-Rokny, Hamid
Yang, Min
author_facet Chen, Longze
Shan, Renke
Wang, Huiming
Wang, Lu
Liu, Ziqiang
Luo, Run
Wang, Jiawei
Alinejad-Rokny, Hamid
Yang, Min
contents Speculative decoding (SD) is a promising method for accelerating the decoding process of Large Language Models (LLMs). The efficiency of SD primarily hinges on the consistency between the draft model and the verify model. However, existing drafting approaches typically require additional modules to be trained, which can be challenging to implement and ensure compatibility across various LLMs. In this paper, we propose CLaSp, an in-context layer-skipping strategy for self-speculative decoding. Unlike prior methods, CLaSp does not require additional drafting modules or extra training. Instead, it employs a plug-and-play mechanism by skipping intermediate layers of the verify model to construct a compressed draft model. Specifically, we develop a dynamic programming algorithm that optimizes the layer-skipping process by leveraging the complete hidden states from the last verification stage as an objective. This enables CLaSp to dynamically adjust its layer-skipping strategy after each verification stage, without relying on pre-optimized sets of skipped layers. Experimental results across diverse downstream tasks demonstrate that CLaSp achieves a speedup of 1.3x ~ 1.7x on LLaMA3 series models without altering the original distribution of the generated text.
format Preprint
id arxiv_https___arxiv_org_abs_2505_24196
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle CLaSp: In-Context Layer Skip for Self-Speculative Decoding
Chen, Longze
Shan, Renke
Wang, Huiming
Wang, Lu
Liu, Ziqiang
Luo, Run
Wang, Jiawei
Alinejad-Rokny, Hamid
Yang, Min
Computation and Language
Speculative decoding (SD) is a promising method for accelerating the decoding process of Large Language Models (LLMs). The efficiency of SD primarily hinges on the consistency between the draft model and the verify model. However, existing drafting approaches typically require additional modules to be trained, which can be challenging to implement and ensure compatibility across various LLMs. In this paper, we propose CLaSp, an in-context layer-skipping strategy for self-speculative decoding. Unlike prior methods, CLaSp does not require additional drafting modules or extra training. Instead, it employs a plug-and-play mechanism by skipping intermediate layers of the verify model to construct a compressed draft model. Specifically, we develop a dynamic programming algorithm that optimizes the layer-skipping process by leveraging the complete hidden states from the last verification stage as an objective. This enables CLaSp to dynamically adjust its layer-skipping strategy after each verification stage, without relying on pre-optimized sets of skipped layers. Experimental results across diverse downstream tasks demonstrate that CLaSp achieves a speedup of 1.3x ~ 1.7x on LLaMA3 series models without altering the original distribution of the generated text.
title CLaSp: In-Context Layer Skip for Self-Speculative Decoding
topic Computation and Language
url https://arxiv.org/abs/2505.24196