EARN:基于寄存器令牌的LLM生成式推荐高效推理加速
EARN: Efficient Inference Acceleration for LLM-based Generative Recommendation by Register Tokens
AI总结:
本文提出EARN框架,通过在输入序列边界引入寄存器令牌,利用LLMRec早期层压缩信息并在后续层仅关注这些令牌,实现高达3.79倍加速和80.8%的KV Cache缩减,同时提升准确率。
摘要:
基于大语言模型的生成式推荐(LLMRec)取得了显著成功,但由于巨大的计算开销和KV Cache的内存压力,其推理延迟较高。现有的KV Cache缩减方法存在关键局限:鉴于推荐任务的解码步骤较短,缓存压缩提供的加速微乎其微;而提示压缩则有丢失重要交互历史的风险。通过对LLMRec中注意力模式的系统分析,我们发现了两个关键洞察:1)逐层注意力稀疏性反转,即早期层保留密集的信息模式,而后期层表现出高度冗余;2)双重注意力沉槽现象,即注意力分数集中在输入序列的头部和尾部令牌上。受这些洞察启发,我们提出了EARN,这是一个高效的推理框架,它利用早期层将信息压缩到放置在输入序列边界的寄存器令牌中,然后在后续层中仅关注这些令牌。在三个数据集、两种LLMRec方法和两种LLM架构上的大量实验证明了EARN的优越性,实现了高达3.79倍的加速和80.8%的KV Cache缩减,且准确率优于一般微调方法。我们的工作弥合了LLMRec中的效率与有效性差距,为工业场景提供了实际的部署优势。
英文摘要:
Large Language Model-based generative recommendation (LLMRec) has achieved notable success, but it suffers from high inference latency due to massive computational overhead and memory pressure of KV Cache. Existing KV Cache reduction methods face critical limitations: cache compression offers marginal acceleration given recommendation tasks' short decoding steps, while prompt compression risks discarding vital interaction history. Through systematic analysis of attention patterns in LLMRec, we uncover two pivotal insights: 1) layer-wise attention sparsity inversion where early layers retain dense informative patterns while later layers exhibit high redundancy, and 2) dual attention sinks phenomenon where attention scores concentrate on both head and tail tokens of input sequences. Motivated by these insights, we propose EARN, an efficient inference framework that leverages the early layers to compress information into register tokens placed at the input sequence boundaries, then focuses solely on these tokens in the subsequent layers. Extensive experiments on three datasets, two LLMRec methods and two LLM architectures demonstrate EARN's superiority, achieving up to 3.79x speedup and 80.8% KV Cache reduction with better accuracy than the general finetuning approach. Our work bridges the efficiency-effectiveness gap in LLMRec, offering practical deployment advantages for industrial scenarios.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。