Document Hashing with Mixture-Prior Generative Models

Wei Dong, Qinliang Su, Dinghan Shen, Changyou Chen

Abstract

This paper introduces a more expressive framework for semantic hashing by replacing simple priors in generative models with mixture priors. By utilizing a Bernoulli mixture prior (BMSH) and end-to-end training via the straight-through estimator, the authors achieve state-of-the-art performance in document retrieval. These models create compact binary codes that effectively capture the multi-modal nature of real-world document data, overcoming the limitations of single-component distributions.

Introduction

In large-scale information retrieval, comparing documents in their raw form is computationally prohibitive. Semantic hashing addresses this by mapping documents to short binary strings, enabling rapid "Hamming distance" calculations via bitwise operations. While recent Variational Autoencoder (VAE) based methods have advanced the field, they often rely on restrictive single-component priors (e.g., a single Gaussian). Such priors fail to model the multi-modal structure inherent in document collections where items naturally belong to diverse topics. Additionally, traditional two-stage training—continuous training followed by thresholding—often results in a significant "quantization gap" and loss of retrieval quality.

Methods

The authors propose two generative models that leverage mixture priors to better represent complex data distributions:

  1. GMSH (Gaussian Mixture Semantic Hashing): This model replaces the standard Gaussian prior with a Gaussian Mixture Model (GMM), allowing for more complex latent structures. However, it still requires a post-hoc quantization step to generate binary codes.
  2. BMSH (Bernoulli Mixture Semantic Hashing): This advanced model employs a Bernoulli Mixture prior, which naturally generates discrete samples. To enable end-to-end training despite the non-differentiability of discrete variables, the authors use the Straight-Through (ST) gradient estimator. This allows the model to learn binary representations directly, minimizing the quantization gap.
Architectural comparison of GMSH and BMSH models.

A supervised extension, BMSH-S, further incorporates label information through an additional classification loss, encouraging semantically similar documents to share closer hash codes.

Experimental Results

The models were evaluated on three standard benchmarks: Reuters21578, 20Newsgroups, and the TMC (Traffic Management Center) dataset.

Key Insights

  • Contextual Regularization: Mixture priors allow the model to regularize documents differently based on their specific topic context, creating distinct "neighborhoods" in the latent space.
  • End-to-End Advantage: BMSH consistently outperforms GMSH because it is optimized specifically for binary output from the start, avoiding the performance drop associated with separate thresholding.
  • Stability and Robustness: BMSH performance remains stable across various numbers of mixture components ($K$) and shows resistance to overfitting as bit length increases, unlike many baseline models.

Performance Comparison

BMSH consistently outperformed previous unsupervised state-of-the-art models like VDSH and NASH. For instance, on the TMC dataset with 32-bit codes, BMSH achieved a precision of 0.7481, surpassing NASH (0.6921) and VDSH (0.7108).

Retrieval precision on the TMC dataset showing BMSH outperforming baselines.

In supervised settings, BMSH-S set new benchmarks, reaching 0.9640 precision on the Reuters dataset with 32-bit codes. Visualization via UMAP confirmed that mixture priors lead to tighter, more discriminative document clusters.

Conclusion

This work demonstrates that mixture-prior generative models significantly improve the quality of semantic hashes for document retrieval. By bridging the gap between continuous latent spaces and discrete binary codes through end-to-end training, BMSH provides a robust and scalable solution for large-scale retrieval. Future work may explore extending these mixture-prior models to other multi-modal data types, such as images and video.

Summary updated

BibTeX
@inproceedings{dong2019document,
  author = {Wei Dong and Qinliang Su and Dinghan Shen and Changyou Chen},
  title = {{Document Hashing with Mixture-Prior Generative Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/d19-1526},
}
Figure