Abstract
Modern document retrieval systems face a trade-off between the rich semantic representations of models like BERT and the computational efficiency of binary hashing. We present MICPQ (Mutual-Information-Improved Contrastive Product Quantization), a framework that bridges this gap by combining BERT embeddings with Product Quantization (PQ). By employing end-to-end training with contrastive learning and mutual information maximization, MICPQ overcomes the limitations of traditional semantic hashing. Our evaluations show that MICPQ outperforms state-of-the-art methods by up to 4.3% across standard benchmarks while maintaining high retrieval efficiency.
Introduction: The Retrieval Bottleneck
In large-scale document retrieval, Approximate Nearest Neighbor (ANN) search is essential. Traditional semantic hashing converts documents into binary codes for fast Hamming distance calculations. However, this approach suffers from two primary issues: the use of outdated features (like TF-IDF) and the "integer bottleneck," where the discrete nature of Hamming distance limits similarity measurement precision. While BERT offers superior contextual embeddings, its raw output is often anisotropic—clustering into a narrow cone—making it unsuitable for direct quantization without refinement.
Methodology: MICPQ Framework
MICPQ addresses these challenges through a multi-stage refinement and quantization process:
- End-to-End Refining: BERT embeddings are sliced and passed through learnable mappings to optimize them for subsequent quantization.
- Probabilistic Product Quantization: Instead of binary codes, MICPQ uses PQ to represent documents via real-valued codewords from multiple codebooks. To maintain differentiability, we utilize probabilistic assignment with the Gumbel-Softmax trick.
- Contrastive Learning with "Two Views": We refine BERT's anisotropic space by training the model to minimize the distance between two different "views" of the same document, generated using independent dropout masks.
- Mutual Information (MI) Maximization: To prevent "codeword collapse," where only a subset of the codebook is utilized, we maximize the MI between documents and their assigned codewords, ensuring an even and representative distribution.
As shown in the sensitivity analysis above, the model's performance is robust across various hyperparameter settings, with specific optimal ranges for the contrastive dropout rate ($p_{drop}$) and the mutual information weight ($\lambda$).
Experimental Results
We evaluated MICPQ on three standard benchmarks: NYT (New York Times), AGNews, and DBpedia.
Key Performance Gains
MICPQ consistently established new state-of-the-art results, surpassing the previous leading method (DHIM) by an average of 4.32% on NYT, 3.07% on AGNews, and 4.37% on DBpedia across various bit lengths. Notably, even our simplified binary baseline, CSH (Contrastive Semantic Hashing), outperformed many existing models, validating the strength of our contrastive training approach.
The transition from binary hashing (CSH) to Product Quantization (MICPQ) provides a significant boost in representational accuracy. As seen in the figure above, MICPQ consistently outperforms its variants across all bit lengths, demonstrating the effectiveness of the integrated framework.
Conclusion and Future Directions
MICPQ demonstrates that combining BERT with contrastive product quantization significantly enhances document retrieval. Future work will focus on increasing codebook diversity to capture different document "aspects" and scaling the framework to massive passage retrieval tasks. Additionally, exploring more sophisticated embedding decomposition methods beyond simple slicing may further unlock BERT's potential for efficient search.
Summary updated