TERGAD: Structure-Aware Text-Enhanced Representations for Graph Anomaly Detection

Wen Shi, Zhe Wang, Huafei Huang, Qing Qing, Ziqi Xu, Qixin Zhang, Xikun Zhang, Renqiang Luo, Feng XiaarXiv 2026

TL;DR

Graph Anomaly Detection (GAD) often struggles when a node's structural role contradicts its textual content. TERGAD solves this by translating complex graph topology into natural language descriptions, leveraging Large Language Models (LLMs) to generate high-level semantic embeddings, and adaptively fusing them with raw features via a gated dual-branch autoencoder. This approach sets a new state-of-the-art across multiple real-world benchmarks while remaining highly computationally efficient.

What Problem Does This Paper Address?

Graph Anomaly Detection (GAD) is crucial for spotting fraud, cyber intrusions, or social media spam. However, existing methods often fail when graphs are "text-poor" or when anomalies are subtle—such as a node whose text content seems perfectly normal, but its position in the network is highly suspicious (e.g., acting as a malicious bridge between distinct communities).

Traditional deep learning models rely on raw numerical matrices (like adjacency matrices) which struggle to capture the functional meaning of a node's position. Conversely, vanilla LLMs applied directly in a zero-shot manner fail to grasp structural anomalies on their own because they cannot inherently parse raw graph connectivity matrices efficiently.

Fig. 1: Performance comparison between DOMINANT, a traditional GCN-based method, and four representative LLMs. The significant performance gap motivates the need for the integrated semantic-structural approach in LLM-based GAD.

Methods

TERGAD (Structure-aware Text-enhanced Representations for Graph Anomaly Detection) introduces a multi-phase pipeline to bridge the gap between graph structure and natural language reasoning:

  1. Graph-to-Text Conversion: Instead of feeding raw matrices to an LLM, TERGAD extracts topological features (such as degree percentiles, clustering coefficients, centrality measures, and k-core layers) and plugs them into a structured template to generate a fluent narrative describing each node's structural role.
  2. LLM Semantic Embedding: A pre-trained text encoder (BGE-large-en-v1.5) processes these narratives to generate high-level semantic embeddings, which are then normalized using Z-score standardization.
  3. Dual-Branch Gated Autoencoder: The architecture uses two parallel Graph Convolutional Network (GCN) branches—one for raw node attributes and one for the LLM-derived structural embeddings. A learnable gating mechanism dynamically balances the importance of each branch for every single node.
  4. Reconstruction and Scoring: The model attempts to reconstruct both the graph structure (adjacency matrix) and the original node attributes. Nodes that exhibit high reconstruction errors are flagged as anomalies.
Fig. 2: The architecture of TERGAD.

Datasets

The authors evaluated TERGAD on six widely used real-world benchmark datasets:

  • Cora, Citeseer, DBLP, ACM, Pubmed: Academic citation and co-authorship networks where nodes represent papers/authors and edges represent citations/collaborations.
  • BlogCatalog (Blog): A social network dataset mapping follower-followee relationships among bloggers.

To evaluate anomaly detection performance, the authors injected synthetic anomalies using attribute perturbation (randomly flipping features) and structural perturbation (rewiring edges to create hub-periphery mismatches).

Key Insights and Ideas

  • LLMs need a translator, not raw data: Sequential text descriptions of raw adjacency lists quickly exceed context windows and obscure structural patterns. Translating abstract topology into role-based narratives unlocks the LLM's latent reasoning capabilities.
  • Gating is essential: A simple concatenation of features fails because different nodes require different balances of structural vs. attribute information. The learnable gate allows the model to adaptively prioritize LLM semantic priors or raw features based on local context.
  • Narratives beat technical dossiers: Ablation studies revealed that fluent, narrative-style prompts outperform rigid, markdown-style technical profiles. LLMs extract better features from text that mimics human-readable explanatory language.

Key Results

  • State-of-the-Art Performance: TERGAD consistently outperformed all nine baseline methods across all six datasets. Notably, it achieved an ROC-AUC of 98.03% on Pubmed and 97.72% on DBLP.
  • Robustness to Class Imbalance: In Precision-Recall Area Under the Curve (PR-AUC) metrics—which are highly sensitive to imbalanced anomaly data—TERGAD showed massive improvements, scoring 76.42% on Pubmed compared to the next best baseline at just 40.04%.
  • High Efficiency: Despite incorporating an LLM step, the in-processing training time remains incredibly fast. On the large ACM dataset, TERGAD completed training in 52.70 seconds, vastly outperforming heavy baselines like DOMINANT (2,361.97s) and GAAN (5,663.09s).

Limitations and Future Work

  • Static Prompting: The current framework relies on a fixed, human-designed prompt template for graph-to-text conversion. The authors note that exploring dynamic prompt optimization could yield even richer semantic embeddings.
  • Embedding Bottleneck: While the text generation phase takes less than a quarter of a second, computing the LLM embeddings remains the primary offline preprocessing time cost.
  • Scope Extensions: Future work will focus on extending TERGAD to support multi-hop semantic propagation, as well as adapting the framework to heterogeneous and temporal graph settings.

Summary updated

BibTeX
@misc{shi2026tergad,
  author = {Wen Shi and Zhe Wang and Huafei Huang and Qing Qing and Ziqi Xu and Qixin Zhang and Xikun Zhang and Renqiang Luo and Feng Xia},
  title = {{TERGAD: Structure-Aware Text-Enhanced Representations for Graph Anomaly Detection}},
  year = {2026},
  eprint = {2605.19738},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.19738},
}
Figure