One Model for All: Large Language Models are Domain-Agnostic Recommendation Systems

Zuoli Tang, Zhaoxin Huan, Zihao Li, Xiaolu Zhang, Jun Hu, Chilin Fu, Jun Zhou, Chenliang Li · DOI

TL;DR

This paper introduces LLM-Rec, a novel framework that leverages pre-trained Large Language Models (LLMs) to create domain-agnostic recommendation systems. By treating user interaction sequences and item titles as natural language, LLM-Rec effectively bridges the gap between different domains, significantly improving recommendation performance, especially for sparse and cold-start scenarios.

What Problem Does This Paper Address?

Traditional sequential recommendation systems struggle with data sparsity and cold-start problems, where there's limited historical data for users or items. While multi-domain recommendation approaches aim to alleviate this by leveraging data from other domains, they often rely on simple ID-based item representations. This approach fails to capture semantic similarities between items across different domains, leading to suboptimal knowledge transfer. The authors aim to overcome these limitations by using LLMs to understand the rich semantic information embedded in item titles and user behavior sequences, enabling a more effective and domain-agnostic recommendation system.

Methods

The core of LLM-Rec is the utilization of pre-trained Large Language Models (LLMs) as a unified framework for both user and item representation. The authors propose the following:

  • Input Construction: User interaction histories are transformed into sequences of item titles. For each user, their interactions across multiple domains are mixed and concatenated chronologically into a single sequence of item titles. Item titles are also tokenized and fed into the LLM.
  • LLM Backbones: They explore three types of LLM architectures: encoder-only (e.g., BERT), decoder-only (e.g., OPT), and encoder-decoder (e.g., FLAN-T5).
  • Representation Generation: The LLM backbone processes the input sequences to generate contextualized user and item representations. For encoder-only models, the [CLS] token's representation is used, while for decoder-only models, the representation of the end-of-sequence token is utilized.
  • Prediction: The recommendation score is calculated using the inner product between the user and item representations.
  • Optimization: A sampled cross-entropy loss function is employed for training, using hard negatives.

Datasets

The experiments were conducted on five real-world datasets from the Amazon reviews dataset, specifically:

  • "Scientific"
  • "Pantry"
  • "Industrial and Scientific"
  • "Musical Instruments"
  • "Arts, Crafts and Sewing"
  • "Office Products"

These datasets were pre-processed to create a mixed dataset named SPAIO, which was used for training and evaluation.

Key Insights and Ideas

  • LLMs as Domain-Agnostic Recommenders: The study demonstrates that LLMs can effectively act as domain-agnostic recommendation systems, leveraging their world knowledge to bridge semantic gaps across different domains.
  • Semantic Understanding Over ID: LLMs, by processing item titles, can capture semantic relationships that ID-based methods miss, leading to better performance, especially for cold-start items.
  • User-Oriented Mixing is Key: Mixing user behaviors from different domains in a user-oriented chronological manner (SPIAO) yields significantly better results than domain-oriented mixing (S²PIAO). This highlights the importance of capturing the user's holistic interaction journey.
  • "Bigger is Better" is Nuanced: While larger LLMs generally improve zero-shot performance and handle long-tail items better, the performance gains from extremely large models (beyond ~100M parameters) in fine-tuned recommendation tasks diminish, suggesting that collaborative filtering signals might be more dominant in these scenarios.
  • Parameter-Efficient Fine-Tuning (PEFT) Limitations: PEFT methods like LoRA show significant performance drops for smaller LLMs (<1B parameters) in recommendation tasks, indicating that full parameter fine-tuning is often necessary for smaller models in this domain.

Key Results

  • LLM-Rec achieved state-of-the-art performance across multiple domains, outperforming strong baselines by an average of over 19% on the mixed SPIAO dataset.
  • In the "Diff" setting (where the target item's domain is orthogonal to all interacted domains), LLM-Rec showed significant relative improvement, demonstrating its cross-domain transfer capabilities.
  • LLM-Rec significantly improved performance on long-tail (low-frequency) items compared to ID-based methods.
  • Zero-shot domain performance improved substantially with larger LLM sizes, with some models outperforming even well-trained ID-based baselines.
  • Training cost for LLM-Rec can be substantial, especially for larger models, but PEFT methods offer a potential solution for more efficient fine-tuning, though with performance trade-offs for smaller models.

Limitations and Future Work

  • Training Cost and Latency: Training and inference costs for LLMs, especially larger ones, can be significant, posing a challenge for real-time recommendation systems. The authors suggest that smaller models (around 100M) are more viable for sequence modeling due to latency concerns.
  • PEFT for Small Models: PEFT methods are not yet suitable for small LLMs in recommendation tasks, requiring full parameter fine-tuning for optimal performance.
  • Matthew Effect: Despite leveraging semantic understanding, LLM-Rec still exhibits a noticeable Matthew effect (popularity bias), suggesting that collaborative filtering signals still play a significant role.
  • Future Work: The authors suggest further exploring the impact of model size and tuning methods, investigating more efficient fine-tuning strategies, and potentially combining LLMs with other recommendation techniques to further mitigate popularity bias and improve performance on sparse data.

Summary updated

BibTeX
@article{tang2025one,
  author = {Zuoli Tang and Zhaoxin Huan and Zihao Li and Xiaolu Zhang and Jun Hu and Chilin Fu and Jun Zhou and Chenliang Li},
  title = {{One Model for All: Large Language Models are Domain-Agnostic Recommendation Systems}},
  journal = {ACM Trans. Information Systems},
  year = {2025},
  doi = {10.1145/3705727},
}
Figure