NLI to the Rescue: Mapping Entailment Classes to Hallucination Categories in Abstractive Summarization (2023)

Abstract: In this paper, we detect hallucinations in summaries generated by abstractive summarization models. We focus on three types of hallucination viz. intrinsic, extrinsic, and nonhallucinated. The method used for detecting hallucination is based on textual entailment. Given a premise and a hypothesis, textual entailment classifies the hypothesis as contradiction, neutral, or entailment. These three classes of textual entailment are mapped to intrinsic, extrinsic, and non-hallucinated respectively. We fine-tune a RoBERTa-large model on NLI datasets and use it to detect hallucinations on the XSumFaith dataset. We demonstrate that our simple approach using textual entailment outperforms the existing factuality inconsistency detection systems by 12% and we provide insightful analysis of all types of hallucination. To advance research in this area, we create and release a dataset, XSumFaith++, which contains balanced instances of hallucinated and non-hallucinated summaries.

## introduction natural language generation (nlg) has made tremendous progress in neural text generation with the advent of large pre-trained language models like bert @xcite and gpt series @xcite @xcite . although text generation using these models is fluent, it is often observed that the generated text is divergent or unfaithful to the source text @xcite @xcite . this problem of generating contradicting or irrelevant text is termed hallucination @xcite . the state-of-the-art abstractive summarization systems can generate fluent summaries with high values of automatic evaluation metrics like rogue @xcite . however, the generated summaries are often inconsistent with respect to the original document and such * these authors contributed equally to this work summaries are said to be hallucinated @xcite . these hallucinations can be intrinsic or extrinsic. we follow @xcite for defining intrinsic and extrinsic hallucination in abstractive summarization. if the generated summary contradicts the source document, we refer to it as intrinsic hallucination. if the generated summary contains information that cannot be verified from the source document, we refer to it as extrinsic hallucination. when the summary is factually consistent with the document, we refer to the summary as non-hallucinated. in this work, we explore the usage of natural language inference (nli) for hallucination detection in abstractive summarization. natural language inference (a.k.a textual entailment) was first studied in @xcite . given a premise p , the task of nli or textual entailment is to classify a hypothesis, h, as con-tradictory, neutral or entailed with respect to the premise p . we justify in section 2.3 that these three classes of textual entailment can be mapped to intrinsic, extrinsic, and non-hallucinated respectively. we apply our approach by using models fine-tuned on the nli task for hallucination classification. we evaluate this approach on the xsum-faith dataset @xcite which contains document-summary pairs with summaries labelled as intrinsic, extrinsic or non-hallucinated. further, we observe that the xsumfaith dataset is heavily skewed towards hallucinated summaries (section 4.2). to address this imbalance, we create and release xsumfaith++, a balanced extension of xsumfaith, which will aid further research in hallucination detection. ## methodology using textual entailment for hallucination detection: textual entailment or nli (natural language inference) is the task of classifying a hypothesis, h, as a contradiction, neutral, or entailment given a premise p . we argue that the three types of textual entailment can be mapped to the three types of hallucination viz. intrinsic, extrinsic, and non-hallucination (section 2.3). task formulation: for a document d (considered as the premise), its summary s (considered as the hypothesis) and a set of entailment labels y 0 , y 1 and y 2 corresponding to contradiction, neutral, or entailment respectively, we can mathematically formulate the three-class hallucination classification as: ## experiments and results to perform the three-way classification, we use the following models which are fine-tuned on nli datasets: deberta-base foot_4 and roberta-large foot_5 . we use two experimental settings: zero-shot (zs) and fine-tuning (ft). in a zero-shot setting, we use the models fine-tuned on nli directly for the task of hallucination detection without training them on any hallucination data. for the fine-tuning experiments, these deberta and roberta models are further fine-tuned using the xsumfaith++ dataset. the results are shown in roberta-large model shows better performance in both zero-shot and fine-tuned experiment settings. the best performance is seen in the fine-tuned roberta-large model with an f1 score of 0.81. this three-way classification performance cannot be compared with the existing factual consistency detection models as all of them perform a binary classification (i.e., hallucinated vs. non-hallucinated). to compare the performance with the current models, we use our approach for binary classification (viz. hallucinated vs. nonhallucinated) by combining intrinsic and extrinsic categories into a single category, i.e., hallucinated. ## qualitative analysis as seen from the results (tables 4 and 5 ), models fine-tuned on nli datasets are very effective in detecting hallucination. an example where the roberta-large model correctly detects the presence of intrinsic hallucination is: document: ... mr gustafsson, 42, is being flown back to sweden from africa, sweden's foreign minister margot wallstram said in a statement on monday. ... generated summary: swedish foreign minister johan gusttrom has been freed after two sus-pected kidnappings in a raid in mali, the foreign ministry says. ## conclusion and future work we propose an entailment-grounded approach to detect types of hallucination in summaries generated by abstractive summarizers. the models fine-tuned on nli datasets show a 12% increase in accuracy compared to the existing consistencychecking models. we also release a new dataset, xsumfaith++, containing a balanced number of hallucinated and non-hallucinated instances. we do this by augmenting the xsumfaith dataset with 7, 282 non-hallucinated data instances. xsum-faith++ dataset can be used to aid further research in hallucination detection. the takeaway from our work is that zero-shot entailment-grounded classification of hallucination works better than the existing factuality detection models for abstractive summarization. in this work, we do not tackle scenarios where both intrinsic and extrinsic hallucinations are present in the same instance. this is a potential future direction of our work. we also plan to explore approaches to generalize hallucination detection for all nlg tasks.