Draft & Verify: Lossless Large Language Model Acceleration via Self-Speculative Decoding

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhang, Jun, Wang, Jue, Li, Huan, Shou, Lidan, Chen, Ke, Chen, Gang, Mehrotra, Sharad
Natura: Preprint
Pubblicazione: 2023
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916603725086720
author Zhang, Jun
Wang, Jue
Li, Huan
Shou, Lidan
Chen, Ke
Chen, Gang
Mehrotra, Sharad
author_facet Zhang, Jun
Wang, Jue
Li, Huan
Shou, Lidan
Chen, Ke
Chen, Gang
Mehrotra, Sharad
contents We present a novel inference scheme, self-speculative decoding, for accelerating Large Language Models (LLMs) without the need for an auxiliary model. This approach is characterized by a two-stage process: drafting and verification. The drafting stage generates draft tokens at a slightly lower quality but more quickly, which is achieved by selectively skipping certain intermediate layers during drafting. Subsequently, the verification stage employs the original LLM to validate those draft output tokens in one forward pass. This process ensures the final output remains identical to that produced by the unaltered LLM. Moreover, the proposed method requires no additional neural network training and no extra memory footprint, making it a plug-and-play and cost-effective solution for inference acceleration. Benchmarks with LLaMA-2 and its variants demonstrated a speedup up to 1.99$\times$.
format Preprint
id arxiv_https___arxiv_org_abs_2309_08168
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Draft & Verify: Lossless Large Language Model Acceleration via Self-Speculative Decoding
Zhang, Jun
Wang, Jue
Li, Huan
Shou, Lidan
Chen, Ke
Chen, Gang
Mehrotra, Sharad
Computation and Language
We present a novel inference scheme, self-speculative decoding, for accelerating Large Language Models (LLMs) without the need for an auxiliary model. This approach is characterized by a two-stage process: drafting and verification. The drafting stage generates draft tokens at a slightly lower quality but more quickly, which is achieved by selectively skipping certain intermediate layers during drafting. Subsequently, the verification stage employs the original LLM to validate those draft output tokens in one forward pass. This process ensures the final output remains identical to that produced by the unaltered LLM. Moreover, the proposed method requires no additional neural network training and no extra memory footprint, making it a plug-and-play and cost-effective solution for inference acceleration. Benchmarks with LLaMA-2 and its variants demonstrated a speedup up to 1.99$\times$.
title Draft & Verify: Lossless Large Language Model Acceleration via Self-Speculative Decoding
topic Computation and Language
url https://arxiv.org/abs/2309.08168