Direct Preference Optimization for LLM-Enhanced Recommendation Systems

Chao Sun, Yaobo Liang, Yaming Yang, Shilin Xu, Tianmeng Yang, Yunhai Tong · DOI

TL;DR

This paper introduces DPO4Rec, a novel framework that leverages Direct Preference Optimization (DPO) to align Large Language Models (LLMs) with recommendation system objectives. By using a recommender system to provide feedback on LLM-generated user preferences, DPO4Rec significantly improves recommendation quality and demonstrates LLMs' enhanced instruction-following capabilities in this domain.

What Problem Does This Paper Address?

Traditional recommendation systems often struggle to capture nuanced user preferences and provide explainable suggestions. While Large Language Models (LLMs) offer rich knowledge and reasoning capabilities, their direct application to recommendation tasks is hindered by a mismatch between their pre-training objectives and the specific needs of recommendation systems. Existing methods that use LLMs for recommendations often rely on in-context learning or simply augment existing models with LLM-generated representations, which can be suboptimal. This paper addresses the challenge of effectively integrating LLMs into recommendation systems by aligning their outputs with the preferences and goals of the recommendation task itself, moving beyond simple knowledge injection.

Methods

The core of DPO4Rec lies in its innovative approach to aligning LLMs with recommendation system preferences. The framework consists of three main stages:

  1. Extracting Reasoning Knowledge from LLMs: The LLM is prompted to infer user preferences from historical interaction data. This process goes beyond simple item prediction by generating textual explanations and reasoning behind these preferences, considering factors like genre, actors, and plot.
  2. Evaluating Feedback from the Recommender: A reward model is trained, not on human feedback, but on the performance of a traditional recommendation model. This recommender model uses the LLM-generated reasoning knowledge (converted into low-dimensional vectors) as additional input features. The reward model then evaluates the quality of the LLM's reasoning by assessing how well it contributes to the recommender's performance (e.g., using NDCG scores).
  3. Alignment of LLMs with Recommender Preferences: Direct Preference Optimization (DPO) is employed to fine-tune the LLM. The highest- and lowest-ranked responses from the LLM, as determined by the reward model, are used to create pairwise preference data. DPO then directly optimizes the LLM to generate responses that align with these preferences, avoiding the unstable RL phase often found in RLHF. This process is described as an iterative optimization method, aiming for mutual enhancement between the LLM and the recommender.

Datasets

The experiments were conducted on three public datasets:

  • ML-1M: A dataset containing 1 million ratings from 6,040 users for 3,416 movies. Ratings are converted to binary labels (positive/negative).
  • Amazon-Books: A dataset with 11,906 users, 17,332 items, and 1,406,582 interactions, excluding user features.
  • Amazon-Beauty: A dataset with 991 users, 85 items, and 5,269 interactions, also excluding user features.

The paper does not introduce new datasets but rather uses these existing ones to evaluate the proposed framework.

Key Insights and Ideas

  • Recommender as a Teacher: The most significant insight is using the recommendation system itself as a source of feedback for the LLM. This creates a bidirectional learning loop where the LLM learns to generate better reasoning that helps the recommender, and the recommender's performance guides the LLM's fine-tuning.
  • Beyond In-Context Learning: The paper demonstrates that simply using LLMs for in-context learning or representation augmentation is insufficient. Effective alignment with recommendation objectives requires a more direct optimization approach like DPO.
  • Reasoning Knowledge is Crucial: Ablation studies show that the reasoning knowledge generated by the LLM is critical for performance improvements. Without it, the framework's effectiveness diminishes significantly.
  • DPO's Efficiency: The use of DPO is highlighted as a more stable and easier-to-implement alternative to traditional RLHF for aligning LLMs with preferences, especially in this domain.

Key Results

DPO4Rec consistently outperforms strong baselines across all evaluated datasets and backbone recommendation models (DLCM, PRM, SetRank).

  • Superior Performance: DPO4Rec variants, particularly with the Llama3.1-8B LLM, achieved relative MAP@5 improvements of up to 1.45% over original backbone models.
  • Outperforming KAR: DPO4Rec consistently outperformed the KAR baseline (an LLM-enhanced recommender) across all configurations, with notable gains like a 3.92% increase in NDCG@5 on Amazon-Beauty with PRM.
  • Robustness: The framework shows remarkable flexibility, performing well when integrated with various LLMs (Llama3.1-8B, Mistral-7B, Yi-6B), indicating its generalizability.
  • Efficiency: The paper notes that while increasing the number of generated samples (N) generally improves performance, there's a trade-off with inference latency. They found N=10 to be a good balance.
  • Iterative Optimization: The optimal performance was observed with 2 iterations of the proposed iterative optimization method.

Limitations and Future Work

  • Overfitting in DPO: The paper acknowledges that DPO training can lead to overfitting, which can degrade performance on test data, as observed in their study of iteration numbers. This is a known issue in DPO and requires careful regularization.
  • Computational Cost: While DPO is more efficient than RLHF, fine-tuning large LLMs still incurs significant computational costs. The paper mentions the trade-off between sample size (N) and inference time.
  • Future Work: The authors suggest exploring further improvements through iterative optimization and investigating more sophisticated methods for converting LLM reasoning into a format usable by traditional recommenders. They also imply that further research into aligning LLMs with recommendation objectives is warranted.

Summary updated

BibTeX
@inproceedings{sun2024direct,
  author = {Chao Sun and Yaobo Liang and Yaming Yang and Shilin Xu and Tianmeng Yang and Yunhai Tong},
  title = {{Direct Preference Optimization for LLM-Enhanced Recommendation Systems}},
  booktitle = {ICME},
  year = {2024},
  doi = {10.48550/arxiv.2410.05939},
}
Figure