Abstract
Network embedding is a critical component in modern recommendation systems, yet scaling these methods to graphs with billions of edges remains a significant challenge. This paper presents DistNE (Distributed Network Embedding), a highly scalable algorithm implemented in Apache Spark. DistNE utilizes a recursive graph partitioning strategy to decompose massive networks into manageable subgraphs and a specialized "border subgraph." This "share-nothing" architecture enables parallel processing with zero communication overhead during the embedding phase. Experimental results on datasets with up to 20 billion edges demonstrate that DistNE outperforms state-of-the-art frameworks like Pytorch-BigGraph in both speed and accuracy, while delivering substantial real-world performance gains in production environments.
Introduction
Mapping graph nodes into low-dimensional vector spaces—network embedding—is essential for tasks such as link prediction and node classification. However, as social networks and web graphs grow to billions of edges, traditional embedding techniques face severe scalability bottlenecks. Single-machine approaches are limited by memory constraints, while existing distributed frameworks often rely on parameter servers that introduce massive communication overhead. Furthermore, simple "divide-and-conquer" partitioning often fails to preserve the structural integrity of "border nodes" that bridge different partitions, leading to degraded embedding quality.
The DistNE Framework
DistNE addresses these challenges by leveraging a "share-nothing" architecture within the Apache Spark ecosystem. The framework operates through three primary phases: recursive partitioning, parallel processing, and embedding fusion.
Recursive Graph Partitioning
The core innovation of DistNE is its handling of inter-partition connections. Using a greedy strategy called SparkGP, the graph $G$ is divided into $k$ induced subgraphs. Nodes that possess neighbors in multiple partitions are identified as "border nodes." These nodes and their associated edges are grouped into a dedicated "border subgraph" ($G_b$). If $G_b$ remains too large for a single machine, the partitioning process is applied recursively.
Parallel Processing and Fusion
Once the graph is decomposed into sufficiently small subgraphs, standard embedding algorithms (e.g., node2vec) are executed on each subgraph independently and in parallel. This design eliminates the need for inter-node communication during the most computationally intensive stage. Finally, the embedding for any given node is generated by concatenating its vectors from its primary induced subgraph and any border subgraphs it inhabits. This fusion captures both local community structures and global "bridge" connections.
Experimental Evaluation
DistNE was evaluated against seven diverse datasets, including massive real-world graphs like Friendster (2.5B edges) and production social graphs from Tencent games (up to 20.58B edges).
Performance and Accuracy
In comparative benchmarks on the Friendster dataset, DistNE was found to be over 4x faster than Pytorch-BigGraph (PBG). On smaller benchmarks like Youtube, it achieved an order of magnitude speedup over standard node2vec. Beyond speed, DistNE improved link prediction and node classification accuracy by approximately 4.25% and 4.27%, respectively, over the next-best distributed methods.
Production Impact
The framework was deployed at Tencent to power friend recommendation systems. In a live A/B test, DistNE increased the user "approval rate" for friend requests by 12.80% compared to the previous PBG-based pipeline. Additionally, it reduced the processing time for a game graph with 8.54B edges from 25.8 hours to 13.5 hours.
Conclusion and Future Work
DistNE demonstrates that recursive partitioning and the explicit modeling of border subgraphs can overcome the scalability limits of traditional distributed network embedding. By avoiding the communication bottlenecks of parameter servers, it provides a robust solution for industrial-scale graph analysis. Future research will focus on extending DistNE to inductive scenarios—allowing for the embedding of new nodes without full retraining—and further optimizing the partitioning logic for exceptionally high-density graphs.
Summary updated