OPT-Tree: Speculative Decoding with Adaptive Draft Tree Structure

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wang, Jikai, Su, Yi, Li, Juntao, Xia, Qingrong, Ye, Zi, Duan, Xinyu, Wang, Zhefeng, Zhang, Min
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866909590548905984
author Wang, Jikai
Su, Yi
Li, Juntao
Xia, Qingrong
Ye, Zi
Duan, Xinyu
Wang, Zhefeng
Zhang, Min
author_facet Wang, Jikai
Su, Yi
Li, Juntao
Xia, Qingrong
Ye, Zi
Duan, Xinyu
Wang, Zhefeng
Zhang, Min
contents Autoregressive language models demonstrate excellent performance in various scenarios. However, the inference efficiency is limited by its one-step-one-word generation mode, which has become a pressing problem recently as the models become increasingly larger. Speculative decoding employs a "draft and then verify" mechanism to allow multiple tokens to be generated in one step, realizing lossless acceleration. Existing methods mainly adopt fixed heuristic draft structures, which fail to adapt to different situations to maximize the acceptance length during verification. To alleviate this dilemma, we proposed OPT-Tree, an algorithm to construct adaptive and scalable draft trees. It searches the optimal tree structure that maximizes the mathematical expectation of the acceptance length in each decoding step. Experimental results reveal that OPT-Tree outperforms the existing draft structures and achieves a speed-up ratio of up to 3.2 compared with autoregressive decoding. If the draft model is powerful enough and the node budget is sufficient, it can generate more than ten tokens in a single step. Our code is available at https://github.com/Jikai0Wang/OPT-Tree.
format Preprint
id arxiv_https___arxiv_org_abs_2406_17276
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle OPT-Tree: Speculative Decoding with Adaptive Draft Tree Structure
Wang, Jikai
Su, Yi
Li, Juntao
Xia, Qingrong
Ye, Zi
Duan, Xinyu
Wang, Zhefeng
Zhang, Min
Computation and Language
Autoregressive language models demonstrate excellent performance in various scenarios. However, the inference efficiency is limited by its one-step-one-word generation mode, which has become a pressing problem recently as the models become increasingly larger. Speculative decoding employs a "draft and then verify" mechanism to allow multiple tokens to be generated in one step, realizing lossless acceleration. Existing methods mainly adopt fixed heuristic draft structures, which fail to adapt to different situations to maximize the acceptance length during verification. To alleviate this dilemma, we proposed OPT-Tree, an algorithm to construct adaptive and scalable draft trees. It searches the optimal tree structure that maximizes the mathematical expectation of the acceptance length in each decoding step. Experimental results reveal that OPT-Tree outperforms the existing draft structures and achieves a speed-up ratio of up to 3.2 compared with autoregressive decoding. If the draft model is powerful enough and the node budget is sufficient, it can generate more than ten tokens in a single step. Our code is available at https://github.com/Jikai0Wang/OPT-Tree.
title OPT-Tree: Speculative Decoding with Adaptive Draft Tree Structure
topic Computation and Language
url https://arxiv.org/abs/2406.17276