Coarse-to-Fine Open-Set Graph Node Classification with Large Language Models

Xueqi Ma, Xingjun Ma, Sarah Monazam Erfani, Danilo P. Mandic, James Bailey

TL;DR

Most graph neural networks (GNNs) fail when they encounter "unknown" data, usually lumping all out-of-distribution (OOD) samples into a single "other" category. This paper introduces CFC (Coarse-to-Fine Classification), a framework that uses Large Language Models (LLMs) to not only detect OOD samples but actually classify them into meaningful sub-categories (e.g., identifying a specific type of fraud rather than just "unknown") with up to 70% accuracy.

What Problem Does This Paper Address?

In the real world, data is messy. When we deploy a GNN to classify nodes in a graph—like identifying research topics in a citation network or types of users in a social network—the model often encounters classes it never saw during training. This is the Open-Set Classification problem.

Traditional approaches typically treat OOD detection as a binary task: is this node "In-Distribution" (ID) or "Out-of-Distribution" (OOD)? If it's OOD, it goes into a single "unknown" bucket. However, for high-stakes applications like medical diagnosis or fraud detection, simply saying "I don't know" isn't enough. We need to know what the unknown sample likely is.

The challenge is that we don't have labels for these unknown classes. Previous methods tried to solve this by generating synthetic "fake" OOD data or using auxiliary datasets, but these often fail to capture the nuanced semantic reality of genuine OOD samples.

Methods

The authors propose a three-stage framework called CFC (Coarse-to-Fine Classification) that bridges the gap between the structural power of GNNs and the semantic reasoning of LLMs.

  1. Coarse Classification (The LLM "Expert"): The framework first uses an LLM (like GPT-4o) to inspect the text attributes of nodes. It employs two prompting strategies:

  2. Easy-Reject: For samples far from the training data, the LLM acts as a confident gatekeeper.

  3. Hard-Reject: For "near-OOD" samples that look similar to known classes, the LLM is prompted to summarize major categories first and then identify specific outliers that fall outside the training labels but within the broader domain.
  4. Fine Classification (The GNN "Worker"): The OOD samples identified by the LLM are used as "semantic OOD" training data for a GNN. To improve this, the authors use:

  5. Denoising: A label propagation method to filter out ID samples the LLM might have mislabeled as OOD.

  6. Manifold Mixup: A data augmentation technique that interpolates between hidden representations of nodes to create a smoother, more robust decision boundary between known and unknown classes.
  7. Refined OOD Classification: Finally, the framework takes the potential OOD labels generated by the LLM, post-processes them (using similarity measures like TF-IDF to merge redundant categories), and performs a final classification pass to assign each OOD node to a specific, meaningful label.

Datasets

The authors evaluated CFC on two types of benchmarks:

  • Textual Graphs: Cora, Citeseer, WikiCS, and DBLP (standard citation and web graphs where nodes have rich text descriptions).
  • Non-Textual Graphs: Amazon-Computer and Amazon-Photo (product graphs). For these, they utilized text-attributed versions to allow the LLM to "read" the node metadata.

In each case, they held out specific classes during training to serve as the "unknown" OOD targets.

Key Insights and Ideas

  • Semantic OOD vs. Synthetic OOD: The "aha moment" here is that LLMs can identify real OOD examples from the test set to use as training signal. This is far more effective than generating Gaussian noise or synthetic "fake" nodes, which often don't represent the actual geometry of the OOD space.
  • Smoothing the Boundary: By training on these semantic OOD samples, the GNN develops a "flatter" and more expansive OOD subspace. This prevents the model from being overconfident about samples that lie just outside the training distribution.
  • LLMs as Zero-Shot Labelers: The paper demonstrates that LLMs can effectively "invent" a useful label space for unknown data by looking at the inherent meaning of the text, providing a level of interpretability that traditional OOD detectors lack.

Key Results

  • OOD Detection: CFC outperformed state-of-the-art methods (like GNNSafe and GOLD) by roughly 10% in detection accuracy across multiple datasets. On the Cora dataset, OOD detection accuracy reached a staggering 95.74%.
  • OOD Classification: This is the paper's most novel metric. CFC achieved between 48% and 70% accuracy in actually naming the unknown classes correctly, a task most previous models couldn't even attempt.
  • Ablation Success: The results showed that the "Hard-Reject" prompting strategy was crucial for distinguishing between closely related classes, proving that how you ask the LLM matters as much as the model itself.

Limitations and Future Work

  • LLM Dependency: The method relies heavily on nodes having descriptive text. If a graph is purely structural (e.g., a protein-protein interaction network with no text), the "coarse" stage would struggle.
  • Computational Cost: Calling high-end LLMs like GPT-4o for every node in a massive graph is expensive and slow. The authors suggest that fine-tuning smaller, domain-specific models or using Retrieval-Augmented Generation (RAG) could be a path forward.
  • Knowledge Cutoff: The LLM’s ability to classify OOD samples is limited by its own internal training data. If the "unknown" class is something entirely new to the world (post-dating the LLM's training), the labels might be less accurate.

Summary updated

BibTeX
@inproceedings{ma2026coarse,
  author = {Xueqi Ma and Xingjun Ma and Sarah Monazam Erfani and Danilo P. Mandic and James Bailey},
  title = {{Coarse-to-Fine Open-Set Graph Node Classification with Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i43.40996},
}
Figure