AI Skills AI技能 21h ago Updated 15h ago 更新于 15小时前 45

A RAG That Says 'Not in This Document' Has to Show Four Kinds of Evidence 能说出'不在本文档中'的RAG必须展示四种证据

A RAG system's most valuable response is sometimes "that is not in this document," but models naturally tend to answer anyway, so honest "not found" responses must be deliberately engineered rather than assumed A confident wrong answer is a bug, while an unverified bare "no answer" is almost as bad—absence claims require defensible evidence, not just a refusal to respond The "four bricks" framework (parsing, retrieval, structured output, and verification) each contribute one piece of evidence to RAG系统应能诚实回答"文档中无相关信息",但模型倾向于强行生成答案,需主动构建"不知道"机制 可信的"不知道"需要证据支撑,否则用户无法判断是系统未充分检索还是确实无答案 四个核心组件(解析、检索、推理、输出)各自为"不知道"提供可验证证据 解析阶段通过关系型数据表(line_df、image_df等)生成覆盖范围报告,证明已全面检查文档 结构化输出使"是"答案可验证,同样逻辑适用于"否"答案的可辩护性

58
Hot 热度
72
Quality 质量
65
Impact 影响力

Analysis 深度分析

TL;DR

  • A RAG system's most valuable response is sometimes "that is not in this document," but models naturally tend to answer anyway, so honest "not found" responses must be deliberately engineered rather than assumed
  • A confident wrong answer is a bug, while an unverified bare "no answer" is almost as bad—absence claims require defensible evidence, not just a refusal to respond
  • The "four bricks" framework (parsing, retrieval, structured output, and verification) each contribute one piece of evidence to make a "no" verdict trustworthy and auditable
  • Parsing produces relational DataFrames (line_df, image_df, page_df, toc_df, cross_ref_df) that serve as the audit trail for absence claims, covering text lines, images, tables, and cross-references
  • False negatives in parsing are silently dangerous: the system appears to correctly say "no," but the answer was actually present and simply never detected by the pipeline

Why It Matters

This article addresses one of the most persistent failure modes in enterprise RAG systems: the inability to reliably and defensibly report when information is absent from a document. For AI practitioners building production retrieval systems, this is critical because users will lose trust in a chatbot that either hallucinates answers or gives unverified "I don't know" responses that may simply reflect shallow retrieval. The framework provides a concrete, structured approach to making absence claims auditable and trustworthy.

Technical Details

  • Relational parsing output: The parse_pdf function produces a structured set of DataFrames rather than unstructured text—line_df (text lines with page numbers, bounding boxes, and line types), image_df (registered images), page_df, toc_df (table of contents entries), cross_ref_df (in-body cross-references), and an object_registry—each serving as evidence surfaces for absence verification
  • Coverage aggregation for absence claims: A parse_coverage dictionary aggregates key metrics (total pages, pages with text, image count, TOC entries, cross-references, registered objects) to define the scope an absence claim must cover, ensuring the system can demonstrate it searched all relevant surfaces
  • OCR pass on image_df: Charts and figures often contain axis labels and legends as image-embedded text rather than typographic spans; an OCR pass adds an ocr_text column to image_df without modifying line_df, and the coverage report tracks how many images were processed
  • Table-aware retrieval: Numbers in table cells parse as lines whose neighbors are other cells in the same row, not words above on the page—meaning a keyword sweep can miss relevant data; the object_registry flags which pages host tables so retrieval can perform column-aware sweeps
  • Asymmetric cost of parsing errors: False positives (extracting noise) are recoverable downstream, but false negatives (failing to extract a real token) are silent and catastrophic for absence claims—the system appears correct while the answer was actually present but undetected

Industry Insight

  • Enterprise RAG systems must treat "I don't know" as a first-class output that requires the same rigor of evidence and verification as affirmative answers—simply refusing to answer is insufficient without an audit trail proving the system searched comprehensively
  • The relational parsing approach (treating documents as structured DataFrames rather than text blobs) should be adopted as a standard practice in enterprise document intelligence pipelines, as it enables both affirmative and negative answers to be verified and audited
  • Organizations building corporate chatbots should invest in coverage reporting and absence-claim verification as part of their evaluation framework, since user trust erodes not from honest "no answer" responses but from unverifiable ones that may mask shallow or incomplete retrieval

TL;DR

  • RAG系统应能诚实回答"文档中无相关信息",但模型倾向于强行生成答案,需主动构建"不知道"机制
  • 可信的"不知道"需要证据支撑,否则用户无法判断是系统未充分检索还是确实无答案
  • 四个核心组件(解析、检索、推理、输出)各自为"不知道"提供可验证证据
  • 解析阶段通过关系型数据表(line_df、image_df等)生成覆盖范围报告,证明已全面检查文档
  • 结构化输出使"是"答案可验证,同样逻辑适用于"否"答案的可辩护性

为什么值得看

本文解决了企业RAG系统的关键信任问题:如何让"不知道"成为可验证的可靠回答而非系统故障。对AI从业者而言,这提供了构建可信企业级文档智能系统的具体技术路径,避免模型幻觉导致的错误决策风险。

技术解析

  • 解析层证据:使用关系型数据模型(parse_pdf输出line_df、image_df、page_df等),通过聚合统计(总页数、有文本页数、图像数量、目录条目等)证明文档已被全面扫描,为"无答案"声明提供审计轨迹。
  • 多模态覆盖:除文本行外,还需检查图像中的嵌入文本(通过OCR添加ocr_text列)和表格数据(通过object_registry标记含表格页面),确保答案不会隐藏在非文本元素中。
  • 不对称错误成本:假阳性(提取噪声)可通过下游处理纠正,但假阴性(遗漏真实信息)会导致错误的"无答案"声明,因此解析阶段必须高精度。
  • 结构化输出框架:延续系列文章第8篇的理念,强制模型提供引用证据(引文、页码、置信度),同样适用于"不知道"答案的可验证性。

行业启示

  • 企业RAG系统应将"诚实不知道"作为核心能力而非边缘功能,需要设计完整的证据链来支持负向回答。
  • 文档解析不能仅停留在文本提取,必须建立多模态覆盖验证机制,包括图像OCR和表格结构解析。
  • 在构建企业AI系统时,应优先投资可验证性基础设施,使每个回答(无论肯定或否定)都能提供审计轨迹,建立用户信任。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

RAG 检索增强生成 LLM 大模型 Research 科学研究 Evaluation 评测