Attacking Graph Neural Networks with Bit Flips: Weisfeiler and Lehman Go Indifferent

Lorenz Kummer, Samir Moustafa, Nils Morten Kriege, Wilfried N. Gansterer · Submission to ICLR 2024 · Rejected

TL;DR

The paper introduces the Injectivity Bit Flip Attack (IBFA), the first hardware fault-injection attack tailored specifically to the mathematical structure of Graph Neural Networks (GNNs). By corrupting a tiny fraction of weight bits in memory, IBFA destroys the injectivity of neighborhood aggregation in Graph Isomorphism Networks (GINs), stripping their Weisfeiler-Lehman structural expressivity and reducing models to random guessing in fewer than 33 bit flips.

What Problem Does This Paper Address?

Prior security research on GNNs has almost exclusively targeted graph data directly via data poisoning or adversarial evasion (e.g., adding/removing edges or perturbing node features). Meanwhile, Bit Flip Attacks (BFAs)—which exploit physical memory vulnerabilities like RowHammer to flip individual weight bits at runtime—have been extensively studied for quantized Convolutional Neural Networks (CNNs).

Directly porting traditional CNN attacks (such as the standard Progressive Bit Flip Attack, or PBFA) to GNNs often fails. On tasks requiring structural discrimination—such as molecular property prediction where graph homophily is weak—PBFA barely outperforms random bit flips, sometimes requiring thousands of flips to make an impact. The authors set out to determine how malicious bit flips can exploit the unique mathematical mechanisms of GNNs.

Methods

IBFA specifically targets the multi-layer perceptrons (MLPs) responsible for the injective neighborhood aggregation in Graph Isomorphism Networks (GINs), which provide GINs with the discriminative power of the 1-Weisfeiler-Lehman (1-WL) graph isomorphism test.

  • Objective Inversion: Rather than maximizing task loss (as in standard PBFA), IBFA minimizes the difference between outputs for two distinct graph inputs: $$\min_{\{W\}} \mathcal{L}\big(\Phi(X_a), \Phi(X_b)\big)$$ This collapses the network's ability to map different graph structures (unfolding trees) to different embeddings. It also allows IBFA to operate on unlabeled data.

  • Tailored Loss Functions: The authors use the $L_1$ norm for single-task binary classification. For multi-task binary and multiclass tasks, they employ pointwise Kullback-Leibler (KL) Divergence across output distributions to avoid averaging out inter-class probability shifts.

  • Input Pair Selection: Inputs $X_a$ and $X_b$ are chosen to maximize output distance prior to the attack. The authors study two selection schemes:
  • IBFA1: Selects $X_a, X_b$ once before the attack begins.
  • IBFA2: Re-evaluates and selects the most divergent inputs before each bit flip (slightly faster degradation, but scales as $\Theta(k n^2)$).

Datasets

The authors evaluated 8-bit integer quantized (INT8) 5-layer GIN models across eight benchmark datasets:

  • Open Graph Benchmark (OGB / MoleculeNet): Six molecular property prediction datasets evaluated with scaffold splits—ogbg-molhiv, ogbg-molpcba, ogbg-moltox21, ogbg-moltoxcast, ogbg-molbace, and ogbg-molmuv.
  • TUDataset: Two social/ego-network datasets with random splits—COLLAB (scientific collaboration multiclass prediction) and GITHUB_STARGAZERS (binary classification).

Key Insights and Ideas

  • Expressivity Relies on Injectivity Across All Layers: While non-injective mappings at early layers can theoretically be rectified downstream, IBFA flips bits across multiple layers (MLP1 through MLP4), degrading expressivity system-wide.
  • Distinct Layer Signatures: Standard PBFA concentrates flips in the first 1–2 layers (mirroring CNN behavior). IBFA distributes bit flips across $\ge 4$ layers, focusing primarily on aggregation MLPs.
  • Evasion of Defenses: Traditional BFA defenses like Neuropots (honeypot neurons) and RADAR (checksums on the 2 most significant bits) rely on standard gradient ascent loss patterns. Because IBFA alters the loss formulation and optimization target, it generates unique gradient profiles and frequently flips lower-significance bits, evading detection and dropping Neuropots model repair rates from 70% to 23%.

Key Results

  • Catastrophic Degradation with < 33 Flips: Across evaluated datasets, IBFA forced GIN models into near-random performance (AUROC $\le 0.50$, Accuracy $\le 0.33$ on 3-class COLLAB, AP $\le 0.11$ on ogbg-molpcba) using fewer than 33 bit flips on average.
  • Massive Efficiency Gain over PBFA: On ogbg-molhiv, PBFA required 953 bit flips to reach random output; on ogbg-moltoxcast, PBFA failed to degrade performance even after 2,662 bit flips. IBFA achieved total degradation on both tasks in fewer than 30 flips.
  • Architectural Generalization: When tested on Graph Convolutional Networks (GCNs)—which use non-injective mean aggregation—IBFA still matched or outperformed PBFA.

Limitations and Future Work

  • White-Box Threat Model: Assumes the attacker has knowledge of model architecture, weights, and a subset of training data (though unlabelled data suffices, and a 1% sample yields similar results).
  • Hardware Abstraction: The attack assumes precise bit-flipping capabilities via DRAM exploits (e.g., RowHammer) without accounting for real-world memory layouts or hardware budgets.
  • Scalability of IBFA2: Dynamic recalculation of input pairs scales quadratically with dataset size, making IBFA1 the more practical variant for large datasets.
  • Future Work: Developing stealthier attack variants and exploring dedicated defense and quantization schemes to improve GNN resilience against memory-level fault injections.

Summary updated

Abstract

Prior attacks on graph neural networks have mostly focused on graph poisoning and evasion, neglecting the network’s weights and biases. Traditional weight-based fault injection attacks, such as bit flip attacks used for convolutional neural networks, do not consider the unique properties of graph neural networks. We propose the Injectivity Bit Flip Attack, the first bit flip attack designed specifically for graph neural networks. Our attack targets the learnable neighborhood aggregation functions in quantized message passing neural networks, degrading their ability to distinguish graph structures and losing the expressivity of the Weisfeiler-Lehman test. Our findings suggest that exploiting mathematical properties specific to certain graph neural network architectures can significantly increase their vulnerability to bit flip attacks. Injectivity Bit Flip Attacks can degrade the maximal expressive Graph Isomorphism Networks trained on various graph property prediction datasets to random output by flipping only a small fraction of the network’s bits, demonstrating its higher destructive power compared to a bit flip attack transferred from convolutional neural networks. Our attack is transparent and motivated by theoretical insights which are confirmed by extensive empirical results.
BibTeX
@misc{kummer2023attacking,
  author = {Lorenz Kummer and Samir Moustafa and Nils Morten Kriege and Wilfried N. Gansterer},
  title = {{Attacking Graph Neural Networks with Bit Flips: Weisfeiler and Lehman Go Indifferent}},
  year = {2023},
  eprint = {2311.01205},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.01205},
}
Figure