LLM-Enhanced Energy Contrastive Learning for Out-of-Distribution Detection in Text-Attributed Graphs
Abstract
Text-attributed graphs, where nodes are enriched with textual attributes, have become a powerful tool for modeling real-world networks such as citation, social, and transaction networks. However, existing methods for learning from these graphs often assume that the distributions of training and testing data are consistent. This assumption leads to significant performance degradation when faced with out-of-distribution (OOD) data. In this paper, we address the challenge of node-level OOD detection in text-attributed graphs, with the goal of maintaining accurate node classification while simultaneously identifying OOD nodes. We propose a novel approach, LLM-Enhanced Energy Contrastive Learning for Out-of-Distribution Detection in Text-Attributed Graphs (LECT), which integrates large language models (LLMs) and energy-based contrastive learning. The proposed method involves generating high-quality OOD samples by leveraging the semantic understanding and contextual knowledge of LLMs to create dependency-aware pseudo-OOD nodes, and applying contrastive learning based on energy functions to distinguish between in-distribution (IND) and OOD nodes. The effectiveness of our method is demonstrated through extensive experiments on six benchmark datasets, where our method consistently outperforms state-of-the-art baselines, achieving both high classification accuracy and robust OOD detection capabilities.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- One For All: Towards Training One Graph Model For All Classification Tasks cites GraphGPT: Graph Instruction Tuning for Large Language Models
- One For All: Towards Training One Graph Model For All Classification Tasks cites Node Feature Extraction by Self-Supervised Multi-scale Neighborhood Prediction
Builds on17
- MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained TransformersWenhui Wang, Furu Wei, Li Dong, Hangbo Bao et al.NeurIPS 2020 · 2,727 citations
- GraphFormers: GNN-nested Transformers for Representation Learning on Textual GraphJunhan Yang, Zheng Liu, Shitao Xiao, Chaozhuo Li et al.NeurIPS 2021 · 262 citations
- One For All: Towards Training One Graph Model For All Classification TasksHao Liu, Jiarui Feng, Lecheng Kong, Ningyue Liang et al.ICLR 2024 · 253 citations
- Node Feature Extraction by Self-Supervised Multi-scale Neighborhood PredictionEli Chien, Wei-Cheng Chang, Cho-Jui Hsieh, Hsiang-Fu Yu et al.ICLR 2022 · 185 citations
- GraphGPT: Graph Instruction Tuning for Large Language ModelsJiabin Tang, Yuhao Yang, Wei Wei, Lei Shi et al.SIGIR 2024 · 182 citations
Related papers
- Out-of-Distribution Detection via LLM-Guided Outlier Generation for Text-attributed GraphXiangwei Lv, Mengze Li, Jingyuan Chen, Zhiang Dong et al.ACL Findings 2025 · 4 citations
- DMHM: Density-aware Manifold Learning and Hybrid Mahalanobis Energy for LLMs-generated Text DetectionTianle Liu, Zhiliang Tian, Zhen Huang, Tianlun Liu et al.ACL 2026
- Both Topology and Text Matter: Revisiting LLM-guided Out-of-Distribution Detection on Text-attributed GraphsYinlin Zhu, Di Wu, Xu Wang, Guocong Quan et al.KDD 2026
- Out-of-Distribution Detection with Positive and Negative Prompt Supervision Using Large Language ModelsZhixia He, Chen Zhao, Minglai Shao, Xintao Wu et al.AAAI 2026
- An Energy-centric Framework for Category-free Out-of-distribution Node Detection in GraphsZheng Gong, Ying SunKDD 2024 · 4 citations
