Skip to main content
QUICK REVIEW

[Paper 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 Science3 citations
TL;DR

SLMRec proposes a knowledge distillation approach to transfer knowledge from large language models (LLMs) to small language models (SLMs) for sequential recommendation, achieving competitive performance with only 13% of the parameters and up to 8.0x faster inference. It leverages intermediate-layer representations and is compatible with quantization and pruning for further efficiency gains.

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.

Motivation & Objective

  • To investigate whether large language models (LLMs) are necessary for sequential recommendation, especially regarding model size and parameter scaling.
  • To address the inefficiency and impracticality of deploying large LLMs in real-world platforms processing billions of daily traffic logs.
  • To explore the redundancy of intermediate layers in LLMs for sequential recommendation tasks.
  • To develop a lightweight, efficient, and high-performing sequential recommender using small language models (SLMs) via knowledge distillation.
  • To ensure compatibility with existing efficiency techniques like quantization and pruning for further optimization.

Proposed method

  • Employs vanilla knowledge distillation to transfer representation knowledge from a large teacher LLM to a smaller student SLM.
  • Focuses on distilling knowledge from intermediate layers of the LLM, identifying that these layers contain the most useful representations for recommendation.
  • Uses multiple supervision signals to guide the student model in learning task-aware representations within its hidden states.
  • Applies a layer-skipping strategy to selectively transfer knowledge from the most informative layers of the teacher model.
  • Integrates with parameter-efficient fine-tuning (PEFT) techniques like LoRA to reduce memory and computation costs during distillation.
  • Removes the need for architectural modifications in the student model, making it orthogonal and composable with other efficiency techniques.

Experimental results

Research questions

  • RQ1How does the performance of LLM-based sequential recommendation vary with model size, and at what point does scaling yield diminishing returns?
  • RQ2Which layers of a pre-trained LLM contain the most relevant knowledge for sequential recommendation tasks?
  • RQ3Can a small language model achieve competitive performance by distilling knowledge from a large LLM, without architectural modifications?
  • RQ4To what extent can knowledge distillation reduce model size and inference time while preserving recommendation accuracy?
  • RQ5How compatible is the proposed distillation method with existing model compression techniques like quantization and pruning?

Key findings

  • The performance gain from increasing LLM parameters in sequential recommendation is not consistent, with diminishing returns observed beyond a certain point.
  • A significant portion of intermediate layers in LLMs are redundant for sequential recommendation, suggesting that only a subset of layers contributes meaningfully to downstream performance.
  • SLMRec achieves performance comparable to LLM-based models using only 13% of the parameters, demonstrating that smaller models can match larger ones when knowledge is effectively distilled.
  • SLMRec achieves up to 6.6x speedup in training time and 8.0x speedup in inference time compared to LLM-based baselines.
  • The method remains effective even with online knowledge distillation, showing robustness and adaptability to dynamic data.
  • SLMRec is fully compatible with quantization and pruning, enabling further compression and acceleration without performance degradation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.