Abstract
Out-of-distribution (OOD) detection is critical for ensuring the safety and reliability of machine learning systems, particularly in dynamic and open-world environments. In the vision and text domains, zero-shot OOD detection—which requires no training on in-distribution (ID) data—has advanced significantly through the use of large-scale pretrained models. However, zero-shot OOD detection in graph-structured data remains largely unexplored. In this work, we take the first step toward enabling zero-shot graph OOD detection by leveraging a graph foundation model (GFM). Our experiments show that, when provided only with class label names for both ID and OOD categories, the GFM can effectively perform OOD detection—often surpassing existing "supervised" OOD detection methods that rely on extensive labeled node data. We further address the practical scenario in which OOD label names are not available by introducing GLIP-OOD, a framework that uses LLMs to generate semantically informative pseudo-OOD labels from unlabeled data. To our knowledge, this is the first approach to achieve node-level graph OOD detection in a fully zero-shot setting, attaining performance comparable to state-of-the-art supervised methods on four benchmark text-attributed graph datasets.
Introduction
In real-world applications, machine learning models frequently encounter data that falls outside their training categories. Detecting these out-of-distribution (OOD) instances is essential for safety-critical domains like medical diagnosis or autonomous driving. While zero-shot OOD detection has flourished in computer vision and NLP thanks to models like CLIP, it has remained a missing piece for graph-structured data. Traditional graph OOD methods require significant labeled "in-distribution" (ID) data, which is expensive and impractical for dynamic environments like social networks where new entity types emerge constantly. GLIP-OOD addresses this gap by adapting Graph Foundation Models (GFMs) for open-set scenarios without requiring labeled training nodes.
Methodology
GLIP-OOD leverages the semantic alignment capabilities of GFMs to compare graph node embeddings with natural language descriptions of classes. The framework operates in two primary modes:
- GLIP-OOD-R (Reference Case): When OOD class names are known, the GFM compares node embeddings against both ID and OOD label embeddings. This "label-only" approach surprisingly outperforms many supervised models.
- GLIP-OOD-L (Latent Case): For practical scenarios where OOD classes are unknown, GLIP-OOD-L uses an LLM (e.g., GPT-4o-mini) to analyze a small sample of unlabeled nodes and their text attributes. If a node does not fit existing ID categories, the LLM generates a descriptive pseudo-OOD label (e.g., "Reinforcement Learning" if ID classes are "Databases" and "Security").
The final OOD score is derived from the node's affinity to these generated pseudo-labels versus known ID labels, creating a contrastive label space that sharpens the decision boundary between known and unknown classes.
Experimental Results
The framework was evaluated on four benchmark Text-Attributed Graph (TAG) datasets: Cora, Citeseer, Ele-Computers, and Wiki-CS. These datasets were specifically excluded from the GFM's pre-training to ensure a true zero-shot evaluation.
Key findings include:
- Superiority over Supervised Methods: In the GLIP-OOD-R setting, the model achieved state-of-the-art results, including an AUROC of 0.9282 on Wiki-CS, significantly higher than supervised baselines like GNNSafe or GRASP.
- Competitive Zero-Shot Performance: Even when OOD labels are unknown (GLIP-OOD-L), the model remains highly competitive. On the Cora dataset, it achieves an AUROC of 0.7573 without using any node labels, rivaling supervised methods that require extensive training data.
- Semantic Richness: The use of specific pseudo-categories (e.g., "Computer Vision") provides a much stronger signal for differentiation than simple negative prompts (e.g., "not a [Class]").
Conclusion and Future Work
GLIP-OOD demonstrates that Graph Foundation Models possess a strong intrinsic capacity for OOD detection when guided by semantic labels. While currently optimized for Text-Attributed Graphs, future research will explore applying these principles to "pure" graphs without text attributes and improving the efficiency of LLM-based sampling to identify the most informative nodes for pseudo-label generation.
Summary updated