ComGPT: Detecting Local Community Structure with Large Language Models
About
Large Language Models (LLMs), like GPT-3.5-turbo, have demonstrated the ability to understand graph structures and have achieved excellent performance in various graph reasoning tasks, such as node classification. Despite their strong abilities in graph reasoning tasks, they lack specific domain knowledge and have a weaker understanding of community-related graph information, which hinders their capabilities in the community detection task. Moreover, local community detection algorithms based on seed expansion, referred to as seed expansion algorithms, often face several shortcomings, including the seed-dependent problem, community diffusion, and free rider effect. To use LLMs to overcome the above shortcomings, we explore a GPT-guided seed expansion algorithm named ComGPT. ComGPT iteratively selects potential nodes by local modularity from the detected community's neighbors, and subsequently employs LLMs to choose the node from these selected potential nodes to join the detected community. To improve LLMs' understanding of community-related graph information, we propose ComIncident, a graph encoding method that incorporates community knowledge and is designed for the community detection task. Additionally, we design the Node Selection Guide (NSG) prompt to enhance LLMs' understanding of community characteristics. Experimental results demonstrate that ComGPT outperforms the baselines, thereby confirming the effectiveness of the ComIncident and the NSG prompt.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Graph Clustering | BD-30K | NMI90.4 | 15 | |
| Graph Clustering | EC-30K | NMI90.2 | 15 | |
| Graph Clustering | Wikipedia | NMI0.305 | 15 | |
| Graph Clustering | Dublin | NMI45.9 | 15 | |
| Graph Clustering | arXiv | NMI35.5 | 15 | |
| Graph Clustering | BD-100K | NMI82.5 | 10 | |
| Graph Clustering | DR 100K | NMI81.2 | 10 | |
| Graph Clustering | MS 100K | NMI83.4 | 10 | |
| Graph Clustering | SO | NMI38.2 | 10 | |
| Graph Clustering | Flickr | NMI38.2 | 10 |