Abstract
We propose Rec-R1, a general reinforcement learning framework that bridges large language models (LLMs) with recommendation systems through closed-loop optimization. Unlike prompting and supervised fine-tuning (SFT), Rec-R1 directly optimizes LLM generation using feedback from a fixed, black-box recommendation model—without relying on synthetic SFT data from proprietary models like GPT-4o. This avoids the substantial cost and effort required for data distillation. To verify the effectiveness of Rec-R1, we evaluate Rec-R1 on three representative tasks: product search, sequential recommendation, and product re-ranking. Experimental results demonstrate that Rec-R1 not only consistently outperforms prompting- and SFT-based methods, but also achieves remarkable gains over strong discriminative baselines, even when used with simple retrievers like BM25. More impressively, Rec-R1 preserves the general-purpose capabilities of the LLM, in contrast to SFT, which often impairs instruction-following and reasoning. These findings suggest Rec-R1 as a promising foundation for continual task-specific adaptation without catastrophic forgetting.
Introduction
The integration of Large Language Models (LLMs) into recommendation systems (RecSys) has typically followed two paths: zero-shot prompting of frozen models or supervised fine-tuning (SFT) on "gold standard" outputs. However, these methods face significant hurdles. SFT optimizes for imitation rather than actual recommendation performance, relies on expensive synthetic data distillation, and often leads to "catastrophic forgetting," where the model loses its general reasoning and instruction-following abilities.
We introduce Rec-R1, a framework that treats LLM-RecSys integration as a closed-loop reinforcement learning problem. By using direct performance feedback (e.g., NDCG) as a reward signal, Rec-R1 enables LLMs to master recommendation tasks efficiently while maintaining their general intelligence.
The Rec-R1 Framework
Rec-R1 utilizes Group Relative Policy Optimization (GRPO), a memory-efficient RL algorithm that eliminates the need for a separate critic model. The LLM acts as an agent, generating textual outputs—such as rewritten queries or item descriptions—that are processed by a "black-box" recommendation model.
This closed-loop system allows the LLM to explore and discover optimal generation strategies that align with the inductive biases of the underlying retriever. For instance, when paired with a retriever pre-trained on product reviews, Rec-R1 autonomously learned to rewrite queries into a review-style format to maximize retrieval accuracy.
Experimental Evaluation
The framework was rigorously tested across three primary recommendation scenarios:
- Product Search: Enhancing short or complex natural language queries for retrievers like BM25 and BLAIR.
- Sequential Recommendation: Predicting the next item in a user's purchase history, particularly in inductive (cold-start) settings.
- Product Re-ranking: Re-ordering a filtered list of candidate items to improve final list quality.
To ensure the model retained its general-purpose capabilities, we also benchmarked it on MMLU (knowledge), IFEval (instruction following), and GSM8K (mathematical reasoning).
Key Results and Insights
Rec-R1 demonstrated superior performance across all metrics:
- Performance Gains: In product search, Rec-R1 improved NDCG@100 by up to 21.45 points over SFT baselines. In re-ranking, a 3B-parameter Rec-R1 model outperformed much larger specialized models and even GPT-4o.
- Zero Forgetting: While SFT caused a drastic 27-point drop in instruction-following (IFEval), Rec-R1 maintained its performance, scoring 60.1 compared to the ~30-35 range of SFT variants.
- Economic Efficiency: Rec-R1 is remarkably efficient. Training reached SFT-level performance in just 210 seconds, costing approximately $0.48—a 30x reduction compared to the $15.60 required for SFT data preparation and training.
Conclusion
Rec-R1 bridges the gap between generative LLMs and discriminative recommendation systems. By replacing imitation with direct performance optimization via RL, it achieves state-of-the-art results, reduces costs, and preserves the fundamental intelligence of the base model. This framework provides a robust foundation for building specialized yet versatile AI agents for the next generation of recommendation systems.
Summary updated