NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

When Graph Anomalies Learn to Hide: Test-Time Cloaking in Graph-Level Anomaly Detection

Jinyu Cai, Glynnis Lim, See-Kiong NgNeurIPS 2026

TL;DR

Graph anomaly detectors look remarkably accurate when tested on static, polite datasets—until an anomalous graph decides to fight back. By strategically flipping just a handful of edges after a model is deployed, an anomaly can "cloak" itself to look completely ordinary without changing what it fundamentally is. This paper exposes how brittle modern graph detectors are to this kind of adaptive evasion and introduces a clever way to smooth out their blind spots using only normal training data.

What Problem Does This Paper Address?

Imagine screening molecular structures or biological networks for anomalies. In Graph-Level Anomaly Detection (GLAD), we rarely have a neat catalog of every possible bad thing that could happen. Instead, we use unsupervised learning: we show a neural network thousands of normal graphs, and it learns to output a single scalar "weirdness" score for any new graph it sees.

Standard benchmarks evaluate these detectors on static, clean test sets. That leaves a massive blind spot: what happens when anomalous inputs adapt?

If an adversary slightly tweaks an anomalous molecule’s structure before screening, can it slip past the detector? Standard adversarial attacks on graphs usually rely on class labels or cross-entropy losses—luxuries that don't exist in unsupervised anomaly detection. Furthermore, we need to know if a detector fails simply because it is sensitive to random noise, or because its scoring logic has exploitable "downhill" directions. The authors formalize this challenge as test-time graph cloaking.

Figure 1: Motivation for test-time graph cloaking. (a) Clean anomaly scores may be separated from normal scores, but this separation need not be stable under score-directed structural edits. (b–d) Under the same 10% edge-flip budget, random-structure (RS) can preserve or even improve AUC relative to clean evaluation, whereas SGC causes substantial performance degradation.

Methods

Because unsupervised GLAD models use wildly different internal machinery (contrastive learning, knowledge distillation, reconstruction, etc.), the authors build tools that rely solely on the universal interface they all share: the final scalar anomaly score.

  • The Attack — Score-Directed Graph Cloaking (SGC): SGC is a white-box, test-time attack given a strict edge-edit budget (e.g., flipping at most 10% of existing edges). Because searching discrete edge combinations is intractable, SGC relaxes the graph into continuous edge-flip intensities bounded by a "capped simplex" (ensuring the relaxed budget matches the true discrete budget). It uses normalized projected gradient descent to minimize the anomaly score, then greedily rounds the top candidates back into valid binary edge additions or deletions.
  • The Control — Directedness Gap (DG): To prove SGC isn't just exploiting generic noise sensitivity, the authors pair it with a budget-matched Random-Structure (RS) baseline that flips edges blindly. The performance difference between random edits and SGC is the directedness gap.
  • The Defense — Adversarial Score Training (AST): How do you defend against cloaking anomalies when your training set only contains normal graphs? AST flips the game: during training, an inner adversary perturbs normal graphs to maximize their anomaly scores. A relative score-smoothing penalty then trains the detector to flatten those upward spikes, indirectly smoothing the score landscape across the learned representation space.

Datasets

The authors evaluate their framework on five standard graph datasets from TUDataset, following the UB-GOLD unsupervised anomaly detection benchmark protocol: AIDS, PROTEINS, COX2, ENZYMES, and BZR. No new datasets are introduced, though the evaluation protocol is extended to measure test-time structural evasion.

Key Insights and Ideas

  • Clean accuracy is an illusion of safety: Two detectors can achieve identical, near-perfect clean AUCs (~0.97 on AIDS) while having vastly different vulnerabilities under a 10% edge-edit budget. Clean separability tells you an anomaly is detectable as-is, not whether that decision is stable.
  • Random noise actually helps detectors: Surprisingly, random edge flips often increase detection AUC—uninformed structural noise makes weird graphs look even weirder. SGC does the exact opposite, cleanly relocating the entire distribution of anomaly scores below the detection threshold rather than just smearing the variance.
Figure 2: Score distributions under clean, random-structure perturbation, and SGC evaluations. The x-axis reports detec- tor scores relative to the validation-normal 95th percentile threshold, i.e., s(G) −τ, which is denoted by the dashed ver- tical line at zero. The y-axis shows kernel density estimates, normalized so that each distribution integrates to one. Lower values indicate scores closer to the normal-score region.
  • Architecture dictates vulnerability: Knowledge distillation models (like GLocalKD) naturally exhibit flat, resilient score surfaces, whereas contrastive and reconstruction models (like MUSE and GLADPro) have steep, easily exploited local gradients—sometimes collapsing with just ~1.6 edge edits per graph.
  • True cloaking survives domain rules: When restricted to chemically plausible edits on AIDS (preserving connected components and atomic valence), SGC still fools the target detector while an independent classifier and other detectors confirm the edited molecules remain genuinely anomalous.

Key Results

Evaluated across 5 datasets and 5 GLAD baselines (25 pairs total) at a 10% edge-flip budget ($\rho = 0.10$, averaging just 3.61 edge edits on AIDS):

  • Severe Undefended Drops: On AIDS, GLADC drops from 0.970 clean AUC to 0.886 under SGC (44.8% Attack Success Rate, or ASR), and MUSE drops from 0.951 to 0.793 (83.5% ASR). Meanwhile, GLocalKD barely flinches (0.972 to 0.957 AUC, 10.4% ASR). On harder datasets like ENZYMES, GLADC's ASR hits 100%.
  • Universal Defense Gains: AST improves SGC AUC and reduces SGC ASR across all 25 dataset–model pairs.
  • Notable Recoveries: On AIDS, AST slashes OCGIN's attack success rate from 29.4% down to 0.3% (pushing robust AUC to 0.997). On PROTEINS, OCGIN’s robust AUC jumps from 0.441 to 0.676. On BZR, GLADC's robust AUC climbs from 0.136 to 0.417.

Limitations and Future Work

AST is an empirical mitigation, not a mathematical certificate of robustness. Because a normal-only defender never sees anomalies during training, smoothing around normal graphs only partially transfers to anomalous regions—several difficult dataset–model pairs still suffer high evasion rates even after defense. Additionally, the study focuses purely on structural (edge) edits rather than node-feature perturbations, and true biochemical equivalence of cloaked molecules requires wet-lab or deeper domain validation. Extending defenses to broader domain constraints and stronger adaptive attacks remains wide open.

Summary updated

BibTeX
@inproceedings{cai2026when,
  author = {Jinyu Cai and Glynnis Lim and See-Kiong Ng},
  title = {{When Graph Anomalies Learn to Hide: Test-Time Cloaking in Graph-Level Anomaly Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=0IiGVatU7k},
}
Figure