arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.15844cs.CLcs.LG
收藏

基于蜕变关系的大语言模型幻觉检测

Hallucination Detection in Large Language Models with Metamorphic Relations

King’s College London(伦敦国王学院);University of Calgary(卡尔加里大学);York University(约克大学)

Borui Yang, Md Afif Al Mamun, Jie M. Zhang, Gias Uddin

AI总结:

本文提出MetaQA方法,利用蜕变关系和提示变异在无外部资源条件下检测LLM幻觉,兼容开源与闭源模型,并在多个数据集上显著优于SelfCheckGPT。

摘要:

大语言模型(LLMs)在其响应中容易出现幻觉,例如事实性错误信息。这些幻觉对要求高事实准确性的基于LLM的应用构成了挑战。现有的幻觉检测方法主要依赖外部资源,这些资源可能面临可用性低、覆盖不完整、隐私担忧、高延迟、低可靠性和可扩展性差等问题。还有一些方法依赖输出概率,但对于像GPT模型这样的闭源LLM,输出概率通常无法获取。本文提出了MetaQA,一种利用蜕变关系和提示变异(prompt mutation)的自包含幻觉检测方法。与现有方法不同,MetaQA无需任何外部资源即可运行,并且同时兼容开源和闭源LLM。MetaQA基于以下假设:如果LLM的响应是幻觉,则所设计的蜕变关系将被违反。我们在多个数据集上,以及在两个开源和两个闭源LLM上,将MetaQA与最先进的零资源幻觉检测方法SelfCheckGPT进行了比较。我们的结果表明,MetaQA在精确率、召回率和F1分数方面均优于SelfCheckGPT。对于我们研究的四个LLM,MetaQA优于SelfCheckGPT的优势幅度分别为0.041-0.113(精确率)、0.143-0.430(召回率)和0.154-0.368(F1分数)。例如,在Mistral-7B上,MetaQA实现了0.435的平均F1分数,而SelfCheckGPT的F1分数为0.205,提升率达到112.2%。MetaQA还在所有不同类别的问题上表现出优越性。

英文摘要:

Large Language Models (LLMs) are prone to hallucinations, e.g., factually incorrect information, in their responses. These hallucinations present challenges for LLM-based applications that demand high factual accuracy. Existing hallucination detection methods primarily depend on external resources, which can suffer from issues such as low availability, incomplete coverage, privacy concerns, high latency, low reliability, and poor scalability. There are also methods depending on output probabilities, which are often inaccessible for closed-source LLMs like GPT models. This paper presents MetaQA, a self-contained hallucination detection approach that leverages metamorphic relation and prompt mutation. Unlike existing methods, MetaQA operates without any external resources and is compatible with both open-source and closed-source LLMs. MetaQA is based on the hypothesis that if an LLM's response is a hallucination, the designed metamorphic relations will be violated. We compare MetaQA with the state-of-the-art zero-resource hallucination detection method, SelfCheckGPT, across multiple datasets, and on two open-source and two closed-source LLMs. Our results reveal that MetaQA outperforms SelfCheckGPT in terms of precision, recall, and f1 score. For the four LLMs we study, MetaQA outperforms SelfCheckGPT with a superiority margin ranging from 0.041 - 0.113 (for precision), 0.143 - 0.430 (for recall), and 0.154 - 0.368 (for F1-score). For instance, with Mistral-7B, MetaQA achieves an average F1-score of 0.435, compared to SelfCheckGPT's F1-score of 0.205, representing an improvement rate of 112.2%. MetaQA also demonstrates superiority across all different categories of questions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑