Pre-train and Refine: Towards Higher Efficiency in K-Agnostic Community Detection without Quality Degradation

Meng Qin, Chaorui Zhang, Yu Gao, Weixi Zhang, Dit-Yan Yeung

Abstract

Community detection is a fundamental task in network analysis, yet it remains challenging due to the unknown number of communities ($K$) in real-world graphs and the inherent trade-off between clustering quality and computational efficiency. Deep Graph Learning (DGL) methods offer high quality but suffer from poor scalability and transductive limitations. Conversely, heuristic methods are efficient but often converge to sub-optimal local solutions. We present PRoCD (Pre-training & Refinement for Community Detection), a novel framework that bridges this gap. PRoCD leverages offline pre-training on small synthetic graphs to learn universal structural patterns, which are then used to provide a high-quality initialization for efficient refinement algorithms on large-scale real-world networks. Our approach is inherently $K$-agnostic and achieves significant speedups (up to 86%) without sacrificing clustering quality.

Introduction

Identifying communities—groups of nodes with dense internal connections—is crucial for understanding complex systems like social networks, biological pathways, and citation webs. However, two major obstacles hinder current state-of-the-art methods:

  1. The "K" Problem: Most high-performing algorithms require the number of communities ($K$) as an input parameter. In practice, $K$ is rarely known, making these methods difficult to apply to exploratory data analysis.
  2. The Efficiency-Quality Trade-off: DGL-based methods typically require iterative optimization for every new graph, leading to high computational costs. While fast heuristic methods like InfoMap or Label Propagation (LPA) exist, their "greedy" nature often leads to lower-quality results compared to deep learning approaches.

PRoCD addresses these issues by introducing an inductive, $K$-agnostic framework that transfers knowledge from synthetic data to real-world applications.

The PRoCD Framework

The PRoCD paradigm consists of three distinct phases designed to maximize both generalization and efficiency.

Overview of the PRoCD framework compared to task-dependent and task-independent DGL methods.

1. Offline Pre-training

The model is first trained on small, synthetic graphs generated via a Degree-Corrected Stochastic Block Model (DC-SBM). Using synthetic data allows the model to learn from perfect "ground truth" community structures. This phase is computationally expensive but performed only once.

2. Online Generalization

When presented with a large, unseen real-world graph, the pre-trained model parameters are frozen. The model performs a single "feed-forward" pass to generate an initial community partition. Because no re-training is required, this step is highly efficient and scales well to massive networks.

3. Online Refinement

The initial partition from the generalization phase serves as a "warm start" for traditional, efficient refinement algorithms (e.g., InfoMap or LPA). By starting from a high-quality structural guess rather than a random initialization, these algorithms converge much faster and are less likely to get trapped in poor local optima.

Technical Innovations

To achieve $K$-agnosticism and high performance, PRoCD incorporates several key architectural components.

Detailed architecture of PRoCD, highlighting the Feature Extraction Module, Embedding Encoder, and Binary Node Pair Classifier.
  • Binary Node Pair Classification: Instead of the traditional approach of predicting a cluster label for each node (which depends on $K$), PRoCD predicts whether a pair of nodes belongs to the same community. This reformulation makes the architecture independent of the total number of communities and the graph size.
  • Adaptive Temperature Parameter: The binary classifier utilizes a novel pair-wise adaptive temperature parameter. This allows the model to dynamically adjust its sensitivity when estimating community memberships across diverse graph topologies, enhancing its ability to generalize from synthetic to real-world data.

Experimental Evaluation

The authors evaluated PRoCD on a variety of real-world benchmarks, including biological networks (Protein), citation networks (ArXiv, DBLP), and massive infrastructure graphs (RoadCA with ~2 million nodes).

Key Results

  • Efficiency Gains: PRoCD significantly reduced the inference time of refinement methods. For instance, it achieved speedups of 70% to 86% compared to running refinement algorithms from scratch.
  • Clustering Quality: Despite the increased speed, the quality of the detected communities (measured by modularity) remained competitive with or superior to state-of-the-art baselines.
  • Scalability: PRoCD successfully processed the RoadCA dataset in under 90 seconds. In contrast, many competing DGL models failed due to out-of-memory errors or excessive runtimes.

Conclusion

PRoCD demonstrates that knowledge of community structures can be effectively transferred from small synthetic graphs to large-scale real-world networks. By shifting the focus from node labeling to node-pair classification and utilizing a "pre-train and refine" strategy, the framework provides a scalable, $K$-agnostic solution for high-quality community detection. Future work will explore extending this paradigm to dynamic graphs and integrating multi-modal node attributes to further refine clustering accuracy.

Summary updated

BibTeX
@inproceedings{qin2024pre,
  author = {Meng Qin and Chaorui Zhang and Yu Gao and Weixi Zhang and Dit-Yan Yeung},
  title = {{Pre-train and Refine: Towards Higher Efficiency in K-Agnostic Community Detection without Quality Degradation}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
}
Figure