우로보로스: 대형 모델 강화 드래프팅을 통한 추론적 디코딩
Ouroboros: Speculative Decoding with Large Model Enhanced Drafting
February 21, 2024
저자: Weilin Zhao, Yuxiang Huang, Xu Han, Chaojun Xiao, Zhiyuan Liu, Maosong Sun
cs.AI
초록
드래프트-후-검증(Speculative Decoding)과 같은 디코딩 방법은 대규모 언어 모델(LLM)의 추론 속도를 가속화하기 위해 널리 채택된 학습 없는 방법이다. 이러한 방법은 토큰을 순차적으로 디코딩하는 자기회귀적 프로세스를 사용하는 대신, 효율적인 소형 모델을 사용하여 초안을 먼저 생성한다. 이후 LLM은 비자기회귀 방식으로 검증 및 수정을 수행하여 시간 오버헤드를 최소화한다. 더 긴 초안을 생성하면 검증 후 더 큰 속도 향상을 기대할 수 있지만, 실패할 경우 상당한 시행착오 비용이 발생한다. 기존 디코딩 방법은 높은 검증 실패 확률로 인해 한 번에 너무 많은 내용을 초안으로 생성하여 검증할 수 없어, 최적의 추론 가속을 달성하지 못한다. 본 논문에서는 Ouroboros를 소개한다. Ouroboros는 LLM의 검증 과정에서 구문 후보 풀을 구성하여 소형 모델의 초안 생성을 위한 후보를 제공한다. 이를 통해 Ouroboros는 초기 초안의 효율성과 효과를 더욱 향상시킬 수 있다. 일반적인 텍스트 생성 작업에 대한 실험 결과, Ouroboros는 Lookahead Decoding 및 Speculative Decoding에 비해 각각 최대 1.9배 및 2.8배의 속도 향상을 달성했다. Ouroboros의 소스 코드는 https://github.com/thunlp/Ouroboros에서 확인할 수 있다.
English
Drafting-then-verifying decoding methods such as speculative decoding are
widely adopted training-free methods to accelerate the inference of large
language models (LLMs). Instead of employing an autoregressive process to
decode tokens sequentially, speculative decoding initially creates drafts with
an efficient small model. Then LLMs are required to conduct verification and
correction in a non-autoregressive fashion to minimize time overhead.
Generating longer drafts can lead to even more significant speedups once
verified, but also incurs substantial trial and error costs if it fails.
Suffering from the high verification failure probability, existing decoding
methods cannot draft too much content for verification at one time, achieving
sub-optimal inference acceleration. In this paper, we introduce Ouroboros,
which constructs a phrase candidate pool from the verification process of LLMs
to provide candidates for draft generation of the small model. Thereby,
Ouroboros can further improve the efficiency and effectiveness of the initial
drafts. The experimental results on typical text generation tasks show that
Ouroboros achieves speedups of up to 1.9x and 2.8x compared to lookahead
decoding and speculative decoding, respectively. The source code of Ouroboros
is available at https://github.com/thunlp/Ouroboros.