arXiv:2412.17056cs.CLcs.LG2024-12被引 9

用LLM内部状态检测闭域幻觉,提升生成可信度。

The HalluRAG Dataset: Detecting Closed-Domain Hallucinations in RAG Applications Using an LLM's Internal States

  • 基于模型内部状态,从句子级识别未训练过的虚假信息。
  • 在HalluRAG数据集上,最高检测准确率达75%。
  • 适合关注大模型可靠性与幻觉检测的研究者。

检测大语言模型(LLMs)中的幻觉对提升其可靠性至关重要。现有研究多关注训练数据外的偏差,但模型参数化知识的不透明性使理解生成内容为何失真变得复杂:可能是未从大规模不可访问数据中学习到必要知识,或知识在后续训练中被修改或矛盾化。本文聚焦于训练中未包含的信息所引发的幻觉,通过时间截断确保信息出现于截止日期之后。研究利用不同LLM的内部状态,在句子级别检测此类幻觉,并提出HalluRAG数据集以训练分类器。基于HalluRAG训练的MLP分类器在测试中准确率最高达75%,其中Mistral-7B-Instruct-v0.1表现最优。结果表明,IAVs在检测效果上等同于CEVs,且可回答与不可回答提示在编码上存在差异,分类型分类器显著提升准确率。然而HalluRAG仍表现出有限泛化能力,呼吁构建更具多样性的幻觉数据集。

原文摘要 · Abstract (English)

Detecting hallucinations in large language models (LLMs) is critical for enhancing their reliability and trustworthiness. Most research focuses on hallucinations as deviations from information seen during training. However, the opaque nature of an LLM's parametric knowledge complicates the understanding of why generated texts appear ungrounded: The LLM might not have picked up the necessary knowledge from large and often inaccessible datasets, or the information might have been changed or contradicted during further training. Our focus is on hallucinations involving information not used in training, which we determine by using recency to ensure the information emerged after a cut-off date. This study investigates these hallucinations by detecting them at sentence level using different internal states of various LLMs. We present HalluRAG, a dataset designed to train classifiers on these hallucinations. Depending on the model and quantization, MLPs trained on HalluRAG detect hallucinations with test accuracies ranging up to 75 %, with Mistral-7B-Instruct-v0.1 achieving the highest test accuracies. Our results show that IAVs detect hallucinations as effectively as CEVs and reveal that answerable and unanswerable prompts are encoded differently as separate classifiers for these categories improved accuracy. However, HalluRAG showed some limited generalizability, advocating for more diversity in datasets on hallucinations.

幻觉检测LLM数据集可信生成

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