ChatPaper.aiChatPaper

CLaSp: 자기 추론 디코딩을 위한 컨텍스트 내 계층 건너뛰기

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

May 30, 2025
저자: Longze Chen, Renke Shan, Huiming Wang, Lu Wang, Ziqiang Liu, Run Luo, Jiawei Wang, Hamid Alinejad-Rokny, Min Yang
cs.AI

초록

스펙티브 디코딩(SD)은 대규모 언어 모델(LLM)의 디코딩 과정을 가속화하는 유망한 방법입니다. SD의 효율성은 주로 드래프트 모델과 검증 모델 간의 일관성에 달려 있습니다. 그러나 기존의 드래프팅 접근 방식은 일반적으로 추가 모듈을 학습해야 하며, 이는 다양한 LLM 간의 호환성을 보장하기 어려울 수 있습니다. 본 논문에서는 자기 스펙티브 디코딩을 위한 컨텍스트 내 레이어 스킵 전략인 CLaSp를 제안합니다. 기존 방법과 달리, CLaSp는 추가 드래프팅 모듈이나 별도의 학습이 필요하지 않습니다. 대신 검증 모델의 중간 레이어를 건너뛰어 압축된 드래프트 모델을 구성하는 플러그 앤 플레이 메커니즘을 사용합니다. 구체적으로, 우리는 마지막 검증 단계의 완전한 은닉 상태를 목표로 활용하여 레이어 스킵 과정을 최적화하는 동적 프로그래밍 알고리즘을 개발했습니다. 이를 통해 CLaSp는 사전 최적화된 레이어 스킵 세트에 의존하지 않고 각 검증 단계 이후에 레이어 스킵 전략을 동적으로 조정할 수 있습니다. 다양한 다운스트림 작업에 대한 실험 결과는 CLaSp가 LLaMA3 시리즈 모델에서 생성된 텍스트의 원본 분포를 변경하지 않고도 1.3배 ~ 1.7배의 속도 향상을 달성함을 보여줍니다.
English
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.
PDF136June 2, 2025