Abstract
Knowledge Graph Embeddings (KGE) are critical for link prediction but often demand significant memory. This paper introduces a "greedy bit-flip" algorithm that trains binarized KGEs directly in discrete space. By bypassing the need for high-precision "shadow" vectors, this method reduces memory usage by 20x and accelerates convergence while maintaining state-of-the-art performance.
Introduction
Standard KGE models represent entities and relations as 32-bit float vectors. For large-scale graphs, this leads to massive memory footprints, hindering deployment on edge devices. While binarization (using 1-bit values) offers a solution, traditional training relies on continuous relaxations like the Straight-Through Estimator (HSTE), which requires maintaining real-valued parameters during training, negating memory savings and slowing optimization.
Methodology: Greedy Bit-flip Training
The proposed approach treats training as a pure discrete optimization problem for the Binarized CP (B-CP) model.
- Direct Discrete Optimization: Instead of gradients, the algorithm iterates through binary factor matrices. For each bit, it evaluates if flipping its sign reduces the loss.
- Bitwise Efficiency: The use of XNOR and Hamming distance operations makes evaluating flips extremely fast.
- Parallelization: Updates for different entity rows are independent and can be processed in parallel.
- Ensembling: Due to the small size of binary models, multiple models can be ensembled to improve accuracy while still using less memory than a single real-valued model.
Experimental Results
The model was evaluated on WN18RR and FB15k-237.
Convergence and Performance
A key advantage of the greedy bit-flip approach is its rapid convergence. As shown in Figure 4, the proposed method (D=200, 400, 600) reaches peak performance significantly faster than the HSTE-based baseline.
Comparative Analysis
The Bit-flip B-CP model achieves a 20x reduction in memory compared to standard models like DistMult. On WN18RR, it achieved an MRR of 47.7%, rivaling the real-valued ComplEx model (47.5%). Ensembling five binary models (†Bit-flip B-CP) further pushed performance to 49.1% MRR on WN18RR.
Key Insights
- Discrete Viability: Simple greedy search in discrete space can outperform complex gradient-based optimization on continuous relaxations.
- Efficiency: The method eliminates the "training paradox" by saving memory during both training and inference.
- Flexibility: Since it doesn't require gradients, it can be applied to non-differentiable loss functions.
Conclusion
The greedy bit-flip algorithm provides a robust, memory-efficient alternative for training KGEs. Future work includes extending this logic to other architectures like DistMult and exploring further optimization strategies to avoid local minima.
Summary updated