A Solver-Efficient Neural Adversarial Attack on Subgraph Matching Models

Ninad Jayesh Gandhi, Mayukh Mondal, Brian S. Mackwan, Soumen Chakrabarti, Abir DeNeurIPS 2026

TL;DR

Fooling an image classifier is easy—just add invisible pixel noise, and a panda still looks like a panda to us while the AI sees a gibbon. Fooling a graph retrieval model is much harder because adding or deleting even a single edge might actually change the mathematical ground truth, requiring an NP-hard solver just to verify your attack is legal. This paper introduces SEAGRAM, a clever neural framework that learns to dodge these expensive solver checks, exposing deep vulnerabilities in modern subgraph matching systems.

What Problem Does This Paper Address?

Suppose you are searching a massive database of chemical compounds (the corpus) to see which ones contain a specific molecular ring (the query). Checking if one graph sits neatly inside another—subgraph isomorphism—is famously NP-hard. To make search fast, researchers use Neural Subgraph Matching (NSGM) models, which map graphs into geometric embeddings and rank matches using an asymmetric "relevance distance."

How robust are these neural retrievers against adversarial attacks? An adversary wants to flip a single edge in a corpus graph so that relevant graphs get pushed down the search rankings and irrelevant ones get pushed up.

Here is the catch: a valid adversarial attack must be label-preserving. If a query graph was originally inside a corpus graph, deleting a crucial structural edge might destroy that subgraph relationship. That wouldn't be fooling the AI; that would just be changing the data! In NSGM, checking whether an edge flip preserves the true label requires calling an exact combinatorial solver for every candidate node pair. Across thousands of graphs, this creates a massive computational bottleneck.

Methods

To attack NSGM models without calling a solver at test time, the authors introduce SEAGRAM, powered by a neural classifier called CRITNET.

Figure 1: SEAGRAM block diagram: Panel (a) describes the CRITNETθ classifier, and Panel (b) describes the adversarial objective maximization of SEAGRAM using the substitute model Sψ.
  1. Critical vs. Non-Critical Pairs: For a given query and corpus graph, node pairs are either critical (flipping the edge changes the true subgraph label) or non-critical (safe to flip). CRITNET learns to predict a criticality score, completely replacing the combinatorial solver during the attack.
  2. Perturbation-Aware GNNs: A standard GNN looking at a modified graph $G'_c$ in isolation wouldn't know which edge changed relative to the clean graph $G_c$ (especially if two different edits yield isomorphic graphs). The authors design a perturbation-aware GNN that fuses node embeddings from both the clean and perturbed graphs at every message-passing layer, explicitly encoding what changed. They build two variants mirroring standard NSGM architectures:
  3. CRITNET (Late): Encodes the query and corpus independently before aligning them.
  4. CRITNET (Early): Allows cross-graph attention during message passing. Crucially, it maintains two query embeddings—one conditioned on the clean corpus, and a perturbation-aware one conditioned on the modified corpus—preventing alignment mismatch.
  5. Active Learning: Training CRITNET still needs solver-generated ground truth. To minimize this upfront cost, SEAGRAM uses an SVM-inspired active learning loop, querying the exact solver only for the top 10% most uncertain node pairs sitting closest to CRITNET's decision boundary.
  6. Substitute Models: Once CRITNET flags the safe (non-critical) edits, a surrogate NSGM model picks the single edge flip that maximally ruins the relevance distance—working in both white-box (surrogate = victim) and black-box (surrogate $\neq$ victim) settings.

Datasets

The authors evaluate SEAGRAM on five standard, real-world molecular and chemical graph benchmarks: AIDS, PTC-FM, PTC-FR, PTC-MM, and PTC-MR. No new datasets are introduced; instead, queries are split into 60% train, 15% validation, and 25% test sets against a fixed corpus.

Key Insights and Ideas

  • Expressive cross-graph interaction breeds robustness: Early-interaction victim models like IsoNet++ (which iteratively refine alignments between query and corpus) are significantly harder to fool than late-interaction or attention-only models like Graph Matching Networks (GMN).
  • "Middle-ground" surrogates transfer best: In black-box attacks, IsoNet (Node) makes the deadliest substitute model. Because its inductive bias sits comfortably between overly simple whole-graph embedders and hyper-specialized edge-alignment models, its attacks generalize remarkably well across diverse victims.
  • Distance shift is a natural proxy for criticality: Even a non-trainable heuristic that flags huge spikes in relevance distance outperforms several established graph-attack baselines—because massive distance jumps naturally hint that a structural subgraph relationship just broke.

Key Results

SEAGRAM severely degrades Mean Average Precision (MAP) across six victim architectures, crushing adapted graph-attack baselines (like Nettack and RL-S2V) while using zero test-time solver calls.

Mean Average Precision (MAP) across five datasets under white-box and black-box attacks.
  • Devastating White-Box Attacks: On IsoNet (Edge) with the AIDS dataset, clean retrieval MAP drops from 0.756 down to 0.179 using SEAGRAM (Early), outperforming the nearest baseline (0.508) by over 50% and approaching the theoretical ceiling of an exact-solver attack (0.094).
  • Strong Black-Box Transfer: Using GMN Match as a surrogate against IsoNet++ (Edge) on PTC-MM, SEAGRAM (Early) slashes MAP from 0.873 to 0.515 (compared to 0.672 for the best baseline).
  • Active Learning & Ablations: Active learning consistently beats random sampling under a strict 10% solver budget. Removing the perturbation-aware interaction layers causes attack efficacy to plummet (e.g., MAP stays up at 0.633 instead of dropping to 0.410 on IsoNet++), proving that explicitly tracking what changed is vital.

Limitations and Future Work

  • Test-Time Scalability: Even though CRITNET is vastly faster than an NP-hard solver, SEAGRAM still exhaustively checks all candidate node pairs in a corpus graph to find the worst-case flip. Finding damaging edits in sublinear time will be necessary for massive graphs.
  • Single-Edge & Pure Topology: The attack is restricted to single-edge flips on purely topological graphs. Extending to multi-edge budgets or graphs with rich node/edge text features (like knowledge graphs) remains open.
  • Building Defenses: Having shown how fragile NSGM retrievers are to single-edge tweaks, the authors hope these insights—especially the relative resilience of IsoNet++—spark new research into adversarial defenses for graph retrieval.

Summary updated

Abstract

Neural subgraph matching (NSGM) models are widely used for graph retrieval, where relevance labels for query–corpus pairs are determined by whether the query graph is a subgraph of the corpus graph. Despite widespread applications, the adversarial robustness of such models remains underexplored. In principle, adversarial attacks should induce minimal shift of the instance distribution and the target labels. However, in NSGM, a single edge insertion or deletion can flip relevance labels. Detecting or controlling label flips requires repeated calls to potentially expensive combinatorial solvers. Responding to this challenge, we propose SEAGRAM, a solver-efficient adversarial attack method. It learns to detect non-critical node pairs whose perturbations will likely preserve relevance labels, thereby avoiding solver calls during test time. We further employ an active learning strategy, which reduces the solver calls also during training. Experiments show that SEAGRAM significantly worsens the performance of existing models.
BibTeX
@inproceedings{gandhi2026solver,
  author = {Ninad Jayesh Gandhi and Mayukh Mondal and Brian S. Mackwan and Soumen Chakrabarti and Abir De},
  title = {{A Solver-Efficient Neural Adversarial Attack on Subgraph Matching Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=GSvgUIyvAD},
}
Figure