Zero-shot Generalist Graph Anomaly Detection with Unified Neighborhood Prompts

Chaoxi Niu, Hezhe Qiao, Changlu Chen, Ling Chen, Guansong Pang
10/18/2024
cs.LG

Official code: mala-lab/UNPrompt (23 stars, MIT, last commit 2025-06-07).

Abstract

Graph anomaly detection (GAD), which aims to identify nodes in a graph that significantly deviate from normal patterns, plays a crucial role in broad application domains. However, existing GAD methods are one-model-for-one-dataset approaches, i.e., training a separate model for each graph dataset. This largely limits their applicability in real-world scenarios. To overcome this limitation, we propose a novel zero-shot generalist GAD approach UNPrompt that trains a one-for-all detection model, requiring the training of one GAD model on a single graph dataset and then effectively generalizing to detect anomalies in other graph datasets without any retraining or fine-tuning. The key insight in UNPrompt is that i) the predictability of latent node attributes can serve as a generalized anomaly measure and ii) generalized normal and abnormal graph patterns can be learned via latent node attribute prediction in a properly normalized node attribute space. UNPrompt achieves a generalist mode for GAD through two main modules: one module aligns the dimensionality and semantics of node attributes across different graphs via coordinate-wise normalization, while another module learns generalized neighborhood prompts that support the use of latent node attribute predictability as an anomaly score across different datasets. Extensive experiments on real-world GAD datasets show that UNPrompt significantly outperforms diverse competing methods under the generalist GAD setting, and it also has strong superiority under the one-model-for-one-dataset setting. Code is available at https://github.com/mala-lab/UNPrompt.

View on arXivView PDF

Code Implementations(1)

mala-lab/UNPromptOfficial100%
MIT

Official Code for IJCAI25 paper "Zero-shot Generalist Graph Anomaly Detection with Unified Neighborhood Prompts"

233Shell, PythonOct 14, 20241 years agoMIT
graph-anomaly-detectiongraph-prompt-learninggraph-promptingzero-shot-anomaly-detection

Similar Papers

Cite this paper

@article{niu2024zeroshot,
  title  = {Zero-shot Generalist Graph Anomaly Detection with Unified Neighborhood Prompts},
  author = {Chaoxi Niu and Hezhe Qiao and Changlu Chen and Ling Chen and Guansong Pang},
  year   = {2024},
  eprint = {2410.14886},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.14886v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.14886.svg)](https://codeofpaper.com/paper/2410.14886)

Discussion