Both Topology and Text Matter: Revisiting LLM-guided Out-of-Distribution Detection on Text-attributed Graphs
Title: The Interplay of Structure and Semantics: Re-evaluating LLM-Driven Out-of-Distribution Detection in Text-Attributed Graphs
Abstract
Text-attributed graphs (TAGs) combine node-level textual data with graph topology, allowing Graph Neural Networks (GNNs) to simultaneously capture semantic and structural nuances. While GNNs perform well on in-distribution (ID) samples, they frequently struggle with out-of-distribution (OOD) nodes that exhibit unfamiliar structural or textual patterns. This deficiency often results in high-confidence yet incorrect predictions, highlighting a critical need for robust OOD detection mechanisms.
Current topology-centric methods attempt to counteract node-level bias by leveraging neighborhood structures; however, they typically treat text as shallow features, thereby failing to fully exploit semantic depth. Conversely, recent approaches utilizing Large Language Models (LLMs) generate pseudo OOD priors based on textual knowledge but face two primary challenges: (1) a dilemma between reliability and informativeness, where generated OOD exposures either drift from genuine OOD semantics or inject significant ID noise, and (2) a reliance on specialized architectures that hinders compatibility with topology-level advancements established in earlier research.
To resolve these constraints, we introduce LG-Plug, a plug-and-play framework guided by LLMs for OOD detection in TAGs. LG-Plug harmonizes topological and textual representations to derive granular node embeddings, subsequently building a consensus-based OOD exposure via clustered, iterative LLM prompting. To minimize the computational cost of LLM queries, the framework employs lightweight in-cluster codebooks alongside heuristic sampling. The resulting OOD exposure serves as a regularizer that effectively distinguishes between ID and OOD nodes, allowing for easy integration with existing detection models. Our experiments across six TAG benchmarks reveal that LG-Plug consistently enhances the performance of topology-driven OOD detectors, achieving a reduction in FPR95 of over 7%, while also outperforming previous LLM-based methods by more than 5% in FPR95 reduction.
Source: arXiv Generated at: 2026-06-02 00:00:00 UTC




