GCLS2: Towards Efficient Community Detection Using Graph Contrastive Learning with Structure Semantics.

Qi Wen, Yiyang Zhang, Yutong Ye, Yingbo Zhou, Nan Zhang, Xiang Lian, Mingsong Chen · DOI · OpenReview

Introduction

Community Detection (CD) is a fundamental task in graph analysis, with applications ranging from social network mapping to protein function prediction. While traditional methods often struggle with scalability and supervised models require extensive labeling, Graph Contrastive Learning (GCL) has emerged as a promising unsupervised alternative. However, standard GCL methods often fail to capture "structural semantics"—the principle that nodes within the same community should exhibit structural cohesion. GCLS² addresses this by integrating classic community structures into the learning process and utilizing a custom high-level graph partitioning algorithm.

The Challenge of Structural Semantics in GCL

Standard GCL methods typically focus on individual node attributes and employ random augmentations, such as edge dropping, to generate views. This approach often leads to a "blind spot": the model may inadvertently push apart nodes that belong to the same community simply because they are local neighbors. For effective community detection, a model must understand the inherent dense-interior and sparse-exterior characteristics of communities.

Overview of the GCL-based community detection problem and similarity matrix heatmaps.

Methodology

The GCLS² framework introduces three primary innovations to bridge the gap between contrastive learning and community structure.

1. Structure Similarity Semantic (SSS) Module

Instead of relying on raw adjacency matrices, GCLS² employs a preprocessing step to identify high-level structures using classic patterns like $k$-core, $k$-truss, and $k$-plex. This information is encoded into a "High-Level Graph" ($G^H$) that emphasizes community density over simple connectivity.

2. Structure Contrastive Loss

Unlike standard GCL, which treats any two distinct nodes as a negative pair, GCLS² utilizes high-level structural views to define its samples. Nodes within the same dense structure are treated as positive pairs, both within and across views. Conversely, nodes outside these structures are treated as negatives. This strategy guides the embedding space to naturally cluster community members together.

3. High-level Graph Partitioning (HGP)

To facilitate training on massive graphs that exceed GPU memory, the authors developed the HGP algorithm. HGP partitions the graph while minimizing the disruption to community integrity, ensuring that critical structural features are preserved during the split.

Experimental Evaluation

The authors evaluated GCLS² on eight real-world datasets, including citation networks (Cora, PubMed), social networks (Email-Eu), and large-scale graphs like TWeibo (1.9M nodes) and AmazonProducts (1.5M nodes).

Key Results

  • Superior Accuracy: GCLS² outperformed nine state-of-the-art methods. On the TWeibo dataset, it achieved a 3% improvement in accuracy and a 10% increase in Normalized Mutual Information (NMI) over the next best method.
  • Performance on Dense Graphs: On the AmazonProducts dataset, GCLS² exceeded the second-best method by 7% in accuracy, demonstrating its effectiveness in highly interconnected networks.
  • Scalability: The HGP algorithm successfully partitioned graphs with hundreds of millions of edges in approximately 1,000 seconds, maintaining significantly better load balance than standard tools like METIS.
  • Ablation Study: Removing the structural contrastive loss (SCL) resulted in an 8% drop in accuracy on the Email-Eu dataset, confirming that the structural focus is the primary driver of performance.

Conclusion

GCLS² demonstrates that graph topology itself can serve as a powerful supervision signal for community detection. By prioritizing structural semantics and employing efficient partitioning, the framework achieves state-of-the-art results on massive datasets. Future work may explore extending this approach to overlapping community detection and dynamic, time-varying networks.

Summary updated

BibTeX
@inproceedings{wen2025gcls,
  author = {Qi Wen and Yiyang Zhang and Yutong Ye and Yingbo Zhou and Nan Zhang and Xiang Lian and Mingsong Chen},
  title = {{GCLS2: Towards Efficient Community Detection Using Graph Contrastive Learning with Structure Semantics.}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2025},
  doi = {10.1145/3746252.3761327},
}
Figure