Test-Time Graph Anomaly Detection via Shifted Augmentation with Dynamic Objective Scheduling

Chunjing Xiao, Ruobing Fan, Tian Zhao, Fan Zhou, Ying Ma, Chong TangNeurIPS 2026

TL;DR

Supervised graph anomaly detectors are great at catching fraudsters and bots—until the real world evolves and the data distribution shifts. Updating these models on the fly using unlabeled test data presents a classic Catch-22: high-confidence test samples have trustworthy labels but ignore the new shifts, while low-confidence samples capture the shifts beautifully but are too noisy to learn from directly. SADOS solves this by distilling "shift prototypes" from the noisy samples and injecting them into the trustworthy ones, safely steering the model into uncharted territory.

What Problem Does This Paper Address?

Graph Anomaly Detection (GAD) powers critical defenses in financial networks, e-commerce, and social platforms. Supervised GAD models work well when tomorrow looks like yesterday, but in reality, normal user behaviors drift and fraudsters invent new camouflage.

Test-Time Adaptation (TTA) tries to fix this by updating a pre-trained model at deployment time using incoming, unlabeled test data. However, applying TTA to graph anomalies hits a twofold dilemma:

  1. Coverage bias of reliable samples: If you only fine-tune on test nodes the model is super confident about (using their predicted "pseudo-labels"), you only adapt to regions that already look like your training data. The heavily shifted regions go ignored.
  2. Objective misalignment of unreliable samples: Low-confidence nodes live right where the distribution has shifted the most! Because their pseudo-labels are too noisy for standard supervised training, researchers usually apply label-free objectives (like contrastive learning or entropy minimization) to them. Unfortunately, learning general representation consistency isn't the same as sharpening an anomaly-detection boundary—and can even bias the model toward the majority (normal) class.

Methods

Instead of treating reliable and unreliable test nodes in isolation, SADOS (Shifted Augmentation-based Dynamic Objective Scheduling) makes them collaborate through three novel mechanisms:

Figure 1: The Overview of the SADOS framework.
  • Confidence-Adaptive Node Partitioning: Standard confidence thresholds ignore graph structure. SADOS calibrates each node's predicted confidence using the mutual information between the node and its neighbors (approximated via InfoNCE). Using these calibrated scores, it splits test nodes into a reliable set and stratifies the remaining unreliable set into $K$ distinct confidence tiers.
  • Confidence-Aware Shifted Augmentation: To safely explore shifted regions, SADOS extracts clean, denoised "prototypes" (summary embeddings) from the pseudo-normal nodes in each unreliable tier, maintained via an exponential moving average. It then uses cross-attention to inject these shift-carrying prototypes into reliable normal nodes. Higher-confidence prototypes get a larger reliability bias in the attention calculation, nudging reliable samples into drifted target regions without accidentally flipping their true labels.
  • Dynamic Objective Scheduling: SADOS trains on two losses simultaneously: a standard contrastive loss on unreliable nodes (contrasting noisy feature views against edge-dropped structural views) and a supervised cross-entropy loss on the reliable + augmented nodes. Crucially, it uses a linear ramp-up schedule—emphasizing contrastive exploration early on to absorb the distribution shift, then gradually annealing it to zero so pure anomaly classification dominates by convergence.

Datasets

The authors do not introduce new datasets, instead evaluating SADOS on eight established, real-world GAD benchmarks spanning e-commerce, social networks, crowdsourcing, and finance: Amazon, YelpChi, Reddit, Weibo, Tolokers, Questions, T-Finance, and T-Social. All are node-attributed graphs with binary labels and severe class imbalance. To simulate real-world deployment shifts, the graphs are partitioned into source and target domains using two protocols: cluster-based splits (semantic shifts) and density-based splits (structural shifts).

Key Insights and Ideas

  • Unreliable data is a compass, not garbage: Rather than throwing away low-confidence predictions or forcing noisy labels onto them, SADOS treats them as carriers of domain-shift vectors. Summarizing them into group prototypes averages out instance-level noise while preserving the macro-level direction of the drift.
  • Generic perturbations aren't enough: In ablation studies, replacing SADOS's shifted augmentations with standard graph augmentations (like random feature or edge dropout) caused the steepest drop in performance. To adapt a decision boundary under shift, augmentations need to be directional—actively pointing toward the target distribution.
  • Timing your losses matters: Contrastive learning and anomaly classification pull representations in slightly different directions. Giving contrastive learning the steering wheel early—and taking it away later—captures drift without blurring the final decision boundary. Even starting with too much supervised weight ($c_0 = 0.7$ vs. $0.5$) noticeably slows down early adaptation.

Key Results

Using GHRN as a shared backbone across graph TTA baselines, SADOS achieves the highest AUROC across all 8 datasets and both shift protocols (16 out of 16 scenarios), outperforming both standalone supervised GAD models (e.g., ConsisGAD, PMP) and recent TTA methods (e.g., GTrans, GADT3, TUNE).

Notable AUROC highlights include:

  • Cluster-based split: Reaches 91.45% on Amazon (vs. 89.23% for runner-up TUNE), 97.12% on Weibo, and 84.56% on T-Social (up from TUNE's 81.88%).
  • Density-based split: Achieves 88.15% on T-Finance (a +3.73% jump over GADT3's 84.42% and +4.03% over TUNE) and 65.82% on Reddit (vs. 63.15% for TUNE).

Limitations and Future Work

The authors candidly note three main constraints:

  1. Transductive assumption: SADOS requires access to the entire target test graph at once to compute neighborhood mutual information and global prototypes, limiting its use in strictly streaming, node-by-node online setups.
  2. Source model reliance: Adaptation assumes the pre-trained detector still produces a somewhat meaningful confidence ranking. If the shift is so catastrophic that initial predictions are random—or systematically overconfident on wrong answers—calibration and prototype extraction can break down.
  3. Graph quality and bias: Extremely sparse or noisy topologies can weaken the neighborhood-based confidence calibration, and systematic errors among unreliable pseudo-normal nodes could skew the prototypes.

Future work aims to tackle continuously evolving online graph streams, as well as extending the framework to multi-class, edge-level, and graph-level anomaly detection.

Summary updated

Abstract

Graph anomaly detection (GAD) is critical to many real-world systems. However, supervised GAD models often degrade under distribution shifts due to the closed-world training assumption. Test-time adaptation (TTA) offers a promising solution by updating pre-trained models with unlabeled test data. Yet, applying TTA to GAD poses a unique dilemma. High-confidence samples provide reliable pseudo-labels, but they are scarce and biased toward low-shift regions. Low-confidence samples better reflect target shifts, but they are too noisy for direct cross-entropy optimization and often require label-free objectives that are misaligned with anomaly discrimination. To address this dilemma, we propose SADOS, a Shifted Augmentation-based Dynamic Objective Scheduling framework for test-time GAD. SADOS turns unreliable target samples into drift-carrying signals for reliable supervised adaptation. It distills prototypes from confidence-stratified unreliable samples and injects them into reliable samples to generate label-preserving yet shift-oriented augmentations. This expands coverage over shifted target regions. In parallel, SADOS dynamically schedules the adaptation objective. It uses contrastive learning to capture early-stage drift signals, and gradually anneals its weight so that classification-oriented anomaly detection dominates later adaptation. Extensive experiments demonstrate that SADOS robustly improves test-time GAD under distribution shifts.
BibTeX
@inproceedings{xiao2026test,
  author = {Chunjing Xiao and Ruobing Fan and Tian Zhao and Fan Zhou and Ying Ma and Chong Tang},
  title = {{Test-Time Graph Anomaly Detection via Shifted Augmentation with Dynamic Objective Scheduling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Lelz20rA0P},
}
Figure