NoteLLM: A Retrievable Large Language Model for Note Recommendation

Chao Zhang, Shiwei Wu, Haoxin Zhang, Tong Xu, Yan Gao, Yao Hu, Enhong Chen

Abstract

NoteLLM is a novel framework designed to bridge the gap between Large Language Models (LLMs) and efficient item-to-item (I2I) retrieval in social media contexts. By compressing note content into a single virtual token ([EMB]) and utilizing collaborative supervised fine-tuning for hashtag and category generation, NoteLLM produces high-quality embeddings for large-scale retrieval. Experimental results on Xiaohongshu data demonstrate significant improvements in recall and online click-through rates compared to traditional BERT-based baselines.

1. Introduction

In social media communities like Xiaohongshu or Lemon8, users share "notes"—short posts containing text and images. Recommending related notes (Item-to-Item or I2I recommendation) is a massive retrieval challenge involving millions of items. Traditionally, platforms rely on BERT-based models to generate embeddings. However, these models often fail to capture the high-level semantic anchors provided by hashtags and categories. While LLMs offer superior language understanding, they are typically too computationally expensive for real-time retrieval across millions of items. NoteLLM addresses these challenges by transforming an LLM into an efficient retrieval engine.

2. Methodology

NoteLLM utilizes three core components to integrate generative capabilities with retrieval efficiency:

2.1 Note Compression and the [EMB] Token

Instead of processing a note as a standard sequence of tokens, NoteLLM uses a specific instruction prompt to compress the note's information into a single virtual token, denoted as [EMB]. This token serves as the compact representation used for downstream retrieval tasks.

Extracted figure from page 1 of NoteLLM: A Retrievable Large Language Model for Note Recommendation

2.2 Generative-Contrastive Learning (GCL)

To ensure the [EMB] token is effective for retrieval, the model employs contrastive learning based on user behavior. By analyzing which notes are frequently clicked together, the model is trained to minimize the mathematical distance between the [EMB] tokens of related notes in vector space.

2.3 Collaborative Supervised Fine-tuning (CSFT)

NoteLLM employs a multi-task approach where the model simultaneously learns to group related notes and generate their corresponding hashtags and categories from the [EMB] token. This process, illustrated in Figure 3, treats hashtag generation as a distillation of the note's "essence," which in turn enriches the quality of the embedding.

The Collaborative Supervised Fine-tuning (CSFT) process for hashtag and category prediction.

3. Experimental Setup

The researchers evaluated NoteLLM using real-world data from Xiaohongshu:

  • Training Set: Approximately 458,000 notes and 312,000 related note pairs derived from one week of user interactions.
  • Testing Set: Approximately 258,000 notes and 28,000 pairs from the subsequent month to evaluate temporal generalization.
  • The dataset spanned over 500 distinct categories, ensuring broad topical coverage.

4. Results

NoteLLM demonstrated superior performance in both offline and online environments:

  • Offline Performance: The model outperformed SentenceBERT and other LLM-based retrievers like RepLLaMA across all Recall metrics, specifically showing a significant lead in Recall@100.
  • Online Impact: In a live A/B test on Xiaohongshu, NoteLLM achieved a 16.2% increase in click-through rate (CTR).
  • Cold Start Success: The model saw a 3.58% increase in comments on new notes, indicating its ability to accurately recommend content based solely on semantic features and generated hashtags without prior user data.

5. Discussion and Future Work

While NoteLLM represents a significant advancement, it faces limitations common to LLMs, such as occasional "hallucinations" in hashtag generation. Additionally, context window constraints required truncating note titles and content, potentially losing some nuance. Future research will focus on incorporating visual features into the framework to create a truly multimodal NoteLLM, better reflecting the image-heavy nature of social media notes.

Summary updated

BibTeX
@inproceedings{zhang2024notellm,
  author = {Chao Zhang and Shiwei Wu and Haoxin Zhang and Tong Xu and Yan Gao and Yao Hu and Enhong Chen},
  title = {{NoteLLM: A Retrievable Large Language Model for Note Recommendation}},
  booktitle = {The Web Conference},
  year = {2024},
  doi = {10.1145/3589335.3648314},
}
Figure