Finetuning Large Language Model for Personalized Ranking

Zhuoxi Bai, Ning Wu, Fengyu Cai, Xinyi Zhu, Yun XiongarXiv 2024

Abstract

Large Language Models (LLMs) have demonstrated remarkable performance across various domains, motivating researchers to investigate their potential use in recommendation systems. However, directly applying LLMs to recommendation tasks has proven challenging due to the significant disparity between the data used for pre-training LLMs and the specific requirements of recommendation tasks. In this study, we introduce Direct Multi-Preference Optimization (DMPO), a streamlined framework designed to bridge the gap and enhance the alignment of LLMs for recommendation tasks. DMPO enhances the performance of LLM-based recommenders by simultaneously maximizing the probability of positive samples and minimizing the probability of multiple negative samples. We conducted experimental evaluations to compare DMPO against traditional recommendation methods and other LLM-based recommendation approaches. The results demonstrate that DMPO significantly improves the recommendation capabilities of LLMs across three real-world public datasets in few-shot scenarios. Additionally, the experiments indicate that DMPO exhibits superior generalization ability in cross-domain recommendations. A case study elucidates the reasons behind these consistent improvements and also underscores DMPO's potential as an explainable recommendation system.

Introduction

While Large Language Models (LLMs) excel at general language tasks, adapting them for personalized recommendation—specifically ranking items based on user preferences—remains a challenge. The standard approach, Supervised Fine-Tuning (SFT), typically focuses on maximizing the probability of a single "correct" next item. However, this often fails in ranking scenarios because the model does not explicitly learn to distinguish positive items from irrelevant ones, leading to high probability assignments for non-preferred items. This paper addresses this limitation by introducing Direct Multi-Preference Optimization (DMPO).

Methodology: Direct Multi-Preference Optimization (DMPO)

DMPO is designed to align LLMs more effectively with the requirements of personalized ranking. Unlike standard SFT, DMPO incorporates a contrastive objective that considers multiple negative samples simultaneously.

The DMPO framework for aligning LLMs for recommendation tasks.

The framework consists of several key innovations:

  • Multi-Negative Sampling: By comparing a positive item against multiple negative items, the model learns a more robust boundary between user preferences and non-preferences.
  • Dynamic Margin: A dynamic margin is employed to force a clear separation in the model's internal probability distribution between preferred and non-preferred items.
  • Efficient Tuning with LoRA: To maintain computational efficiency, the authors utilize Low-Rank Adaptation (LoRA), updating only a small subset of parameters during the alignment process.
  • Instruction-Based Prompting: Recommendation tasks are framed as ranking problems within natural language prompts, leveraging the LLM's inherent reasoning capabilities.

Experimental Evaluation

The researchers evaluated DMPO on three benchmark datasets: MovieLens 1M, Amazon Movies and TV, and Amazon Video Games. The performance was measured using the Area Under the Curve (AUC) metric.

Results and Discussion

DMPO consistently outperformed both traditional sequential models (e.g., SASRec) and existing LLM-based methods like TALLRec. On the MovieLens 1M dataset, DMPO achieved an AUC of 70.20, a significant improvement over TALLRec's 67.79.

Performance comparison of SFT vs. DMPO across various LLM backbones.

Key findings include:

  • Backbone Versatility: DMPO provides consistent performance gains across various LLM architectures, including Llama, Mistral, and Gemma.
  • Few-Shot Efficiency: The model demonstrates high data efficiency, reaching 87% of its peak performance with only 20 training samples.
  • Cross-Domain Generalization: DMPO exhibits superior performance in zero-shot cross-domain scenarios (e.g., training on movies and testing on games), suggesting that it effectively leverages the LLM's broad pre-trained knowledge.
  • Optimal Negative Sampling: Ablation studies indicate that using 3 to 5 negative samples provides the best balance between ranking accuracy and computational cost.

Conclusion

Direct Multi-Preference Optimization (DMPO) offers a robust framework for aligning LLMs with personalized ranking tasks. By moving beyond simple supervised learning to a multi-preference contrastive approach, DMPO significantly enhances recommendation accuracy, especially in data-scarce and cross-domain environments. Future work will focus on handling longer user histories and further optimizing computational overhead.

Paper Citation: Zhuoxi Bai, Ning Wu, Fengyu Cai, Xinyi Zhu, and Yun Xiong.

  1. Finetuning Large Language Model for Personalized Ranking. arXiv:2405.16127v2 [cs.IR].

Summary updated

BibTeX
@misc{bai2024finetuning,
  author = {Zhuoxi Bai and Ning Wu and Fengyu Cai and Xinyi Zhu and Yun Xiong},
  title = {{Finetuning Large Language Model for Personalized Ranking}},
  year = {2024},
  eprint = {2405.16127},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.16127},
}
Figure