LLaRA: Large Language-Recommendation Assistant

Jiayi Liao, Sihang Li, Zhengyi Yang, Jiancan Wu, Yancheng Yuan, Xiang Wang, Xiangnan He

Introduction

Sequential recommendation aims to predict a user's next interaction by analyzing their historical behavior. Traditionally, this task has been dominated by ID-based models (such as SASRec or GRU4Rec). While these models excel at capturing mathematical patterns in user behavior, they lack "world knowledge"—for instance, they do not understand that Titanic is a romantic drama, only that it is represented by a specific ID.

Recently, researchers have attempted to leverage the reasoning power of Large Language Models (LLMs) for recommendation by using item titles as text. However, LLMs often struggle with the nuanced behavioral patterns that traditional models capture effortlessly. LLaRA (Large Language-Recommendation Assistant) is a novel framework designed to bridge this gap by treating sequential behavior as a distinct modality and aligning it with the LLM's natural language space.

The Challenge of Item Representation

A core difficulty in building LLM-based recommenders is how to represent items. As shown in the figure below, traditional methods often rely on raw ID numbers or text metadata, both of which have significant drawbacks. Raw IDs are essentially "foreign" to an LLM's vocabulary, while text metadata alone ignores the rich behavioral history captured by traditional sequential recommenders.

Comparison of different item representation strategies for LLM-based recommendation systems.

The LLaRA Framework

LLaRA introduces two primary innovations to fuse behavioral and semantic knowledge: Hybrid Item Representation and Curriculum Prompt Tuning.

1. Hybrid Item Representation (SR2LLM)

Instead of choosing between IDs and text, LLaRA uses both. It employs a module called SR2LLM (Sequential Recommender to LLM). This module takes the ID embedding from a pre-trained, frozen traditional recommender (like SASRec) and passes it through a trainable Projector (a Multi-Layer Perceptron). This process converts behavioral data into a "behavioral token" that exists in the same mathematical space as the LLM’s word tokens. Consequently, each item in a prompt is represented as a combination of its textual title and its behavioral token.

2. Curriculum Prompt Tuning

Introducing complex behavioral tokens into a text-heavy LLM can cause training instability. To mitigate this, LLaRA utilizes a curriculum learning strategy:

  • Phase 1 (Easy): The model is "warmed up" using text-only prompts (titles only). This helps the LLM understand the basic logic of the recommendation task within its native language domain.
  • Phase 2 (Hard): The model progressively transitions to hybrid prompts, gradually injecting behavioral tokens. This ensures a stable alignment between the recommendation modality and the language modality.
The LLaRA architecture, illustrating (a) the curriculum prompt tuning strategy and (b) the SR2LLM architecture used to project behavioral embeddings into the LLM space.

Experimental Results

The framework was evaluated on three diverse datasets: MovieLens (100K), Steam (video games), and LastFM (music). The authors used HitRatio@1 to measure accuracy and Valid Ratio to ensure the LLM followed instructions by selecting items from the provided candidate list.

Key Findings:

  • Superior Accuracy: LLaRA consistently outperformed traditional models. On MovieLens, LLaRA achieved a HitRatio@1 of 0.4737, significantly higher than SASRec (0.3444) and GRU4Rec (0.3750).
  • Domain-Specific Alignment vs. Scale: LLaRA (built on Llama-2-7B) outperformed much larger models like GPT-4 in zero-shot recommendation tasks. This suggests that proper modality alignment is more critical for recommendation than raw model size.
  • Instruction Following: By fine-tuning the LLM with LoRA (Low-Rank Adaptation), LLaRA achieved a >95% Valid Ratio, effectively eliminating the "hallucination" issues common in vanilla LLMs.

Conclusion and Future Work

LLaRA demonstrates that treating user behavior as a modality—similar to how images or audio are handled in multi-modal models—allows LLMs to "read" a user's history more deeply. While the computational overhead of fine-tuning a 7B parameter model is higher than traditional methods, the gains in accuracy and reasoning are substantial.

Future research may focus on scaling LLaRA to handle larger candidate sets (thousands of items) and expanding its capabilities to include conversational critiques and personalized explanations for its recommendations.

Summary updated

BibTeX
@inproceedings{liao2023llara,
  author = {Jiayi Liao and Sihang Li and Zhengyi Yang and Jiancan Wu and Yancheng Yuan and Xiang Wang and Xiangnan He},
  title = {{LLaRA: Large Language-Recommendation Assistant}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2023},
}
Figure