arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.07680cs.LGcs.DC
收藏

SpecRouter:面向大语言模型多级推测解码的自适应路由

SpecRouter: Adaptive Routing for Multi-Level Speculative Decoding in Large Language Models

Xidian University(西安电子科技大学);Tsinghua University(清华大学)

Hang Wu, Jianian Zhu, Yinghui Li, Haojie Wang, Biao Hou, Jidong Zhai

AI总结:

针对 LLM 推理中静态模型选择难以适配请求复杂性与性能波动的问题,SpecRouter 通过实时反馈调度多级模型链、协同验证和同步 KV cache 管理来降低推测解码延迟。

摘要:

大语言模型(LLM)在推理质量与计算成本之间存在关键权衡:更大的模型提供更强能力,但会带来显著延迟,而较小的模型速度更快但能力较弱。现有服务策略通常采用固定模型规模或静态的两阶段推测解码,无法动态适应用户请求不断变化的复杂性或系统性能波动。本文介绍了 SpecRouter,这是一个新颖框架,将 LLM 推理重新构想为通过多级推测解码解决的自适应路由问题。SpecRouter 基于实时反馈动态构建并优化推理“路径”(模型链),以解决静态方法的局限性。我们的贡献有三方面:(1)一种自适应模型链调度机制,利用性能剖析(执行时间)和预测相似性指标(源自 token 分布散度),持续选择草稿模型与验证器模型的最优序列,从而最小化每个生成 token 的预测延迟。(2)一个多级协同验证框架,其中所选模型链内的中间模型可验证推测 token,从而减轻最终、最强大目标模型的验证负担。(3)一个同步状态管理系统,为链中异构模型提供高效、一致的 KV cache 处理,包括为多级推测所固有的异步批处理量身定制的精确、低开销回滚。初步实验证明了我们方法的有效性。

英文摘要:

Large Language Models (LLMs) present a critical trade-off between inference quality and computational cost: larger models offer superior capabilities but incur significant latency, while smaller models are faster but less powerful. Existing serving strategies often employ fixed model scales or static two-stage speculative decoding, failing to dynamically adapt to the varying complexities of user requests or fluctuations in system performance. This paper introduces \systemname{}, a novel framework that reimagines LLM inference as an adaptive routing problem solved through multi-level speculative decoding. \systemname{} dynamically constructs and optimizes inference "paths" (chains of models) based on real-time feedback, addressing the limitations of static approaches. Our contributions are threefold: (1) An \textbf{adaptive model chain scheduling} mechanism that leverages performance profiling (execution times) and predictive similarity metrics (derived from token distribution divergence) to continuously select the optimal sequence of draft and verifier models, minimizing predicted latency per generated token. (2) A \textbf{multi-level collaborative verification} framework where intermediate models within the selected chain can validate speculative tokens, reducing the verification burden on the final, most powerful target model. (3) A \textbf{synchronized state management} system providing efficient, consistent KV cache handling across heterogeneous models in the chain, including precise, low-overhead rollbacks tailored for asynchronous batch processing inherent in multi-level speculation. Preliminary experiments demonstrate the validity of our method.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑