{"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/gnn-explainer-a-tool-for-post-hoc-explanation","title":"GNNExplainer: Generating Explanations for Graph Neural Networks","arxiv_id":"1903.03894","date":"2019-03-10","proceeding":"NeurIPS 2019 12","authors":["Rex Ying","Dylan Bourgeois","Jiaxuan You","Marinka Zitnik","Jure Leskovec"],"abstract":"Graph Neural Networks (GNNs) are a powerful tool for machine learning on graphs.GNNs combine node feature information with the graph structure by recursively passing neural messages along edges of the input graph. However, incorporating both graph structure and feature information leads to complex models, and explaining predictions made by GNNs remains unsolved. Here we propose GNNExplainer, the first general, model-agnostic approach for providing interpretable explanations for predictions of any GNN-based model on any graph-based machine learning task. Given an instance, GNNExplainer identifies a compact subgraph structure and a small subset of node features that have a crucial role in GNN's prediction. Further, GNNExplainer can generate consistent and concise explanations for an entire class of instances. We formulate GNNExplainer as an optimization task that maximizes the mutual information between a GNN's prediction and distribution of possible subgraph structures. Experiments on synthetic and real-world graphs show that our approach can identify important graph structures as well as node features, and outperforms baselines by 17.1% on average. GNNExplainer provides a variety of benefits, from the ability to visualize semantically relevant structures to interpretability, to giving insights into errors of faulty GNNs.","url_abs":"https://arxiv.org/abs/1903.03894v4","url_pdf":"https://arxiv.org/pdf/1903.03894v4.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":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/RexYing/gnn-model-explainer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/Aditya239233/GNNExplainer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/AlexDuvalinho/GNNE_eval","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/LarsHoldijk/RE-ParameterizedExplainerForGraphNeuralNetworks","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/OpenXAIProject/GNNExplainer-Tutorial","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/ShaharGottlieb/GNNExplainer_DGL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/VisiumCH/AMLD-2021-Graphs","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/anshul3899/GNNExplainer-Experiments","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/ipolharvard/readmit-stgnn","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/realmoana/proxyexplainer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/tsy935/readmit-stgnn","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"gnn-explainer-a-tool-for-post-hoc-explanation","repo_url":"https://github.com/dmlc/dgl/tree/master/examples/pytorch/gnn_explainer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"machine-learning","task_name":"BIG-bench Machine Learning"},{"task_slug":"explainable-artificial-intelligence","task_name":"Explainable artificial intelligence"},{"task_slug":"graph-classification","task_name":"Graph Classification"},{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"link-prediction","task_name":"Link Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1903.03894","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1903.03894"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/anshul3899/GNNExplainer-Experiments","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/realmoana/proxyexplainer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/VisiumCH/AMLD-2021-Graphs","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ShaharGottlieb/GNNExplainer_DGL","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dmlc/dgl/tree/master/examples/pytorch/gnn_explainer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/RexYing/gnn-model-explainer","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/AlexDuvalinho/GNNE_eval","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Aditya239233/GNNExplainer","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/LarsHoldijk/RE-ParameterizedExplainerForGraphNeuralNetworks","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/OpenXAIProject/GNNExplainer-Tutorial","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tsy935/readmit-stgnn","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ipolharvard/readmit-stgnn","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":21},"by_repo_kind":{"official":{"samples":9,"ran":0,"repositories":1},"listed":{"samples":13,"ran":1,"repositories":4}},"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":"9e838e040242f5eb","entry":"join_graph","repo":"Aditya239233/GNNExplainer","repo_kind":"listed","path":"gengraph.py","file_url":"https://github.com/Aditya239233/GNNExplainer/blob/HEAD/gengraph.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e838e040242f5eb"}},{"code_sha256_prefix":"b5d664d8043db74c","entry":"create_filename","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"utils/io_utils.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/utils/io_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b5d664d8043db74c"}},{"code_sha256_prefix":"9d2a8b77cbe3adb0","entry":"date_ranges_to_days","repo":"ipolharvard/readmit-stgnn","repo_kind":"listed","path":"stgnn/preprocess_ehr.py","file_url":"https://github.com/ipolharvard/readmit-stgnn/blob/HEAD/stgnn/preprocess_ehr.py","link_basis":"harvester_set","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":"9d2a8b77cbe3adb0"}},{"code_sha256_prefix":"ea9f4e76fa4b2cdf","entry":"denoise_graph","repo":"AlexDuvalinho/GNNE_eval","repo_kind":"listed","path":"plots.py","file_url":"https://github.com/AlexDuvalinho/GNNE_eval/blob/HEAD/plots.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ea9f4e76fa4b2cdf"}},{"code_sha256_prefix":"07dd564321cae261","entry":"exp_moving_avg","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"utils/math_utils.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/utils/math_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"07dd564321cae261"}},{"code_sha256_prefix":"3e89f6550fc6950a","entry":"find_icd_group","repo":"tsy935/readmit-stgnn","repo_kind":"listed","path":"ehr/get_mimic_cohort.py","file_url":"https://github.com/tsy935/readmit-stgnn/blob/HEAD/ehr/get_mimic_cohort.py","link_basis":"harvester_set","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":"3e89f6550fc6950a"}},{"code_sha256_prefix":"4d79e3489891364a","entry":"gen_explainer_prefix","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"utils/io_utils.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/utils/io_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4d79e3489891364a"}},{"code_sha256_prefix":"b787b2d1149916ac","entry":"gen_prefix","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"utils/io_utils.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/utils/io_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b787b2d1149916ac"}},{"code_sha256_prefix":"725051c1c5a70fdf","entry":"get_logger","repo":"tsy935/readmit-stgnn","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/tsy935/readmit-stgnn/blob/HEAD/utils.py","link_basis":"harvester_set","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":"725051c1c5a70fdf"}},{"code_sha256_prefix":"cd9f64817c619200","entry":"get_save_dir","repo":"tsy935/readmit-stgnn","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/tsy935/readmit-stgnn/blob/HEAD/utils.py","link_basis":"harvester_set","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":"cd9f64817c619200"}},{"code_sha256_prefix":"d95d163bbf721125","entry":"get_transform","repo":"tsy935/readmit-stgnn","repo_kind":"listed","path":"cxr/extract_cxr_features.py","file_url":"https://github.com/tsy935/readmit-stgnn/blob/HEAD/cxr/extract_cxr_features.py","link_basis":"harvester_set","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":"d95d163bbf721125"}},{"code_sha256_prefix":"7dfa7b4c71704350","entry":"last_relevant_pytorch","repo":"tsy935/readmit-stgnn","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/tsy935/readmit-stgnn/blob/HEAD/utils.py","link_basis":"harvester_set","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":"7dfa7b4c71704350"}},{"code_sha256_prefix":"362713dfa016e305","entry":"load_cxrs_moco_single_split","repo":"tsy935/readmit-stgnn","repo_kind":"listed","path":"cxr/extract_cxr_features.py","file_url":"https://github.com/tsy935/readmit-stgnn/blob/HEAD/cxr/extract_cxr_features.py","link_basis":"harvester_set","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":"362713dfa016e305"}},{"code_sha256_prefix":"aeb67cb379f56302","entry":"neighborhoods","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"utils/graph_utils.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/utils/graph_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"aeb67cb379f56302"}},{"code_sha256_prefix":"11e1d48886273577","entry":"perturb","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"gengraph.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/gengraph.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"11e1d48886273577"}},{"code_sha256_prefix":"2da026cd7d9d780d","entry":"plot_dist","repo":"AlexDuvalinho/GNNE_eval","repo_kind":"listed","path":"plots.py","file_url":"https://github.com/AlexDuvalinho/GNNE_eval/blob/HEAD/plots.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2da026cd7d9d780d"}},{"code_sha256_prefix":"5dbca373321f92ca","entry":"preprocess_input_graph","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"gengraph.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/gengraph.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5dbca373321f92ca"}},{"code_sha256_prefix":"f2e7e16c79c41137","entry":"str2bool","repo":"ipolharvard/readmit-stgnn","repo_kind":"listed","path":"stgnn/args.py","file_url":"https://github.com/ipolharvard/readmit-stgnn/blob/HEAD/stgnn/args.py","link_basis":"harvester_set","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":"f2e7e16c79c41137"}},{"code_sha256_prefix":"1194b67a9fa45964","entry":"test","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"explain_pyg.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/explain_pyg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1194b67a9fa45964"}},{"code_sha256_prefix":"b35616ed5d1efd11","entry":"test","repo":"AlexDuvalinho/GNNE_eval","repo_kind":"listed","path":"explain_pyg.py","file_url":"https://github.com/AlexDuvalinho/GNNE_eval/blob/HEAD/explain_pyg.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b35616ed5d1efd11"}},{"code_sha256_prefix":"c872f4cd90fce281","entry":"tv_norm","repo":"RexYing/gnn-model-explainer","repo_kind":"official","path":"utils/math_utils.py","file_url":"https://github.com/RexYing/gnn-model-explainer/blob/HEAD/utils/math_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c872f4cd90fce281"}},{"code_sha256_prefix":"ef9363492fc8a07b","entry":"visualize_subgraph","repo":"AlexDuvalinho/GNNE_eval","repo_kind":"listed","path":"plots.py","file_url":"https://github.com/AlexDuvalinho/GNNE_eval/blob/HEAD/plots.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ef9363492fc8a07b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}