{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/zero-shot-generalist-graph-anomaly-detection","title":"Zero-shot Generalist Graph Anomaly Detection with Unified Neighborhood Prompts","arxiv_id":"2410.14886","date":"2024-10-18","proceeding":null,"authors":["Chaoxi Niu","Hezhe Qiao","Changlu Chen","Ling Chen","Guansong Pang"],"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. Existing GAD methods, whether supervised or unsupervised, are one-model-for-one-dataset approaches, i.e., training a separate model for each graph dataset. This limits their applicability in real-world scenarios where training on the target graph data is not possible due to issues like data privacy. 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) highly generalized normal and abnormal graph patterns can be learned via latent node attribute prediction in a properly normalized node attribute space. UNPrompt achieves generalist GAD through two main modules: one module aligns the dimensionality and semantics of node attributes across different graphs via coordinate-wise normalization in a projected space, 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.","url_abs":"https://arxiv.org/abs/2410.14886v1","url_pdf":"https://arxiv.org/pdf/2410.14886v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"zero-shot-generalist-graph-anomaly-detection","repo_url":"https://github.com/mala-lab/UNPrompt","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"attribute","task_name":"Attribute"},{"task_slug":"graph-anomaly-detection","task_name":"Graph Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.14886","atlas_url":"https://app.syntology.ai/?focus=2410.14886","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.14886"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mala-lab/UNPrompt","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran":3,"unverified":1},"by_repo_kind":{"official":{"samples":5,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"22bfb6129463d322","entry":"drop_feature","repo":"mala-lab/UNPrompt","repo_kind":"official","path":"pretrain.py","file_url":"https://github.com/mala-lab/UNPrompt/blob/HEAD/pretrain.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"22bfb6129463d322"}},{"code_sha256_prefix":"0bcbc518f31d5b45","entry":"normalize_adj_tensor","repo":"mala-lab/UNPrompt","repo_kind":"official","path":"utils.py","file_url":"https://github.com/mala-lab/UNPrompt/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0bcbc518f31d5b45"}},{"code_sha256_prefix":"2c7fd193a4fb9c0f","entry":"preprocess_features","repo":"mala-lab/UNPrompt","repo_kind":"official","path":"utils.py","file_url":"https://github.com/mala-lab/UNPrompt/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c7fd193a4fb9c0f"}},{"code_sha256_prefix":"0300d9b136d85dfb","entry":"sparse_to_tuple","repo":"mala-lab/UNPrompt","repo_kind":"official","path":"utils.py","file_url":"https://github.com/mala-lab/UNPrompt/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0300d9b136d85dfb"}},{"code_sha256_prefix":"4124af7b0de1cd57","entry":"mask_edge","repo":"mala-lab/UNPrompt","repo_kind":"official","path":"pretrain.py","file_url":"https://github.com/mala-lab/UNPrompt/blob/HEAD/pretrain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4124af7b0de1cd57"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}