Large Language Model Guided Graph Clustering

Puja Trivedi, Nurendra Choudhary, Edward W Huang, Vassilis N. Ioannidis, Karthik Subbian, Danai KoutraLoG 2024

TL;DR

This paper introduces GCLR, a novel framework that leverages Large Language Models (LLMs) to refine graph clustering results on text-attributed graphs (TAGs). By intelligently querying LLMs for feedback on uncertain nodes and fine-tuning Graph Neural Networks (GNNs) with this feedback, GCLR significantly improves clustering performance, especially when LLM resources are limited.

What Problem Does This Paper Address?

Graph clustering aims to group nodes in a graph into meaningful clusters. When graphs have associated text information (text-attributed graphs or TAGs), traditional methods using Graph Neural Networks (GNNs) often ignore this rich text data, relying solely on embeddings. While LLMs can process text, directly using them for clustering on large graphs is often computationally prohibitive due to hardware or API cost constraints. This paper tackles the challenge of effectively integrating LLM-derived textual insights into GNN-based graph clustering without incurring excessive costs, particularly when dealing with imperfect initial clusterings and limited LLM access.

Methods

The core of the proposed method is GCLR (Graph Clustering with LLM Refinement), an active learning framework. GCLR works by:

  1. Initial GNN Clustering: A standard GNN is used to perform an initial clustering of the TAG.
  2. Active Learning for Feedback: An active learning strategy identifies "uncertain" nodes – those that are difficult to classify or lie near cluster boundaries.
  3. LLM Feedback Elicitation: GCLR employs three distinct prompting strategies to query an LLM for feedback on these uncertain nodes:
  4. Triplet-Based Prompting: Asks the LLM to choose between two samples from nearby clusters, which is conceptually simple but can be sensitive to the initial clustering quality and LLM/GNN similarity function mismatches.
  5. In-Context Similarity Learning: Provides the LLM with examples of nodes and their assigned clusters, allowing it to infer the similarity function. This is more holistic but can be challenging with many clusters.
  6. Concept-Based Prompting: Prompts the LLM to generate descriptive concepts for each cluster and then asks it to assign the query node to the most fitting concept. This strategy is found to be most effective and scalable.
  7. Fine-tuning: The GNN-based clustering solution is then fine-tuned using the LLM's feedback. This fine-tuning process incorporates strategies to handle potentially noisy LLM feedback, such as using token-level confidence scores to filter unreliable labels and a weighted loss that combines LLM and GNN feedback.

Datasets

The authors evaluated their approach on several public graph datasets with available ground-truth cluster labels:

  • Cora
  • Citeseer
  • WikiCS
  • Other unnamed datasets (implied by the tables).

Key Insights and Ideas

  • LLMs as Refiners, Not Replacements: The paper positions LLMs not as replacements for GNNs but as powerful "refiners" that can enhance existing GNN-based clustering by leveraging textual information.
  • Concept-Based Prompting is Key: The "concept-based" prompting strategy emerged as the most effective for eliciting reliable feedback from LLMs, outperforming triplet-based and in-context methods in many scenarios. This highlights the importance of providing semantic context for clusters.
  • LLM and GNN Similarity Mismatches: A critical challenge identified is that LLMs and GNNs might infer different notions of similarity. GCLR's concept-based prompting helps bridge this gap by aligning LLM feedback with cluster semantics.
  • Active Learning for Budget Efficiency: The active learning approach is crucial for making LLM integration feasible within limited budgets, by focusing feedback on the most informative nodes.
  • Handling Noisy LLM Feedback: The framework's ability to tolerate and effectively use imperfect LLM feedback through noise-controlling fine-tuning is a significant contribution.

Key Results

  • GCLR consistently outperforms state-of-the-art GNN-based clustering methods across various datasets and GNN backbones.
  • The "concept-based" prompting strategy achieved the best or second-best performance in most experimental settings.
  • Fine-tuning with LLM feedback, especially using cross-entropy loss, significantly improved clustering metrics like Accuracy, NMI, F1, and ARI compared to GNN-only methods. For example, on WikiCS, LLM feedback with cross-entropy loss achieved dominant performance.
  • Even with a limited LLM budget (e.g., 10% of nodes), GCLR demonstrated substantial improvements.
  • Ensembling different confidence levels of LLM and GNN feedback further improved performance, especially when LLM feedback was less reliable.

Limitations and Future Work

  • LLM Reliability: While GCLR is designed to handle noisy LLM feedback, the reliability of the LLM as an annotator can still impact performance, especially if the LLM's feedback is consistently incorrect.
  • Computational Cost: Although GCLR is designed to be budget-conscious, fine-tuning LLMs or even prompting them can still incur significant computational costs, especially for very large graphs or extensive feedback.
  • Prompt Engineering: The effectiveness of GCLR is tied to the quality of prompt engineering. Developing more robust and generalizable prompting strategies remains an area for exploration.
  • Future Work: The authors suggest exploring more advanced active learning strategies, developing LLM-agnostic prompting methods, and investigating LLM-based methods for other graph learning tasks. They also highlight the potential for further improvements by using larger LLMs or more extensive feedback budgets.

Summary updated

BibTeX
@inproceedings{trivedi2024large,
  author = {Puja Trivedi and Nurendra Choudhary and Edward W Huang and Vassilis N. Ioannidis and Karthik Subbian and Danai Koutra},
  title = {{Large Language Model Guided Graph Clustering}},
  booktitle = {LoG},
  year = {2024},
  url = {https://openreview.net/forum?id=CLyhlb5DG5},
}
Figure