MetaRAG:用于 RAG 系统中幻觉检测的蜕变测试
MetaRAG: Metamorphic Testing for Hallucination Detection in RAG Systems
AI总结:
MetaRAG 提出一种基于蜕变测试的黑盒无监督框架,通过事实点分解、同反义词变异验证与惩罚聚合,在 RAG 系统中检测并定位幻觉,为企业级身份敏感场景提供可信部署支持。
摘要:
大型语言模型(LLMs)越来越多地部署在企业应用中,但其可靠性仍受幻觉(即自信但事实错误的信息)的限制。现有的检测方法,如 SelfCheckGPT 和 MetaQA,主要针对独立的大型语言模型,并未解决检索增强生成(RAG)系统所特有的挑战,即响应必须与检索到的证据保持一致。因此,我们提出了 MetaRAG,一个用于检索增强生成(RAG)系统中幻觉检测的蜕变测试框架。MetaRAG 在实时、无监督、黑盒环境下运行,既不需要真实参考,也不需要访问模型内部结构,因此适用于专有和高风险领域。该框架分四个阶段进行:(1)将答案分解为原子事实点;(2)使用同义词和反义词替换对每个事实点生成受控变异;(3)根据检索到的上下文验证每个变体(同义词预期被蕴含,反义词预期被矛盾);(4)将不一致的惩罚聚合为响应级别的幻觉分数。对于身份感知人工智能至关重要的一点是,MetaRAG 将不受支持的声明定位到其出现的事实点跨度(例如,妊娠特定注意事项、LGBTQ+ 难民权利或劳动资格),使用户能够看到被标记的跨度,并使系统设计者能够为身份敏感的查询配置阈值和防护措施。在一个专有企业数据集上的实验证明了 MetaRAG 在检测幻觉和实现基于 RAG 的对话代理可信部署方面的有效性。我们还概述了一种基于主题的部署设计,将 MetaRAG 的跨度级分数转化为身份感知的防护措施;该设计在本文中进行了讨论,但未在我们的实验中评估。
英文摘要:
Large Language Models (LLMs) are increasingly deployed in enterprise applications, yet their reliability remains limited by hallucinations, i.e., confident but factually incorrect information. Existing detection approaches, such as SelfCheckGPT and MetaQA, primarily target standalone LLMs and do not address the unique challenges of Retrieval-Augmented Generation (RAG) systems, where responses must be consistent with retrieved evidence. We therefore present MetaRAG, a metamorphic testing framework for hallucination detection in Retrieval-Augmented Generation (RAG) systems. MetaRAG operates in a real-time, unsupervised, black-box setting, requiring neither ground-truth references nor access to model internals, making it suitable for proprietary and high-stakes domains. The framework proceeds in four stages: (1) decompose answers into atomic factoids, (2) generate controlled mutations of each factoid using synonym and antonym substitutions, (3) verify each variant against the retrieved context (synonyms are expected to be entailed and antonyms contradicted), and (4) aggregate penalties for inconsistencies into a response-level hallucination score. Crucially for identity-aware AI, MetaRAG localizes unsupported claims at the factoid span where they occur (e.g., pregnancy-specific precautions, LGBTQ+ refugee rights, or labor eligibility), allowing users to see flagged spans and enabling system designers to configure thresholds and guardrails for identity-sensitive queries. Experiments on a proprietary enterprise dataset illustrate the effectiveness of MetaRAG for detecting hallucinations and enabling trustworthy deployment of RAG-based conversational agents. We also outline a topic-based deployment design that translates MetaRAG's span-level scores into identity-aware safeguards; this design is discussed but not evaluated in our experiments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。