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

DiffGAD: A Diffusion-based Unsupervised Graph Anomaly Detector

Jinghan Li, Yuan Gao, Jinda Lu, Junfeng Fang, Congcong Wen, Hui Lin, Xiang Wang

Graph Anomaly Detection (GAD) is essential for identifying abnormal entities—such as fraudsters, spam accounts, or malicious bots—within large, complex networks. Because labeling this kind of data is prohibitively expensive, researchers typically rely on unsupervised methods.

DiffGAD introduces a novel approach to unsupervised GAD by leveraging diffusion models within the latent space. By isolating "discriminative" features from common background noise and preserving multi-scale content during the diffusion process, DiffGAD significantly improves the ability to spot camouflaged anomalies. It achieves state-of-the-art results across multiple benchmarks while remaining computationally efficient.

The Problem with Standard Autoencoders

The standard approach to unsupervised GAD uses Graph Autoencoders (GAEs) to compress the graph into a latent space and then reconstruct it. Nodes that are poorly reconstructed (exhibiting a high reconstruction error) are flagged as anomalies.

However, there is a major flaw in this approach: anomalies are sneaky. Fraudsters often camouflage themselves by mimicking the behavior of normal users, such as maintaining a similar account age, posting frequency, or network structure. Because standard autoencoders are optimized to reconstruct the massive amount of "common" overlapping features, they tend to squash normal and abnormal nodes together in the latent space.

Latent space distributions showing how DiffGAD separates overlapping normal and abnormal nodes.

The subtle, discriminative features that actually define an anomaly get lost in the noise. Consequently, the reconstruction error becomes a weak and unreliable signal for detection.

The DiffGAD Methodology

To force anomalies to stand out, the authors propose DiffGAD, which replaces the standard autoencoder bottleneck with a dual Diffusion Model (DM) setup operating in the latent space.

The DiffGAD architecture featuring dual diffusion models for discriminative content distillation.

The framework operates through three primary steps:

  1. Latent Space Projection: A standard Graph Autoencoder first maps the graph's nodes and edges into a compressed latent embedding.
  2. Discriminative Content Distillation: The authors train two diffusion models.
  3. An unconditional DM learns the overall distribution of the data (the "general content").
  4. A conditional DM is guided by a dynamically updated feature representing the average, shared traits of the graph (the "common content").
  5. Inspired by classifier-free guidance (a technique popular in AI image generation), DiffGAD mathematically subtracts the "common content" from the "general content." What remains is pure discriminative content—the exact signals needed to tell anomalies apart from normal nodes.
  6. General Content Preservation: Standard diffusion models generate data from pure random noise. Because DiffGAD needs to calculate a reconstruction error for specific nodes, it instead adds a specific amount of noise ($t$ steps) to the original node embedding and then denoises it. This preserves the original structure at different scales and provides a reliable baseline for scoring anomalies.

Key Insights

  • Camouflage is the enemy of reconstruction: Standard AEs fail at anomaly detection because the sheer volume of "normal" shared traits overwhelms subtle anomalous traits during reconstruction.
  • Subtraction reveals the truth: By explicitly modeling what makes nodes similar and subtracting it from the overall distribution, the model forces anomalies to the boundaries of the latent space, making them highly visible.
  • Diffusion isn't just for generation: The authors cleverly adapt DMs into a robust scoring mechanism. By starting the reverse diffusion process from a partially noisy state rather than pure noise, they turn a generative model into a highly sensitive reconstruction-error engine.
  • Heterophily dictates guidance strength: The strength of the subtraction (controlled by a parameter $\lambda$) should be tuned based on the graph's heterophily. If anomalies are deeply hidden among normal nodes, a stronger subtraction ($\lambda > 1$) is required to expose them.

Datasets and Results

The authors evaluated DiffGAD on six real-world datasets using the standard BOND (Benchmarking Unsupervised Outlier Node Detection) framework, including social networks (Weibo, Reddit), co-purchase networks (Disney, Books), email networks (Enron), and a large-scale financial dataset (Dgraph).

  • State-of-the-Art Accuracy: DiffGAD achieved top-2 ROC-AUC scores across all 6 datasets, outperforming 13 different baselines (including graph-agnostic, classical, and deep learning methods).
  • Massive Margins: It beat the second-best method's average AUC by over 9%. On specific datasets, the gains were even more pronounced, achieving a >20.7% AUC improvement on the Enron dataset compared to the GAAN baseline.
  • High Efficiency: Despite using diffusion models, DiffGAD is fast. Because the diffusion process happens in the compressed latent space, sampling takes only 0.17 seconds on a standard GPU. The overall time complexity is dominated by the initial Autoencoder, making the diffusion step practically "free" and highly scalable to graphs with millions of nodes.

Limitations and Future Work

DiffGAD's performance is inherently bottlenecked by the initial Graph Autoencoder. If the GAE fails to create an expressive latent embedding in the first step, the downstream diffusion models have poor material to work with. To address this, future work will explore "encoder-free" strategies that might allow the diffusion model to operate more directly on the graph structure, bypassing the limitations of standard GAEs entirely.

Summary updated

BibTeX
@inproceedings{li2025diffgad,
  author = {Jinghan Li and Yuan Gao and Jinda Lu and Junfeng Fang and Congcong Wen and Hui Lin and Xiang Wang},
  title = {{DiffGAD: A Diffusion-based Unsupervised Graph Anomaly Detector}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=AhcYq4CnfF},
}
Figure