Graph Communal Contrastive Learning

Bolian Li, Baoyu Jing, Hanghang Tong

TL;DR

Graph Communal Contrastive Learning ($gCooL$) bridges the gap between local node-level features and global community structures in unsupervised graph learning. By jointly optimizing for community detection and node representation, it prevents the common pitfall of treating semantically similar nodes from the same community as "negative" examples, leading to state-of-the-art performance in node classification and clustering.

What Problem Does This Paper Address?

Graph Contrastive Learning (GCL) has become a powerhouse for learning node representations without human labels. The standard recipe involves creating two "views" of a graph (via augmentations like dropping edges) and training an encoder to pull representations of the same node together while pushing all other node pairs apart.

However, there’s a catch: the "sampling error." In many real-world graphs, nodes naturally form communities (e.g., people with shared interests in a social network). These nodes are semantically similar. Standard GCL methods often sample two nodes from the same community and treat them as a negative pair. This forces the model to learn distinct representations for nodes that should actually be similar, introducing "graphic errors" that hurt downstream performance.

Methods

The authors propose a framework called $gCooL$, which consists of two main innovative components:

  1. Dense Community Aggregation (DeCA): Instead of relying on traditional clustering, DeCA is an end-to-end algorithm that detects communities by maximizing intra-community density (how tightly nodes are connected within a group) and minimizing inter-community density (how loosely groups connect to each other). It uses a "soft assignment" approach, where nodes are assigned to community centroids with varying probabilities.

    Overview of the gCooL framework showing the dual-view augmentation and the contrastive process.
  2. Reweighted Self-supervised Cross-contrastive (ReSC) Training: This is the "secret sauce" for the contrastive step. It combines standard node-level contrast with a novel community contrast. In a cross-view fashion, node representations from one view are pulled toward the community centroids of the other view. This ensures that the learned representations are not only invariant to perturbations but also respect the broader community structure.

To balance these, the authors use an $\alpha$-decay coefficient. Early in training, the model focuses on stabilizing community partitions; as training progresses, it shifts focus toward refining individual node representations.

Datasets

The model was evaluated on six diverse real-world datasets:

  • Single-view graphs: Amazon-Computers, Amazon-Photo (co-purchase networks), Coauthor-CS (academic network), and WikiCS (Wikipedia reference network).
  • Multiplex (multi-view) graphs: IMDB (movies linked by actors/directors) and DBLP (papers linked by authors/citations/terms).

Key Insights and Ideas

  • Communities as Semantic Anchors: The core "aha moment" is treating community centroids as semantic anchors. By contrasting nodes against these centroids across different views, the model learns that being in the same community is a strong signal of similarity that should override simple node-level distinctions.
  • End-to-End Synergy: Unlike pipeline methods that cluster nodes after learning representations, $gCooL$ learns them simultaneously. This allows the emerging community structure to guide the representation learning, and vice versa.
  • Robustness to Noise: By maximizing edge density within communities, DeCA is more robust to the random edge-dropping typically used in graph augmentation than traditional modularity-based methods.
Visualization showing how DeCA achieves higher edge density over training epochs compared to baselines.

Key Results

$gCooL$ consistently outperformed state-of-the-art unsupervised methods (like MVGRL and GCA) and even rivaled supervised GCNs in some tasks:

  • Node Classification: On the Amazon-Photo dataset, $gCooL$ achieved a Micro-F1 score of 93.18%, significantly higher than the 91.74% achieved by MVGRL.
  • Node Clustering: The model showed marked improvements in Normalized Mutual Information (NMI) and Adjusted Rand Index (ARI). For instance, on Amazon-Computers, it reached an ARI of 0.284, nearly doubling the performance of some baselines.
  • Multiplex Graphs: The framework naturally scales to multi-view data, outperforming specialized multiplex models like HDMI and DMGI on the IMDB and DBLP datasets.

Limitations and Future Work

While the paper demonstrates strong results, a few areas remain open for exploration:

  • Computational Complexity: While the authors provide a vectorized version of DeCA for GPU acceleration (Appendix C), the overhead of maintaining and updating community centroids might be significant for extremely large-scale graphs with millions of nodes.
  • Overlapping Communities: The current model assumes a node belongs primarily to one community (soft assignment notwithstanding). Real-world nodes often belong to multiple overlapping communities, which $gCooL$ does not explicitly model.
  • Dynamic Graphs: The study focuses on static graphs; adapting this communal contrastive approach to graphs that evolve over time is a promising future direction.

Summary updated

BibTeX
@inproceedings{li2022graph,
  author = {Bolian Li and Baoyu Jing and Hanghang Tong},
  title = {{Graph Communal Contrastive Learning}},
  booktitle = {The Web Conference},
  year = {2022},
  doi = {10.1145/3485447.3512208},
}
Figure