CAT-ID: Category-Tree Integrated Document Identifier Learning for Generative Retrieval In E-commerce

Xiaoyu Liu, Fuwei Zhang, Yiqing Wu, Xinyu Jia, Zenghua Xia, Fuzhen Zhuang, Zhao Zhang, Fei Jiang, Wei LinarXiv 2025 · OpenReview

TL;DR

Generative Retrieval (GR) replaces traditional search pipelines by training Large Language Models (LLMs) to directly generate document IDs from user queries. CAT-ID$^2$ improves this paradigm for e-commerce by injecting expert-curated hierarchical category trees into semantic IDs using three novel loss functions. This approach ensures product IDs are both semantically cohesive and uniquely identifiable, leading to a +0.13% boost in real-world online orders.

What Problem Does This Paper Address?

Traditional e-commerce search engines rely on a multi-stage pipeline: query rewriting, document retrieval, and ranking. Generative Retrieval (GR) collapses these steps into a single end-to-end process where an LLM autoregressively generates a discrete Document ID (DocID) directly from a query string.

The primary bottleneck in GR is defining these DocIDs. An effective semantic ID must satisfy two opposing constraints: similar items should share similar ID prefixes (semantic clustering), but every item must ultimately have a completely unique ID (distinctiveness).

In e-commerce, products naturally map to rich, expert-defined hierarchical category trees (e.g., Clothes & Shoes → Shoes → Sneakers).

Figure 1: An example of Category-Tree in E-commerce.

Existing GR methods either treat these categories as flat text strings or ignore them entirely in favor of unsupervised clustering. This often results in "codebook collapse," where the model overuses a handful of ID tokens, leading to poor search accuracy for ambiguous or long-tail queries.

Methods

The authors introduce CAT-ID$^2$ (CAtegory-Tree Integrated Document IDentifier), a framework that uses a Residual Quantized Variational Autoencoder (RQ-VAE) to compress continuous product text embeddings into discrete ID sequences.

The core innovation is the introduction of three joint loss functions during the DocID learning stage to enforce structural constraints without sacrificing global semantic relationships:

Figure 2: Overall framework of CAT-ID2. It comprises two stages: DocID Learning and Generative Model Training. In the DocID Learning, Hierarchical Class Constraint Loss LHCC, Cluster Scale Constraint Loss LCSC, and Dispersion Loss LDis are introduced alongside the original residual quantinize loss Lrq. HCCL integrates prior category information, CSCL ensures uniform codebook utilization to prevent collapse, and Dispersion Loss enforces distinct semantic IDs for different documents.
  1. Hierarchical Class Constraint Loss (HCCL): This contrastive learning loss operates layer-by-layer. It pulls products within the same category closer together in the latent space while pushing different categories apart. Crucially, it uses a hard negative mining strategy by selecting negative samples from the same parent category, forcing the model to learn fine-grained distinctions.
  2. Cluster Scale Constraint Loss (CSCL): To prevent codebook collapse, this bidirectional KL-divergence loss penalizes both overused and underused codebook entries, ensuring that ID tokens are uniformly distributed.
  3. Dispersion Loss (DisL): Replacing the standard autoencoder reconstruction loss, DisL explicitly maximizes the distance between different reconstructed item embeddings, guaranteeing that every product retains a highly distinct identifier.

Once the unique DocIDs are generated, an LLM (like T5) is fine-tuned to map user queries to these target ID sequences using standard sequence-to-sequence modeling.

Datasets

The model was evaluated using ESCI (Amazon Shopping Queries Dataset), a large-scale, multilingual e-commerce benchmark containing user queries and product metadata across three languages:

  • English (us)
  • Spanish (es)
  • Japanese (jp)

Products in ESCI include multi-level category depths ranging from 2 to 7 layers. For the experiments, the authors standardized the taxonomy by truncating or filtering the category paths to a uniform depth of 3.

Key Insights and Ideas

  • Soft Constraints Over Rigid Prefixes: Instead of forcing category labels to act as rigid, deterministic ID prefixes (which destroys global semantic context), CAT-ID$^2$ treats categories as a "soft guiding signal" via contrastive losses. This preserves both local category structure and global text semantics.
  • The Necessity of Balance: Ablation studies revealed that applying hierarchical constraints (HCCL) or codebook balancing (CSCL) in isolation actually degrades performance. They must be paired with Dispersion Loss, which acts as a vital stabilizer during optimization.
  • Leveraging Expert Knowledge: Unsupervised clustering (used in baselines like TIGER) struggles to capture domain-specific logic. Integrating human-curated category trees provides a cleaner, more reliable organizational prior for deep learning models.

Key Results

Offline Benchmarks

CAT-ID$^2$ consistently outperformed state-of-the-art GR baselines (including TIGER, NCI, and Hi-Gen) and traditional Dense Retrieval (DPR) methods across all three language datasets. On the ESCI-us dataset, CAT-ID$^2$ achieved a Recall@100 of 23.37%, compared to TIGER's 18.59% and BM25's 19.42%.

Online A/B Tests

The model was deployed in the recall stage of a live production e-commerce search engine for a 10-day A/B test. CAT-ID$^2$ demonstrated significant commercial impact, particularly on difficult query types:

  • +0.33% increase in average orders per thousand users for ambiguous intent queries.
  • +0.24% increase for long-tail queries.
  • +0.13% increase in overall orders across the entire platform.

Limitations and Future Work

  • Fixed Category Depth: The current architecture requires truncating or filtering category trees to a fixed maximum depth (depth 3 in this paper). Adapting the framework to dynamically handle highly asymmetric or deeply nested taxonomies remains an open challenge.
  • Inference Latency: Autoregressive generation with LLMs is computationally expensive for real-world production systems. To meet strict online latency constraints, the authors had to rely on a hybrid approach—using intermediate node clustering and dense retrieval scores to truncate results. Future work will focus on optimizing the native generation speed of the model.

Summary updated

BibTeX
@misc{liu2025cat,
  author = {Xiaoyu Liu and Fuwei Zhang and Yiqing Wu and Xinyu Jia and Zenghua Xia and Fuzhen Zhuang and Zhao Zhang and Fei Jiang and Wei Lin},
  title = {{CAT-ID: Category-Tree Integrated Document Identifier Learning for Generative Retrieval In E-commerce}},
  year = {2025},
  eprint = {2511.01461},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.01461},
}
Figure