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

Yuhui Li, Fangyun Wei, Chao Zhang, Hongyang Zhang

arXiv:2406.16858 · 2026-07-27 공개 · arXiv · PDF

language-models llm-inference context-aware draft-model speculative-sampling speedup-ratio dynamic-draft-tree eagle-2

Abstract

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 of up to **5x**, which is 1.3x that of EAGLE. EAGLE-2 also ensures that the distribution of the generated text remains unchanged, making it a **lossless** acceleration algorithm.

한국어 요약

한 줄 요약

EAGLE-2는 EAGLE 기반으로, 컨텍스트에 따라 동적으로 드래프트 트리 구조를 조정하여 최대 5배의 속도 향상을 달성한 lossless 추론 가속 알고리즘이다.

핵심 기여도

핵심 아이디어

기존 EAGLE는 드래프트 토큰의 수용률이 위치에만 의존한다고 가정하고 **정적 드래프트 트리(static draft tree)**를 사용했으나, 본 연구는 수용률이 **컨텍스트에 따라 달라진다는 사실**을 발견했다. 이에 따라 EAGLE-2는 드래프트 모델의 **confidence score**를 수용률의 근사치로 활용하여, 컨텍스트에 따라 드래프트 트리 구조를 **동적으로 조정**하는 기법을 제안한다. 이는 추가적인 모델 학습 없이도, 기존 EAGLE의 드래프트 모델을 기반으로 동작하므로 **실용성과 신뢰성**을 동시에 확보한다.

기술적 접근법

주요 결과

의의 및 한계

EAGLE-2는 기존 추론 가속 방법 중 가장 빠른 속도를 달성하면서도, 생성 텍스트의 분포를 완전히 유지하는 **lossless 알고리즘**이라는 점에서 학술적·실용적 가치가 크다. 또한, 추가적인 모델 학습 없이 기존 드래프트 모델을 활용하므로, **즉시 적용 가능한 솔루션**으로서의 장점이 있다. 다만, EAGLE-2는 드래프트 모델의 confidence score가 수용률을 잘 근사하는 경우에만 효과적이며, 이 가정이 성립하지 않는 상황에서는 성능이 저하될 수 있다.

실용적 활용

EAGLE-2는 대규모 언어 모델 기반의 **대화형 서비스, 코드 생성, 수학적 추론, 질문 응답** 등 다양한 실시간 추론 시스템에 적용 가능하다. 특히, **ChatGPT와 유사한 대화형 모델**에서 MT-bench와 같은 실제 대화 데이터셋에서 뛰어난 성능을 보였으므로, **대화형 AI 서비스의 추론 지연 감소**에 유용하게 활용될 수 있다.