Evaluating the Factuality of Large Language Models using Large-Scale Knowledge Graphs
Xiaoze Liu, Feijie Wu, Tianyang Xu, Zhuo Chen, Yichi Zhang, Xiaoqian Wang, Jing Gao
TL;DR
GraphEval presents a scalable, knowledge-graph–driven framework for evaluating the factuality of large language models by replacing full-text generation with a lightweight judge that operates on LLM hidden states. By leveraging a large KG (DBpedia) and declarative templates to generate millions of prompts, GraphEval achieves broad coverage across subjects and relations while reducing labeling and compute costs. The approach includes a theoretical generalization bound for the judge, an efficient prompt-encoder pipeline, and extensive experiments showing the judge's predictions align with actual factual correctness, with nuanced insights across LLaMA-2 and Gemma families and relation types. This work offers a practical, domain-agnostic benchmark for factuality that can inform future reliability improvements in LLM outputs and supports scalable, regular evaluation at web-scale KG breadth.
Abstract
The advent of Large Language Models (LLMs) has significantly transformed the AI landscape, enhancing machine learning and AI capabilities. Factuality issue is a critical concern for LLMs, as they may generate factually incorrect responses. In this paper, we propose GraphEval to evaluate an LLM's performance using a substantially large test dataset. Specifically, the test dataset is retrieved from a large knowledge graph with more than 10 million facts without expensive human efforts. Unlike conventional methods that evaluate LLMs based on generated responses, GraphEval streamlines the evaluation process by creating a judge model to estimate the correctness of the answers given by the LLM. Our experiments demonstrate that the judge model's factuality assessment aligns closely with the correctness of the LLM's generated outputs, while also substantially reducing evaluation costs. Besides, our findings offer valuable insights into LLM performance across different metrics and highlight the potential for future improvements in ensuring the factual integrity of LLM outputs. The code is publicly available at https://github.com/xz-liu/GraphEval.
