ChatPaper.aiChatPaper

BanditSpec: 밴딧 알고리즘을 통한 적응형 스펙큘레이티브 디코딩

BanditSpec: Adaptive Speculative Decoding via Bandit Algorithms

May 21, 2025
저자: Yunlong Hou, Fengzhuo Zhang, Cunxiao Du, Xuan Zhang, Jiachun Pan, Tianyu Pang, Chao Du, Vincent Y. F. Tan, Zhuoran Yang
cs.AI

초록

추론적 디코딩(Speculative Decoding)은 대규모 언어 모델(LLMs)의 우수한 텍스트 생성 성능을 유지하면서 추론 속도를 가속화하기 위한 인기 있는 방법으로 부상하고 있다. 기존 방법들은 접두사 토큰에 관계없이 고정된 추론적 디코딩 구성을 채택하거나, 오프라인 또는 온라인 방식으로 드래프트 모델을 훈련하여 컨텍스트와 일치시키는 방식을 사용했다. 본 논문에서는 텍스트가 생성되는 과정에서 추론적 디코딩의 하이퍼파라미터 구성을 적응적으로 선택할 수 있는 훈련이 필요 없는 온라인 학습 프레임워크를 제안한다. 먼저, 이 하이퍼파라미터 선택 문제를 다중 슬롯 머신(Multi-Armed Bandit) 문제로 공식화하고, 일반적인 추론적 디코딩 프레임워크인 BanditSpec을 제시한다. 더 나아가, 두 가지 밴딧 기반 하이퍼파라미터 선택 알고리즘인 UCBSpec과 EXP3Spec을 설계하고, 새로운 개념인 정지 시간 후회(stopping time regret)를 기준으로 분석한다. 이 후회는 확률적 및 적대적 보상 설정 하에서 상한이 도출된다. 정보 이론적 불가능성 결과를 도출함으로써, UCBSpec의 후회 성능이 보편적 상수 범위 내에서 최적임을 보인다. 마지막으로, LLaMA3과 Qwen2를 사용한 광범위한 실험을 통해 제안된 알고리즘이 기존 방법에 비해 효과적이며, 다양한 입력 프롬프트가 주어진 실제 LLM 서비스 시나리오에서 처리량이 오라클 최적 하이퍼파라미터에 근접함을 입증한다.
English
Speculative decoding has emerged as a popular method to accelerate the inference of Large Language Models (LLMs) while retaining their superior text generation performance. Previous methods either adopt a fixed speculative decoding configuration regardless of the prefix tokens, or train draft models in an offline or online manner to align them with the context. This paper proposes a training-free online learning framework to adaptively choose the configuration of the hyperparameters for speculative decoding as text is being generated. We first formulate this hyperparameter selection problem as a Multi-Armed Bandit problem and provide a general speculative decoding framework BanditSpec. Furthermore, two bandit-based hyperparameter selection algorithms, UCBSpec and EXP3Spec, are designed and analyzed in terms of a novel quantity, the stopping time regret. We upper bound this regret under both stochastic and adversarial reward settings. By deriving an information-theoretic impossibility result, it is shown that the regret performance of UCBSpec is optimal up to universal constants. Finally, extensive empirical experiments with LLaMA3 and Qwen2 demonstrate that our algorithms are effective compared to existing methods, and the throughput is close to the oracle best hyperparameter in simulated real-life LLM serving scenarios with diverse input prompts.

Summary

AI-Generated Summary

PDF12May 22, 2025