Few-Shot Graph Out-of-Distribution Detection with LLMs
Abstract
Graph out-of-distribution (OOD) detection usually relies on training a graph neural network (GNN) with a large set of labeled in-distribution (ID) nodes. However, acquiring high-quality labeled nodes in text-attributed graphs (TAGs) is challenging and costly due to their complex textual and structural characteristics. Large language models (LLMs) offer strong zero-shot language capabilities but overlook graph connectivity, limiting their utility for graph OOD detection. In this work, we propose LLM-GOOD, a general framework that effectively combines the strengths of LLMs and GNNs to enhance data efficiency in graph OOD detection. Specifically, we first leverage LLMs’ strong zero-shot capabilities to filter out likely OOD nodes, significantly reducing the human annotation burden. To minimize the usage and cost of the LLM, we employ it only to annotate a small subset of unlabeled nodes. We then train a lightweight GNN filter using these noisy labels, enabling efficient predictions of ID status for all other unlabeled nodes by leveraging both textual and structural information. After obtaining node embeddings from the GNN filter, we can apply informativeness-based methods to select the most valuable nodes for precise human annotation. Finally, we train the target ID classifier using these accurately annotated ID nodes. Extensive experiments on four real-world TAG datasets demonstrate that LLM-GOOD significantly reduces human annotation costs and outperforms state-of-the-art baselines in terms of both ID classification accuracy and OOD detection performance.
Cite
Text
Xu et al. "Few-Shot Graph Out-of-Distribution Detection with LLMs." European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2025. doi:10.1007/978-3-032-06078-5_18Markdown
[Xu et al. "Few-Shot Graph Out-of-Distribution Detection with LLMs." European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2025.](https://mlanthology.org/ecmlpkdd/2025/xu2025ecmlpkdd-fewshot/) doi:10.1007/978-3-032-06078-5_18BibTeX
@inproceedings{xu2025ecmlpkdd-fewshot,
title = {{Few-Shot Graph Out-of-Distribution Detection with LLMs}},
author = {Xu, Haoyan and Yao, Zhengtao and Dong, Yushun and Wang, Ziyi and Rossi, Ryan A. and Li, Mengyuan and Zhao, Yue},
booktitle = {European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases},
year = {2025},
pages = {307-324},
doi = {10.1007/978-3-032-06078-5_18},
url = {https://mlanthology.org/ecmlpkdd/2025/xu2025ecmlpkdd-fewshot/}
}