Skip to content

Add: Document extraction hallucination — agent reports correct-looking JSON with wrong values#31

Open
digitalpromptmarket-beep wants to merge 1 commit into
vectara:mainfrom
digitalpromptmarket-beep:add-document-extraction-hallucination
Open

Add: Document extraction hallucination — agent reports correct-looking JSON with wrong values#31
digitalpromptmarket-beep wants to merge 1 commit into
vectara:mainfrom
digitalpromptmarket-beep:add-document-extraction-hallucination

Conversation

@digitalpromptmarket-beep

Copy link
Copy Markdown

Failure Mode: Silent data extraction errors (Tool Hallucination)

Category: Tool-calling hallucination / Output corruption

Description:
When AI agents extract structured data from documents (invoices, contracts, financial reports), the output often looks perfectly valid — well-formed JSON, reasonable values, correct field names — but contains subtle errors:

  • Line item amounts that don't sum to the stated total
  • Dates that are plausible but don't match the source document
  • Vendor names that are close but not exact (OCR artifacts or LLM "corrections")
  • Tax calculations that use the wrong rate

These errors are particularly dangerous because they pass schema validation and human spot-checks. They only surface when someone manually re-checks the math or compares field-by-field against the original.

Real-world impact:

  • Financial systems that auto-process extracted invoices can pay wrong amounts
  • Compliance workflows that trust extracted dates can miss deadlines
  • Audit trails become unreliable when the extracted record doesn't match the source

Mitigation:
Add a mechanical verification step between extraction and downstream action: arithmetic validation, cross-field consistency checks, and source-document comparison. This should be automated (not human review) to scale with agent throughput.

References:

  • Vectara Hallucination Leaderboard — shows variation in model accuracy for document summarization
  • Common pattern in invoice processing pipelines using Textract, Azure Document Intelligence, or LLM-based extraction

…g JSON with wrong values

Adds a real-world example of silent data extraction errors to the Tool Hallucination
failure mode. Covers how extraction tools return valid JSON with plausible but
incorrect values (wrong totals, dates, vendor names), and mitigation via automated
arithmetic/consistency verification.
@ofermend

ofermend commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR @digitalpromptmarket-beep
I don't think this type of issue should be categorized as a tool hallucination - that category is intended for when a tool is called and responds with a bad output during the query flow.
I think the extraction process is done either by the agent LLM itself or offline / batch during ingest. In the case you're suggesting is the extraction really a tool call, or is it just a separate type of thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants