Abstract
Graph Neural Networks (GNNs) have become the standard for modern recommendation engines, yet their deployment at scale is often hindered by the massive memory footprint and high latency associated with 32-bit floating-point (FP32) embeddings. While quantization offers a path toward efficiency, traditional methods suffer from significant accuracy degradation due to gradient mismatch during training. This paper presents HQ-GNN, a framework that utilizes second-order Hessian information to refine gradients, enabling stable training of low-bit embeddings. HQ-GNN achieves up to a 3.6x inference speedup and significant storage savings, outperforming state-of-the-art quantization techniques by over 15% while maintaining nearly the same accuracy as full-precision models at 4-bit widths.
Introduction
In industry-scale recommendation systems, GNNs must process millions of users and items. Storing these embeddings in FP32 format can require gigabytes of memory, and calculating similarities between high-dimensional continuous vectors during real-time retrieval introduces substantial latency. Quantization—the process of converting these 32-bit numbers into low-bit integers or binary codes—is a promising solution.
However, quantization functions are inherently non-differentiable step functions, which breaks the standard back-propagation algorithm. The industry-standard workaround, the Straight-Through Estimator (STE), ignores the quantization step during the backward pass. This creates a "gradient mismatch," where model updates do not accurately reflect the rounding errors introduced, leading to unstable training and poor recommendation performance.
The HQ-GNN Framework
HQ-GNN (Hessian-aware Quantized GNN) addresses these challenges through two primary innovations designed to bridge the gap between efficiency and accuracy.
1. Arbitrary Bit-width Quantization
Unlike previous hashing-based methods that often restrict embeddings to 1-bit binary spaces, HQ-GNN supports flexible bit-widths (e.g., 2-bit, 4-bit). This allows system architects to precisely tune the trade-off between memory savings and recommendation quality based on specific hardware constraints.
2. Generalized Straight-Through Estimator (GSTE)
The core contribution of HQ-GNN is the Generalized Straight-Through Estimator. Instead of treating the gradient as a simple identity function, GSTE incorporates the Hessian matrix (second-order derivatives) to adjust updates.
The framework treats the Hessian as a "sensitivity map." It recognizes that not all quantization errors are equal; some dimensions of an embedding are highly sensitive to rounding, while others are more robust. By using the Hutchinson method to efficiently estimate the trace of the Hessian without computing the full matrix, HQ-GNN scales gradients based on this second-order information. This effectively weights the updates to account for the loss function's sensitivity to rounding errors at specific points in the embedding space.
Experimental Evaluation
The researchers evaluated HQ-GNN on four diverse, large-scale public benchmarks: Gowalla, Yelp2018, Amazon-Book, and Alibaba. These datasets represent a wide range of user behaviors, from location-based social networking to e-commerce interactions.
Key Findings
- Superior Accuracy: In 1-bit quantization scenarios, HQ-GNN outperformed the previous state-of-the-art (HashGNN) by an average of 15.8% in Recall@50 and 15.6% in NDCG@50 across all datasets.
- The 4-Bit Sweet Spot: The study found that 4-bit quantization recovered approximately 98.5% of the performance of a full FP32 LightGCN model. This suggests that 4-bit quantization provides a nearly "free" compression win for production environments.
- Hardware Acceleration: By producing binary or low-bit embeddings, the model leverages Hamming distance or integer-only arithmetic. This resulted in inference speeds approximately 3.6 times faster than vanilla FP32 GNNs.
- Training Stability: Comparative analysis of training curves showed that the Hessian-aware GSTE was significantly more stable and converged to lower loss values than the standard STE, proving the value of second-order information in mitigating gradient mismatch.
Discussion and Future Work
While HQ-GNN introduces a small training overhead due to the Hutchinson method, this "tax" is only paid during model development. During inference, the model is entirely absent of Hessian calculations, providing a lean, high-speed solution for production.
Current limitations include the fact that while node embeddings (the primary memory bottleneck) are quantized, the GNN weights themselves remain in full precision. Future research may explore full-model quantization or "mixed-precision" strategies, where popular items are assigned higher bit-widths to preserve accuracy while niche items are more aggressively compressed.
Conclusion
HQ-GNN demonstrates that second-order information is a powerful tool for optimizing quantized GNNs. By accounting for the sensitivity of the loss function to quantization errors, HQ-GNN enables the deployment of highly efficient, low-bit recommendation models that do not sacrifice the accuracy required for modern user experiences.
Summary updated