Skip to main content
QUICK REVIEW

[论文解读] SLMRec: Distilling Large Language Models into Small for Sequential Recommendation

Wujiang Xu, Wu, Qitian|arXiv (Cornell University)|May 28, 2024
Recommender Systems and TechniquesComputer Science被引用 3
一句话总结

SLMRec 提出了一种知识蒸馏方法,将大型语言模型(LLMs)的知识迁移至小型语言模型(SLMs)以实现序列推荐,仅使用13%的参数量即达到具有竞争力的性能,并实现最高8.0倍的推理加速。该方法利用中间层表征,并兼容量化与剪枝技术以进一步提升效率。

ABSTRACT

Sequential Recommendation (SR) task involves predicting the next item a user is likely to interact with, given their past interactions. The SR models examine the sequence of a user's actions to discern more complex behavioral patterns and temporal dynamics. Recent research demonstrates the great impact of LLMs on sequential recommendation systems, either viewing sequential recommendation as language modeling or serving as the backbone for user representation. Although these methods deliver outstanding performance, there is scant evidence of the necessity of a large language model and how large the language model is needed, especially in the sequential recommendation scene. Meanwhile, due to the huge size of LLMs, it is inefficient and impractical to apply a LLM-based model in real-world platforms that often need to process billions of traffic logs daily. In this paper, we explore the influence of LLMs' depth by conducting extensive experiments on large-scale industry datasets. Surprisingly, our motivational experiments reveal that most intermediate layers of LLMs are redundant, indicating that pruning the remaining layers can still maintain strong performance. Motivated by this insight, we empower small language models for SR, namely SLMRec, which adopt a simple yet effective knowledge distillation method. Moreover, SLMRec is orthogonal to other post-training efficiency techniques, such as quantization and pruning, so that they can be leveraged in combination. Comprehensive experimental results illustrate that the proposed SLMRec model attains the best performance using only 13% of the parameters found in LLM-based recommendation models while simultaneously achieving up to 6.6x and 8.0x speedups in training and inference time costs, respectively. Besides, we provide a theoretical justification for why small language models can perform comparably to large language models in SR.

研究动机与目标

  • 探究大型语言模型(LLMs)在序列推荐中是否必要,尤其关注模型大小与参数缩放的影响。
  • 解决在处理每日数十亿条流量日志的实际平台中部署大型 LLM 所面临的低效与不切实际的问题。
  • 探索 LLM 中间层在序列推荐任务中的冗余性。
  • 通过知识蒸馏,开发一种轻量化、高效且高性能的序列推荐模型,使用小型语言模型(SLMs)。
  • 确保与现有效率技术(如量化和剪枝)的兼容性,以实现进一步优化。

提出的方法

  • 采用原始知识蒸馏方法,将大型教师 LLM 的表征知识迁移至更小的学生 SLM。
  • 聚焦于从 LLM 的中间层蒸馏知识,识别出这些层包含对推荐任务最有用的表征。
  • 使用多种监督信号,引导学生模型在其隐藏状态中学习任务感知表征。
  • 采用层跳过策略,有选择性地从教师模型中最具信息量的层中转移知识。
  • 与参数高效微调(PEFT)技术(如 LoRA)集成,以在蒸馏过程中降低内存与计算成本。
  • 无需对学生的模型架构进行修改,使其与其它效率技术正交且可组合。

实验结果

研究问题

  • RQ1LLM 在序列推荐中的性能如何随模型大小变化?在何种情况下参数扩展会带来边际收益递减?
  • RQ2预训练 LLM 的哪些层包含对序列推荐任务最相关知识?
  • RQ3通过从大型 LLM 蒸馏知识,无需架构修改,小型语言模型能否实现具有竞争力的性能?
  • RQ4知识蒸馏在多大程度上可减少模型大小与推理时间,同时保持推荐准确率?
  • RQ5所提出的蒸馏方法与现有模型压缩技术(如量化和剪枝)的兼容性如何?

主要发现

  • 在序列推荐中,LLM 参数量增加带来的性能提升并不一致,超过某一临界点后即出现收益递减现象。
  • LLM 中相当一部分中间层对序列推荐任务是冗余的,表明仅少数层对下游性能有显著贡献。
  • SLMRec 仅使用13%的参数量,即可实现与基于 LLM 的模型相当的性能,证明当知识被有效蒸馏时,小型模型可与大型模型比肩。
  • 与基于 LLM 的基线相比,SLMRec 在训练时间上实现最高6.6倍的加速,在推理时间上实现最高8.0倍的加速。
  • 即使在在线知识蒸馏设置下,该方法依然有效,展现出对动态数据的鲁棒性与适应性。
  • SLMRec 与量化和剪枝技术完全兼容,可在不损失性能的前提下实现进一步压缩与加速。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。