arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.05165cs.IRcs.CL
收藏

基于大语言模型的生成式推荐的高效推理

Efficient Inference for Large Language Model-based Generative Recommendation

National University of Singapore(新加坡国立大学);Tsinghua University(清华大学);University of Science and Technology of China(中国科学技术大学);The Hong Kong Polytechnic University(香港理工大学)

Xinyu Lin, Chaoqun Yang, Wenjie Wang, Yongqi Li, Cunxiao Du, Fuli Feng, See-Kiong Ng, Tat-Seng Chua

AI总结:

针对基于大语言模型的生成式推荐推理延迟高的问题,提出AtSpeed框架,通过优化草稿模型与目标模型的对齐并放宽验证策略,实现了近2倍至2.5倍的加速。

摘要:

基于大语言模型(LLM)的生成式推荐已取得显著成功,然而其实际部署成本高昂,尤其是由于自回归解码导致的过度推理延迟。为了实现无损的LLM解码加速,投机解码(SD)已成为一种有前景的解决方案。然而,将SD应用于生成式推荐面临独特挑战,因为需要通过束搜索生成Top-K项(即K个不同的令牌序列)作为推荐列表。这导致SD中的验证更加严格,要求目标LLM的所有Top-K序列在每个解码步骤中都必须由草稿模型成功草拟。为缓解此问题,我们考虑1)提升草稿模型与目标LLM之间的Top-K序列对齐,以及2)放宽验证策略以减少无关紧要的LLM调用。为此,我们提出了一个名为AtSpeed的对齐框架,该框架在严格Top-K验证下提出了用于Top-K对齐的AtSpeed-S优化目标。此外,我们引入了一种宽松的采样验证策略,允许高概率的非Top-K草拟序列被接受,从而显著减少LLM调用。相应地,我们提出了AtSpeed-R用于在这种宽松采样验证下的Top-K对齐。在两个真实世界数据集上的实验结果表明,AtSpeed显著加速了基于LLM的生成式推荐,例如在严格Top-K验证下实现了近2倍加速,在宽松采样验证下实现了高达2.5倍的加速。代码和数据集已在https://github.com/Linxyhaha/AtSpeed发布。

英文摘要:

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.

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

↑