Source-linked AI summary

Learnable Item Tokenization for Generative Recommendation

Wenjie Wang, Honghui Bao, Xinyu Lin, Jizhi Zhang, Yongqi Li, Fuli Feng, See-Kiong Ng, Tat-Seng Chua

arXiv:2405.07314v3cs.IR

TL;DR

LLM-based generative recommendation needs item tokenization that represents recommendation data in the language space while addressing limitations in semantics, collaborative signals, and code assignment. LETTER combines hierarchical semantic, collaborative, and diversity regularization, and its instantiations with ranking-guided generation loss outperform existing tokenization methods across three datasets. The paper concludes that richer behavioral, cross-domain, and natural-language integrations remain promising directions.

  • Problem

    Existing ID, textual, and codebook-based identifiers inadequately encode semantics, collaborative signals, or balanced code assignments for LLM-based generative recommendation.

  • Method

    LETTER uses RQ-VAE semantic regularization, contrastive collaborative alignment, diversity loss, and ranking-guided generation loss in two generative recommender models.

  • Results

    LETTER outperforms existing item tokenization methods across three datasets and achieves superior performance in generative recommendation models.

  • Takeaways & Limitations

    Effective item tokenization should jointly capture hierarchical semantics, collaborative signals, and code-assignment diversity for generative recommendation.

  • Takeaways & Limitations

    Future work is needed to tokenize richer user behaviors, cross-domain items, and combinations of natural-language instructions with LETTER-tokenized histories.

Abstract

from arXiv · show

Utilizing powerful Large Language Models (LLMs) for generative recommendation has attracted much attention. Nevertheless, a crucial challenge is transforming recommendation data into the language space of LLMs through effective item tokenization. Current approaches, such as ID, textual, and codebook-based identifiers, exhibit shortcomings in encoding semantic information, incorporating collaborative signals, or handling code assignment bias. To address these limitations, we propose LETTER (a LEarnable Tokenizer for generaTivE Recommendation), which integrates hierarchical semantics, collaborative signals, and code assignment diversity to satisfy the essential requirements of identifiers. LETTER incorporates Residual Quantized VAE for semantic regularization, a contrastive alignment loss for collaborative regularization, and a diversity loss to mitigate code assignment bias. We instantiate LETTER on two models and propose a ranking-guided generation loss to augment their ranking ability theoretically. Experiments on three datasets validate the superiority of LETTER, advancing the state-of-the-art in the field of LLM-based generative recommendation.

1 INTRODUCTION

LLM-based generative recommendation depends on item tokenization, but existing identifiers inadequately combine semantics, collaborative signals, and assignment diversity. LETTER addresses these requirements through three regularizations, is instantiated in two recommender models, and outperforms existing tokenization methods across three datasets.

  • Motivation: Item tokenization maps each recommendation item to an identifier, enabling LLMs to encode interaction histories and generate target items autoregressively.Identifiers are token sequences used both for representing historically interacted items and for next-item generation.
  • Existing identifiers: ID identifiers ensure uniqueness but encode little semantic information, making generalization to cold-start items challenging.They assign each item a unique numerical string.
  • Existing identifiers: Textual and codebook-based identifiers lack collaborative signals, so semantically similar items with different user behaviors can receive insufficiently distinctive sequences.Codebook-based methods additionally suffer imbalanced code assignment, which makes high-frequency-code items easier to generate.
  • Design objectives: Ideal identifiers should combine coarse-to-fine hierarchical semantics, collaborative signals, and diverse token assignments to reduce item generation bias.These properties align identifier structure with autoregressive generation and distinguish items by user behavior.
  • LETTER: LETTER uses RQ-VAE for semantic regularization, contrastive alignment for collaborative regularization, and diversity loss to mitigate code assignment and item generation bias.The method enhances codebook-based identifiers while integrating the three required properties.
  • Evaluation: LETTER is applied to two generative recommender models, with a ranking-guided generation loss, and experiments on three datasets validate superior item tokenization.The paper also releases code and data for reproducibility.

2 ITEM TOKENIZATION

Generative recommendation represents historical interactions and next-item targets as item identifiers, but existing ID, textual, and codebook-based methods leave important tokenization objectives unmet. The paper therefore frames hierarchical semantics, collaborative alignment, and code-assignment diversity as essential identifier objectives.

  • Item tokenization: Generative recommendation converts historical interactions into identifier sequences and autoregressively generates the next item’s identifier.Item tokenization supports both interaction encoding and next-item recommendation.
  • Existing limitations: ID identifiers have insufficient semantic encoding, while textual identifiers do not organize semantic information hierarchically from coarse to fine-grained.The paper identifies non-hierarchical semantics as a textual-identifier issue.
  • Existing limitations: Textual and codebook-based identifiers can misalign semantic similarity with collaborative behavior, causing collisions when collaborative signals are injected into similar identifier embeddings.Items with similar semantics may have dissimilar interactions, complicating collaborative alignment.
  • Existing limitations: Imbalanced code assignment in codebook-based methods produces item generation bias, making identifiers with popular codes more likely to be generated.The paper empirically investigates this issue with TIGER on the Instruments dataset.
  • Design objectives: An ideal identifier integrates hierarchical semantics, collaborative signals, and high code-assignment diversity.These are presented as the three essential objectives for item tokenization.

3 METHOD

LETTER learns item identifiers that combine hierarchical semantics, collaborative signals, and diverse code assignments. It then instantiates these identifiers in generative recommenders with a ranking-guided generation loss.

  • Semantic regularization: LETTER uses RQ-VAE to encode item semantics into hierarchical identifiers that progress from coarse to fine-grained information.Semantic embeddings are extracted, recursively quantized through multiple codebook levels, and reconstructed.
  • Collaborative regularization: A contrastive collaborative loss aligns quantized semantic embeddings with CF embeddings, encouraging similar interaction patterns to produce similar code sequences.Unlike semantic-only tokenization, optimizing quantized embeddings changes code assignments to reflect collaborative patterns.
  • Diversity regularization: Diversity regularization clusters code embeddings, pulls same-cluster codes together, and pushes different-cluster codes apart to alleviate biased assignment.The intended effect is a more uniform code-embedding distribution and more balanced code assignment.
  • Instantiation: LETTER tokenizes each item into a code sequence before translating user histories and next-item targets into generative-recommendation training examples.The trained tokenizer is used during both training and inference, and valid identifiers are generated with Trie-constrained decoding.
  • Ranking-guided generation loss: The ranking-guided loss adjusts temperature to emphasize hard negatives, and its minimization is associated with optimizing one-way partial AUC and improving top-K ranking ability.Smaller temperature intensifies the hard-negative penalty.

4 EXPERIMENTS

The experiments evaluate LETTER against different identifier types and examine how its components and settings affect performance across three real-world recommendation datasets.

  • Research questions: The experiments address LETTER’s comparative performance, component effects, and sensitivity to identifier and regularization settings.The stated research questions cover comparisons with different identifiers, ablations of LETTER components, and multiple hyperparameter settings.

4.1 Experimental Settings

The study uses three real-world datasets and compares LETTER-based generative recommenders with traditional and LLM-based baselines using several identifier types.

  • Datasets: The datasets cover music gear, beauty products, and Yelp businesses from Amazon review and Yelp interaction data.They are Instruments, Beauty, and Yelp2.
  • Preprocessing and split: Evaluation uses sequential recommendation with sparse users and items removed, leave-one-out splitting, and histories limited to 20 items.Users and items with fewer than five interactions are discarded.
  • Baselines: Baselines include traditional recommender models and LLM-based generative recommenders using ID, textual, collaborative, and codebook-based identifiers.The listed models include MF, Caser, HGN, BERT4Rec, LightGCN, SASRec, BIGRec, P5 variants, TIGER, and LC-Rec.
  • Implementation: LETTER is instantiated on TIGER and LC-Rec, with LC-Rec fine-tuned using LoRA on LLaMA-7B and semantic embeddings extracted with LLaMA-7B.The implementation follows TIGER’s paper because official code was unavailable.
  • Training configuration: The tokenizer uses four RQ-VAE codebook levels, each containing 256 code embeddings of dimension 32, and is trained with AdamW for 20k epochs.The passage also specifies the learning rate, batch size, and searched regularization strengths.

4.2 Overall Performance (RQ1)

LETTER is evaluated by instantiating it on TIGER and LC-Rec across three datasets. It consistently improves both backend models, while codebook-based identifiers generally outperform ID- and textual-identifier baselines.

  • P5-CID usually outperforms P5-SemID across the three datasets.P5-CID uses collaborative signals from the item co-appearance graph, whereas P5-SemID assigns identifiers from item categories.
  • Codebook-based TIGER and LC-Rec outperform ID- and textual-identifier models in most cases.The paper attributes this pattern to hierarchical semantics encoded through RQ-VAE, which captures fine-grained item details.
  • Textual identifiers can misalign similar item semantics with dissimilar interactions, hindering collaborative-signal learning for recommendation.
  • LETTER consistently improves TIGER and LC-Rec across three datasets.The authors attribute these gains to collaborative-signal integration and more diverse token assignments.

4.3 In-depth Analysis

In-depth analyses show that LETTER’s collaborative and diversity regularization improve performance, code utilization, and collaborative encoding, while identifier and codebook sizes require balanced choices.

  • 4.3.1 Ablation Study (RQ2): Collaborative or diversity regularization individually improves TIGER, while combining all three regularizations improves it further.The ablation study evaluates semantic, collaborative, and diversity regularization variants on Instruments and Beauty; Yelp results are omitted because observations are similar.
  • 4.3.1 Ablation Study (RQ2): Ranking-guided generation loss makes LETTER-TIGER the best-performing ablation variant by suppressing hard negatives through temperature adjustment.
  • 4.3.2 Code Assignment Distribution (RQ2): Diversity regularization produces a more uniform first-code distribution, alleviating code-assignment bias and potentially item-generation bias.Figure 6 compares TIGER with and without diversity regularization, and collaborative TIGER with and without it.
  • 4.3.2 Code Assignment Distribution (RQ2): Diversity regularization raises first-level code utilization and compensates for the collaborative regularizer’s reduction from 148 to 76 codes.LETTER therefore combines collaborative-signal capture with high code utilization.
  • 4.3.4 Investigation on Collaborative Signals in Identifiers (RQ2): LETTER outperforms TIGER in ranking with quantized item embeddings, indicating effective incorporation of collaborative signals into identifiers.A similarity experiment also measures overlap between code sequences of items paired by similar pretrained CF embeddings.
  • 4.3.5 Hyper-Parameter Analysis (RQ3): Identifier length improves performance from 2 to 4 but degrades it from 4 to 8, because longer sequences are harder to generate accurately.
  • 4.3.5 Hyper-Parameter Analysis (RQ3): Increasing codebook size generally helps, but excessive expansion can hurt through limited selection diversity at small sizes and noise overfitting at large sizes.The evaluated sizes are N = 64, 128, 256, and 512.
  • 4.3.5 Hyper-Parameter Analysis (RQ3): Stronger collaborative regularization generally improves performance, although overly large strength can interfere with semantic regularization.

5 RELATED WORK

Related work uses LLMs for generative and discriminative recommendation, with item tokenization remaining central to generative systems. Existing identifiers differ in how they represent semantics, collaboration, hierarchy, and adaptability.

  • LLMs for Generative Recommendation: Generative recommendation research uses LLMs to generate recommendations, making item tokenization a crucial indexing problem.
  • LLMs for Generative Recommendation: ID identifiers can encode item semantics or collaborative signals, but fixed, unlearnable structures struggle to represent similarity efficiently and adapt to new items.
  • LLMs for Generative Recommendation: Textual identifiers provide detailed item descriptions but struggle to encode semantics hierarchically or integrate collaborative signals.
  • LLMs for Discriminative Recommendation: Discriminative recommendation work includes LLM-enhanced traditional recommenders and LLM-based recommenders used directly for recommendation tasks.

6 CONCLUSION AND FUTURE WORK

The study concludes that LETTER is a learnable tokenizer designed around hierarchical semantics, collaborative signals, and diverse code assignments. Applied to two generative recommender models, LETTER and ranking-guided generation are supported by extensive experiments.

  • LETTER learns item identifiers that capture hierarchical semantics, collaborative signals, and code assignment diversity.
  • LETTER is applied to two generative recommender models with a ranking-guided generation loss intended to enhance ranking performance.
  • Extensive experiments substantiate LETTER’s superiority in item tokenization for generative recommendation models.

7 APPENDIX

The appendix explains how the ranking-guided loss emphasizes difficult negatives and relates to top-K ranking metrics. Its derivation connects hard-negative weighting, temperature control, surrogate optimization, OPAUC, Recall@K, and NDCG@K.

  • Proof strategy: The proof analyzes hard-negative mining and the relationship between the ranking-guided loss and ranking metrics.
  • Hard Negative Mining: When t-1 tokens are determined, the loss is associated with hard-negative mining on the t-th token.
  • Hard Negative Mining: The gradient weighting is proportional to p(v), so harder negative samples receive larger weights under the ranking-guided loss.
  • Hard Negative Mining: Decreasing τ increases the weights of difficult negatives with higher p(v) and decreases the weights of simpler negatives.
  • Relation with Ranking: L_rank is established as a surrogate loss for L_ρ,τ, while DRO is described as the closed-form solution of an associated optimization problem.
  • Relation with Ranking: With one positive sample, OPAUC strongly correlates with top-K ranking metrics and determines whether the positive item ranks within K.
Loading 2405.07314v3…