Generative Semantic Hashing Enhanced via Boltzmann Machines

Lin Zheng, Qinliang Su, Dinghan Shen, Changyou Chen

TL;DR

This paper introduces a novel generative semantic hashing framework that captures correlations between hash bits by using a Boltzmann Machine as the variational posterior. By developing a new reparameterization trick and an asymptotically-exact lower bound for training, the authors overcome the performance degradation typically seen in hashing models as code length increases.

What Problem Does This Paper Address?

In large-scale information retrieval, semantic hashing is essential for speed and memory efficiency. It maps documents into compact binary codes so that similar documents have similar codes (measured by Hamming distance).

Recent "generative" hashing methods use Variational Autoencoders (VAEs) to learn these codes. However, to keep training tractable, these models almost always assume that the bits in a hash code are independent (a factorized posterior). The authors argue this is a major flaw:

  1. Semantic Reality: Real-world data features complex dependencies; forcing bits to be independent limits the model's representational power.
  2. The "Curse" of Long Codes: As hash code length increases (e.g., to 128 bits), the code space grows exponentially. Without correlations to restrict this space, independent-bit models often assign similar items to distant codes, causing retrieval precision to plummet.

Methods

The authors propose using a Boltzmann Machine (BM) distribution for the variational posterior to explicitly model bit correlations. To make this computationally feasible, they introduce three key innovations:

  • Hierarchical Reparameterization: BMs are notoriously difficult to sample from in a way that allows backpropagation. The authors prove that a BM can be approximated as a hierarchical process: first sampling from a correlated Gaussian-like distribution, then passing the result through a Bernoulli distribution. This allows the use of the "reparameterization trick" for end-to-end training.
  • Asymptotically-Exact Lower Bound: Training a BM involves an intractable normalization constant (the partition function $Z$). The authors derive a new lower bound for the Evidence Lower Bound (ELBO) that uses a mixture distribution to cancel out the $Z$ term. They prove that as the number of mixture components $k$ increases, this bound approaches the true ELBO.
  • Low-Rank Perturbation: To handle long hash codes without a quadratic explosion in parameters, they restrict the covariance matrix of the latent Gaussian to a low-rank form ($\Sigma = D + UU^T$). This keeps the model efficient even for large bit counts.

Datasets

The model was evaluated on three standard text retrieval benchmarks:

  • Reuters21578: 10,788 documents across 90 categories.
  • 20Newsgroups: 18,828 newsgroup posts across 20 topics.
  • TMC: 21,519 documents across 22 classes.

Key Insights and Ideas

  • Correlations are a Regularizer: By modeling dependencies, the Boltzmann Machine effectively restricts the "active" area of the binary embedding space. This prevents the model from spreading similar documents across a vast, empty 128-bit space.
  • Breaking the Performance Ceiling: The most striking insight is that while baseline models like VDSH and NASH see precision drop significantly when moving from 64 to 128 bits, this model’s performance remains stable or even improves.
  • Efficiency via Math: The paper demonstrates that complex probabilistic models like BMs don't have to be slow. With the low-rank trick, their model trains nearly as fast as simpler independent-bit models.
Precision vs. Code Length: Note how the "Ours" line remains stable or rises at 128 bits while others drop.

Key Results

The proposed model consistently outperformed all unsupervised baselines (including LSH, SpH, VDSH, and NASH) across all datasets and code lengths.

  • Precision Gains: On the Reuters dataset with 128-bit codes, the model achieved a precision of 0.8482, significantly higher than the previous state-of-the-art generative model, NASH (0.7559).
  • Qualitative Clustering: UMAP visualizations of the 128-bit hash codes show that this method produces much tighter and more distinct clusters for different document categories compared to VDSH and NASH.
UMAP Visualization: (a) VDSH and (b) NASH show significant overlap, while (c) the proposed model creates much clearer category separation.

Limitations and Future Work

  • Prior Distribution: The authors used a simple prior for this study. They note that combining their correlation-enhanced posterior with more complex priors (like the mixture priors used in BMSH) could yield even better results.
  • Approximation Sensitivity: The reparameterization trick relies on an approximation that assumes small variances in the posterior. While this held true in their experiments, it might be a limitation in other domains.
  • Hyperparameter Tuning: The performance is sensitive to the rank $v$ and the number of mixture components $k$, requiring some empirical tuning to balance speed and accuracy.

Summary updated

Abstract

Generative semantic hashing is a promising technique for large-scale information retrieval thanks to its fast retrieval speed and small memory footprint. For the tractability of training, existing generative-hashing methods mostly assume a factorized form for the posterior distribution, enforcing independence among the bits of hash codes. From the perspectives of both model representation and code space size, independence is always not the best assumption. In this paper, to introduce correlations among the bits of hash codes, we propose to employ the distribution of Boltzmann machine as the variational posterior. To address the intractability issue of training, we first develop an approximate method to reparameterize the distribution of a Boltzmann machine by augmenting it as a hierarchical concatenation of a Gaussian-like distribution and a Bernoulli distribution. Based on that, an asymptotically-exact lower bound is further derived for the evidence lower bound (ELBO). With these novel techniques, the entire model can be optimized efficiently. Extensive experimental results demonstrate that by effectively modeling correlations among different bits within a hash code, our model can achieve significant performance gains.
BibTeX
@inproceedings{zheng2020generative,
  author = {Lin Zheng and Qinliang Su and Dinghan Shen and Changyou Chen},
  title = {{Generative Semantic Hashing Enhanced via Boltzmann Machines}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.71},
}
Figure