vGraph: A Generative Model for Joint Community Detection and Node Representation Learning

Fan-Yun Sun, Meng Qu, Jordan Hoffmann, Chin-Wei Huang, Jian Tang

Introduction

In graph analysis, researchers typically focus on two distinct levels of structure: global structure (community detection), which involves grouping nodes into densely connected clusters, and local structure (node representation learning), which maps nodes into low-dimensional vector spaces to capture immediate neighborhood relationships.

Historically, these tasks have been treated as separate, sequential problems—for instance, learning embeddings first and then applying K-means to find communities. However, these tasks are deeply intertwined. A node’s community provides vital context for its embedding, and high-quality embeddings serve as excellent features for clustering. To bridge this gap, researchers propose vGraph, a probabilistic generative model that performs community detection and node representation learning simultaneously in a unified, scalable framework.

The vGraph Model

Inspired by topic modeling techniques like Latent Dirichlet Allocation (LDA), vGraph adapts probabilistic generative processes for graph structures.

The Generative Process

To generate an edge between a target node $w$ and a context neighbor $c$, the model follows a two-step process:

  1. Pick a Community: Draw a community assignment $z$ from the node’s community distribution $p(z|w)$.
  2. Pick a Neighbor: Draw the neighbor $c$ from that specific community’s distribution over nodes $p(c|z)$.
Graphical models for vGraph and its hierarchical extension.

Key Technical Innovations

  • Embedding Parameterization: Both community memberships and community-to-node distributions are parameterized using low-dimensional embeddings. This forces the model to learn a shared latent space that optimizes both tasks simultaneously.
  • Variational Inference with Gumbel-Softmax: Because community assignments are discrete, standard backpropagation is ineffective. vGraph employs the Gumbel-Softmax trick to enable end-to-end gradient-based optimization.
  • Smoothness Regularization: Borrowing intuition from spectral clustering, vGraph incorporates a regularization term. This encourages neighboring nodes—especially those with high Jaccard similarity in their neighborhoods—to have similar community membership distributions.
  • Scalability: By utilizing negative sampling (similar to LINE or Word2Vec), vGraph avoids the computationally expensive task of summing over all nodes in the graph, making it highly applicable to large-scale networks.
  • Hierarchical Flexibility: The model can be easily extended to detect hierarchical communities by representing assignments as paths in a tree rather than flat categories.

Experimental Setup

The model was rigorously evaluated across 20 standard graph datasets, categorized by task:

  • Non-overlapping Community Detection & Node Classification: Citeseer, Cora, Cornell, Texas, Washington, and Wisconsin.
  • Overlapping Community Detection: 10 different Facebook ego-networks, Youtube, Amazon, Dblp, and Coauthor-CS.
  • Scalability Testing: Dblp-full (a large-scale version with ~93k nodes and ~335k edges).

Key Insights and Results

The "Mutual Benefit" Hypothesis

The results strongly support the hypothesis that joint learning is not just a convenience, but a significant performance booster. The global community information acts as a regularizer for local embeddings, preventing them from overfitting to noisy local edges.

Edge-Centric Overlap

Instead of assigning a node to a single community, vGraph assigns edges to communities via the variational distribution $q(z|w, c)$. This allows a single node to naturally participate in multiple communities depending on which neighbor it is interacting with.

Visualizations of network communities and embeddings.

Performance Highlights

  • Community Detection: vGraph (and its regularized version, vGraph+) outperformed competitive baselines like BigCLAM and CESNA on 11 out of 14 datasets for overlapping community detection.
  • Node Representation: In non-overlapping scenarios, vGraph surpassed established embedding methods (DeepWalk, LINE, node2vec) in both Normalized Mutual Information (NMI) and Modularity.
  • Node Classification: The model demonstrated significant gains in classification accuracy. On the Cornell dataset, for example, the Macro-F1 score improved from ~22.7 (DeepWalk) to ~29.8 (vGraph).
  • Efficiency: vGraph proved highly scalable, successfully completing tasks on large datasets where several baselines failed to produce results within a 24-hour window.

Limitations and Future Work

While vGraph achieves state-of-the-art results, there are areas for future exploration:

  • Node Attributes: vGraph is primarily a structural model. Incorporating node features (like text or metadata) into the generative process is a promising next step.
  • Hyperparameter Sensitivity: The smoothness regularization relies on a hyperparameter $\lambda$. While set to 100 for these experiments, the optimal value may vary significantly depending on the graph's density and inherent clusteredness.
  • Hierarchical Depth: The hierarchical extension shows promise, but the current research focuses mostly on two-level hierarchies. Exploring deeper, more complex tree structures remains an open area for future research.

Summary updated

BibTeX
@inproceedings{sun2019vgraph,
  author = {Fan-Yun Sun and Meng Qu and Jordan Hoffmann and Chin-Wei Huang and Jian Tang},
  title = {{vGraph: A Generative Model for Joint Community Detection and Node Representation Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure