arXiv:2411.02603cs.CLcs.AI2024-11ICML被引 5

用统计方法验证大模型回答是否真实,确保错误率可控。

FactTest: Factuality Testing in Large Language Models with Finite-Sample and Distribution-Free Guarantees

  • 将事实性检测建模为假设检验,控制误判率上限。
  • 在多个基准上使准确率提升超40%,有效识别幻觉并拒绝未知问题。
  • 不依赖数据分布,小样本即可用,适用于任何模型类型。

大型语言模型(LLM)生成幻觉和非事实内容的问题严重影响其在高风险场景中的可靠性,严格控制第一类错误(即错误地将幻觉判定为真实内容的条件概率)至关重要。尽管如此,具备有限样本和分布无关保证的正式验证仍鲜有研究。本文提出FactTest,一种新型框架,通过统计方法评估LLM能否以高概率正确回答问题。我们将事实性检测建模为假设检验,确保第一类错误率在用户设定的显著性水平下受控。我们证明,在温和条件下,该框架还能有效控制第二类错误,并可扩展至应对协变量偏移的情况。本方法无需假设数据分布,适用于任意数量的人工标注样本,且对黑盒或白盒模型均适用。在问答与多选题基准上的大量实验表明,FactTest能有效检测幻觉,增强模型对未知问题的拒答能力,整体准确率提升超过40%。

原文摘要 · Abstract (English)

The propensity of Large Language Models (LLMs) to generate hallucinations and non-factual content undermines their reliability in high-stakes domains, where rigorous control over Type I errors (the conditional probability of incorrectly classifying hallucinations as truthful content) is essential. Despite its importance, formal verification of LLM factuality with such guarantees remains largely unexplored. In this paper, we introduce FactTest, a novel framework that statistically assesses whether a LLM can confidently provide correct answers to given questions with high-probability correctness guarantees. We formulate factuality testing as hypothesis testing problem to enforce an upper bound of Type I errors at user-specified significance levels. Notably, we prove that our framework also ensures strong Type II error control under mild conditions and can be extended to maintain its effectiveness when covariate shifts exist. Our approach is distribution-free and works for any number of human-annotated samples. It is model-agnostic and applies to any black-box or white-box LM. Extensive experiments on question-answering (QA) and multiple-choice benchmarks demonstrate that FactTest effectively detects hallucinations and improves the model's ability to abstain from answering unknown questions, leading to an over 40% accuracy improvement.

大模型验证幻觉检测统计推断可靠性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。