PEARL: Parallel Speculative Decoding with Adaptive Draft Length

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Liu, Tianyu, Li, Yun, Lv, Qitan, Liu, Kai, Zhu, Jianchen, Hu, Winston, Sun, Xiao
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909495178821632
author Liu, Tianyu
Li, Yun
Lv, Qitan
Liu, Kai
Zhu, Jianchen
Hu, Winston
Sun, Xiao
author_facet Liu, Tianyu
Li, Yun
Lv, Qitan
Liu, Kai
Zhu, Jianchen
Hu, Winston
Sun, Xiao
contents Speculative decoding (SD), where an extra draft model is employed to provide multiple draft tokens first, and then the original target model verifies these tokens in parallel, has shown great power for LLM inference acceleration. However, existing SD methods suffer from the mutual waiting problem, i.e., the target model gets stuck when the draft model is guessing tokens, and vice versa. This problem is directly incurred by the asynchronous execution of the draft model and the target model and is exacerbated due to the fixed draft length in speculative decoding. To address these challenges, we propose a conceptually simple, flexible, and general framework to boost speculative decoding, namely Parallel spEculative decoding with Adaptive dRaft Length (PEARL). Specifically, PEARL proposes pre-verify to verify the first draft token in advance during the drafting phase, and post-verify to generate more draft tokens during the verification phase. PEARL parallels the drafting phase and the verification phase via applying the two strategies, and achieves adaptive draft length for different scenarios, which effectively alleviates the mutual waiting problem. Experiments on various text generation benchmarks demonstrate the effectiveness of our PEARL, leading to a superior speed up performance up to 4.43$\times$ and 1.50$\times$, compared to auto-regressive decoding and vanilla speculative decoding, respectively. Our code is available at https://github.com/smart-lty/ParallelSpeculativeDecoding.
format Preprint
id arxiv_https___arxiv_org_abs_2408_11850
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle PEARL: Parallel Speculative Decoding with Adaptive Draft Length
Liu, Tianyu
Li, Yun
Lv, Qitan
Liu, Kai
Zhu, Jianchen
Hu, Winston
Sun, Xiao
Computation and Language
Speculative decoding (SD), where an extra draft model is employed to provide multiple draft tokens first, and then the original target model verifies these tokens in parallel, has shown great power for LLM inference acceleration. However, existing SD methods suffer from the mutual waiting problem, i.e., the target model gets stuck when the draft model is guessing tokens, and vice versa. This problem is directly incurred by the asynchronous execution of the draft model and the target model and is exacerbated due to the fixed draft length in speculative decoding. To address these challenges, we propose a conceptually simple, flexible, and general framework to boost speculative decoding, namely Parallel spEculative decoding with Adaptive dRaft Length (PEARL). Specifically, PEARL proposes pre-verify to verify the first draft token in advance during the drafting phase, and post-verify to generate more draft tokens during the verification phase. PEARL parallels the drafting phase and the verification phase via applying the two strategies, and achieves adaptive draft length for different scenarios, which effectively alleviates the mutual waiting problem. Experiments on various text generation benchmarks demonstrate the effectiveness of our PEARL, leading to a superior speed up performance up to 4.43$\times$ and 1.50$\times$, compared to auto-regressive decoding and vanilla speculative decoding, respectively. Our code is available at https://github.com/smart-lty/ParallelSpeculativeDecoding.
title PEARL: Parallel Speculative Decoding with Adaptive Draft Length
topic Computation and Language
url https://arxiv.org/abs/2408.11850