用轻量验证器预测生成质量,减少大模型调用次数,加速推理。
Speeding up Speculative Decoding via Sequential Approximate Verification
- 用小模型训练验证器,逐个预测草案令牌是否通过。
- 相比原方法减少70%以上的大模型调用,延迟降低45%~60%。
- 适合追求低延迟的部署场景,如实时对话系统。
推测解码(Speculative Decoding, SD)是一种用于加速大语言模型(LLM)推理的新技术。其核心是使用较小的草案模型自回归生成一组标记,并由较大的目标模型并行验证其统计一致性。然而,周期性地调用目标模型进行验证限制了进一步的延迟降低。我们提出SPRINTER,采用一个低复杂度的验证器,训练其预测草案模型生成的标记是否会被目标模型接受。通过顺序近似验证,SPRINTER无需对每个标记都调用目标模型,仅在标记被判定为不可接受时才触发。这显著减少了对大模型的调用次数,实现更低延迟与更少计算开销。我们对SPRINTER进行了理论分析,研究生成标记的统计特性及验证器性能对期望延迟的影响。在多个数据集和模型组合上的评估表明,近似验证仍可保持高质量生成,同时进一步降低延迟。
原文摘要 · Abstract (English)
Speculative Decoding (SD) is a recently proposed technique for faster inference using Large Language Models (LLMs). SD operates by using a smaller draft LLM for autoregressively generating a sequence of tokens and a larger target LLM for parallel verification to ensure statistical consistency. However, periodic parallel calls to the target LLM for verification prevent SD from achieving even lower latencies. We propose SPRINTER, which utilizes a low-complexity verifier trained to predict if tokens generated from a draft LLM would be accepted by the target LLM. By performing sequential approximate verification, SPRINTER does not require verification by the target LLM and is only invoked when a token is deemed unacceptable. This reduces the number of calls to the larger LLM, achieving further speedups and lower computation cost. We present a theoretical analysis of SPRINTER, examining the statistical properties of the generated tokens, as well as the expected reduction in latency as a function of the verifier. We evaluate SPRINTER on several datasets and model pairs, demonstrating that approximate verification can still maintain high quality generation while further reducing latency.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。