{"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/gradient-rewiring-for-editable-graph-neural","title":"Gradient Rewiring for Editable Graph Neural Network Training","arxiv_id":"2410.15556","date":"2024-10-21","proceeding":null,"authors":["Zhimeng Jiang","Zirui Liu","Xiaotian Han","Qizhang Feng","Hongye Jin","Qiaoyu Tan","Kaixiong Zhou","Na Zou","Xia Hu"],"abstract":"Deep neural networks are ubiquitously adopted in many applications, such as computer vision, natural language processing, and graph analytics. However, well-trained neural networks can make prediction errors after deployment as the world changes. \\textit{Model editing} involves updating the base model to correct prediction errors with less accessible training data and computational resources. Despite recent advances in model editors in computer vision and natural language processing, editable training in graph neural networks (GNNs) is rarely explored. The challenge with editable GNN training lies in the inherent information aggregation across neighbors, which can lead model editors to affect the predictions of other nodes unintentionally. In this paper, we first observe the gradient of cross-entropy loss for the target node and training nodes with significant inconsistency, which indicates that directly fine-tuning the base model using the loss on the target node deteriorates the performance on training nodes. Motivated by the gradient inconsistency observation, we propose a simple yet effective \\underline{G}radient \\underline{R}ewiring method for \\underline{E}ditable graph neural network training, named \\textbf{GRE}. Specifically, we first store the anchor gradient of the loss on training nodes to preserve the locality. Subsequently, we rewire the gradient of the loss on the target node to preserve performance on the training node using anchor gradient. Experiments demonstrate the effectiveness of GRE on various model architectures and graph datasets in terms of multiple editing situations. The source code is available at \\url{https://github.com/zhimengj0326/Gradient_rewiring_editing}","url_abs":"https://arxiv.org/abs/2410.15556v2","url_pdf":"https://arxiv.org/pdf/2410.15556v2.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":"gradient-rewiring-for-editable-graph-neural","repo_url":"https://github.com/zhimengj0326/gradient_rewiring_editing","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"model-editing","task_name":"Model Editing"}],"methods":[{"method_slug":"base","method_name":"BASE"},{"method_slug":"graph-neural-network","method_name":"Graph Neural Network"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.15556","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.15556"}},"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":"deterministic:regex_extraction","url":"https://github.com/eric-mitchell/mend","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/zhimengj0326/Gradient_rewiring_editing","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhimengj0326/gradient_rewiring_editing","reach":{"status":"ok"}}],"summary":{"ran_violates":1,"unverified":8},"by_repo_kind":{"official":{"samples":7,"ran":0,"repositories":1},"found_in_text":{"samples":1,"ran":0,"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":8,"samples":[{"code_sha256_prefix":"dce9e6218ab55e37","entry":"update_counter","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"dce9e6218ab55e37"}},{"code_sha256_prefix":"5f80a8cf6fc66a93","entry":"GRE","repo":"zhimengj0326/gradient_rewiring_editing","repo_kind":"official","path":"editable_gnn/gre.py","file_url":"https://github.com/zhimengj0326/gradient_rewiring_editing/blob/HEAD/editable_gnn/gre.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":"5f80a8cf6fc66a93"}},{"code_sha256_prefix":"072cb35ecca2208e","entry":"GradientTransform","repo":"eric-mitchell/mend","repo_kind":"found_in_text","path":"algs/mend.py","file_url":"https://github.com/eric-mitchell/mend/blob/HEAD/algs/mend.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":"072cb35ecca2208e"}},{"code_sha256_prefix":"37212e852e7bfd7e","entry":"cs_matrix","repo":"zhimengj0326/Gradient_rewiring_editing","repo_kind":"official","path":"editable_gnn/smat_util.py","file_url":"https://github.com/zhimengj0326/Gradient_rewiring_editing/blob/HEAD/editable_gnn/smat_util.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":"37212e852e7bfd7e"}},{"code_sha256_prefix":"faf670547bb5166e","entry":"csc_matrix","repo":"zhimengj0326/Gradient_rewiring_editing","repo_kind":"official","path":"editable_gnn/smat_util.py","file_url":"https://github.com/zhimengj0326/Gradient_rewiring_editing/blob/HEAD/editable_gnn/smat_util.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":"faf670547bb5166e"}},{"code_sha256_prefix":"daec7637a492323b","entry":"csr_matrix","repo":"zhimengj0326/Gradient_rewiring_editing","repo_kind":"official","path":"editable_gnn/smat_util.py","file_url":"https://github.com/zhimengj0326/Gradient_rewiring_editing/blob/HEAD/editable_gnn/smat_util.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":"daec7637a492323b"}},{"code_sha256_prefix":"fc9caff04eab72da","entry":"gen_masks","repo":"zhimengj0326/Gradient_rewiring_editing","repo_kind":"official","path":"data.py","file_url":"https://github.com/zhimengj0326/Gradient_rewiring_editing/blob/HEAD/data.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":"fc9caff04eab72da"}},{"code_sha256_prefix":"f4be3d37312246ec","entry":"get_planetoid","repo":"zhimengj0326/Gradient_rewiring_editing","repo_kind":"official","path":"data.py","file_url":"https://github.com/zhimengj0326/Gradient_rewiring_editing/blob/HEAD/data.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":"f4be3d37312246ec"}},{"code_sha256_prefix":"4e0d1bcb50e86417","entry":"index2mask","repo":"zhimengj0326/Gradient_rewiring_editing","repo_kind":"official","path":"data.py","file_url":"https://github.com/zhimengj0326/Gradient_rewiring_editing/blob/HEAD/data.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":"4e0d1bcb50e86417"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}