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

SpecPilot:用于投机解码的自主算法发现与系统优化

SpecPilot: Autonomous Algorithm Discovery and Systems Optimization for Speculative Decoding

University of California, Berkeley(加州大学伯克利分校);Princeton University(普林斯顿大学);Stanford University(斯坦福大学);NVIDIA(英伟达)

Kunjun Li, Wenhao Chai, Yihao Liang, Yuezhou Hu, Shuyao Xu, Yi Pan, William X. Zheng, Kannan Ramchandran, Kurt Keutzer, Jiantao Jiao

AI总结:

本研究针对投机解码现有系统未达并行草稿全部加速效果的问题,提出自主智能体循环SpecPilot,发现多项优化方案,大幅提升了单请求与批处理场景下的解码加速比。

摘要:

投机解码通过轻量级草稿模型加速内存受限的大语言模型(LLM)解码,而并行草稿模型通过一次前向传播生成整个块的草稿来进一步提升该速度。然而,目前尚不清楚现有已发布的系统(stock)是否达到了并行草稿所能允许的全部加速效果。我们确定了三大挑战:第一,对于单个请求,每一步仅接受少量token,但需要读取所有目标模型权重;第二,在批处理场景下,每个请求的验证工作大致将其与自回归(AR)解码的加速效果减半;第三,投机解码具有部署特异性,不存在适用于所有服务场景、草稿模型、目标模型和GPU的通用优化方案。为解决这些挑战,我们提出了SpecPilot,这是一种自主智能体循环,可为每个部署场景发现算法和系统优化方案。在每一轮中,成本模型会定位当前系统与其性能上限之间的最大差距;并行智能体探索优化方向并整合成功的方案;token强制机制会将每个输出token与stock系统进行比对,以检测奖励黑客行为;结构化内存则会将经过验证的机制传递到后续轮次和部署场景。SpecPilot发现了一种通用的无损12位权重格式、针对混合循环目标的树状验证机制、两级验证方案以及三种批处理机制。我们在四个目标模型、三个草稿模型、两个GPU平台和五个基准测试上对其进行了评估。在无训练且无质量损失的情况下,它将单个请求场景下与AR解码的加速比从stock系统的4.46×提升至10.87×,将批处理场景下的加速比从1.94×提升至3.93×。

英文摘要:

Speculative decoding accelerates memory-bound LLM decoding with a lightweight drafter, and parallel drafters extend this speedup by drafting a whole block in one forward pass. However, it remains unclear whether their released systems (stock) attain the full speedup that parallel drafting permits. We identify three challenges. First, with one request, each step accepts few tokens but reads every target weight. Second, with batching, per-request verification work roughly halves the speedup over autoregressive (AR) decoding. Third, speculative decoding is deployment-specific, and no universal optimization fits every serving regime, drafter, target model and GPU. To address these challenges, we present SpecPilot, an autonomous agentic loop that discovers algorithms and systems optimizations for each deployment. In each round, a cost model locates the largest gaps between the current system and its ceiling. Parallel agents explore directions and integrate the successful ones. Token forcing checks every output token against stock to detect reward hacking. A structured memory carries validated mechanisms to new rounds and deployments. SpecPilot discovered a general lossless 12-bit weight format, tree verification for hybrid recurrent targets, two-level verification and three batching mechanisms. We evaluate it across four target models, three drafters, two GPU platforms and five benchmarks. Without training or quality loss, it raises the speedup over AR from stock's 4.46$\times$ to 10.87$\times$ with one request, and from 1.94$\times$ to 3.93$\times$ with batching.

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

相关深度报道

↑