TALLRec: An Effective and Efficient Tuning Framework to Align Large Language Model with Recommendation

Keqin Bao, Jizhi Zhang, Yang Zhang, Wenjie Wang, Fuli Feng, Xiangnan He

Introduction

Large Language Models (LLMs) like GPT-4 and LLaMA have demonstrated remarkable capabilities across diverse natural language processing tasks. However, their performance in the specialized domain of recommendation systems has historically been underwhelming. Despite their vast world knowledge, LLMs often struggle with the specific logic of user-item interactions, frequently exhibiting a "positivity bias" or failing to follow the structured constraints of recommendation tasks.

TALLRec (Tuning framework to Align LLM with Recommendation) addresses this "alignment gap." By utilizing a lightweight, two-stage instruction tuning process, TALLRec transforms general-purpose LLMs into specialized recommendation engines that are both data-efficient and computationally accessible.

The Alignment Gap in Recommendation

Traditional recommendation models, such as SASRec or GRU4Rec, are trained from scratch on massive interaction datasets. In contrast, LLMs are typically applied to recommendations via In-Context Learning (ICL)—providing a user's history in a prompt and asking for a prediction. This approach faces three primary hurdles:

  1. Positivity Bias: LLMs tend to predict that a user will like almost any item presented to them.
  2. Safety Filters: Models may refuse to provide recommendations due to over-active content moderation.
  3. Domain Misalignment: LLMs are trained on general web text, not the specific patterns of preference and behavior found in recommendation data.

TALLRec seeks to bridge this gap by explicitly teaching the LLM the "language" of recommendation through fine-tuning rather than simple prompting.

The TALLRec Framework

The core of TALLRec is a two-stage tuning pipeline designed to maximize performance while minimizing computational overhead.

1. Alpaca Tuning

The base model (LLaMA-7B) first undergoes general instruction tuning using the Alpaca dataset. This stage ensures the model can follow basic natural language instructions and maintain a conversational flow, providing a foundation for the more specialized tuning that follows.

2. Rec-Tuning

In the second stage, recommendation data is formatted into natural language instructions. For instance, a user's history is presented as: "Given the user's liked items [A, B] and disliked items [C], will they enjoy movie D? Answer Yes or No." This forces the model to align its internal representations with the binary classification logic required for recommendation.

3. Parameter-Efficient Fine-Tuning (LoRA)

To make this process efficient, the researchers employed Low-Rank Adaptation (LoRA). Instead of updating all 7 billion parameters, LoRA freezes the original weights and trains a small set of auxiliary matrices. This reduces the trainable parameters to approximately 1/1000th of the original size, allowing the entire framework to be trained on a single consumer-grade Nvidia RTX 3090 (24GB) GPU.

Experimental Results

The authors evaluated TALLRec on two primary benchmarks: MovieLens100K and BookCrossing. To test the model's efficiency, they focused on "few-shot" settings, using as few as 16 to 256 training samples.

Superiority in Low-Data Regimes

TALLRec demonstrated a significant advantage over traditional models when data was scarce. In a 64-shot setting on the MovieLens dataset, TALLRec achieved an AUC of 67.48. In comparison, traditional models like SASRec and DROS hovered around 50-51, performing no better than a random guess. This suggests that TALLRec successfully leverages the LLM's pre-existing knowledge of items (e.g., knowing the genre and tone of The Godfather) to make informed predictions with minimal new data.

Outperforming General-Purpose Giants

Despite its smaller size (7B parameters), TALLRec significantly outperformed much larger models like GPT-3.5 (text-davinci-003) and ChatGPT. While the larger models are more capable in general reasoning, TALLRec’s specific alignment to the recommendation task allowed it to overcome the biases and instruction-following issues that plagued the larger, un-tuned models.

Cross-Domain Robustness

A notable finding was TALLRec's ability to transfer knowledge across domains. A model tuned on movie data showed remarkable performance when tested on book recommendations. This indicates that the model is learning a generalized philosophy of recommendation—understanding how to weigh likes against dislikes—rather than simply memorizing specific item IDs.

Limitations and Future Directions

While TALLRec represents a significant step forward, it currently operates as a binary classification task (Yes/No). In real-world production environments, systems must often rank thousands of items simultaneously, a task that remains computationally expensive for LLMs. Additionally, the model's effectiveness is tied to the quality of text metadata; vague or missing titles can prevent the LLM from activating its internal world knowledge.

Future work aims to expand TALLRec into a true "Foundation Model for Recommendation" by pre-training on massive, heterogeneous datasets across multiple domains, potentially creating a universal recommender that works out-of-the-box for any product category.

Summary updated

BibTeX
@inproceedings{bao2023tallrec,
  author = {Keqin Bao and Jizhi Zhang and Yang Zhang and Wenjie Wang and Fuli Feng and Xiangnan He},
  title = {{TALLRec: An Effective and Efficient Tuning Framework to Align Large Language Model with Recommendation}},
  booktitle = {RecSys},
  year = {2023},
  doi = {10.1145/3604915.3608857},
}
Figure