TL;DR
Neural networks are increasingly replacing brutally slow mathematical solvers to search massive databases of graphs—helping us find life-saving drug molecules or spot malicious hardware trojans. This paper introduces GRAP, the first adversarial attack framework designed to sabotage these graph retrieval systems. By adding or deleting just a single edge in a carefully chosen handful of database graphs, GRAP scrambles a neural retriever's rankings with surgical precision and mathematical guarantees.
What Problem Does This Paper Address?
Imagine searching a massive chemical database for every molecule that contains a specific atomic ring (a query graph). Checking if one graph sits inside another—subgraph isomorphism—is famously NP-hard. To avoid grinding supercomputers to a halt, modern Neural Subgraph Retrievers (NSRs) use Graph Neural Networks to map graphs into an embedding space. They learn a "relevance distance," pulling valid supergraphs close to the query and pushing irrelevant ones away, then simply return the top-$K$ closest matches.
Given that NSRs are used in safety-critical domains like drug discovery and hardware security, how fragile are they? Attacking them presents two unique headaches compared to fooling an image classifier:
- Budget & Stealth: Modifying every graph in a million-item database is noisy and expensive. An attacker must intelligently select a tiny subset of corpus graphs (a budget $B$) to perturb for maximum collateral damage.
- Brittle Ground Truth: Add a few pixels of noise to a photo of a dog, and it’s still a dog. Delete one edge from a molecule, however, and it might genuinely stop containing the query subgraph—flipping its ground-truth label! Checking whether a tweak accidentally changed the true label requires running an expensive exact subgraph solver, which even the attacker might want to avoid.
Methods
The authors propose GRAP (Graph Retrieval Adversarial Perturbation), which operates via query-only access to a substitute model (matching the victim's weights in gray-box settings, or trained independently in black-box/transfer settings). To stay stealthy, GRAP restricts itself to the minimal possible edit: flipping (adding or deleting) at most one edge per selected corpus graph.
GRAP formalizes two distinct attack regimes depending on the attacker's computational budget:
- Pairwise Ranking Attacks (With Solver): Aimed at corrupting the global ranking order while strictly preserving true relevance labels. GRAP-LCP optimizes edge flips only among node pairs that keep the ground-truth label intact. GRAP-LPF finds the most destructive edge flip first, then uses the solver to filter out any graph whose true label accidentally mutated.
- Top-$K$ Attack (Solver-Free): When running an exact solver is too costly, GRAP-TOPK ignores labels and directly pushes the victim's top-$K$ retrieved graphs away from the query so irrelevant graphs bubble up to take their place.
In both regimes, the authors turn a tangled joint-optimization problem (which graphs to pick + which edges to flip) into clean set-function optimizations maximized via a fast greedy algorithm with provable $(1 - e^{-\alpha})$ approximation guarantees.
Datasets
The authors evaluate GRAP on five standard molecular and chemical benchmark datasets from the TU Datasets repository: PTC-MM, PTC-MR, PTC-FM, PTC-FR, and AIDS (detailed in the appendix). No new datasets are introduced; query sets are split 60%/15%/25% for training, validation, and testing.
Key Insights and Ideas
- Miraculous Decoupling: You might expect the best edge to flip in Graph A to depend on whether Graph B is also being perturbed. The authors prove that the optimal single-edge perturbation for any individual graph is completely independent of the rest of the selected subset! This allows the attacker to precompute the best edge flip per graph once, vastly simplifying subset selection.
- Taming Non-Submodularity with a Variational Trick: Greedy algorithms rely on diminishing returns (submodularity) to guarantee good performance. While the ranking attacks are naturally approximately submodular, the solver-free
GRAP-TOPKobjective is not—perturbing a graph outside the top-$K$ yields zero immediate gain until enough top graphs are pushed down. By rewriting the sum of the smallest $K$ distances as a clever variational maximization and constructing a lower-bounding surrogate function, the authors restore strict monotonicity and approximate submodularity—and prove this surrogate matches the exact objective at full budget! - The LPF vs. LCP Crossover: Unconstrained per-graph optimization (
LPF) packs a bigger punch per graph at tiny budgets, but hits a ceiling once it exhausts the pool of graphs whose labels survive unconstrained attacks. Constrained optimization (LCP) steadily overtakes it at larger budgets.
Key Results
Tested against state-of-the-art retrievers like IsoNet++ and Graph Matching Networks (GMN), GRAP consistently crushes adapted graph-attack baselines (like Nettack, RL-S2V, and GMA), measured by drops in Mean Average Precision (MAP):
- Gray-Box Devastation: With solver access, perturbing just 10% of the corpus with a single edge flip per graph causes IsoNet++ MAP to plummet from ~0.75 to ~0.50 (statistically beating the best baseline, Nettack, with $p < 10^{-6}$).
- Black-Box & Solver-Free Potency: Even without a solver or victim weights,
GRAP-TOPKinflicts a ~20% MAP drop on the PTC-FR dataset while touching only 10% of the corpus, while causing the smallest shift in true relevance ratios (lowest detectability). - Architecture Transferability: Attacks crafted on substitute models with completely different architectures (e.g., GMN-match) still transfer effectively to degrade IsoNet++.
Limitations and Future Work
- Computational Cost of Exact Labels: While solver-free attacks work well, they are noticeably less potent than solver-assisted attacks, highlighting a clear trade-off between an adversary's compute budget and attack strength.
- Scaling & Defenses: Currently, the attacker evaluates perturbations across the corpus directly. The authors point toward integrating approximate nearest neighbor (ANN) indexing to make attacks faster and more scalable on massive databases, alongside the urgent open problem of designing adversarial defenses for neural graph retrievers.
Summary updated