Language Models As Semantic Indexers

Bowen Jin, Hansi Zeng, Guoyin Wang, Xiusi Chen, Tianxin Wei, Ruirui Li, Zhengyang Wang, Zheng Li, Yang Li, Hanqing Lu, Suhang Wang, Jiawei Han, Xianfeng Tang · DOI

Abstract

Traditional Information Retrieval (IR) systems rely on two-stage pipelines to generate document identifiers, often leading to information loss and distribution mismatches. This paper presents LMINDEXER, a self-supervised framework introduced at ICML 2024 that transforms generative language models into semantic indexers. By learning discrete, hierarchical "Semantic IDs" directly from text through an auto-reconstruction objective, LMINDEXER achieves state-of-the-art performance across recommendation, product search, and document retrieval tasks.

Introduction

In modern IR, assigning unique and meaningful identifiers to documents is crucial. While traditional systems use arbitrary IDs, Semantic IDs—which reflect the document's content—enable more effective generative retrieval. The prevailing method for creating these IDs involves a disjointed two-stage process: encoding text into continuous vectors (e.g., via BERT) and then quantizing those vectors into discrete sequences. This approach often suffers from information bottlenecks and a lack of alignment between the latent space and the required hierarchical structure. LMINDEXER addresses these issues by learning representations and their hierarchy simultaneously and directly from the source text.

Methodology: The LMINDEXER Framework

LMINDEXER utilizes an encoder-decoder architecture (based on T5-base) to treat indexing as a sequence-to-sequence task. The framework consists of two primary components: the Semantic Indexer and the Reconstructor.

The LMINDEXER architecture featuring the Semantic Indexer and the auto-reconstruction pipeline.

Semantic Indexing and Auto-Reconstruction

The Semantic Indexer generates a sequence of discrete tokens from multiple codebooks to form a hierarchical Semantic ID. To ensure these IDs capture the document's "essence," the model employs a self-supervised reconstruction objective. A shallow Transformer reconstructor attempts to rebuild the original text using only the generated Semantic ID and minimal context hints. Successful reconstruction implies that the ID effectively compresses the document's semantic information.

Training Stability

To prevent training collapse, the authors implemented several strategies:

  • Warm-up: The reconstructor is trained first to provide stable gradients to the indexer.
  • Pre-training: The indexer is pre-trained without discrete constraints to avoid posterior collapse.
  • Loss Functions: Contrastive loss ensures uniqueness among document IDs, while commitment loss maintains hierarchical consistency during progressive training.

Evaluation and Results

The framework was evaluated on the Amazon Review Dataset (Beauty, Sports, Toys) for recommendation and product search, and on NQ320k and MS MACRO for document retrieval.

Performance Highlights

  • Semantic Quality: LMINDEXER achieved an Adjusted Mutual Information (AMI) score of 0.3563 on Amazon Beauty, significantly outperforming rq-VAE (0.2654).
  • Recommendation: On the Amazon Beauty task, it reached a Recall@5 of 0.0415, nearly tripling the performance of the rq-VAE baseline.
  • Retrieval: On NQ320k, the model achieved a Recall@1 of 0.6631, surpassing the previous state-of-the-art generative retriever, SEAL.

Discussion: Insights and Limitations

A key insight of this work is that reconstruction serves as a powerful proxy for semantic supervision. By forcing the model to recover the original text, the resulting IDs naturally organize into a taxonomy where initial digits represent broad categories and subsequent digits represent finer details.

Visualization of probabilities by category and semantic ID, demonstrating the alignment between learned IDs and ground-truth taxonomies.

Despite its success, LMINDEXER faces challenges at extreme scales. On the MS MACRO 1M dataset, traditional Dual Encoders (DPR) still maintain a slight performance edge. Additionally, the computational cost of beam search during generative retrieval remains higher than simple vector similarity lookups. Future research may focus on scaling the backbone model and optimizing inference latency to bridge these gaps.

Summary updated

BibTeX
@inproceedings{jin2024language,
  author = {Bowen Jin and Hansi Zeng and Guoyin Wang and Xiusi Chen and Tianxin Wei and Ruirui Li and Zhengyang Wang and Zheng Li and Yang Li and Hanqing Lu and Suhang Wang and Jiawei Han and Xianfeng Tang},
  title = {{Language Models As Semantic Indexers}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=sYeioWoF9u},
}
Figure