Abstract
Anomaly detection on text-rich graphs is widely prevalent in real life, such as detecting incorrectly assigned academic papers to authors and detecting bots in social networks. The remarkable capabilities of large language models (LLMs) pave a new revenue by utilizing rich-text information for effective anomaly detection. However, simply introducing rich texts into LLMs can obscure essential detection cues and introduce high fine-tuning costs. Moreover, LLMs often overlook the intrinsic structural bias of graphs which is vital for distinguishing normal from abnormal node patterns. To this end, this paper introduces GuARD, a text-rich and graph-informed language model that combines key structural features from graph-based methods with fine-grained semantic attributes extracted via small language models for effective anomaly detection on text-rich graphs. GuARD is optimized with the progressive multi-modal multi-turn instruction tuning framework in the task-guided instruction tuning regime tailed to incorporate both rich-text and structural modalities. Extensive experiments on four datasets reveal that GuARD outperforms graph-based and LLM-based anomaly detection methods, while offering up to 5× times speedup in training and 5× times speedup in inference over vanilla long-context LLMs on the large-scale WhoIsWho dataset.
Introduction
Anomaly detection in "text-rich graphs" (TRGs) is a high-stakes task essential for maintaining the integrity of digital ecosystems. Common applications include identifying incorrectly assigned papers in academic databases—where many authors share identical names—and spotting malicious bots within social networks.
Traditional solutions typically fall into two categories, each with significant drawbacks. Graph Neural Networks (GNNs) excel at understanding structural connectivity but struggle to process the nuanced, long-form text associated with nodes. Conversely, Large Language Models (LLMs) are masters of textual semantics but are computationally expensive and suffer from a "lost in the middle" problem when processing long contexts. Furthermore, LLMs do not inherently understand graph topology, missing the structural biases critical for distinguishing abnormal patterns.
The GuARD Framework
To bridge this gap, we introduce GuARD (Graph-informed and text-Rich Anomaly Detection). GuARD gives LLMs "graph vision" and "textual memory" without the prohibitive computational costs of standard long-context processing. The framework relies on three core innovations:
1. Modality Encoders (The Projectors)
GuARD uses specialized modules to compress complex data into tokens the LLM can digest:
- Semantic Module: A Small Language Model (SLM), such as RoBERTa, processes dense text (e.g., full paper abstracts) and compresses it into a single semantic token.
- Structural Module: A state-of-the-art GNN (e.g., GCCAD) extracts a node's position and role within the graph, compressing this topology into a single graph token.
2. Task-Guided Multi-Turn Instruction Tuning
Instead of querying the LLM about one node at a time, GuARD employs a multi-turn chat format. This allows the model to maintain a global context across multiple queries. This "soft" demonstration mechanism significantly boosts efficiency and accuracy by helping the model understand what "normal" looks like within a specific neighborhood.
3. Progressive Training Recipe
Training all modalities simultaneously often leads to "modality dominance," where the model ignores one source of data. GuARD uses a three-stage progressive approach: first tuning the base LLM, then the semantic projector, and finally the structural projector. This ensures the model learns to value both text and structure equally.
Experimental Results
GuARD was evaluated on four diverse datasets: WhoIsWho and MAG (academic networks), TwiBot-20 (bot detection), and SemEval-23F (propaganda detection).
Performance and Efficiency
GuARD consistently outperformed SOTA GNNs and fine-tuned LLMs (such as Llama-3-8B and Qwen-2.5-7B). On the WhoIsWho dataset, GuARD achieved an AUC of 0.789, surpassing both base LLMs and GNNs.
The most significant advantage is efficiency. By bypassing massive context windows through token compression, GuARD achieved a 5× speedup in training and up to a 10× speedup in inference compared to vanilla long-context LLMs. This efficiency allowed a variant of GuARD to secure the top rank on the WhoIsWho-IND test leaderboard for the KDD Cup 2024.
Conclusion and Future Work
GuARD demonstrates that integrating structural graph data with fine-grained text semantics via a progressive tuning framework is the most effective path for anomaly detection in TRGs. While highly effective, future work will explore reducing the dependency on pre-trained GNNs and investigating the scaling laws for multi-modal anomaly detection tasks. Currently, GuARD provides a scalable, high-performance solution for real-world graph monitoring.
Summary updated