arXiv:2607.00895cs.CL2026-07

提出跨代码、工具输出等多源输入的幻觉检测基准,提升生成可靠性。

Beyond Document Grounding: Span-Level Hallucination Detection over Code, Tool Output, and Documents

  • 构建统一基准,覆盖代码、工具输出等结构化输入的幻觉检测
  • 模型在统一测试集上达0.689的跨度F1,显著优于现有方法
  • 适用于需要高可信生成的开发者工具与自动化系统

检索增强生成(RAG)中的幻觉检测通常基于自然语言文档证据评估。然而,日益增多的生成系统依赖结构化输入:源代码、开发者工具输出、标记文档、表格和仓库元数据。本文提出一个统一的细粒度幻觉检测基准,涵盖代码、工具输出、结构化文档及现有自然语言RAG数据集。该基准通过从正确答案出发,精准注入局部幻觉并标注字符级标签,并通过基于证据的评审验证代码测试集。微调后的Qwen3.5-2B检测器在统一测试集上达到0.689的跨度F1,代码代理源上为0.60,显著优于LettuceDetect-large(0.17)和最强零样本LLM评判者(最高0.22)。同一模型在经典自然语言基准上表现良好,达81.8的RAGTruth例级F1和0.724的English PsiloQA IoU。

原文摘要 · Abstract (English)

Hallucination detection for retrieval-augmented generation (RAG) is usually evaluated on natural-language document evidence. However, grounded generation systems increasingly rely on structured inputs: source code, developer-tool output, markdown documents, tables, and repository metadata. We introduce a unified benchmark for span-level hallucination detection over code, tool output, structured documents, and existing natural-language RAG datasets. The benchmark is built by starting from grounded correct answers, injecting localized hallucinations with exact character labels, and validating the code test split with evidence-based review. Our fine-tuned Qwen3.5-2B detector reaches 0.689 span-F1 on the unified test set and 0.60 on the code-agent source, where it substantially outperforms LettuceDetect-large (0.17) and the strongest zero-shot LLM judges we evaluated (at most 0.22). The same model remains competitive on established natural-language benchmarks, with 81.8 RAGTruth example-F1 and 0.724 English PsiloQA IoU.

幻觉检测代码生成RAG基准测试

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