Node-level Contrastive Unlearning on Graph Neural Networks

Hong-Kyu Lee, Qiuchen Zhang, Carl Yang, Li XiongarXiv 2025 · DOI

Introduction

In the era of privacy regulations like GDPR and CCPA, users have the "right to be forgotten." For machine learning, this means a model must be able to remove the influence of specific data points from its parameters. While this is relatively straightforward for independent data (like rows in a spreadsheet), it is incredibly difficult for Graph Neural Networks (GNNs). In a graph, nodes are interconnected; a GNN learns a node's representation by aggregating information from its neighbors. If you simply "delete" a node, its "ghost" remains in the learned weights of every node it ever touched.

Node-CUL is a novel framework that allows GNNs to "forget" specific nodes without the massive computational cost of retraining from scratch. By using contrastive learning in the embedding space, it makes target nodes indistinguishable from unseen data while simultaneously "repairing" their neighbors to maintain high model accuracy.

Methodology: Contrastive Unlearning

The authors propose Node-level Contrastive Unlearning (Node-CUL), which operates directly on the model's embedding space through two main phases:

  1. Node Representation Unlearning: Instead of just trying to make the model "wrong" about a node, Node-CUL uses a contrastive loss to push the target node's embedding toward nodes of different classes and away from its original neighbors. The goal is to make the unlearned node's embedding look exactly like that of an unseen test node.
  2. Neighborhood Reconstruction: Because a node’s influence "bleeds" into its neighbors during training, the authors introduce a recursive cleanup step. They optimize the embeddings of the target node's neighbors (up to $k$-hops away) to minimize their reliance on the deleted node, effectively "erasing" the memory of the deleted entity from the surrounding graph structure.
Conceptual overview of Node-CUL: Node Representation Unlearning (left) and Neighborhood Reconstruction (right) in the embedding space.

Crucially, the algorithm includes an explicit termination condition: it stops unlearning as soon as the model’s accuracy on the "forgotten" nodes drops to the same level as its accuracy on totally unseen data. This prevents the model from becoming "too wrong," which could actually signal to an attacker that a node was specifically targeted for deletion.

Experimental Evaluation

The framework was evaluated on four standard graph benchmarks: Cora-ML, PubMed, Citeseer, and CS (Computer Science). The authors tested these across three popular GNN architectures: GCN, GAT, and GIN, ensuring the method is "model-agnostic."

Key Results and Privacy Analysis

Node-CUL achieved "Unlearn Scores" (the difference in accuracy between forgotten nodes and unseen nodes) very close to the "Gold Standard" of full retraining. For example, on the Cora-ML dataset with a GCN, Node-CUL achieved an unlearn score of 2.62, compared to 51.75 for the state-of-the-art GNNDelete (where lower is better).

Using Membership Inference Attacks (MIA), the authors showed that an attacker could not reliably tell if a "forgotten" node was ever part of the training set. Node-CUL's ROC curves for these attacks were close to the baseline of full retraining, indicating high privacy protection.

ROC curves for Membership Inference Attacks on GIN-PubMed, showing Node-CUL (red) performing similarly to the gold standard of full retraining (grey).

Efficiency and Utility

While Node-CUL requires multiple updates, it is still orders of magnitude faster than retraining. On the large CS dataset, Node-CUL took roughly 256 seconds, whereas full retraining would take significantly longer and scale poorly as the graph grows. Furthermore, the "Neighborhood Reconstruction" phase is vital; by "repairing" the neighbors, the unlearned model often maintains or even improves performance on test data compared to the original model.

Discussion and Future Work

The core insight of Node-CUL is that a perfectly unlearned node shouldn't just produce a random prediction; it should behave exactly like a node the model has never encountered before. By targeting the "test node distribution," Node-CUL achieves a more natural state of forgetting.

However, some limitations remain. The current scope is limited to node-level unlearning, though extensions to edges and features are planned. Additionally, the method relies on having a small subset of "unseen" nodes available to set the termination threshold, which might be a challenge in data-constrained environments. Finally, the computational cost of neighborhood reconstruction increases with graph density, suggesting a need for more efficient sampling methods in the future.

Summary updated

BibTeX
@misc{lee2025node,
  author = {Hong-Kyu Lee and Qiuchen Zhang and Carl Yang and Li Xiong},
  title = {{Node-level Contrastive Unlearning on Graph Neural Networks}},
  year = {2025},
  eprint = {2503.02959},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.02959},
}
Figure