Recent advancements in large language models (LLMs) have facilitated specialized applications in fields such as religious studies. Customized AI models, developed using tools like GPT Builder to source information from authoritative collections such as Sahih al-Bukhari or the Qur’an, were explored as potential solutions to address inquiries related to Islamic teachings. However, initial evaluations highlighted significant limitations, including hallucinations and reference inaccuracies, which undermined their reliability for handling sensitive religious content. To address these limitations, this study proposes EMAN (Embedding Methodology for Authentic Narrations), a novel framework designed to enhance adherence to Sahih al-Bukhari through API-based integration. Three methodologies are examined within this framework: Zero-Shot Instructions, which guide the model without prior examples; Few-Shot Learning, which fine-tunes the model using a limited set of examples; and Embedding-Based Integration, which grounds the model directly in a verified Ahadith database. Results demonstrate that Embedding-Based Integration significantly improves performance by anchoring outputs in a structured knowledge base, reducing hallucination rates, and increasing accuracy. The success of this approach underscores its potential for enhancing LLM performance in precision-critical domains. This research provides a foundation for the ethical and accurate deployment of AI in religious studies, emphasizing accountability and fidelity to source material.

Generative AI for Islamic Texts: The EMAN Framework for Mitigating GPT Hallucinations

Gagliardelli L.;
2025-01-01

Abstract

Recent advancements in large language models (LLMs) have facilitated specialized applications in fields such as religious studies. Customized AI models, developed using tools like GPT Builder to source information from authoritative collections such as Sahih al-Bukhari or the Qur’an, were explored as potential solutions to address inquiries related to Islamic teachings. However, initial evaluations highlighted significant limitations, including hallucinations and reference inaccuracies, which undermined their reliability for handling sensitive religious content. To address these limitations, this study proposes EMAN (Embedding Methodology for Authentic Narrations), a novel framework designed to enhance adherence to Sahih al-Bukhari through API-based integration. Three methodologies are examined within this framework: Zero-Shot Instructions, which guide the model without prior examples; Few-Shot Learning, which fine-tunes the model using a limited set of examples; and Embedding-Based Integration, which grounds the model directly in a verified Ahadith database. Results demonstrate that Embedding-Based Integration significantly improves performance by anchoring outputs in a structured knowledge base, reducing hallucination rates, and increasing accuracy. The success of this approach underscores its potential for enhancing LLM performance in precision-critical domains. This research provides a foundation for the ethical and accurate deployment of AI in religious studies, emphasizing accountability and fidelity to source material.
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11389/69846
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? ND
social impact