arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.08600cs.CL
收藏

自动任务检测与异构 LLM 推测解码

Automatic Task Detection and Heterogeneous LLM Speculative Decoding

Beijing Normal University(北京师范大学)

Danying Ge, Jianhua Gao, Qizhi Jiang, Yifei Feng, Weixing Ji

AI总结:

本文提出面向下游任务的异构 LLM 推测解码方法,通过自动任务划分分配、任务特定对齐及在线 prompt 路由,显著提升草稿准确率和推理速度。

摘要:

推测解码通过将草稿模型与目标模型相结合,已成为加速大型语言模型(LLM)推理的一种有效方法。然而,由于草稿模型能力有限,现有方法在下游任务中往往需要在接受率与解码速度之间进行权衡,因此难以在多样化任务中保证效率。为解决这一问题,我们提出了一种面向下游任务优化的推测解码算法。该算法包含自动任务划分与分配方法,可自动将下游任务归类为不同的子任务,并将其分配给一组异构草稿模型。每个草稿模型都使用任务特定数据与目标模型对齐,从而增强推理结果的一致性。此外,我们提出的方法还加入了一个在线轻量级 prompt 分类器,用于将 prompt 动态路由到合适的草稿模型。实验结果表明,与普通推测解码相比,所提方法将草稿准确率提高了 6% 至 50%,同时在 LLM 推理中实现了 1.10 倍至 2.64 倍的加速。

英文摘要:

Speculative decoding, which combines a draft model with a target model, has emerged as an effective approach to accelerate large language model (LLM) inference. However, existing methods often face a trade-off between the acceptance rate and decoding speed in downstream tasks due to the limited capacity of the draft model, making it difficult to ensure efficiency across diverse tasks. To address this problem, we propose a speculative decoding algorithm tailored for downstream task optimization. It includes an automatic task partitioning and assigning method, which automatically categorizes downstream tasks into different sub-tasks and assigns them to a set of heterogeneous draft models. Each draft model is aligned with the target model using task-specific data, thereby enhancing the consistency of inference results. In addition, our proposed method incorporates an online lightweight prompt classifier to dynamically route prompts to the appropriate draft model. Experimental results demonstrate that the proposed method improves draft accuracy by 6% to 50% over vanilla speculative decoding, while achieving a speedup of 1.10x to 2.64x in LLM inference.

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

↑