Article contents
Hallucination Detection and Factuality Validation in Enterprise Retrieval-Augmented Generation Systems
Abstract
Retrieval-augmented generation (RAG) enhances the factual relevance of LLM-produced replies by including retrieved context information; nonetheless, hallucinations may develop when the generated material is incongruous with the retrieved content or when there is no relevant content in the retrieved context. This paper presents a machine learning-based approach that uses task metadata, generator information, and content-based attributes to identify hallucinations after they are generated. The RAGTruth-processed data, which include 15,090 training answers and 2,700 test responses from Hugging Face, serve as the foundation for the framework. The hallucination labels are based on the evident-conflict and baseless-information annotations. Logistic Regression, Random Forest, XGBoost, and LightGBM all use stratified group cross-validation and hold-out testing. The experimental findings show that XGBoost has an accuracy of 82.85%, an F1 score of 0.7582, and a ROC-AUC value of 0.8986. There are variations in recognising baseless information and conflict errors across categories. A SHAP analysis demonstrates that the novel-token ratio, generation temperature, and generator identity are all critical aspects in prediction. The approach also contains probability-based risk routing, which flags possibly unreliable replies for blocking or human review. The performance findings are impressive, but the dependence on generator and task features may limit generalisation to models and domains beyond the scope of the results. The suggested system provides an understandable method for recognising RAG hallucinations and is simple to test on a variety of datasets and deployment scenarios.
Article information
Journal
Frontiers in Computer Science and Artificial Intelligence
Volume (Issue)
5 (11)
Pages
37-48
Published
Copyright
Copyright (c) 2026 https://creativecommons.org/licenses/by/4.0/
Open access

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
How to Cite
References
Retrieval-Augmented Generation, Hallucination Detection, Machine Learning, Explainable AI, Risk-Based Routing
Aims & scope
Call for Papers
Article Processing Charges
Publications Ethics
Google Scholar Citations
Recruitment