Gradient Rewiring for Editable Graph Neural Network Training

Zhimeng Jiang, Zirui Liu, Xiaotian Han, Qizhang Feng, Hongye Jin, Qiaoyu Tan, Kaixiong Zhou, Na Zou, Xia Ben Hu

Introduction

Deep learning models, particularly Graph Neural Networks (GNNs), are increasingly deployed in high-stakes environments such as credit risk assessment and fake news detection. Despite their performance, these models occasionally make errors. Model editing provides a mechanism to fix specific misclassifications (e.g., a single node) without the prohibitive cost of retraining the entire model. However, GNNs present a unique challenge due to their inherent message-passing architecture: updates intended to fix one node often propagate through the graph, causing a "ripple effect" that degrades performance elsewhere.

The Problem: Gradient Inconsistency

The authors identify that the primary cause of this ripple effect is gradient inconsistency. When a model is fine-tuned on a target error, the gradient required to fix that error often conflicts with the gradients necessary to maintain general accuracy on the rest of the training data. This conflict leads to a rapid spike in general training loss ($L_{train}$) even as the target loss ($L_{target}$) decreases.

Figure 1: Visualization of gradient inconsistency and loss behavior during editing across different datasets.

As illustrated in Figure 1, standard fine-tuning causes the training loss to climb significantly (middle row), demonstrating that surgical fixes to GNNs are naturally unstable without specialized intervention.

Proposed Method: Gradient Rewiring (GRE)

To address these inconsistencies, the authors propose Gradient Rewiring (GRE) and its enhanced version, GRE+.

The GRE Framework

Instead of following the raw gradient of the error, GRE formulates the update as a constrained optimization problem. It establishes an anchor gradient from the training data to represent the model's existing knowledge. The framework then "rewires" the target gradient to minimize the discrepancy between the fix and this anchor. This ensures that the parameter update remains local and does not increase the overall training loss.

GRE+

GRE+ further refines this by splitting the training data into multiple disjoint subsets. It ensures the rewired gradient respects the performance of all subsets simultaneously. This prevents the model from fixing an error at the expense of any specific cluster or neighborhood within the graph. By solving these constraints in the "dual space," the authors maintain low computational overhead, making the method scalable to large models.

Experimental Evaluation

The framework was evaluated across eight datasets ranging from small-scale citation networks (Cora) to large-scale product graphs (ogbn-products). The researchers measured performance using three primary metrics:

  • Edit Success Rate (SR): The ability to fix the targeted error.
  • Accuracy (Acc): The overall performance after the edit.
  • Drawdown (DD): The drop in test accuracy specifically caused by the edit.

Key Results

GRE and GRE+ consistently outperformed traditional Gradient Descent (GD) and existing editors like the Editable Neural Network (ENN).

Figure 2: Performance comparison on small-scale datasets showing GRE+ achieving the best balance of accuracy and low drawdown.

As shown in Figure 2, standard GD often results in catastrophic drawdown (e.g., a 65.08% drop on the A-photo dataset). In contrast, GRE+ significantly limits this drop while maintaining a near-perfect success rate. The method proved to be "model-agnostic," showing improvements when applied to GCN, GraphSAGE, and specialized architectures like EGNN (Editable GNN).

Conclusion and Future Work

Gradient Rewiring effectively mitigates the ripple effect in GNN editing by aligning error-correcting updates with the model's general knowledge. While GRE+ shows superior stability, the authors note that "sequential editing"—fixing multiple errors in a row—remains a challenge as the anchor gradient may eventually decay. Future research will focus on strategies to update these anchors using critical training samples and improving subset selection for more robust constraints.

Summary updated

BibTeX
@inproceedings{jiang2024gradient,
  author = {Zhimeng Jiang and Zirui Liu and Xiaotian Han and Qizhang Feng and Hongye Jin and Qiaoyu Tan and Kaixiong Zhou and Na Zou and Xia Ben Hu},
  title = {{Gradient Rewiring for Editable Graph Neural Network Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=JWzH6qeW8G},
}
Figure