Towards Effective Top-N Hamming Search via Bipartite Graph Contrastive Hashing

Yankai Chen, Yixiang Fang, Yifei Zhang, Chenhao Ma, Yang Hong, Irwin King

Abstract

In large-scale retrieval and recommendation systems, the computational overhead of high-dimensional, full-precision embeddings often limits real-time performance. Hashing methods offer a solution by mapping data into binary codes for fast Hamming space search; however, traditional hashing often suffers from significant accuracy loss and training difficulties due to non-differentiable binarization. This paper presents BGCH+, a novel hashing framework for bipartite graphs that leverages adaptive graph convolutions and dual-feature contrastive learning. By preserving multi-order topology and ensuring representation uniformity, BGCH+ achieves over 8x computation acceleration and 9x memory reduction while maintaining approximately 90% of the ranking quality of state-of-the-art full-precision models.

1. Introduction

Modern information retrieval and recommendation systems frequently model interactions as bipartite graphs (e.g., user-item or query-document). To find the most relevant matches, Graph Convolutional Networks (GCNs) are typically employed to generate high-dimensional continuous-value embeddings. While effective, calculating similarities between millions of these float32 vectors is computationally expensive and memory-intensive.

Hashing—the process of converting these vectors into binary codes—enables lightning-fast similarity checks using bitwise XOR operations. Despite the efficiency gains, two primary challenges persist: the "quantization gap," where binarization destroys fine-grained structural information, and the "gradient vanishing problem," caused by the non-differentiable nature of the sign function used to generate bits. BGCH+ addresses these issues through a combination of adaptive convolution and self-supervised contrastive signals.

2. Methodology

2.1 Adaptive Graph Convolutional Hashing

Unlike standard hashing methods that only binarize the final output of a GCN, BGCH+ incorporates intermediate features across multiple layers. It utilizes a layer-wise rescaling factor ($\alpha$) to ensure that the resulting binary codes can accurately approximate the original continuous values. This approach preserves the "topology-aware" information inherent in the graph's multi-order connectivity, preventing the loss of structural nuances during the hashing process.

2.2 Dual Feature Contrastive Learning (DFCL)

To improve the discriminative power of the hash codes, the authors introduce Dual Feature Contrastive Learning. This module performs data augmentation directly in the feature space by creating two distinct "views" of the data. This is achieved by adding controlled noise to both the continuous intermediate features and the scaling factors of the binary codes. By forcing the model to recognize that these perturbed views represent the same node, the model learns to produce hash codes that are more uniform and spread out across the Hamming space, effectively preventing representation collapse.

2.3 Fourier Serialized Gradient Estimation

A significant hurdle in training hashing models is the non-differentiable sign() function. Traditional approaches like "straight-through estimators" often provide inaccurate gradients. BGCH+ employs a Fourier series decomposition to approximate the derivative of the sign function. This provides a more mathematically grounded and accurate gradient for backpropagation, leading to more stable and effective training.

3. Experimental Evaluation

3.1 Datasets and Setup

The model was evaluated on six diverse real-world bipartite graph benchmarks, including MovieLens, AMZ-Book, Gowalla, Yelp2018, Pinterest, and Dianping. These datasets range in density from 0.04190 to 0.00062, providing a robust test of the model's performance on extremely sparse data.

3.2 Performance and Efficiency

Experimental results demonstrate that BGCH+ is highly competitive with full-precision baselines:

  • Accuracy: BGCH+ retains over 87% of the Recall and 90% of the NDCG of state-of-the-art models like LightGCN.
  • Speed: The framework provides over 8x computation acceleration during inference compared to floating-point operations.
  • Storage: It achieves a 9x reduction in memory footprint, making it suitable for deployment on edge devices or memory-constrained environments.
  • Baselines: BGCH+ consistently outperformed other hashing-based methods, such as HashGNN and CIGAR, across all tested datasets.

4. Key Insights

4.1 The Importance of Uniformity

A critical finding of this research is that standard hashing often leads to "representation collapse," where distinct nodes are mapped to identical binary codes. The DFCL module explicitly combats this by maximizing the entropy of the hash code distribution. This increased uniformity is directly correlated with improved ranking performance in Top-N search tasks.

4.2 Multi-Order Connectivity

By incorporating information from the "journey" through GCN layers rather than just the final state, BGCH+ captures complex relational patterns. The transition from the original BGCH to BGCH+ (adding dual contrastive learning) resulted in performance gains of up to 20% in specific metrics, highlighting the potency of self-supervised signals in mitigating quantization loss.

5. Conclusion and Future Work

BGCH+ represents a significant step toward making graph-based retrieval both efficient and effective. By combining adaptive convolutions with contrastive learning and Fourier-based gradient estimation, it bridges the gap between binary efficiency and continuous-value accuracy. Future research may focus on addressing the "over-smoothing" inherent in deep GCNs and extending the bipartite architecture to support general or multi-partite graph structures.

Summary updated

BibTeX
@article{chen2024towards,
  author = {Yankai Chen and Yixiang Fang and Yifei Zhang and Chenhao Ma and Yang Hong and Irwin King},
  title = {{Towards Effective Top-N Hamming Search via Bipartite Graph Contrastive Hashing}},
  journal = {IEEE Trans. Knowl. Data Eng.},
  year = {2024},
  url = {https://openreview.net/forum?id=GrnRZOPXRU},
}
Figure