Fine-tuning is Not Fine: Mitigating Backdoor Attacks in GNNs with Limited Clean Data

Jiale Zhang, Bosen Rao, Chengcheng Zhu, Xiaobing Sun, Qingming Li, Haibo Hu, Xiapu Luo, Qingqing Ye, Shouling JiarXiv 2025 · DOI

TL;DR

Graph Neural Networks (GNNs) are highly vulnerable to backdoor attacks, but existing defenses require unrealistically large amounts of clean data to sanitize compromised models. This paper introduces GraphNAD, a novel knowledge distillation framework that uses graph-specific attention transfer and inter-layer relationship mapping to effectively erase backdoors. Remarkably, GraphNAD reduces the attack success rate to under 5% using just 3% of clean data, all while preserving the model's accuracy on normal tasks.

The Vulnerability of Graph Neural Networks

Graph Neural Networks (GNNs) are the go-to architecture for modeling complex relational data like molecular structures and social networks. However, if you download a pre-trained GNN from an untrusted source, it might contain a backdoor—a hidden vulnerability where a specific "trigger" (like a specific subgraph pattern) causes the model to intentionally misclassify the input.

Illustration of graph tampering methods, including node feature manipulation and topological disruption.

To remove these backdoors, defenders typically use fine-tuning or knowledge distillation. The problem? In the graph domain, these methods require a massive amount of clean, trusted data (often 15-20% of the original training set) to successfully overwrite the backdoor. In real-world scenarios, defenders rarely have access to that much proprietary training data. The authors tackle the challenge of sanitizing a backdoored GNN when the defender only has access to a severely limited sliver of clean data (e.g., <5%).

The GraphNAD Framework

The authors propose GraphNAD (Graph Neural Attention Distillation), which operates on a Teacher-Student distillation framework.

The GraphNAD framework overview, illustrating graph attention transfer and attention relation congruence between teacher and student models.
  1. Creating the Teacher: The defender takes the backdoored model and fine-tunes it on the tiny available clean dataset. This creates a "teacher" model that is slightly cleaner than the original. The original backdoored model acts as the "student."
  2. Graph Attention Transfer: Standard attention maps used in computer vision don't work for graphs because they ignore topological structure. The authors design a custom graph attention operator that factors in node degrees to identify which parts of the graph the model is focusing on. They then force the student model's intermediate attention layers to align with the teacher's. This forces the student to "look away" from backdoor triggers and focus on benign features.
  3. Attention Relation Congruence: Because the clean dataset is so small, simply matching layer-to-layer attention isn't enough to preserve the model's overall accuracy. To squeeze more knowledge out of the limited data, GraphNAD also aligns the relationships between different layers (e.g., how Layer 1 relates to Layer 2) using a metric called sliced Wasserstein distance. This acts as a powerful regularizer to maintain the model's performance on normal tasks.

Experimental Evaluation

The authors evaluated their method on four standard graph classification benchmarks: PROTEINS, COLLAB, AIDS, and Fingerprint. They also used NCI1 and NCI109 as out-of-distribution auxiliary datasets to test extreme scenarios where the defender has zero access to the original data distribution.

Key Results

  • High Defense Efficacy: GraphNAD reduced the Attack Success Rate (ASR) to below 5% across all tested datasets and against three state-of-the-art attack methods (Sub-BA, GTA, Motif-BA).
  • Data Efficiency: It achieved these results using only 3% clean data, whereas baseline methods (like Anti-Backdoor Learning or Pruning) either failed to remove the backdoor or severely degraded the model's normal accuracy. GraphNAD kept the main-task accuracy drop to within 5%.
  • Extreme Scenarios: Even when restricted to just 1% clean data, GraphNAD kept the ASR below 10%. Furthermore, when using completely different public datasets (e.g., using NCI1 data to defend a model trained on AIDS data), the method still successfully suppressed the backdoor.

Key Insights

  • Attention reveals the backdoor: Visualizing the attention maps of backdoored models shows they hyper-focus on the injected trigger nodes. By forcing the model to mimic the attention map of a fine-tuned model, the backdoor neurons are effectively overwritten and "unlearn" the trigger.
  • Amplifying the signal: Because the clean dataset is tiny, the authors use an exponentiation trick to artificially amplify the activation differences between backdoor and benign neurons, making the distillation process more aggressive and effective.
  • Inter-layer dynamics: Matching inter-layer relationships prevents the model from forgetting its primary task while it unlearns the backdoor, which is crucial when data is scarce.

Conclusion and Future Work

GraphNAD demonstrates that effective backdoor defense is possible even with extremely limited clean data by leveraging graph-specific attention and inter-layer relationships. While currently tailored for graph-level classification and multi-layer networks, future work aims to explore zero-data defense scenarios and adapt the framework for node-level prediction tasks.

Summary updated

BibTeX
@misc{zhang2025fine,
  author = {Jiale Zhang and Bosen Rao and Chengcheng Zhu and Xiaobing Sun and Qingming Li and Haibo Hu and Xiapu Luo and Qingqing Ye and Shouling Ji},
  title = {{Fine-tuning is Not Fine: Mitigating Backdoor Attacks in GNNs with Limited Clean Data}},
  year = {2025},
  eprint = {2501.05835},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.05835},
}
Figure