Evolutionary Router Feature Generation for Zero-Shot Graph Anomaly Detection with Mixture-of-Experts

Haiyang Jiang, Tong Chen, Xinyi Gao, Guansong Pang, Quoc Viet Hung Nguyen, Hongzhi Yin

Abstract

Zero-shot graph anomaly detection (GAD) has attracted increasing attention in recent years, yet the heterogeneity of graph structures, features, and anomaly patterns across graphs make existing single GNN methods insufficiently expressive to model diverse anomaly mechanisms. In this regard, Mixture-of-experts (MoE) architectures provide a promising paradigm by integrating diverse GNN experts with complementary inductive biases, yet their effectiveness in zero-shot GAD is severely constrained by distribution shifts, leading to two key routing challenges. First, nodes often carry vastly different semantics across graphs, and straightforwardly performing routing based on their features is prone to generating biased or suboptimal expert assignments. Second, as anomalous graphs often exhibit pronounced distributional discrepancies, existing router designs fall short in capturing domain-invariant routing principles that generalize beyond the training graphs. To address these challenges, we propose a novel MoE framework with evolutionary router feature generation (EvoFG) for zero-shot GAD. To enhance MoE routing, we propose an evolutionary feature generation scheme that iteratively constructs and selects informative structural features via an LLM-based generator and Shapley-guided evaluation. Moreover, a memory-enhanced router with an invariant learning objective is designed to capture transferable routing patterns under distribution shifts. Extensive experiments on six benchmarks show that EvoFG consistently outperforms state-of-the-art baselines, achieving strong and stable zero-shot GAD performance.

Introduction

Graph Anomaly Detection (GAD) is critical for identifying abnormal nodes in networks, such as fraudsters in financial systems or malicious bots on social media. A significant real-world challenge is zero-shot GAD, where models must be deployed on completely unseen graphs without retraining.

Current zero-shot GAD models typically rely on a single Graph Neural Network (GNN) architecture. However, different graphs possess vastly different structural properties (e.g., homophily vs. heterophily), and a single GNN is often biased toward specific structures, limiting its generalization. While a Mixture-of-Experts (MoE) approach—integrating multiple GNNs with diverse inductive biases—seems ideal, it introduces a major routing bottleneck. Because node features (like text or user profiles) vary significantly across domains, routers often fail to generalize, leading to suboptimal expert assignments on unseen graphs. EvoFG addresses this by teaching the MoE router to make smart, domain-agnostic decisions using evolutionary feature generation.

Methodology: The EvoFG Framework

To build a robust, generalizable router, the EvoFG framework employs a four-stage evolutionary pipeline designed to bridge the gap between disparate graph domains.

The overall training pipeline of EvoFG, featuring iterative LLM-based feature generation and invariant router learning.

1. Diverse GNN Experts and Warmup

The model utilizes four distinct GNN architectures—GCN, GAT, ChebNet, and GPR—to cover a wide range of structural biases. It employs "soft routing," where the final output is a weighted average of expert predictions, ensuring the model can leverage complementary strengths.

2. LLM-Based Router Feature Generation

Rather than using raw, dataset-specific node attributes, EvoFG extracts 23 standardized structural primitives (e.g., PageRank, betweenness centrality). A Large Language Model (LLM), specifically Qwen2-7B, acts as an automated feature engineer. It iteratively combines these primitives using mathematical operators (log, square root, mean, etc.) to synthesize richer, domain-invariant routing features.

3. Efficient Shapley Selection

To ensure only the most informative features are retained, the system evaluates generated features using Shapley values. To overcome the computational cost of exact Shapley values, EvoFG introduces a fast approximation using subset sampling and a lightweight proxy task, allowing for efficient selection without retraining the entire MoE.

4. Memory-Enhanced & Invariant Router

The router includes memory banks to retain knowledge across feature-generation iterations. Crucially, it is trained using Invariant Risk Minimization (IRM). By randomly masking features to simulate different "environments," the router is forced to learn stable, causal routing rules rather than overfitting to spurious correlations in the training data.

Experimental Results

EvoFG was evaluated using a strict cross-dataset protocol. The model was trained on PubMed and Flickr, validated on Coauthor-CS and Amazon-Photo, and tested on six diverse datasets: Cora, CiteSeer, ACM, BlogCatalog, Facebook, and Weibo.

Zero-shot GAD performance comparison across six benchmark datasets showing EvoFG's superior ranking.

As shown in the results, EvoFG achieved the best average rank across all test datasets (1.67 for AUROC and 1.83 for AUPRC). It consistently outperformed state-of-the-art generalist models such as ARC, UNPrompt, and AnomalyGFM. Ablation studies further confirmed that every component—the LLM-guided generation, Shapley selection, memory bank, and invariant learning—contributes significantly to the model's performance and stability.

Conclusion

EvoFG demonstrates that the router is the primary bottleneck in zero-shot MoE for graphs. By shifting from raw node attributes to evolved structural features, the framework provides a "universal language" for expert assignment across diverse domains. The success of LLM-driven evolutionary feature engineering combined with invariant learning suggests a promising path for other cross-domain graph learning tasks, such as zero-shot link prediction or graph classification.

Summary updated

BibTeX
@misc{jiang2026evolutionary,
  author = {Haiyang Jiang and Tong Chen and Xinyi Gao and Guansong Pang and Quoc Viet Hung Nguyen and Hongzhi Yin},
  title = {{Evolutionary Router Feature Generation for Zero-Shot Graph Anomaly Detection with Mixture-of-Experts}},
  year = {2026},
  eprint = {2602.11622},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.11622},
}
Figure