NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Breaking the Hourglass Phenomenon of Residual Quantization: Enhancing the Upper Bound of Generative Retrieval

Zhirui Kuai, Zuxu Chen, Huimu Wang, Mingming Li, Dadong Miao, Binbin Wang, Xusong Chen, Li Kuang, Yuxing Han, Jiaxing Wang, Guoyu Tang, Lin Liu, Songlin Wang, Jingwei Zhuo

Introduction

Generative Retrieval (GR) represents a paradigm shift in search and recommendation systems. Unlike traditional "dual-tower" models that rely on embedding similarity, GR treats retrieval as a sequence-to-sequence task. In this framework, a Large Language Model (LLM) is trained to directly generate the unique Semantic Identifier (SID) of a relevant item given a query.

To create these SIDs, researchers typically employ Residual Quantization (RQ), which decomposes high-dimensional item vectors into a hierarchical sequence of discrete tokens. However, a critical structural flaw has been identified: the "Hourglass Phenomenon." This bottleneck in intermediate layers significantly hampers the retrieval performance and representational efficiency of LLMs.

The Hourglass Phenomenon: A Structural Bottleneck

The core of the issue lies in how RQ generates tokens across multiple layers. While the first and final layers often exhibit a healthy distribution, the intermediate layers—specifically the second layer—become extremely "clumped."

The Hourglass Phenomenon in Residual Quantization (RQ), where intermediate layers suffer from extreme token concentration, creating a bottleneck for the LLM.

This phenomenon occurs because the second layer quantizes the residuals (the errors) remaining after the first layer's quantization. Mathematically, these residuals tend to cluster near zero. Standard clustering algorithms, aiming to minimize total loss, naturally focus on outliers, which inadvertently forces the vast majority of items into a tiny subset of "head tokens." This creates a "path sparsity" problem: only a fraction of the potential ID space is utilized, confusing the LLM and leading to higher hallucination rates.

Quantifying the Imbalance

To validate this observation, the authors utilized the Gini coefficient—a standard measure of statistical dispersion—to quantify the concentration of items across SID tokens.

Gini coefficients across different RQ configurations, highlighting the disproportionately high concentration in Layer 2 compared to other layers.

As shown in the data, Layer 2 consistently exhibits a Gini coefficient significantly higher than Layers 1 or 3 (often exceeding 0.55). This empirical evidence confirms that a few tokens in the middle of the SID sequence are doing the "heavy lifting" for an overwhelming number of items, effectively hiding the fine-grained distinctions the LLM needs to make.

Proposed Solutions: Breaking the Bottleneck

The researchers proposed two primary methods to mitigate the hourglass effect:

  1. Heuristic Layer Deletion: A straightforward approach where the problematic second layer is removed entirely. While this reduces the total "address space," it eliminates the confusing bottleneck, allowing the model to focus on the relationship between coarse-grained (Layer 1) and fine-grained (Layer 3) features.
  2. Adaptive Variable-Length Token Strategy: A more nuanced approach that transforms SIDs into variable-length sequences. By identifying and removing only the most overused "head tokens" from the second layer, the system preserves detail where it is useful while skipping the crowded, non-discriminative parts of the hierarchy.

Experimental Results

The strategies were tested on a massive dataset from JD.com, involving a catalog of 200 million items and hundreds of millions of training samples. The results across various LLM architectures (LLaMA2, Qwen, Baichuan) were striking.

Using the Adaptive Variable-Length strategy (removing the top 400 most frequent tokens from Layer 2):

  • LLaMA2-0.8B: Recall@1 improved from 0.2480 to 0.3340, a relative increase of approximately 34%.
  • Recall@50: Performance reached nearly 0.80, up from 0.7480.
  • Reliability: The "Invalid ID Ratio" dropped significantly, indicating that the model became more precise and less prone to hallucinating non-existent identifiers.

Conclusion and Future Directions

The discovery of the Hourglass Phenomenon reveals that the current standard for generating Semantic IDs is fundamentally flawed. By simply removing redundant or overly concentrated information, we can significantly enhance the upper bound of generative retrieval.

While the proposed adaptive strategies provide a powerful "patch," future work should focus on developing new quantization objectives. These objectives should explicitly penalize token concentration and path sparsity during the training phase, ensuring that the resulting SIDs are optimized for the sequential processing nature of Large Language Models from the start.

Summary updated

BibTeX
@inproceedings{kuai2024breaking,
  author = {Zhirui Kuai and Zuxu Chen and Huimu Wang and Mingming Li and Dadong Miao and Binbin Wang and Xusong Chen and Li Kuang and Yuxing Han and Jiaxing Wang and Guoyu Tang and Lin Liu and Songlin Wang and Jingwei Zhuo},
  title = {{Breaking the Hourglass Phenomenon of Residual Quantization: Enhancing the Upper Bound of Generative Retrieval}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-industry.50},
}
Figure