一句话:提出 SpecInfer,用小型模型生成 token 树,并通过树形并行解码在 LLM 上验证,从而加速 LLM 服务并保持质量。
生成式大语言模型服务通常因逐 token 自回归解码而面临高延迟与高计算开销。SpecInfer 的核心思想是利用小型推测模型预测 LLM 的输出,并将预测组织为 token 树:树的每个节点表示一个候选 token 序列。系统使用一种新颖的树形并行解码机制,在 LLM 上并行验证 token 树中所有候选序列的正确性。与将 LLM 用作增量解码器不同,SpecInfer 将 LLM 用作 token 树验证器,从而显著降低端到端延迟与计算需求,并可证明地保持模型质量。评估表明,SpecInfer 在分布式 LLM 推理中比现有服务系统快 1.5–2.8 倍,在基于 offloading 的推理中快 2.6–3.5 倍,且生成性能不变。
This paper introduces SpecInfer, a system that accelerates generative large language model (LLM) serving with tree-based speculative inference and verification. The key idea behind SpecInfer is leveraging small speculative models to predict the LLM's outputs; the predictions are organized as a token tree, whose nodes each represent a candidate token sequence. The correctness of all candidate token sequences represented by a token tree is verified against the LLM in parallel using a novel tree-based parallel decoding mechanism. SpecInfer uses an LLM as a token tree verifier instead of an incremental decoder, which significantly reduces the end-to-end latency and computational requirement for serving generative LLMs while provably preserving model quality. Our evaluation shows that SpecInfer outperforms existing LLM serving systems by 1.5-2.8× for distributed LLM inference and by 2.6-3.5× for offloading-based LLM inference, while preserving the same generative performance. SpecInfer is publicly available at https://github.com/flexflow/FlexFlow/
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{MiaoOZCWZWZYSSC24,
title = {SpecInfer: Accelerating Large Language Model Serving with Tree-based Speculative Inference and Verification},
author = {Xupeng Miao and Gabriele Oliaro and Zhihao Zhang and Xinhao Cheng and Zeyu Wang and Zhengxin Zhang and Rae Ying Yee Wong and Alan Zhu and Lijie Yang and Xiaoxiang Shi and Chunan Shi and Zhuoming Chen and Daiyaan Arfeen and Reyna Abhyankar and Zhihao Jia},
booktitle = {ASPLOS},
year = {2024},
doi = {10.1145/3620666.3651335}
}