Halwasa: Quantify and Analyze Hallucinations in Large Language Models: A rabic as a Case Study (2024)

Abstract: Large Language Models (LLMs) have shown superb abilities to generate texts that are indistinguishable from human-generated texts in many cases. However, sometimes they generate false, incorrect, or misleading content, which is often described as “hallucinations”. Quantifying and analyzing hallucination in LLMs can increase their reliability and usage. While hallucination is being actively studied for English and other languages, and different benchmarking datsets have been created, this area is not studied at all for Arabic. In our paper, we create the first Arabic dataset that contains 10K of generated sentences by LLMs and annotate it for factuality and correctness. We provide detailed analysis of the dataset to analyze factual and linguistic errors. We found that 25% of the generated sentences are factually incorrect. We share the dataset with the research community.

## introduction the advent of large language models (llms) has unfolded a new chapter in the field of artificial intelligence (ai), particularly in natural language processing (nlp). these models have shown remarkable proficiency in text generation, translation, and other linguistically driven tasks across various languages. however, a concerning phenomenon known as "hallucination" shadows the reliability of these models, where they generate text that is factually incorrect, nonsensical, or misleading @xcite . this issue is not confined to english or other widely studied languages but extends to arabic, a semitic language with unique phonetic, morphological, syntactic, and semantic characteristics @xcite . earlier studies have dived into the hallucination issue in llms, shedding light on its manifestations such as the generation of incorrect information, nonsensical text, and conflation of sources @xcite . furthermore, hallucinations have been studied in the context of machine translation between specific language pairs, with rates exceeding 10% in some cases @xcite . however, a focused examination of hallucinations in the arabic language through llms remains largely uncharted. the need for more investigation into hallucinations in llms for arabic is underlined by the linguistic complexity and the significance of the language. addressing hallucinations in llms for the arabic language not only enhances the reliability and applicability of these models but also holds potential implications for a wide array of applications including information retrieval, sentiment analysis, and machine translation. therefore, the motivation behind our work is twofold: (1) to enable a rigorous evaluation of the factuality and reliability of llms when generating arabic text, and (2) to pave the path for developing techniques to mitigate hallucinations in arabic llms. this paper aims to bridge the existing knowledge gap by conducting a case study on hallucinations in llms for the arabic language. the two llms we experimented with are gpt 3.5 (aka chatgpt) and gpt-4. the research questions will aim to answer the following: i) to what extent can we rely on the factual output of llms in the arabic language? ii) what are the types of factual errors and linguistic errors in the generated output from llms? iii) do arabic-centric llms suffer from hallucinations, and how much? the contributions of our work are as follows: the dataset comprises 10k sentences generated equally by chatgpt and gpt-4 and judged by a large number of human annotators. the annotation covers factuality, correctness, linguistic errors, and reference links. we make the dataset publicly available for research purposes. the rest of the paper is organized as follows: in section 2, we provide a brief overview of previous work regarding hallucination. we discuss the dataset in detail in section 3, and the annotation process and guidelines in section 3.3. in section 4, we present an in-depth analysis of different aspects like model accuracy, reasons for errors, etc. finally, we conclude and mention possible future directions of our work in section 5. ## related work hallucination refers to the generation of factually inaccurate or ungrounded information by llms, posing challenges to the reliability and trustworthiness of the generated content @xcite . this literature review aims to encapsulate the current state of research on hallucination in llms, including efforts toward understanding, evaluating, and mitigating hallucination, with a particular emphasis on multilingual scenarios. recent studies have ventured into unraveling the underpinnings of hallucination in llms. for instance, a survey about hallucination in large foundation models (lfms) explores the models' tendency to produce inaccurate content. it categorizes these inaccuracies, suggests evaluation criteria, reviews mitigation strategies, and points to future research directions @xcite . similarly, a survey conducted in the domain of natural language generation shed light on the metrics, mitigation methods, and task-specific research progress concerning hallucinations @xcite . on the other hand, (rawte et al., 2023a) categorized hallucination by degree, orientation, and type, introducing the hallucination elicitation (hilt) dataset and the hallucination vulnerability index (hvi) for evaluating llms. they aimed to guide ai policy-making and provide mitigation solutions. evaluation frameworks have also been proposed to assess the extent of hallucination in llms. notably, a benchmark named felm was introduced to evaluate the factuality of text from large language models (llms), highlighting the need for accurate evaluations across diverse domains beyond just world knowledge. this benchmark provides detailed annotations, error types, and reference links to support or challenge statements, emphasizing the challenges current llms face in reliably detecting factual inaccuracies @xcite . likewise, a benchmark and dataset named med-halt was introduced to specifically evaluate hallucination in the medical domain, underscoring the serious consequences of incorrect information generation in healthcare applications @xcite . various strategies have been proposed to curb hallucination in llms. a recent paper introduced an uncertainty-aware in-context learning framework aimed at enhancing the reliability of llms by empowering the model to enhance or reject its output, thereby addressing the issue of hallucination @xcite . moreover, the chain-of-verification (cove) method was proposed to enable llms to deliberate on their responses, correcting mistakes, thereby reducing hallucination @xcite . the issue of hallucination is not confined to monolingual models but extends to multilingual models as well. a study explored hallucinations in large multilingual translation models, though primarily focusing on small bilingual models trained on english-centric high-resource language pairs @xcite . despite the insights provided, the study leaves a gap in understanding hallucination in low-resource languages or non-englishcentric settings. another study addresses hallucination within a multi-modal context, which also encompasses multilingual scenarios given the multimodal nature of communication across languages @xcite . a recent study @xcite presents the first large-scale dataset with human-annotated hallucinations across 18 translation directions covering diverse language resources and scripts. their dataset contains naturally generated translations from a public model. analyzing this, they show for low-resource languages, model internal methods outperform external ones for hallucination detection. previous conclusions about detection methods do not transfer well when evaluated across many languages. this work enables reliable multilingual research on mitigating hallucination beyond english-centric evaluations. as we can see from the previous work, the body of literature on hallucination in llms is growing, with researchers exploring various dimensions including understanding the causes, developing evaluation benchmarks, and proposing mitigation strategies. however, the exploration of hallucination in multilingual and non-english-centric scenarios, especially arabic, remains an area warranting further investigation. ## conclusion in this paper, we present "halwasa", the first arabic dataset to benchmark llms; namely chatgpt and gpt-4. we asked the models to generate diverse factual sentences and annotated them manually. we described the data collection and annotation processes in details. also, we analyzed the factual errors and linguistic errors in the generated sentences. several future directions emerged from our work. evaluating chatgpt and gpt-4 on english equivalents of the arabic words could enable crosslingual comparisons, while prompting them to factcheck english translations of incorrect arabic sentences could yield insights into cross-lingual hallucination patterns. further analysis of gpt-4's dialectical errors, where it underperformed compared to chatgpt, is warranted and could inform developing more robust, dialect-aware arabic llms, as indiscriminate data scaling may not be optimal for multi-dialectal languages like arabic. additionally, we plan to increase the size of our dataset, include more arabic llms like jais @xcite and bloomz in our evaluation, use the human-corrected sentences as a new test set, and employ llms to verify their own results. moreover, we will build a machine learning model to predict the factuality of the generated sentences and attempt to correct their mistakes. we will also explore the change in performance when translating the generated arabic sentences to english and evaluating english llms on them. exploring these directions would advance our understanding of arabic llm hallucinations and facilitate techniques to