TL;DR
This paper tackles the prohibitive deployment cost of Large Language Models (LLMs) in recommendation systems by introducing PruneRec, a novel three-stage pruning pipeline. PruneRec effectively reduces LLM parameters by over 95% (excluding embeddings) while retaining 88% of the original recommendation performance, making LLM-powered recommendations more practical.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown immense promise in enhancing recommender systems by leveraging their vast world knowledge and reasoning capabilities. However, their enormous size, characterized by billions of parameters, leads to substantial computational and memory overhead, posing a significant barrier to real-world deployment. Existing approaches to reduce this burden, such as knowledge distillation to smaller models or simple layer-wise pruning, either suffer from a capacity gap or overlook crucial redundancies within the LLM's internal components. This paper aims to bridge this gap by proposing a more sophisticated pruning strategy that targets both inter-layer and, importantly, intra-layer redundancies within LLMs specifically adapted for recommendation tasks.
Methods
The core of this work is the PruneRec pipeline, an iterative "prune-and-restore" approach designed to progressively reduce LLM parameters while preserving recommendation quality. It consists of three stages:
- Stage I: Width Pruning (Intra-layer): This stage focuses on reducing the model's dimensionality by pruning attention heads and embedding dimensions.
- Self-Attention Module: Pruning is guided by a novel importance score that combines layer-wise and recursive importance estimation, considering the influence of attention heads across layers. This is achieved by measuring the KL divergence between original and perturbed outputs when an attention head is suppressed.
- Embedding Layer: Importance is determined by a combination of embedding weight magnitudes and their gradients, targeting less relevant vocabulary tokens.
- Stage II: MLP Pruning (Intra-layer): This stage addresses redundancy within the Multi-Layer Perceptron (MLP) layers. It identifies and retains only the top-K most frequently activated intermediate dimensions based on a thresholding mechanism, effectively pruning less impactful dimensions.
- Stage III: Layer Pruning (Inter-layer): This stage tackles redundancy across layers by evaluating the impact of removing each layer on the model's perplexity. Layers that cause a larger increase in perplexity are deemed more important and are retained.
Crucially, after each pruning stage, a performance restoration step is employed using knowledge distillation. The pruned model acts as the student, learning from the original, unpruned model (teacher) by minimizing a combined loss of KL divergence between their output logits and cross-entropy with ground-truth labels. This iterative refinement helps recover performance and prepares the model for the next pruning stage.
Datasets
The experiments were conducted on three publicly available Amazon datasets: Video Games, Sports, and CDs. These datasets were preprocessed by retaining users with at least five interactions, capping histories to 10 entries, and splitting them chronologically into training, validation, and test sets (8:1:1 ratio).
Key Insights and Ideas
- Intra-layer Redundancy is Key: Beyond the well-known inter-layer redundancy, LLMs adapted for recommendation exhibit significant redundancy within components like self-attention and MLP layers. This is a critical insight that existing pruning methods often overlook.
- Iterative Pruning and Restoration is Crucial: A single-step pruning approach can lead to model collapse. PruneRec's iterative strategy, combined with performance restoration via distillation after each stage, allows for a more controlled and effective reduction of parameters.
- Task-Specific Pruning Matters: General LLM pruning techniques (like WANDA) perform poorly when applied to recommendation tasks, highlighting the need for specialized approaches that consider the unique requirements of recommendation.
- Moderate Pruning is Optimal: Aggressively pruning parameters can harm performance. The paper demonstrates that there's an optimal balance, and excessive pruning can be detrimental.
Key Results
- PruneRec achieves an impressive 95% reduction in non-embedding parameters while retaining 88% of the original model's performance on average across three datasets.
- The method outperforms traditional recommender systems and other LLM-based approaches (like DLLM2Rec and SLMRec) in terms of both performance and parameter efficiency.
- The three-stage pruning strategy effectively reduces parameter count at each step, with attention pruning reducing parameters by ~83% and MLP pruning further reducing them significantly.
- The importance estimation for attention heads, which considers cross-layer influences, is shown to be more effective than global or layer-only importance estimation.
Limitations and Future Work
- Embedding Parameters Excluded: The reported parameter reduction (95%) excludes embedding parameters, which can still be substantial. Future work could explore more efficient ways to handle embeddings.
- Generalizability of Pruning Strategies: While PruneRec is tailored for recommendation, further research could explore its adaptability to other downstream tasks.
- Hyperparameter Sensitivity: The performance restoration step involves balancing KL divergence and cross-entropy losses, and the optimal balance might vary across different models and datasets.
- Computational Cost of Pruning: While the goal is to reduce deployment cost, the pruning process itself can be computationally intensive. Future work could focus on more efficient pruning algorithms.
Summary updated