TL;DR
Out-of-distribution (OOD) exposure typically requires expensive, human-labeled outlier samples during training to prevent models from making overconfident errors on unseen classes. GOE-LLM overcomes this on text-attributed graphs (TAGs) by using Large Language Models to either zero-shot identify pseudo-OOD nodes from unlabeled data or synthesize entirely new OOD text nodes. Training a standard Graph Neural Network with this synthetic exposure achieves up to a 23.5% AUROC boost over non-exposure baselines—matching the performance of methods that rely on real OOD nodes—with zero inference-time LLM overhead.
What Problem Does This Paper Address?
Graph neural networks (GNNs) deployed in the open world routinely encounter nodes belonging to classes not seen during training, such as emerging scientific disciplines in citation networks or novel fraud types in transaction graphs. Standard graph OOD detection methods train purely on in-distribution (ID) data and use post-hoc scoring (e.g., softmax entropy or energy scores) to flag outliers. However, models trained exclusively on ID data are notoriously overconfident on out-of-distribution samples, especially when OOD nodes share structural or semantic similarities with ID classes.
While outlier exposure (adding auxiliary OOD samples during training) mitigates this overconfidence in computer vision and NLP, acquiring verified OOD nodes in graph domains is costly, elusive, or impossible. Prior pseudo-OOD generation techniques cannot be trivially plugged into graphs because they ignore graph connectivity and the interplay between text semantics and topological structure.
Methods
GOE-LLM introduces two strategies to supply pseudo-OOD supervision without human-annotated OOD data:
┌─► [GOE-identifier] ── Zero-shot label unlabeled nodes ("none" = OOD) ┐
Unlabeled Graph/TAG ┤ ├─► Regularize ID GNN
└─► [GOE-generator] ── LLM generates synthetic text for OOD classes ──┘
- GOE-identifier (Transductive Setting): Randomly samples a small subset of unlabeled nodes from the graph and prompts an LLM with only the known ID class names. If the LLM determines a node does not match any ID category, it outputs
"none", designating it as a pseudo-OOD instance. - GOE-generator (Inductive/Generative Setting): When candidate OOD concepts are known (or node text is limited), the LLM generates synthetic titles and abstracts corresponding to OOD categories. These synthetic nodes are embedded via SentenceBERT, appended to the node feature matrix, and optionally linked into the graph structure.
Regularization Objective: The pseudo-OOD nodes are used alongside ID nodes in an energy-based contrastive loss ($\mathcal{L}_{\text{expo}}$) that penalizes ID nodes with OOD scores above a margin $s_{\text{id}}$ and penalizes pseudo-OOD nodes with scores below a margin $s_{\text{ood}}$. The paper also explores a $(K+1)$-way classification head (where the $(K+1)$-th class denotes OOD).
Datasets
The authors evaluate on four benchmark text-attributed citation and hyperlink graphs:
- Cora (4 ID classes, 3 OOD classes)
- CiteSeer (3 ID classes, 3 OOD classes)
- PubMed (2 ID classes, 1 OOD class)
- Wiki-CS (4 ID classes, 6 OOD classes)
Nodes are partitioned into ID and OOD classes following standard semi-supervised protocols. All experiments are evaluated using standard metrics: ID accuracy (ACC), AUROC, AUPR, and FPR@95.
Key Insights and Ideas
- Imperfect Annotations Make Great Hard Negatives: Zero-shot LLM labeling accuracy on OOD nodes is moderately noisy (71.9%–84.1%). However, these errors are not random noise; they tend to lie right along the semantic boundary between ID and OOD classes, providing highly informative "hard negative" signals during training.
- Diminishing Returns with Minimal Queries: You do not need thousands of synthetic nodes. On PubMed (~19.7k nodes), adding just 10 synthetic OOD nodes brings performance near saturation, demonstrating that LLM exposure is exceptionally lightweight and query-efficient ($<$\$0.03 per dataset).
- Zero Inference Overhead: Because LLMs are used strictly as an offline data engine during training, inference relies entirely on a standard 2-layer GCN, matching post-hoc baselines at ~2.4 ms per inference run.
Key Results
- Substantial Gains Over Non-Exposure Baselines: GOE-LLM consistently outperforms post-hoc baselines (MSP, Energy, GNNSafe, GRASP). On PubMed, GOE-identifier achieves 0.8985 AUROC, a relative gain of >23.5% over the strongest non-exposure baseline (GRASP at 0.6627).
- Competitive with Real OOD Supervision: GOE-LLM performs on par with—and on PubMed even surpasses—GNNSafe++ (0.8985 vs. 0.8852 AUROC) and Outlier Exposure (0.8236 AUROC), which require human-curated OOD labels.
- Preserved ID Accuracy: Unlike typical regularization methods that risk "forgetting" ID features, GOE-LLM maintains or slightly improves ID classification accuracy (e.g., achieving 0.8552 on CiteSeer).
- LLM Agnostic: Swapping the backend LLM from GPT-4o-mini to GPT-3.5-Turbo or the open-source DeepSeek-V3 yielded consistent, robust performance.
Limitations and Future Work
- Restricted to Text-Attributed Graphs: The core mechanism relies on textual descriptions; it cannot be applied directly to structural-only or non-textual graphs (e.g., molecule graphs or pure topology networks).
- Dependence on LLM Priors: If an LLM possesses weak domain knowledge or hallucinates heavily in obscure sub-fields, pseudo-OOD label quality will drop.
- Simple Graph Topology for Synthetic Nodes: GOE-generator currently relies on basic embedding similarity or simple negative sampling to integrate synthetic nodes into the graph topology. Exploring adaptive graph structure learning or extending the method to graph-level and dynamic graph OOD detection remains open for future research.
Summary updated