{"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/learning-on-graphs-with-out-of-distribution","title":"Learning on Graphs with Out-of-Distribution Nodes","arxiv_id":"2308.06714","date":"2023-08-13","proceeding":null,"authors":["Yu Song","Donglin Wang"],"abstract":"Graph Neural Networks (GNNs) are state-of-the-art models for performing prediction tasks on graphs. While existing GNNs have shown great performance on various tasks related to graphs, little attention has been paid to the scenario where out-of-distribution (OOD) nodes exist in the graph during training and inference. Borrowing the concept from CV and NLP, we define OOD nodes as nodes with labels unseen from the training set. Since a lot of networks are automatically constructed by programs, real-world graphs are often noisy and may contain nodes from unknown distributions. In this work, we define the problem of graph learning with out-of-distribution nodes. Specifically, we aim to accomplish two tasks: 1) detect nodes which do not belong to the known distribution and 2) classify the remaining nodes to be one of the known classes. We demonstrate that the connection patterns in graphs are informative for outlier detection, and propose Out-of-Distribution Graph Attention Network (OODGAT), a novel GNN model which explicitly models the interaction between different kinds of nodes and separate inliers from outliers during feature propagation. Extensive experiments show that OODGAT outperforms existing outlier detection methods by a large margin, while being better or comparable in terms of in-distribution classification.","url_abs":"https://arxiv.org/abs/2308.06714v1","url_pdf":"https://arxiv.org/pdf/2308.06714v1.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":"learning-on-graphs-with-out-of-distribution","repo_url":"https://github.com/songyyyy/kdd22-oodgat","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"graph-attention","task_name":"Graph Attention"},{"task_slug":"graph-learning","task_name":"Graph Learning"},{"task_slug":"outlier-detection","task_name":"Outlier Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2308.06714","atlas_url":"https://app.syntology.ai/?focus=2308.06714","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.06714"}},"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/songyyyy/kdd22-oodgat","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":3},"by_repo_kind":{"official":{"samples":9,"ran":6,"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":9,"samples":[{"code_sha256_prefix":"dece6fe999782006","entry":"cosine_similarity","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"utils.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dece6fe999782006"}},{"code_sha256_prefix":"a1e46b338f6ac6ad","entry":"get_acc","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/blob/HEAD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a1e46b338f6ac6ad"}},{"code_sha256_prefix":"a1f38821e8c243bc","entry":"get_consistent_loss_new","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"utils.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a1f38821e8c243bc"}},{"code_sha256_prefix":"fc1c75c0befeceee","entry":"get_ood_performance","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/blob/HEAD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fc1c75c0befeceee"}},{"code_sha256_prefix":"bf6f0b5a65218aa0","entry":"glorot_init","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"layer.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/blob/HEAD/layer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bf6f0b5a65218aa0"}},{"code_sha256_prefix":"2ad5e40631c11bf3","entry":"glorot_init_2","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"layer.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/blob/HEAD/layer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2ad5e40631c11bf3"}},{"code_sha256_prefix":"415ce879b437fe80","entry":"generate_masks","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"data_process.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/blob/HEAD/data_process.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"415ce879b437fe80"}},{"code_sha256_prefix":"f814504939b756db","entry":"get_f1_score","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/blob/HEAD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f814504939b756db"}},{"code_sha256_prefix":"f40df564d22a1703","entry":"normalize_feature","repo":"songyyyy/kdd22-oodgat","repo_kind":"official","path":"data_process.py","file_url":"https://github.com/songyyyy/kdd22-oodgat/blob/HEAD/data_process.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f40df564d22a1703"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}