arXiv:2411.04975cs.CLcs.AI2024-11NeurIPS被引 29

针对智能体任务的重复性,用后缀树加速大模型推理。

SuffixDecoding: Extreme Speculative Decoding for Emerging AI Applications

  • 用后缀树缓存提示和输出,动态预测更多或更少令牌。
  • 在智能体基准上最高提速5.3倍,优于现有方法。
  • 适合长序列重复任务,如多智能体协作与自优化循环。

推测解码广泛用于降低大语言模型推理延迟,通过较小的草稿模型处理多样用户任务。然而,新兴的AI应用(如基于大模型的智能体)具有独特工作负载特征:并非多样独立请求,而是重复性推理任务,例如多智能体管道执行相似子任务或自优化循环反复提升输出。这类任务生成长且高度可预测的序列,现有推测解码方法未能有效利用。为此,我们提出 extit{SuffixDecoding},一种利用高效后缀树缓存提示及先前输出中的长标记序列的新方法。通过在接受概率高时自适应推测更多标记,低时减少推测,该方法在机会充足时实现更长推测,计算受限时节约资源。在包含SWE-Bench和Text-to-SQL在内的智能体基准上的评估显示,SuffixDecoding 最高实现5.3×加速,显著优于当前最先进方法——比EAGLE-2/3等基于模型的方法快2.8×,比无模型方法如Token Recycling快1.9×。代码已开源:https://github.com/snowflakedb/ArcticInference。

原文摘要 · Abstract (English)

Speculative decoding is widely adopted to reduce latency in large language model (LLM) inference by leveraging smaller draft models capable of handling diverse user tasks. However, emerging AI applications, such as LLM-based agents, present unique workload characteristics: instead of diverse independent requests, agentic frameworks typically submit repetitive inference requests, such as multi-agent pipelines performing similar subtasks or self-refinement loops iteratively enhancing outputs. These workloads result in long and highly predictable sequences, which current speculative decoding methods do not effectively exploit. To address this gap, we introduce \emph{SuffixDecoding}, a novel method that utilizes efficient suffix trees to cache long token sequences from prompts and previous outputs. By adaptively speculating more tokens when acceptance likelihood is high and fewer when it is low, SuffixDecoding effectively exploits opportunities for longer speculations while conserving computation when those opportunities are limited. Evaluations on agentic benchmarks, including SWE-Bench and Text-to-SQL, demonstrate that SuffixDecoding achieves speedups of up to 5.3$\times$, outperforming state-of-the-art methods -- 2.8$\times$ faster than model-based approaches like EAGLE-2/3 and 1.9$\times$ faster than model-free approaches such as Token Recycling. SuffixDecoding is open-sourced at https://github.com/snowflakedb/ArcticInference

推理加速智能体后缀树

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。