DistillSpec: Improving Speculative Decoding via Knowledge Distillation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Zhou, Yongchao, Lyu, Kaifeng, Rawat, Ankit Singh, Menon, Aditya Krishna, Rostamizadeh, Afshin, Kumar, Sanjiv, Kagy, Jean-François, Agarwal, Rishabh
Formato: Preprint
Publicado: 2023
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866916185133547520
author Zhou, Yongchao
Lyu, Kaifeng
Rawat, Ankit Singh
Menon, Aditya Krishna
Rostamizadeh, Afshin
Kumar, Sanjiv
Kagy, Jean-François
Agarwal, Rishabh
author_facet Zhou, Yongchao
Lyu, Kaifeng
Rawat, Ankit Singh
Menon, Aditya Krishna
Rostamizadeh, Afshin
Kumar, Sanjiv
Kagy, Jean-François
Agarwal, Rishabh
contents Speculative decoding (SD) accelerates large language model inference by employing a faster draft model for generating multiple tokens, which are then verified in parallel by the larger target model, resulting in the text generated according to the target model distribution. However, identifying a compact draft model that is well-aligned with the target model is challenging. To tackle this issue, we propose DistillSpec that uses knowledge distillation to better align the draft model with the target model, before applying SD. DistillSpec makes two key design choices, which we demonstrate via systematic study to be crucial to improving the draft and target alignment: utilizing on-policy data generation from the draft model, and tailoring the divergence function to the task and decoding strategy. Notably, DistillSpec yields impressive 10 - 45% speedups over standard SD on a range of standard benchmarks, using both greedy and non-greedy sampling. Furthermore, we combine DistillSpec with lossy SD to achieve fine-grained control over the latency vs. task performance trade-off. Finally, in practical scenarios with models of varying sizes, first using distillation to boost the performance of the target model and then applying DistillSpec to train a well-aligned draft model can reduce decoding latency by 6-10x with minimal performance drop, compared to standard decoding without distillation.
format Preprint
id arxiv_https___arxiv_org_abs_2310_08461
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle DistillSpec: Improving Speculative Decoding via Knowledge Distillation
Zhou, Yongchao
Lyu, Kaifeng
Rawat, Ankit Singh
Menon, Aditya Krishna
Rostamizadeh, Afshin
Kumar, Sanjiv
Kagy, Jean-François
Agarwal, Rishabh
Computation and Language
Artificial Intelligence
Machine Learning
Speculative decoding (SD) accelerates large language model inference by employing a faster draft model for generating multiple tokens, which are then verified in parallel by the larger target model, resulting in the text generated according to the target model distribution. However, identifying a compact draft model that is well-aligned with the target model is challenging. To tackle this issue, we propose DistillSpec that uses knowledge distillation to better align the draft model with the target model, before applying SD. DistillSpec makes two key design choices, which we demonstrate via systematic study to be crucial to improving the draft and target alignment: utilizing on-policy data generation from the draft model, and tailoring the divergence function to the task and decoding strategy. Notably, DistillSpec yields impressive 10 - 45% speedups over standard SD on a range of standard benchmarks, using both greedy and non-greedy sampling. Furthermore, we combine DistillSpec with lossy SD to achieve fine-grained control over the latency vs. task performance trade-off. Finally, in practical scenarios with models of varying sizes, first using distillation to boost the performance of the target model and then applying DistillSpec to train a well-aligned draft model can reduce decoding latency by 6-10x with minimal performance drop, compared to standard decoding without distillation.
title DistillSpec: Improving Speculative Decoding via Knowledge Distillation
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2310.08461