CoFiRec: Coarse-to-Fine Tokenization for Generative Recommendation

Tianxin Wei, Xuying Ning, Xuxing Chen, Ruizhong Qiu, Yupeng Hou, Yan Xie, Shuang Yang, Zhigang Hua, Jingrui He · OpenReview

Abstract

In web environments, user preferences are often refined progressively as users move from browsing broad categories to exploring specific items. However, existing generative recommenders overlook this natural refinement process. Generative recommendation formulates next-item prediction as autoregressive generation over tokenized user histories, where each item is represented as a sequence of discrete tokens. Prior models typically fuse heterogeneous attributes such as ID, category, title, and description into a single embedding before quantization, which flattens the inherent semantic hierarchy of items and fails to capture the gradual evolution of user intent during web interactions. To address this limitation, we propose CoFiRec, a novel generative recommendation framework that explicitly incorporates the Coarse-to-Fine nature of item semantics into the tokenization process. Instead of compressing all attributes into a single latent space, CoFiRec decomposes item information into multiple semantic levels, ranging from high-level categories to detailed descriptions and collaborative filtering signals. Based on this design, we introduce the CoFiRec Tokenizer, which tokenizes each level independently while preserving structural order. During autoregressive decoding, the language model is instructed to generate item tokens from coarse to fine, progressively modeling user intent from general interests to specific item-level interests. Experiments across multiple public benchmarks and backbones demonstrate that CoFiRec outperforms existing methods, offering a new perspective for generative recommendation.

Introduction

Generative Recommendation (GR) has emerged as a powerful paradigm where items are treated as discrete tokens within a language model's vocabulary. Instead of traditional ranking, an LLM generates the next item ID as a sequence of tokens. However, a significant limitation in current GR models is the "flatness" of item identifiers. Typically, metadata like titles, categories, and descriptions are compressed into a single latent embedding before quantization. This approach ignores the natural semantic hierarchy of products and the way users browse.

The concept of coarse-to-fine preference refinement in user purchase history.

As shown in Figure 1, user intent often follows a refinement process: starting from a broad category (e.g., Musical Instruments), narrowing to a type (e.g., Electric Guitars), then a specific series, and finally a single product. If a model mispredicts the first token of a flat ID, the entire recommendation often loses relevance.

The CoFiRec Framework

To align recommendation with this natural refinement, we propose CoFiRec (Coarse-to-Fine Recommendation). The framework is built on three pillars: hierarchical tokenization, a specialized tokenizer, and structured generation.

Hierarchical Tokenization

Each item is represented by a sequence of tokens corresponding to four distinct semantic levels:

  1. Level 1 (Category): High-level product classification.
  2. Level 2 (Title): Semantic information derived from the item title.
  3. Level 3 (Description): Detailed product features.
  4. Level 4 (Collaborative Filtering): Behavioral signals captured from user-item interaction patterns using a pre-trained model (e.g., SASRec).

CoFiRec Tokenizer and Generation

The CoFiRec Tokenizer uses Vector Quantization (VQ) to encode these levels. Textual levels (1-3) share a semantic encoder, while the CF level (4) uses a dedicated tokenizer. This ensures that behavioral nuances—which text might miss—are preserved at the finest level of granularity.

Overview of the CoFiRec architecture, including tokenization and autoregressive generation.

During inference, the LLM generates tokens in a structured order. To assist the model, we inject semantic-level ($E_{level}$) and positional ($E_{pos}$) embeddings, signaling whether the model is currently predicting a broad category or a specific item detail. Theoretically, the authors prove that this structured decoding reduces the "expected dissimilarity" between predicted and ground-truth items.

Experimental Evaluation

We evaluated CoFiRec on three public benchmarks: Amazon Instruments, Amazon Beauty, and Yelp. The framework demonstrated significant improvements over state-of-the-art baselines like TIGER and IDGenRec.

Key Results

  • Performance Gains: CoFiRec achieved an average performance boost of 7.27% across all datasets.
  • Cold-Start Robustness: The model showed a 10% improvement in recommending "cold" items. The hierarchical structure allows the model to transfer categorical knowledge from popular items to rare ones.
  • Model Agility: The framework is backbone-agnostic, showing consistent gains with both T5 and LLaMA-3B architectures.
  • Efficiency: Training and inference times remain comparable to "flat" models, requiring less than 4GB of GPU memory for generation.

Conclusion

CoFiRec introduces a structured, hierarchical approach to generative recommendation that mirrors human decision-making. By decomposing item semantics into a coarse-to-fine sequence, the model improves both accuracy and interpretability. Future work will explore end-to-end training of the tokenizer and recommender, as well as the integration of multimodal signals like product imagery.

Summary updated

BibTeX
@misc{wei2025cofirec,
  author = {Tianxin Wei and Xuying Ning and Xuxing Chen and Ruizhong Qiu and Yupeng Hou and Yan Xie and Shuang Yang and Zhigang Hua and Jingrui He},
  title = {{CoFiRec: Coarse-to-Fine Tokenization for Generative Recommendation}},
  year = {2025},
  eprint = {2511.22707},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.22707},
}
Figure