Grounding and Source Verification

A mechanism that mechanically verifies whether AI outputs are backed by trustworthy primary source text. Eliminates model hallucinations by cross-checking extracted claims and numbers against the fetched web page body.

General Meaning

Because LLMs generate plausible-sounding text probabilistically, they carry an inherent risk of fabricating convincing falsehoods (hallucinations) when asked about facts outside their training data or precise numerical figures. In domains involving public subsidies, financial amounts, or eligibility terms, inaccurate numbers directly harm users.

Grounding anchors a model's responses to authoritative external sources—such as fetched web pages, official documents, or databases—to make the basis of every output explicit. Source Verification goes a step further by mechanically cross-checking that every extracted claim or figure literally appears inside the primary source text.

Why It Matters

  • Eliminating hallucinations: Prevents fabricated numbers or conditions invented by model memory or probabilistic guessing from entering public datasets.
  • Guaranteeing accuracy of public information: Preserves exact precision for critical data such as subsidy caps and application deadlines where even a single character error is unacceptable.
  • Ensuring auditability (traceability): Allows anyone to trace and explain exactly which passage of which web page backs every published field.

How the Site Factory Uses It

In the Site Factory's site data pipelines, the source verification script engine/check_sources.py (implemented purely in the Python standard library) enforces strict source verification on every extraction draft (drafts.json). For fields marked needs_quote, it checks whether the extracted quote exists verbatim in the fetched page body (fetch_state.json), and whether the extracted figure or date appears inside that quote (value_inside_quote).

Even for fields that do not require a quote, check_sources.py verifies that the value exists in the page body, and checks fiscal_year_on_page to confirm that the current fiscal year (e.g., Reiwa 8 / 2026) is mentioned on the page. If a field fails verification, it is forcibly overwritten to unknown with the failure reason logged; if a required field becomes unknown, an ID is missing, or the fiscal year check fails, the entire row is excluded from public records (records.json) and held in candidates.json.

Caveats & Operational Rules

  • Never let the LLM verify its own sources: Asking a model whether its output appears in the source text often causes it to double down on its hallucination; verification must be performed by a deterministic Python script.
  • Normalize notation variants without allowing guesswork: The verifier normalizes Japanese numerical variants (such as 3,000円, 3千円, and 0.3万円) for inclusion checks, but never permits guessing numbers absent from the source.
  • Watch out for outdated fiscal year data: Even when a number literally exists in the source text, it may belong to an expired program from a previous year, so combining value checks with fiscal year verification is essential.

Related Terms

References

  • Book: Chip Huyen, "AI Engineering", Chapter 5 (Retrieval-Augmented Generation and Grounding)

Verified: 2026-11-08