ProCom: A Few-shot Targeted Community Detection Algorithm

Xixi Wu, Kaiyu Xiong, Yun Xiong, Xiaoxin He, Yao Zhang, Yizhu Jiao, Jiawei Zhang

Introduction

In the study of complex networks—ranging from financial transaction logs to social media interactions—identifying specific sub-structures or "communities" is a fundamental task. However, traditional community detection often fails when the objective is highly specific. This specialized task, known as Targeted Community Detection (TCD), aims to identify communities of a particular type (e.g., fraudulent rings, specific interest groups) rather than partitioning the entire graph.

Historically, TCD has been approached through either unsupervised methods, which lack specificity, or semi-supervised models, which require extensive labeled data. At KDD '24, researchers presented ProCom, a framework that addresses these limitations by adapting the "pre-train, prompt" paradigm to graph structures. ProCom enables high-accuracy detection with as few as 10 labeled examples, significantly reducing the supervision burden.

Problem Formulation

Existing approaches to TCD generally fall into two categories, both of which face significant hurdles in real-world applications:

  1. Unsupervised and Traditional Methods: Algorithms like BigClam are designed to detect all latent communities within a graph. While effective for general topology analysis, they lack the mechanism to distinguish between relevant targets (e.g., a money-laundering circle) and irrelevant ones (e.g., a group of colleagues), necessitating manual post-hoc filtering.
  2. Semi-supervised Methods: Models such as CLARE or SEAL are capable of targeting specific community types but are notoriously "data-hungry." These models typically require 100 to 500 labeled examples to achieve convergence. In domains like emerging cyber-crime or niche academic sub-fields, obtaining such a high volume of labels is often prohibitively expensive or impossible.

Furthermore, these models often lack transferability; a model trained on one network frequently requires exhaustive re-training to function on another, even if the underlying community structures are similar.

The ProCom Framework

ProCom introduces a two-phase pipeline designed to capture the structural nuances of communities through a "Pre-train, Prompt" architecture.

1. Dual-level Context-aware Pre-training

Unlike standard node-level pre-training, ProCom focuses on the "context" of a node, defined by its $k$-ego net. The framework utilizes a Graph Neural Network (GNN) encoder trained via two self-supervised objectives:

  • Node-to-Context Proximity: Utilizing an InfoNCE loss, the model aligns a node's individual embedding with the aggregated embedding of its local neighborhood. This process teaches the encoder the structural signatures of nodes that naturally belong together.
  • Context Distinction: The model is trained to differentiate between an authentic local context and a "corrupted" version (where edges or nodes have been randomly perturbed). This ensures the model captures the robust structural properties of latent communities rather than just local density.

2. Targeted Community-guided Prompting

Following pre-training, the GNN weights are frozen to preserve the learned structural knowledge. To adapt the model to a specific target task with minimal labels, ProCom employs a parameter-efficient prompting mechanism:

  • Candidate Generation: A lightweight, learnable Multi-layer Perceptron (MLP) acts as a "distiller." It processes the neighborhoods of all nodes to generate candidate communities based on the pre-trained structural knowledge.
  • Similarity Matching: The few-shot "prompt" communities (the target examples) and the generated "candidate" communities are mapped into a shared embedding space. The system then uses $L_2$ distance to retrieve candidates that most closely resemble the provided prompts.

Experimental Evaluation

The researchers evaluated ProCom across five diverse real-world benchmarks from the SNAP repository, including social networks (Facebook, Twitter, Livejournal) and co-purchase/citation networks (Amazon, DBLP). These datasets are characterized by overlapping communities and varying degrees of sparsity.

Key Results

  • Performance in Low-Data Regimes: In a 10-shot setting, ProCom significantly outperformed the state-of-the-art (CLARE). Specifically, it achieved an F1-score improvement of +17.2% on Facebook and +19.8% on Livejournal.
  • Computational Efficiency: ProCom demonstrates superior scalability. On the Twitter dataset, ProCom completed its execution in approximately 7 minutes, whereas the previous leading semi-supervised method, SEAL, required nearly 2.5 hours.
  • Robustness: While traditional semi-supervised methods experience a sharp decline in performance when labels are reduced from 100 to 5, ProCom remains stable, maintaining high precision even under extreme data scarcity.

Discussion and Transferability

A significant finding of the ProCom study is the structural universality of communities. The model exhibits remarkable cross-dataset transferability; for instance, a model pre-trained on Facebook can be prompted to identify communities on Twitter with minimal performance loss. This suggests that the "grammar" of community structure—how nodes cluster and interact—is largely consistent across similar network types.

By freezing the GNN and only tuning a small MLP prompt, ProCom avoids the "catastrophic forgetting" common in fine-tuning approaches and maintains a low memory footprint, making it suitable for large-scale industrial applications.

Conclusion and Future Work

ProCom represents a shift in Targeted Community Detection, moving away from data-intensive training toward efficient structural prompting. While highly effective, the authors note that the model's reliance on $k$-ego nets may pose challenges in extremely sparse graphs where local contexts are under-defined. Future research may explore extending this paradigm to heterogeneous graphs containing multiple node and edge types, as well as automating the threshold parameters used in the community distillation process.

Summary updated

BibTeX
@inproceedings{wu2024procom,
  author = {Xixi Wu and Kaiyu Xiong and Yun Xiong and Xiaoxin He and Yao Zhang and Yizhu Jiao and Jiawei Zhang},
  title = {{ProCom: A Few-shot Targeted Community Detection Algorithm}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
}
Figure