Aftina: enhancing stability and preventing hallucination in AI-based Islamic fatwa generation using LLMs and RAG
Open Access
- 2 June 2025
- journal article
- research article
- Published by Springer Nature in Neural Computing and Applications
- Vol. 37 (25) , 20957-20982
Abstract
Question–answering (QA) systems face considerable challenges when involved in Islamic fatwas due to the complexity and sensitivity of the data. Such problems involve providing accurate and reliable responses, managing hallucinations and inaccurate responses, and maintaining the stability of the generated responses. Prior studies have concentrated mainly on collecting and preprocessing Islamic datasets or developing retrieval-based QA systems, overlooking the precision and reliability required for fatwa issuance. To address this issue, we propose a QA approach utilizing advanced retrieval-augmented generation (RAG), which is enhanced by a re-ranker to increase response stability, eliminate hallucinations, and prioritize the most appropriate and exact answer. This enhancement significantly improves response stability and reduces hallucinations by improving the data used for answer generation. We conducted experiments across three setups: (1) base LLM, (2) LLM with RAG, and (3) LLM with RAG and re-ranker. The third method of LLM with RAG includes a re-ranker for knowledge retrieval, which improves the process and ensures relevant and trustworthy data. This differentiates it from the second method, which uses a retrieval model. The Flash re-ranker retrieves the most relevant data, which increases the response stability and trustworthiness. Evaluations using BERTScore, hallucination, completeness, and irrelevance metrics demonstrated that the third experiment LLM with RAG and re-ranker outperformed other setups, providing precise, stable, and dependable answers. This research contributes a robust methodology to improve AI-driven fatwa systems, guaranteeing higher precision and trustworthiness in Islamic QA systems.Keywords
Funding Information
- Nile University
This publication has 22 references indexed in Scilit:
- From text to multimodal: a survey of adversarial example generation in question answering systemsKnowledge and Information Systems, 2024
- ArabicaQA: A Comprehensive Dataset for Arabic Question Answering2024
- Islamic QA with Chatbot System Using Convolutional Neural NetworkIraqi Journal of Science, 2024
- A RAG-based Question Answering System Proposal for Understanding Islam: MufassirQAS LLMSSRN Electronic Journal, 2024
- Improving the Domain Adaptation of Retrieval Augmented Generation (RAG) Models for Open Domain Question AnsweringTransactions of the Association for Computational Linguistics, 2023
- Arabic question answering system: a surveyArtificial Intelligence Review, 2021
- AyaTECACM Transactions on Asian and Low-Resource Language Information Processing, 2020
- Answering Islamic Questions with a Chatbot using Fuzzy String-Matching AlgorithmJournal of Physics: Conference Series, 2020
- A Seq2seq-Based Approach to Question Answering over Knowledge Bases2020
- BLEU2001