Direct Preference Optimization for LLM-Enhanced Recommendation Systems

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

TL;DR

DPO4Rec introduces a bidirectional framework that aligns Large Language Models (LLMs) with traditional recommendation systems using Direct Preference Optimization (DPO). By treating the recommendation model as a reward function, it fine-tunes the LLM to generate high-quality user preference reasoning, significantly boosting re-ranking performance and outperforming much larger models like GPT-4o.

What Problem Does This Paper Address?

While Large Language Models (LLMs) possess vast world knowledge and strong reasoning capabilities, directly applying them to recommendation systems (RecSys) yields suboptimal results. This stems from a fundamental mismatch: LLMs are pretrained for general next-token prediction, not for recommendation-specific tasks like click-through rate (CTR) prediction or item ranking.

Existing "knowledge-augmented" approaches typically operate in a unidirectional fashion: they use an LLM to generate text-based profiles or reasoning about a user, which is then fed into a traditional ID-based recommendation model. However, this ignores a crucial signal—the feedback from the recommendation system itself. Without this feedback, the LLM has no way of knowing whether its generated reasoning actually helps make better recommendations.

Fig. 1: Comparison between (a) Unidirectional LLM-enhanced recommendations and (b) Bidirectional LLM-enhanced recom- mendations.

Methods

To close this loop, the authors propose DPO4Rec, a framework that establishes a bidirectional feedback loop between the LLM and the recommender system using Direct Preference Optimization (DPO).

The pipeline consists of three main phases:

  1. Extracting Reasoning Knowledge: The LLM is prompted with a user's interaction history to generate $N$ distinct reasoning samples summarizing the user's preferences.
  2. Evaluation Feedback (The Recommender as a Judge): Because traditional recommendation models process IDs rather than text, a Knowledge Adaptor (a text encoder + adapter layer) transforms the LLM's text into low-dimensional vectors. The recommendation model then evaluates these vectors alongside traditional ID features, scoring each of the $N$ samples based on ranking metrics like NDCG.
  3. Alignment via DPO: For each user, the highest-scoring LLM response is labeled as "chosen" and the lowest-scoring as "rejected." This pairwise data is used to fine-tune the LLM directly via DPO, bypassing the need for a separate, unstable reinforcement learning reward model.

The authors also introduce an Iterative Optimization Method, repeating this cycle to mutually enhance both the LLM's reasoning and the recommender's preference modeling.

Fig. 2: The overview of the proposed framework.

Datasets

The framework was evaluated on three widely used public recommendation benchmarks:

  • MovieLens-1M (ML-1M): 1 million movie ratings from ~6,000 users.
  • Amazon-Books: A large-scale dataset containing over 1.4 million interactions across ~12,000 users.
  • Amazon-Beauty: A smaller, sparser dataset containing ~5,200 interactions.

Ratings were converted into binary labels (clicks/non-clicks), and the datasets were split 90/10 for training and testing.

Key Insights and Ideas

  • Flipping the Script on Reward Models: Instead of using human feedback (RLHF) or AI feedback (RLAIF) to align the LLM, DPO4Rec uses recommender system feedback. The recommendation model's performance metrics serve as an objective, automated ground truth for what constitutes "good" reasoning.
  • The Iterative Sweet Spot: More training isn't always better. The authors found that performance peaks at exactly 2 iterations. By the 3rd iteration, the LLM begins to overfit to the DPO loss, causing recommendation performance to degrade—a phenomenon aligned with recent theoretical critiques of DPO's weak regularization.
  • Smaller Models Can Punch Above Their Weight: When properly aligned using DPO, smaller open-source models (like Llama3.1-8B, Mistral-7B, and Yi-6B) consistently outperform massive, closed-source models like GPT-4o that rely purely on zero-shot prompting.

Key Results

DPO4Rec was tested across three state-of-the-art backbone recommendation architectures: DLCM, PRM, and SetRank.

  • Superiority Over Baselines: The Llama3.1-8B variant of DPO4Rec consistently achieved the best results. On the Amazon-Beauty dataset using a PRM backbone, DPO4Rec surpassed KAR (a strong baseline utilizing ChatGPT-4o) by 3.92% in NDCG@5.
  • Ablation Studies: Removing the reasoning knowledge component caused a massive performance drop (especially on Amazon-Books), proving that the contextual insights generated by the LLM are vital. Omitting the DPO alignment step also led to a moderate decline, validating the necessity of the feedback loop.
  • Sample Size Trade-off: Increasing the number of generated samples ($N$) improves recommendation accuracy but increases inference latency. The authors identified $N=10$ as the optimal balance point for computational efficiency.
Fig. 5: Analysis of iterations and samples.

Limitations and Future Work

  • DPO Overfitting: As shown in the iteration analysis, the framework is susceptible to policy degradation if trained for too many iterations. Developing stronger regularization techniques to prevent this overfitting is a key area for future research.
  • Inference Latency: Generating multiple reasoning samples ($N=10$) per user introduces significant computational overhead during the data-generation phase, which could limit real-time deployment in massive production environments without further optimization.

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