Zing Forum

Reading

LLM Fact Auditor: Building a Fact-Checking Pipeline for LLM Answers

Introduces a fact-checking system for post-processing large language model (LLM) answers, which enhances the reliability of AI-generated content through a three-stage process: entity linking, answer extraction, and fact verification.

大语言模型事实核查实体链接幻觉问题知识图谱NLP流水线阿姆斯特丹自由大学
Published 2026-06-03 01:14Recent activity 2026-06-03 01:19Estimated read 7 min
LLM Fact Auditor: Building a Fact-Checking Pipeline for LLM Answers
1

Section 01

LLM Fact Auditor: A Fact-Checking Pipeline for LLM Answers

Core Introduction LLM Fact Auditor is a post-processing fact-checking system for large language model (LLM) answers, developed by students from the Web Data Processing Systems course at Vrije Universiteit Amsterdam. It addresses the critical 'hallucination' issue in LLMs (generating plausible but factually incorrect content) through a three-stage pipeline: entity linking, answer extraction, and fact verification.

Basic Info

This system aims to enhance the reliability of AI-generated content, making it suitable for high-accuracy scenarios like news writing and academic research.

2

Section 02

Background & Motivation: Solving LLM Hallucination

LLMs excel in natural language tasks but suffer from 'hallucination'—generating content that seems reasonable but contains factual errors or unverifiable info. This is fatal in fields requiring precision (e.g., news, academic research, medical advice).

To tackle this, the Amsterdam Free University student team created LLM Fact Auditor: a post-processing pipeline to verify LLM outputs and improve their credibility.

3

Section 03

3-Stage Pipeline: Entity Linking → Answer Extraction → Fact-Checking

The system uses a modular three-step process:

  1. Entity Linking: Identify named entities (people, places, organizations) in LLM answers and link them to Wikipedia entries (via spaCy/Stanza tools). This provides a factual foundation for verification.
  2. Answer Extraction: Distill long LLM responses into concise answers (e.g., 'yes/no' for binary questions, specific entities for entity queries) using Hugging Face Transformers models.
  3. Fact Verification: Cross-check the extracted answer against structured knowledge sources like Wikidata and linked Wikipedia pages. Results are marked as correct, incorrect, or unverifiable.
4

Section 04

Technical Stack & Modular Design

Key technologies used:

  • Python: Main development language.
  • Docker: Containerization for consistent environments.
  • Llama 2/3: Base LLMs for answer generation.
  • PyTorch: Deep learning framework for model inference.
  • Hugging Face Transformers: Pre-trained models for answer extraction.
  • spaCy: NER and text processing.

The modular design allows easy replacement of components (e.g., switching entity linking tools or adding new knowledge bases).

5

Section 05

How to Use & Output Format

Command Line Usage

  • Default (Llama 2): python3 main.py < ./test_data/input.txt > ./test_data/output.txt
  • Llama3 (higher quality/faster): python3 main.py --llama_ver=3 < ./test_data/input.txt > ./test_data/output.txt

Output Fields

  • R: Raw LLM response
  • A: Extracted concise answer
  • C: Correctness result (correct/incorrect/unverifiable)
  • E: Linked entities with Wikipedia URLs

Example For the question 'Is Managua the capital of Nicaragua?', output includes:

  • R: Original Llama answer
  • A: 'yes'
  • C: 'correct'
  • E: Links to Managua and Nicaragua Wikipedia pages.
6

Section 06

Project Significance & Real-World Applications

LLM Fact Auditor offers a practical way to improve LLM reliability by using external knowledge verification (complementary to model internal improvements).

Applications:

  • News/content review: Verify AI-generated news facts.
  • Education: Help students spot errors in learning materials.
  • Enterprise KM: Check accuracy of internal docs/reports.
  • Search engines: Add credibility scores to results.
7

Section 07

Future Directions & Final Summary

Future Plans

  1. Add relation extraction to verify entity relationships.
  2. Support more knowledge bases beyond Wikidata.
  3. Develop a web interface for easier use.
  4. Improve handling of nuanced/complex claims.

Summary LLM Fact Auditor is a pragmatic solution to LLM hallucination. It provides a reusable, extensible framework for fact-checking, which will become increasingly important as LLMs are used in critical fields. It complements model improvements to build more reliable AI systems.