OntoFact: Unveiling Fantastic Fact-Skeleton of LLMs via Ontology-Driven Reinforcement Learning

Ziyu Shang, Wenjun Ke, Nana Xiu, Peng Wang, Jiajun Liu, Yanhui Li, Zhizhao Luo, Ke Ji

Abstract

Large Language Models (LLMs) are impressively fluent but frequently suffer from intrinsic hallucinations—generating plausible-sounding but factually incorrect responses. A core challenge in improving these models is identifying the "boundaries" of their knowledge. We present OntoFact, a novel framework that uses reinforcement learning to systematically map the "fact-skeleton" of LLMs—the underlying distribution of their actual knowledge versus hallucinations. By navigating knowledge graphs at the ontology level, OntoFact identifies systematic factual gaps with high efficiency. Our evaluation reveals that even state-of-the-art models like ChatGPT exhibit error rates exceeding 50% in many general knowledge domains.

Introduction

While LLMs demonstrate remarkable capabilities, their tendency to hallucinate remains a significant barrier to reliability. Existing evaluation methods generally fall into two categories: text-driven and Knowledge Graph (KG)-driven. Text-driven methods often suffer from redundancy, testing the same facts through different linguistic expressions. Conversely, traditional KG-driven methods typically focus on a narrow set of popular domains, such as movies or sports, neglecting specialized fields like biology or niche history.

Comparison of traditional text-driven evaluation versus the proposed KG-driven ontology approach.

Furthermore, LLMs exhibit a pervasive "Yes-bias," where they are more likely to confirm a statement as true regardless of their actual knowledge. OntoFact addresses these limitations by providing a scalable, cross-domain, and bias-aware framework for factual detection.

The OntoFact Framework

OntoFact operates through three main stages designed to efficiently probe an LLM's knowledge boundaries:

  1. Test Case Initialization: The system maps ontology-level triples (e.g., Person, birthPlace, City) to thousands of specific instances (e.g., LeBron James, birthPlace, Akron).
  2. Ontology-Driven Reinforcement Learning (ORL): An RL agent navigates the KG to find "error-prone" regions. It employs a dual-searching strategy: a continuous space search for macroscopic ontology categories the LLM struggles with, and a discrete space search to select specific instance-level triples that maximize hallucination discovery.
  3. Hallucination-Free Detection (HFD): To mitigate "Yes-bias," OntoFact uses a triplet of queries for every fact: a simple negative, a hard negative (using a related but incorrect entity), and the original positive triple. A model is only considered "factual" if it correctly identifies all three.

To ensure broad coverage, the framework utilizes five large-scale benchmarks, including DBpedia, YAGO, and BIOS 2.2 (biomedical knowledge), involving over 700,000 instance-level triples.

Results and the Fact-Skeleton

Our analysis demonstrates that factual errors in LLMs are not random but clustered. If a model lacks knowledge about one specific ontological structure (e.g., "Athlete winning an Award"), it likely lacks knowledge for that entire category. We refer to this underlying distribution as the "fact-skeleton."

Visualization of the fact-skeleton across multiple domains, illustrating the varying knowledge coverage of different LLMs.

Key Findings

  • High Error Rates: Even state-of-the-art models struggle. ChatGPT showed factual error rates of 51.6% on DBpedia and 64.7% on YAGO.
  • Efficiency via RL: The ORL mechanism achieved an average recall of 80% for identifying missing facts while reducing evaluation time by 35% to 63% compared to exhaustive testing. The agent effectively "jumps" between diverse domains to find new gaps.
  • Cross-Lingual Disparity: ChatGPT was found to be significantly more factual in Chinese benchmarks (9.1% error in BIOS-CHS) compared to English ones (36.3% error in BIOS-ENG), likely reflecting training data distributions.

Conclusion

OntoFact provides a systematic "map" of the holes in LLM knowledge. By moving beyond simple text-based testing to an ontology-driven reinforcement learning approach, we can more accurately characterize the reliability of these models. Future work will address the dependency on static Knowledge Graphs and explore more complex reasoning chains where facts are combined dynamically.

Summary updated

BibTeX
@inproceedings{shang2024ontofact,
  author = {Ziyu Shang and Wenjun Ke and Nana Xiu and Peng Wang and Jiajun Liu and Yanhui Li and Zhizhao Luo and Ke Ji},
  title = {{OntoFact: Unveiling Fantastic Fact-Skeleton of LLMs via Ontology-Driven Reinforcement Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i17.29859},
}
Figure