Abstract
Network embedding is crucial for graph-based tasks but faces significant storage and retrieval challenges at scale. We present SNEQ, a semi-supervised framework that jointly optimizes node representations and a compressed codebook. By leveraging a differentiable self-attention mechanism for quantization alongside adaptive and semantic margin losses, SNEQ achieves state-of-the-art accuracy while drastically reducing memory footprint and latency.
Introduction
As networks scale to millions of nodes, traditional embedding methods encounter two primary bottlenecks: massive storage overhead for high-dimensional floating-point vectors and high retrieval latency for similarity searches. Existing quantization techniques often suffer from accuracy loss because they are applied post-hoc. SNEQ (Semi-supervised attributed Network Embedding with attention-based Quantisation) addresses these issues by integrating quantization directly into the learning process, leveraging available node labels to enhance semantic quality.
Methodology
The SNEQ architecture consists of three integrated components designed for end-to-end training:
- Adaptive Margin Learning: To preserve structural information, SNEQ employs a triplet loss based on shortest-path distances. Unlike fixed-margin approaches, the adaptive margin reflects the actual structural disparity between nodes, ensuring precise neighborhood preservation.
- Semantic Margin Learning: A semi-supervised loss incorporates node labels by pulling nodes with identical labels together and pushing those with different labels apart by a constant margin.
- Self-Attention Based Quantisation: This core innovation uses a self-attention layer to generate "soft" one-hot vectors, making the quantization process differentiable. These vectors are converted into compact binary codes and learned codebooks during inference.
Experimental Setup
SNEQ was evaluated on several real-world networks:
- Cora_ML & Citeseer: Standard citation networks with attributes and labels.
- DBLP: A medium-sized co-authorship network.
- cDBLP: A large-scale version with over 317,000 nodes, used to test scalability.
Results and Discussion
SNEQ consistently outperforms state-of-the-art methods like Graph Attention Networks (GAT) and Graph2Gauss (G2G) across various tasks.
Key Performance Metrics
- Accuracy: SNEQ achieved superior results in link prediction and node classification. On the cDBLP dataset, it surpassed G2G's link prediction AUC by nearly 4 percentage points.
- Compression: For cDBLP, SNEQ reduced storage requirements from 155.31 MB to 2.69 MB—a 60x reduction—without sacrificing accuracy.
- Efficiency: The model achieved a 70x speedup in retrieval time compared to real-valued embeddings through the use of Symmetric Distance Computation (SDC) and lookup tables.
Insights
The success of SNEQ stems from making quantization differentiable. By using self-attention as a "sparsifier," the network learns embeddings that are inherently compressible, avoiding the "information cliff" typical of post-processing discretization. Furthermore, using shortest-path distances for adaptive margins provides a richer training signal than binary neighbor signals.
Conclusion
SNEQ demonstrates that high-quality network embeddings can be both compact and fast. While calculating shortest paths may pose a challenge for extremely massive, dynamic graphs, the self-attention quantization module offers a general-purpose solution that could be integrated into other GNN architectures. Future work will explore the application of this module to a broader range of graph neural network models.
Summary updated