1. Abstract
LLM Hallucination Detection is a Generative AI-based system designed to identify incorrect, unsupported, or fabricated information generated by Large Language Models (LLMs). The system analyzes AI-generated responses, compares claims against trusted documents or reference sources, and assigns confidence or verification scores. It helps improve the reliability, factual consistency, and trustworthiness of AI-generated content.
2. Objectives
- Detect factual errors in LLM-generated responses.
- Verify generated claims against trusted reference documents.
- Identify unsupported statements and misleading information.
- Generate confidence scores for individual claims.
- Provide evidence-based verification results.
- Improve the reliability of Generative AI applications.
3. Existing System
Traditional AI applications may display LLM-generated answers without systematically checking whether the information is factually supported.
Disadvantages
- Incorrect information may be presented confidently.
- Unsupported claims can be difficult to identify.
- Manual fact-checking takes time.
- Source verification may be inconsistent.
- Users may over-rely on AI-generated responses.
4. Proposed System
The proposed system combines LLMs, NLP, and evidence retrieval to evaluate generated answers against trusted information sources.
Key features:
- Input interface for AI-generated responses.
- Automatic claim extraction and decomposition.
- Evidence retrieval from trusted documents.
- Claim-level factual consistency analysis.
- Classification as supported, contradicted, or unverifiable.
- Confidence and evidence scores.
- Highlighting of potentially hallucinated statements.
- Source references for verification.
- Dashboard displaying verification results.
5. Implementation Procedure
- Collect reference documents and sample AI-generated responses.
- Build a user interface for submitting text or answers.
- Split responses into individual factual claims.
- Retrieve supporting evidence from trusted documents using semantic search.
- Generate embeddings and store reference passages in FAISS or ChromaDB.
- Compare each claim with the retrieved evidence using an NLI model or LLM-based verifier.
- Classify claims as supported, contradicted, or insufficiently supported.
- Calculate verification scores using evidence relevance and model outputs.
- Display flagged claims, supporting evidence, and source references.
- Evaluate the system using labeled test datasets and deploy the application.
6. Software Requirements
- Programming Language: Python
- Frontend: Streamlit or React.js
- Backend: Flask or FastAPI
- LLM: OpenAI API or a compatible model
- NLP Libraries: Transformers and spaCy
- Verification Model: Natural Language Inference (NLI) model
- Embedding Model: Sentence Transformers
- Vector Database: FAISS or ChromaDB
- Database: SQLite or PostgreSQL
- Development Environment: VS Code
- Operating System: Windows or Linux
7. Hardware Requirements
- Processor: Intel Core i3 or equivalent
- RAM: Minimum 8 GB; 16 GB recommended
- Storage: At least 10 GB free space
- Internet: Required for hosted AI APIs
- GPU: Optional for locally running larger verification models
8. Advantages of the Project
- Identifies potentially fabricated information.
- Improves trust in AI-generated responses.
- Supports claim-level fact verification.
- Provides evidence to help users review flagged claims.
- Reduces manual fact-checking effort.
- Can be integrated into chatbots and RAG applications.
- Supports more transparent and accountable AI workflows.