A Cognac Shot To Forget Bad Memories: Corrective Unlearning for Graph Neural Networks

Varshita Kolipaka, Akshit Sinha, Debangan Mishra, Sumit Kumar, Arvindh Arun, Shashwat Goel, Ponnurangam Kumaraguru

TL;DR

Cognac is a novel "corrective unlearning" framework for Graph Neural Networks (GNNs) designed to purge the influence of adversarial or incorrect data. Unlike prior methods, it effectively removes these "bad memories" even when only a tiny fraction (as little as 5%) of the manipulated data is identified, outperforming retraining from scratch while being 8x more efficient.

What Problem Does This Paper Address?

In the world of Graph Neural Networks, data is not independent. Because GNNs rely on message-passing to aggregate information from neighbors, a single malicious node or a spurious edge can propagate its influence across large portions of a graph. This "poisoning" can severely degrade model performance, fairness, and robustness.

While "privacy-oriented" unlearning focuses on simply deleting specific data points, corrective unlearning aims to restore the model's performance on the distribution affected by manipulations. This is significantly harder because:

  1. Influence Propagation: Deleting a node doesn't automatically undo the changes it caused in its neighbors' hidden representations during training.
  2. Partial Knowledge: In real-world scenarios, we rarely identify the entire set of manipulated data ($S_m$). We usually only find a small representative subset ($S_f$).

The authors show that existing graph unlearning methods fail in this corrective setting, often performing worse than simply retraining the model from scratch.

Methods

The proposed method, Cognac, addresses these challenges by alternating between two core components:

  1. CoGN (Contrastive unlearning on Graph Neighborhoods): This component focuses on the neighbors. It first uses a clever heuristic to identify "affected nodes"—neighbors whose output logits change most when the features of known manipulated nodes are inverted. It then applies a contrastive loss to push the representations of these affected nodes away from the manipulated entities while keeping them close to their "clean" neighbors.

    Figure 2. A toy example detailing Affected Node Identification. (1) We first invert the features of the known manipulated node. (2) We perform two forward passes through the GNN, one with the original feature vector and one with the inverted feature vector. (3) We compute the difference in output logits from both cases and take the top 2 nodes with the largest logit change, which in this case are nodes E and B.
  2. AC$\lightning$DC (AsCent DesCent de$\lightning$coupled): This handles the labels. It performs gradient ascent on the known deletion set ($S_f$) to "forget" the incorrect labels and gradient descent on the remaining data to maintain overall model utility. Crucially, it uses decoupled optimizers with different learning rates for ascent and descent to prevent the model from collapsing or reinforcing unidentified bad data.

Figure 1. Illustration of our method Cognac. Initially (Left), the model is trained on manipulated data (Devils), out of which only a subset is identified for deletion (Dark-red-devils). Our method alternates between two steps. (1) Identifying neighbors by the deletion set, which can include both nodes from the remaining data (light red) and unidentified manipulated nodes (Purple), and pushes their representation away from the deletion set and toward other nodes in the neighborhood. (2) We then perform ascent on the deletion set labels and descent on the remaining data with separate optimizer instances. This cleanly separates the embeddings of the affected classes (Right), recovering the accuracy on the affected distribution, and maintaining it on the remaining distribution.

Datasets

The authors evaluated Cognac across ten diverse benchmark datasets covering citation, co-author, and co-purchase networks:

  • Citation: Cora, PubMed, CiteSeer, DBLP, CoraFull, OGB-arXiv.
  • Co-author: Coauthor CS, Coauthor Physics.
  • Co-purchase: Amazon Photos, Amazon Computers.

They tested against two primary targeted attacks: Spurious Edge Addition (violating homophily) and Interclass Confusion (label swapping between two classes).

Key Insights and Ideas

  • Retraining is not the "Gold Standard": A major "aha" moment is that if you only know a subset of the bad data, retraining on the "rest" can actually reinforce the influence of the unidentified bad data still present in the training set. Cognac avoids this by actively pushing representations away from the bad distribution.
  • Graph Locality as a Search Space: By recognizing that GNN influence is bounded by the number of message-passing layers, the authors drastically reduced the search space for affected nodes to an $n$-hop neighborhood.
  • The Power of Contrast: Simply maximizing loss on bad data (ascent) isn't enough in graphs. You need the contrastive signal from CoGN to "steer" affected nodes back toward the correct distribution by aligning them with their unaffected neighbors.
  • Efficiency Matters: Cognac achieves its results without the heavy computational overhead of calculating inverse Hessians or influence functions, making it scalable to large graphs like OGB-arXiv.

Key Results

  • State-of-the-Art Recovery: Cognac consistently achieves the highest "Corrected Accuracy" ($Acc_{aff}$) across all datasets. It often matches or even surpasses a "strong oracle" (a model trained only on perfectly clean data).
  • Performance with Minimal Data: Remarkably, Cognac can recover most of the lost performance even when only 5% of the manipulated set is identified for deletion.
  • Efficiency: It is 8x more efficient than retraining from scratch and significantly faster than complex sampling-based unlearning baselines.
  • Scalability: On the large-scale OGB-arXiv dataset (170k nodes, 1M+ edges), Cognac maintained a substantial lead over retraining and other baselines.
Main results showing Cognac (blue line) consistently outperforming baselines and approaching Oracle performance across various datasets and deletion fractions.

Limitations and Future Work

  • Homophily Dependence: The current method relies on the homophily assumption (that neighbors are similar). While common, this doesn't hold for heterophilic graphs where neighbors are expected to be different. The authors suggest expanding to heterophilic datasets as a future direction.
  • Attack Generalization: While tested against common adversarial attacks, there is no theoretical guarantee that it will succeed against every possible real-world data corruption.
  • Theoretical Foundations: The work provides strong empirical evidence and some initial theorems, but the authors call for deeper theoretical understanding of graph corrective unlearning in the broader GNN robustness community.

Summary updated

Abstract

Graph Neural Networks (GNNs) are increasingly being used for a variety of ML applications on graph data. Because graph data does not follow the independently and identically distributed (i.i.d.) assumption, adversarial manipulations or incorrect data can propagate to other data points through message passing, which deteriorates the model's performance. To allow model developers to remove the adverse effects of manipulated entities from a trained GNN, we study the recently formulated problem of Corrective Unlearning. We find that current graph unlearning methods fail to unlearn the effect of manipulations even when the whole manipulated set is known. We introduce a new graph unlearning method, Cognac, which can unlearn the effect of the manipulation set even when only 5% of it is identified. It recovers most of the performance of a strong oracle with fully corrected training data, even beating retraining from scratch without the deletion set while being 8x more efficient. We hope our work assists GNN developers in mitigating harmful effects caused by issues in real-world data, post-training. Our code is publicly available at https://github.com/cognac-gnn-unlearning/corrective-unlearning-for-gnns
BibTeX
@inproceedings{kolipaka2025cognac,
  author = {Varshita Kolipaka and Akshit Sinha and Debangan Mishra and Sumit Kumar and Arvindh Arun and Shashwat Goel and Ponnurangam Kumaraguru},
  title = {{A Cognac Shot To Forget Bad Memories: Corrective Unlearning for Graph Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=epDkt44mkq},
}
Figure