RecoBERT: A Catalog Language Model for Text-Based Recommendations

Itzik Malkiel, Oren Barkan, Avi Caciularu, Noam Razin, Ori Katz, Noam Koenigstein

Abstract

Language models that utilize extensive self-supervised pre-training from unlabeled text have recently shown to significantly advance the state-of-the-art performance in a variety of language understanding tasks. However, it is yet unclear if and how these recent models can be harnessed for conducting text-based recommendations. In this work, we introduce RecoBERT, a BERT-based approach for learning catalog-specialized language models for text-based item recommendations. We suggest novel training and inference procedures for scoring similarities between pairs of items, that don't require item similarity labels. Both the training and the inference techniques were designed to utilize the unlabeled structure of textual catalogs, and minimize the discrepancy between them. By incorporating four scores during inference, RecoBERT can infer text-based item-to-item similarities more accurately than other techniques. In addition, we introduce a new language understanding task for wine recommendations using similarities based on professional wine reviews. As an additional contribution, we publish an annotated recommendations dataset crafted by human wine experts. Finally, we evaluate RecoBERT and compare it to various state-of-the-art NLP models on wine and fashion recommendations tasks.

Introduction

Most recommendation systems rely on Collaborative Filtering (CF), which leverages historical user behavior. However, CF faces significant challenges in "cold start" scenarios, such as new stores or items with no purchase history. In these instances, Content-Based (CB) recommendations—which compare item metadata like titles and descriptions—are essential.

Standard Natural Language Processing (NLP) models often struggle with product catalogs. Generic models may fail to capture domain-specific nuances; for example, while "apple" and "citrus" are both fruits, a wine expert recognizes them as distinct flavor profiles. Furthermore, professional reviews often employ non-literal jargon. RecoBERT addresses these gaps by adapting the BERT architecture specifically for the requirements of textual product catalogs.

Methodology

RecoBERT builds upon the BERT-Large architecture, introducing modifications to make the model "catalog-aware" through specialized training and inference strategies.

Training Procedures

The model employs two primary training tasks:

  1. Masked Language Model (MLM) Specialization: The model undergoes self-supervised pre-training on domain-specific catalog text. This allows it to learn specialized semantics, such as understanding that "dry" in a wine context refers to sugar content rather than moisture.
  2. Title-Description Model (TDM): Unlike standard BERT’s Next Sentence Prediction, TDM trains the model to recognize the relationship between an item's title and its description. The model learns to minimize the cosine distance between embeddings of "real" title-description pairs while maximizing the distance for "fake" (randomly paired) ones.
The RecoBERT architecture, illustrating the Title-Description Model (TDM) training and the multi-score inference strategy.

Hybrid Inference Scoring

During inference, RecoBERT calculates four distinct similarity scores for every pair of items (Seed and Candidate):

  • Similarity between descriptions.
  • Similarity between titles.
  • TDM score of Seed Title vs. Candidate Description.
  • TDM score of Candidate Title vs. Seed Description.

These scores are normalized and combined to produce a final recommendation ranking. This approach leverages cross-attention, where the embedding for a title is influenced by its paired description, creating a deeper semantic bond.

Datasets and Evaluation

The researchers evaluated RecoBERT across two primary domains:

  • Wine Dataset: Comprising 120,000 wine titles and reviews.
  • Fashion Dataset: A catalog of 4,000 fashion items.

A significant contribution of this work is the creation of a new benchmark: a human-annotated wine test set. A professional sommelier manually crafted 1,095 recommendations for 100 "seed" wines, providing a high-quality ground truth for evaluation.

Example of a seed item and a similar item from the expert-annotated wine dataset.

Results

RecoBERT consistently outperformed state-of-the-art baselines, including Specialist-BERT and MoverScore.

  • Wine Recommendations: On the 120K wine dataset, RecoBERT achieved a Mean Percentile Rank (MPR) of 97.3% and a Mean Reciprocal Rank (MRR) of 21.0%, nearly doubling the MRR of the next best baseline.
  • Fashion Recommendations: In blind human evaluations, a fashion expert gave RecoBERT’s recommendations an average score of 3.94/5, the highest among all tested models.
  • Efficiency: The model processes approximately 340 items per second on a single GPU, demonstrating viability for large-scale offline processing.

Conclusion

RecoBERT demonstrates that specialized training tasks like TDM are more effective for recommendations than general-purpose NLP tasks. While the model relies on informative titles and requires significant computational resources for training, it sets a new standard for text-based item-to-item recommendations. Future work may explore knowledge distillation to enable real-time inference for even larger catalogs.

Summary updated

BibTeX
@inproceedings{malkiel2020recobert,
  author = {Itzik Malkiel and Oren Barkan and Avi Caciularu and Noam Razin and Ori Katz and Noam Koenigstein},
  title = {{RecoBERT: A Catalog Language Model for Text-Based Recommendations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  url = {https://openreview.net/forum?id=bY3WdkhQYn},
}
Figure