ADKGD: Anomaly Detection in Knowledge Graphs with Dual-Channel Training

Jiayang Wu, Wensheng Gan, Jiahao Zhang, Philip S. Yu

TL;DR

This paper introduces ADKGD, a novel dual-channel training framework for detecting anomalies in knowledge graphs (KGs). By leveraging both entity-level and triplet-level representations, ADKGD significantly improves anomaly detection accuracy, addressing a critical need for reliable KGs in downstream applications like LLMs.

What Problem Does This Paper Address?

Large Language Models (LLMs) are powerful but prone to "hallucinations" due to knowledge gaps in their training data. Knowledge Graphs (KGs) can mitigate this by providing structured, real-world information. However, KGs themselves can contain errors (anomalies) introduced during their construction from unstructured data. These anomalies degrade KG quality and, consequently, the reliability of LLMs that use them. Detecting and correcting these anomalies is crucial for ensuring the accuracy and trustworthiness of KGs and the applications that rely on them. Existing anomaly detection methods in KGs often struggle with generalization or fail to capture the full complexity of KG data.

Methods

ADKGD employs a dual-channel training framework to enhance representation learning.

  • Channel I (Entity-View): Uses a Bidirectional Long Short-Term Memory (BI-LSTM) network to learn internal relationships within triplets. This channel maintains the original dimensionality of entity and relation embeddings.
  • Channel II (Triplet-View): Also uses a BI-LSTM (specifically BI-LSTM-D) but reduces the dimensionality of triplet embeddings, aiming for a more compact representation.

Both channels incorporate contextual information aggregation by considering neighbor triplets (head and tail neighbors). A key innovation is the use of a Kullback-Leibler (KL) divergence-based consistency loss to ensure that the representations learned from the entity-view and triplet-view are aligned and coherent. This consistency loss is applied to both the direct triplet scores and the aggregated neighbor scores. The final anomaly score is a combination of internal learning, neighbor aggregation, and the consistency loss.

Datasets

The authors evaluated ADKGD on several real-world KG datasets:

  • FB15K-237: A subset of Freebase with 14,541 entities and 237 relations.
  • WN18RR: A subset of WordNet with 40,943 entities and 11 relations.
  • NELL-995: A subset of the never-ending language learner with 200 relations, including variants like NELL-995-h25, -h50, -h75, and -h100.
  • Kinship: A dataset of family relations with 104 entities and 46 relations.
  • Yago: A large-scale KG derived from Wikipedia and WordNet with 123,182 entities and 37 relations.
  • KG20C: A large-scale scholarly KG representing academic research relationships with 16,362 entities and 5 relations.

These datasets were augmented with noisy triplets at ratios of 5%, 10%, and 15% to simulate real-world anomaly scenarios.

Key Insights and Ideas

  • Dual-channel learning is powerful: Combining entity-level and triplet-level views captures complementary information that single-view methods miss.
  • Consistency is key: The KL divergence loss between the two channels is crucial for aligning representations and achieving superior performance, highlighting the importance of a unified understanding.
  • Neighbor context matters: Aggregating information from neighboring triplets significantly enhances anomaly detection by providing a broader context.
  • KG anomalies degrade LLMs: The paper strongly motivates the need for anomaly detection by linking KG quality directly to LLM reliability.

Key Results

ADKGD consistently outperformed state-of-the-art KG anomaly detection methods, including CAGED, CKRL, KGTtm, and KGIst, across various datasets and anomaly ratios.

  • On the FB15K dataset at K=1% with a 5% anomaly ratio, ADKGD achieved a precision of 0.951, outperforming CAGED (0.927).
  • On WN18RR at K=5% with a 5% anomaly ratio, ADKGD achieved a precision of 0.560, surpassing CAGED (0.482) by 16.2%.
  • In experiments with increasing anomaly ratios (5% to 15%) on NELL-995, ADKGD's precision generally improved, demonstrating robustness to noise.
  • An ablation study showed that both internal learning and neighbor aggregation contribute significantly, but their combination, along with the dual-channel structure and KL divergence, yields the best results.
  • The optimal hyperparameter settings were found to be $\gamma=0.5$ for balancing views and $\alpha=0.9, \beta=0.3$ for weighting different loss components.

Limitations and Future Work

  • Textual Data: ADKGD currently relies solely on graph structure. Text-based methods sometimes show better recall at higher K values by leveraging external textual information. Future work will focus on integrating textual data with graph structures to enhance anomaly detection capabilities.
  • Scalability: While ADKGD performs well, improving its scalability for very large KGs is a potential direction.
  • Real-time Detection: Investigating real-time anomaly detection capabilities for dynamic data environments is another future avenue.
  • LLM Integration: Extending ADKGD to integrate with LLMs is proposed to enhance LLM response quality and capabilities.
  • Efficient Neighbor Search: Developing more efficient neighbor node search algorithms is suggested to improve computational efficiency.
  • Advanced Techniques: Exploring diffusion models or GANs for noise generation is mentioned as a way to improve anomaly detection and representation learning.

Summary updated

Abstract

In the current development of large language models (LLMs), it is important to ensure the accuracy and reliability of the underlying data sources. LLMs are critical for various applications, but they often suffer from hallucinations and inaccuracies due to knowledge gaps in the training data. Knowledge graphs (KGs), as a powerful structural tool, could serve as a vital external information source to mitigate the aforementioned issues. By providing a structured and comprehensive understanding of real-world data, KGs enhance the performance and reliability of LLMs. However, it is common that errors exist in KGs while extracting triplets from unstructured data to construct KGs. This could lead to degraded performance in downstream tasks such as question-answering and recommender systems. Therefore, anomaly detection in KGs is essential to identify and correct these errors. This paper presents an anomaly detection algorithm in knowledge graphs with dual-channel learning (ADKGD). ADKGD leverages a dual-channel learning approach to enhance representation learning from both the entity-view and triplet-view perspectives. Furthermore, using a cross-layer approach, our framework integrates internal information aggregation and context information aggregation. We introduce a kullback-leibler (KL)-loss component to improve the accuracy of the scoring function between the dual channels. To evaluate ADKGD's performance, we conduct empirical studies on three real-world KGs: WN18RR, FB15K, and NELL-995. Experimental results demonstrate that ADKGD outperforms the state-of-the-art anomaly detection algorithms. The source code and datasets are publicly available at https://github.com/csjywu1/ADKGD.
BibTeX
@article{wu2025adkgd,
  author = {Jiayang Wu and Wensheng Gan and Jiahao Zhang and Philip S. Yu},
  title = {{ADKGD: Anomaly Detection in Knowledge Graphs with Dual-Channel Training}},
  journal = {ACM Trans. Asian Low Resour. Lang. Inf. Process.},
  year = {2025},
  doi = {10.1145/3748321},
}
Figure