arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.02620cs.DCcs.AI
收藏

FlowSpec: 基于流水线的连续推测解码用于高效分布式大语言模型推理

FlowSpec: Continuous Pipelined Speculative Decoding for Efficient Distributed LLM Inference

Department of Computer Science and Engineering, Southern University of Science and Technology(南方科技大学计算机科学与工程系);School of Computing, Montclair State University(蒙特克莱尔州立大学计算机学院);School of Computer Science and Engineering, Sun Yat-sen University(中山大学计算机科学与工程学院)

Xing Liu, Lizhuo Luo, Ming Tang, Chao Huang, Xu Chen

AI总结:

FlowSpec提出了一种基于流水线的树状推测解码框架,通过三个关键技术提升分布式大语言模型推理效率。

摘要:

分布式推理是一种使大型语言模型(LLMs)能够在网络边缘进行推理的有前景的方法。它将推理过程分布到多个设备上,以确保LLMs可以适应设备内存。近年来,基于流水线的方法有潜力并行化通信和计算,这有助于减少推理延迟。然而,当网络边缘的推理请求稀疏时,流水线通常处于低利用率状态,其收益会减少。为了在边缘实现高效的分布式LLM推理,我们提出了FlowSpec,一种基于流水线的树状推测解码框架。FlowSpec结合了三个关键机制来提高解码效率:1)基于分数的逐步验证优先处理更重要的草稿标记,以尽早接受令牌;2)高效的草稿管理,以修剪无效令牌,同时在验证过程中保持正确的因果关系;3)动态草稿扩展策略,以提供高质量的推测输入。这些技术协同工作,以增强流水线利用率和推测效率。我们评估了FlowSpec在真实世界测试床上与其他基线方法的性能。实验结果表明,我们提出的框架在各种模型和配置上显著提高了推理速度,比基线方法快1.37倍至1.73倍。我们的代码在https://github.com/Leosang-lx/FlowSpec#上公开可用。

英文摘要:

Distributed inference serves as a promising approach to enabling the inference of large language models (LLMs) at the network edge. It distributes the inference process to multiple devices to ensure that the LLMs can fit into the device memory. Recent pipeline-based approaches have the potential to parallelize communication and computation, which helps reduce inference latency. However, the benefit diminishes when the inference request at the network edge is sparse, where pipeline is typically at low utilization. To enable efficient distributed LLM inference at the edge, we propose \textbf{FlowSpec}, a pipeline-parallel tree-based speculative decoding framework. FlowSpec incorporates three key mechanisms to improve decoding efficiency: 1) score-based step-wise verification prioritizes more important draft tokens to bring earlier accepted tokens; 2) efficient draft management to prune invalid tokens while maintaining correct causal relationship during verification; 3) dynamic draft expansion strategies to supply high-quality speculative inputs. These techniques work in concert to enhance both pipeline utilization and speculative efficiency. We evaluate FlowSpec on a real-world testbed with other baselines. Experimental results demonstrate that our proposed framework significantly improves inference speed across diverse models and configurations, achieving speedup ratios 1.37$\times$-1.73$\times$ compared to baselines. Our code is publicly available at \href{https://github.com/Leosang-lx/FlowSpec#}{https://github.com/Leosang-lx/FlowSpec\#}.

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

↑