Table of Contents
Fetching ...

ComGPT: Detecting Local Community Structure with Large Language Models

Li Ni, Haowen Shen, Lin Mu, Yiwen Zhang, Wenjian Luo

TL;DR

The paper tackles local community detection, a task hindered by seed-dependence, diffusion, and free-rider effects in seed-expansion methods. It introduces ComGPT, a GPT-guided approach that leverages a graph-knowledge encoding (ComIncident) and specialized Node Selection Guide prompts (NSG) to inform node additions, while also enabling node supplementation via LLM reasoning. Through empirical evaluation on five real networks, ComGPT demonstrates competitive or superior performance to established baselines, with ablation and prompt-design studies validating the importance of the LLM component, graph encoding, and prompts. The work highlights the potential of integrating LLMs with domain-specific graph reasoning for scalable local community detection, while also discussing runtime and scalability considerations for real-world deployments.

Abstract

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.

ComGPT: Detecting Local Community Structure with Large Language Models

TL;DR

The paper tackles local community detection, a task hindered by seed-dependence, diffusion, and free-rider effects in seed-expansion methods. It introduces ComGPT, a GPT-guided approach that leverages a graph-knowledge encoding (ComIncident) and specialized Node Selection Guide prompts (NSG) to inform node additions, while also enabling node supplementation via LLM reasoning. Through empirical evaluation on five real networks, ComGPT demonstrates competitive or superior performance to established baselines, with ablation and prompt-design studies validating the importance of the LLM component, graph encoding, and prompts. The work highlights the potential of integrating LLMs with domain-specific graph reasoning for scalable local community detection, while also discussing runtime and scalability considerations for real-world deployments.

Abstract

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.
Paper Structure (31 sections, 5 equations, 9 figures, 6 tables, 1 algorithm)

This paper contains 31 sections, 5 equations, 9 figures, 6 tables, 1 algorithm.

Figures (9)

  • Figure 1: Seed-dependent problem. The community detected by M method M with starting nodes 5 is {5, 11, 6, 7, 17}. This community misses many nodes. Nodes in the same community are marked with the same color.
  • Figure 2: Community diffusion. The community detected by the M method M with node 1 as the starting seed node is {1, 2, 3, 4, 7, 8, 9, 13, 14, 15, 16, 17, 18, 20}, which incorrectly includes nodes from two different communities. Nodes in the same community are marked with the same color.
  • Figure 3: Free rider effect. The target community consists of nodes 5, 6, 7, 8, and 9. The detected community not only contains nodes in the target community {5, 6, 7, 8, 9} but also erroneously includes all nodes in the unrelated community {1, 2, 3, 4, 10, 11}. Nodes in the same community are marked with the same color.
  • Figure 4: The diagram of ComGPT. It includes four main steps: 1) Potential node identification aims to pinpoint potential nodes from the neighbors of the current community. 2) Graph encoding involves transforming the graph structure into a textual format interpretable by GPT-3.5-turbo. 3) Node selection by GPT-3.5-turbo is that GPT-3.5-turbo selects the node that optimally integrates into the community from potential nodes. 4) Node supplementation by GPT-3.5-turbo involves GPT-3.5-turbo selecting which nodes to add to the community when no potential nodes remain.
  • Figure 5: An toy example of graph encoding. The middle part illustrates the text corresponding to topology graph. The lower part illustrates the text corresponding to supplementary knowledge.
  • ...and 4 more figures