EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Li, Yuhui, Wei, Fangyun, Zhang, Chao, Zhang, Hongyang
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910507403837440
author Li, Yuhui
Wei, Fangyun
Zhang, Chao
Zhang, Hongyang
author_facet Li, Yuhui
Wei, Fangyun
Zhang, Chao
Zhang, Hongyang
contents Inference with modern Large Language Models (LLMs) is expensive and time-consuming, and speculative sampling has proven to be an effective solution. Most speculative sampling methods such as EAGLE use a static draft tree, implicitly assuming that the acceptance rate of draft tokens depends only on their position. Interestingly, we found that the acceptance rate of draft tokens is also context-dependent. In this paper, building upon EAGLE, we propose EAGLE-2, which introduces a new technique of context-aware dynamic draft tree into drafting modeling. This improvement leverages the fact that the draft model of EAGLE is well-calibrated: the confidence scores from the draft model approximate acceptance rates with small errors. We conducted extensive evaluations on three series of LLMs and six tasks, with EAGLE-2 achieving speedup ratios 3.05x-4.26x, which is 20%-40% faster than EAGLE-1. EAGLE-2 also ensures that the distribution of the generated text remains unchanged, making it a lossless acceleration algorithm.
format Preprint
id arxiv_https___arxiv_org_abs_2406_16858
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees
Li, Yuhui
Wei, Fangyun
Zhang, Chao
Zhang, Hongyang
Computation and Language
Machine Learning
Inference with modern Large Language Models (LLMs) is expensive and time-consuming, and speculative sampling has proven to be an effective solution. Most speculative sampling methods such as EAGLE use a static draft tree, implicitly assuming that the acceptance rate of draft tokens depends only on their position. Interestingly, we found that the acceptance rate of draft tokens is also context-dependent. In this paper, building upon EAGLE, we propose EAGLE-2, which introduces a new technique of context-aware dynamic draft tree into drafting modeling. This improvement leverages the fact that the draft model of EAGLE is well-calibrated: the confidence scores from the draft model approximate acceptance rates with small errors. We conducted extensive evaluations on three series of LLMs and six tasks, with EAGLE-2 achieving speedup ratios 3.05x-4.26x, which is 20%-40% faster than EAGLE-1. EAGLE-2 also ensures that the distribution of the generated text remains unchanged, making it a lossless acceleration algorithm.
title EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2406.16858