Detecting hallucinations in language models is a crucial step in ensuring reliable outputs, thereby increasing model trustworthiness in real-world implementations. To this end, we propose a novel approach towards hallucination detection in large language models (LLMs) that leverages the vast data capacity and semantic relationship modelling capabilities of knowledge graphs (KGs). By constructing a KG from an LLM-generated answer, we use this KG as a certificate for verifying the model output efficiently against an external KG. Our methodology integrates breadth-first search (BFS) and a natural language inference (NLI) model to enable real-time, schema-agnostic evaluation of LLMs which is applicable to both open- and closed-source domains. Furthermore, our approach is the first to evaluate answers requiring reasoning over complex graph structures, rather than relying solely on straightforward path-based inference.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

A Knowledge Graph Approach Towards Detecting Large Language Model Hallucination

  • Thomas S. Winter,
  • Jan H. van Vuuren

摘要

Detecting hallucinations in language models is a crucial step in ensuring reliable outputs, thereby increasing model trustworthiness in real-world implementations. To this end, we propose a novel approach towards hallucination detection in large language models (LLMs) that leverages the vast data capacity and semantic relationship modelling capabilities of knowledge graphs (KGs). By constructing a KG from an LLM-generated answer, we use this KG as a certificate for verifying the model output efficiently against an external KG. Our methodology integrates breadth-first search (BFS) and a natural language inference (NLI) model to enable real-time, schema-agnostic evaluation of LLMs which is applicable to both open- and closed-source domains. Furthermore, our approach is the first to evaluate answers requiring reasoning over complex graph structures, rather than relying solely on straightforward path-based inference.