NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Aligning Large Language Models with Recommendation Knowledge

Yuwei Cao, Nikhil Mehta, Xinyang Yi, Raghunandan Hulikal Keshavan, Lukasz Heldt, Lichan Hong, Ed H. Chi, Maheswaran Sathiamoorthy

Introduction

In the current landscape of recommender systems (RecSys), specialized supervised models like Matrix Factorization and SASRec remain the industry standard for retrieval and ranking. Despite their immense reasoning capabilities, Large Language Models (LLMs) often underperform in these domains. This performance deficit stems from a "knowledge gap": while LLMs excel at natural language processing, they are not natively trained to understand the complex correlations between specific items or the subtle nuances of user-item interaction histories.

Previous attempts to bridge this gap through instruction tuning focused on teaching models how to perform a task (e.g., "select an item from this list") rather than helping them comprehend the underlying recommendation domain. This paper introduces a framework to align LLMs with recommendation logic by reformulating classical recommendation objectives into natural language prompts.

Methodology: Recommendation Logic as Language

The researchers propose a multi-task fine-tuning framework using FLAN-T5 as a backbone. The core innovation lies in converting mathematical loss functions used in traditional recommenders into auxiliary natural language tasks.

Auxiliary-Task Alignment

To inject recommendation-specific logic, the model is trained on three primary auxiliary tasks:

  • Masked Item Modeling (MIM): Based on Cloze objectives, the model receives a sequence where certain items are replaced by [masked item] and must predict the missing items in chronological order.
  • Bayesian Personalized Ranking (BPR): This task mimics contrastive learning by presenting the model with a binary choice: "Which of these two products would the user buy next?" This forces the model to distinguish between a ground-truth item and a negative sample.
  • Masked Language Modeling (MLM): Fine-grained token-level masking of item titles helps the model learn semantic relationships between products at a textual level.
Figure 1: Examples of natural language prompts for standard and auxiliary recommendation tasks.

Prompt Engineering for RecSys

The authors also refined standard tasks like retrieval and ranking. A key design choice was the elimination of specific User IDs, which are often too numerous for LLMs to memorize effectively. Instead, users are represented by their historical purchase sequences. By including both Item IDs and Item Titles, the model leverages its pre-existing semantic knowledge to infer that a user who purchased "Running Shoes" might also be interested in "Dry-fit Shorts."

Experimental Results

The framework was evaluated on three standard Amazon datasets: Toys & Games, Beauty, and Sports & Outdoors. The resulting models—ReAT (Retrieval-aligned) and RaAT (Ranking-aligned)—demonstrated significant performance gains over both LLM baselines and traditional state-of-the-art (SOTA) models.

Ranking Performance

In ranking tasks, the proposed RaAT model showed a massive leap in accuracy. On the Toys & Games dataset, RaAT achieved an NDCG@10 of 0.2034, significantly outperforming the LLM-based baseline P5-XL (0.0444) and even surpassing the strong conventional baseline SimpleX (0.1469).

Figure 4: Ranking performance comparison across different datasets and metrics.

Retrieval Performance

For retrieval, ReAT outperformed TIGER (the previous generative retrieval SOTA) by margins ranging from +5.6% to +19% in NDCG@5 across different domains. These results suggest that aligning LLMs with recommendation-specific auxiliary tasks effectively bridges the gap between general reasoning and domain-specific expertise.

Discussion and Future Work

While the results are promising, the authors acknowledge several challenges. LLMs involve significantly higher computational overhead and latency compared to lightweight traditional models. Furthermore, the models are currently constrained by context window limits, typically handling a sliding window of 20 items.

Future research directions include refining item metadata to remove noise (like URLs or hashtags) and exploring "semantic-rich IDs" that encode category information directly into the identifier to further enhance the model's alignment with the recommendation domain.

Summary updated

BibTeX
@inproceedings{cao2024aligning,
  author = {Yuwei Cao and Nikhil Mehta and Xinyang Yi and Raghunandan Hulikal Keshavan and Lukasz Heldt and Lichan Hong and Ed H. Chi and Maheswaran Sathiamoorthy},
  title = {{Aligning Large Language Models with Recommendation Knowledge}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-naacl.67},
}
Figure