提出AtSpeed框架,让大模型推荐生成更快更省资源。
Efficient Inference for Large Language Model-based Generative Recommendation
- 用对齐优化提升草稿模型与目标模型的推荐序列匹配度
- 在严格验证下提速近2倍,宽松验证下最高达2.5倍
- 适合需要高效部署生成式推荐系统的研发人员
基于大语言模型的生成式推荐已取得显著成效,但其实际部署成本高,主要源于自回归解码带来的过长推理延迟。针对无损加速问题,推测解码(Speculative Decoding, SD)成为有前景的解决方案。然而,将SD应用于生成式推荐面临独特挑战:需通过束搜索生成前K个独立标记序列作为推荐列表,导致在每一步解码中必须确保目标LLM的全部前K序列均被草稿模型成功生成,验证要求更为严苛。为此,本文提出两种优化策略:1)增强草稿模型与目标模型在前K序列上的对齐能力;2)放宽验证策略以减少不必要的LLM调用。为此,我们提出名为AtSpeed的对齐框架,包含AtSpeed-S(用于严格验证下的前K对齐优化)和AtSpeed-R(用于宽松采样验证下的前K对齐优化)。实证结果表明,在两个真实数据集上,AtSpeed显著加速了生成式推荐,例如在严格验证下接近2倍加速,在宽松采样验证下最高达2.5倍加速。代码与数据集已开源。
原文摘要 · Abstract (English)
Large Language Model (LLM)-based generative recommendation has achieved notable success, yet its practical deployment is costly particularly due to excessive inference latency caused by autoregressive decoding. For lossless LLM decoding acceleration, Speculative Decoding (SD) has emerged as a promising solution. However, applying SD to generative recommendation presents unique challenges due to the requirement of generating top-K items (i.e., K distinct token sequences) as a recommendation list by beam search. This leads to more stringent verification in SD, where all the top-K sequences from the target LLM must be successfully drafted by the draft model at each decoding step. To alleviate this, we consider 1) boosting top-K sequence alignment between the draft model and the target LLM, and 2) relaxing the verification strategy to reduce trivial LLM calls. To this end, we propose an alignment framework named AtSpeed, which presents the AtSpeed-S optimization objective for top-K alignment under the strict top-K verification. Moreover, we introduce a relaxed sampling verification strategy that allows high-probability non-top-K drafted sequences to be accepted, significantly reducing LLM calls. Correspondingly, we propose AtSpeed-R for top-K alignment under this relaxed sampling verification. Empirical results on two real-world datasets demonstrate that AtSpeed significantly accelerates LLM-based generative recommendation, e.g., near 2x speedup under strict top-K verification and up to 2.5x speedup under relaxed sampling verification. The codes and datasets are released at https://github.com/Linxyhaha/AtSpeed.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。