{
  "schemaVersion": 1,
  "id": "atlas-lesson-document-extraction-validation",
  "title": "Document fields become validated records",
  "category": "learning",
  "format": "Atlas lesson",
  "description": "Document layout, transcription/extraction, schema normalization, confidence and cross-field constraints.",
  "canonicalUrl": "https://semiaifoundry.com/learn/atlas/document-extraction-validation/",
  "publishedDate": null,
  "revisionDate": "2026-10-07",
  "author": null,
  "topic": "Models become evaluated applications",
  "series": null,
  "license": null,
  "rightsUrl": "https://semiaifoundry.com/ai-atlas/licenses.html",
  "version": "1.3.0",
  "status": "Published educational lesson",
  "evidenceScope": "This is a worked explanation, not an executing external platform, model or robot. The quantities and fixtures are authored. Source scope is recorded in the automation learning review manifest; no source benchmark or private system behavior is claimed. Synthetic invoice; nonnegative integer quantities and exact integer-cent prices. Tax, currency conversion, discounts and rounding policies are outside the example.",
  "contentCoverage": "published-lesson",
  "artifactUrl": "https://semiaifoundry.com/ai-atlas/lesson-data/document-extraction-validation-b08a723accbd1c21.json",
  "interactiveUrl": "https://semiaifoundry.com/ai-atlas/#document-extraction-validation",
  "related": [],
  "supersedes": [],
  "supersededBy": [],
  "contentHash": "0879da9c5d6eb48ddb0472af8c60a5be22309fae4fa4c45584a150dd85fbbe24",
  "contentLength": 6329,
  "jsonUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-document-extraction-validation.json",
  "markdownUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-document-extraction-validation.md",
  "sections": [
    {
      "id": "section-1",
      "title": "Document fields become validated records",
      "start": 53,
      "end": 498
    },
    {
      "id": "section-2",
      "title": "The mechanism",
      "start": 498,
      "end": 1764
    },
    {
      "id": "section-3",
      "title": "Science and assumptions",
      "start": 1764,
      "end": 1792
    },
    {
      "id": "section-4",
      "title": "Document fields become validated records · explicit relationship",
      "start": 1792,
      "end": 2910
    },
    {
      "id": "section-5",
      "title": "Engineering example",
      "start": 2910,
      "end": 3490
    },
    {
      "id": "section-6",
      "title": "Distinctions and tradeoffs",
      "start": 3490,
      "end": 3867
    },
    {
      "id": "section-7",
      "title": "Specifications and interfaces",
      "start": 3867,
      "end": 4336
    },
    {
      "id": "section-8",
      "title": "Interfaces",
      "start": 4336,
      "end": 4615
    },
    {
      "id": "section-9",
      "title": "Check your understanding",
      "start": 4615,
      "end": 4644
    },
    {
      "id": "section-10",
      "title": "An extractor changes both a price and total consistently but disagrees with the image. Is arithmetic validation sufficient?",
      "start": 4644,
      "end": 5109
    },
    {
      "id": "section-11",
      "title": "Evidence and scope",
      "start": 5109,
      "end": 5684
    },
    {
      "id": "section-12",
      "title": "Sources",
      "start": 5684,
      "end": 5992
    },
    {
      "id": "section-13",
      "title": "Continue exploring",
      "start": 5992,
      "end": 6015
    },
    {
      "id": "section-14",
      "title": "Foundations",
      "start": 6015,
      "end": 6226
    },
    {
      "id": "section-15",
      "title": "Related lessons",
      "start": 6226,
      "end": 6329
    }
  ],
  "citations": [
    {
      "title": "Explore in Atlas",
      "url": "https://semiaifoundry.com/ai-atlas/#document-extraction-validation"
    },
    {
      "title": "OCR-free Document Understanding Transformer",
      "url": "https://arxiv.org/abs/2111.15664v5"
    },
    {
      "title": "Published lesson data",
      "url": "https://semiaifoundry.com/ai-atlas/lesson-data/document-extraction-validation-b08a723accbd1c21.json"
    },
    {
      "title": "Atlas releases and licensing",
      "url": "https://semiaifoundry.com/ai-atlas/licenses.html"
    },
    {
      "title": "Evaluation & the AGI frontier",
      "url": "https://semiaifoundry.com/learn/atlas/evaluation/"
    },
    {
      "title": "Tool schemas and semantic validation",
      "url": "https://semiaifoundry.com/learn/atlas/tool-contracts-schemas/"
    },
    {
      "title": "Tools, memory & agent loop",
      "url": "https://semiaifoundry.com/learn/atlas/tool-loop/"
    }
  ],
  "recordHash": "6a0ce07f778302c111da9fd418ac35fcc5f2328ee2cd1606ab022ebf0774efa8",
  "contentFormat": "text/markdown",
  "content": "Models become evaluated applications · Atlas v1.3.0\n\n# Document fields become validated records\n\nDocument layout, transcription/extraction, schema normalization, confidence and cross-field constraints.\n\n[Explore in Atlas](https://semiaifoundry.com/ai-atlas/#document-extraction-validation)Logical state, task evidence and declared units; no physical assembly scale\n\nLearning objectiveDistinguish extraction, field typing, arithmetic consistency and source-correctness checks for document records.\n\n## The mechanism\n\nDocument understanding connects image or text representations to structured fields. An OCR pipeline can introduce transcription errors before a field extractor reasons about layout; an OCR-free model instead learns a route from document images to a structured output representation. Either route can produce plausible fields that are wrong. A schema checks names and types, while cross-field constraints check relationships such as quantities, unit prices and totals. Confidence and review thresholds decide how uncertain output is handled, but high confidence is not an independent truth label. Donut is a primary example of OCR-free document modeling. This lesson uses authored invoice fields to expose the validation boundary; it does not run Donut, an OCR engine or an actual extraction model.\n\n1.  The document and its version are preserved as the evidence from which fields are extracted.\n2.  The extractor returns named fields with explicit units and provenance rather than an unstructured assertion of success.\n3.  Schema and cross-field constraints detect inconsistent records before downstream actions.\n4.  Independent labeled documents evaluate field accuracy and review decisions, including mistakes that still pass arithmetic checks.\n\n## Science and assumptions\n\n### Document fields become validated records · explicit relationship\n\n$$\nT=\\sum_{i=1}^{n}q_i p_i\n$$\n\nThe exact subtotal in this fixture sums quantity times unit price across line items.\n\nSymbols and units\n\nT\n\nSubtotal excluding tax, discounts and fees\n\ninteger cents\n\nqᵢ\n\nQuantity for line item i\n\nunits\n\npᵢ\n\nUnit price for line item i\n\ncents per unit\n\nn\n\nNumber of line items\n\ncount\n\nAn authored invoice has two units at 1,250 cents and three units at 400 cents. The subtotal is 2×1,250 + 3×400 = 3,700 cents. A transcription that turns 1,250 into 12,500 creates a subtotal of 26,200 cents, inconsistent with a separately read total of 3,700. Arithmetic validation catches that case. If both the price and total are incorrectly changed consistently, the arithmetic can pass while the document is still misread, so source comparison remains necessary. Integer cents avoid introducing binary floating-point rounding into this exact fixture.\n\nAssumptions Synthetic invoice; nonnegative integer quantities and exact integer-cent prices. Tax, currency conversion, discounts and rounding policies are outside the example.\n\n## Engineering example\n\nAn authored invoice has two units at 1,250 cents and three units at 400 cents. The subtotal is 2×1,250 + 3×400 = 3,700 cents. A transcription that turns 1,250 into 12,500 creates a subtotal of 26,200 cents, inconsistent with a separately read total of 3,700. Arithmetic validation catches that case. If both the price and total are incorrectly changed consistently, the arithmetic can pass while the document is still misread, so source comparison remains necessary. Integer cents avoid introducing binary floating-point rounding into this exact fixture.\n\n## Distinctions and tradeoffs\n\nA schema-valid and arithmetically consistent record can still misrepresent its source document.\n\nAutomatic validation can reduce review load while still missing mutually consistent errors or unusual document conventions.\n\nDocuments often trigger external actions, making extraction evidence and validation as important as fluent interpretation.\n\n## Specifications and interfaces\n\nMechanism boundary\n\nWhy can accurate-looking text still create a wrong record?\n\nSynthetic invoice; nonnegative integer quantities and exact integer-cent prices. Tax, currency conversion, discounts and rounding policies are outside the example.\n\nEvidence type\n\nAuthored worked example\n\nWorked explanation with a bounded numeric or state example. This lesson does not claim an executing implementation of an external model or platform.\n\n### Interfaces\n\nDeclared input and state Input\n\nThe document and its version are preserved as the evidence from which fields are extracted.\n\nChecked outcome Output\n\nDistinguish extraction, field typing, arithmetic consistency and source-correctness checks for document records.\n\n## Check your understanding\n\n### An extractor changes both a price and total consistently but disagrees with the image. Is arithmetic validation sufficient?\n\n1.  Yes, totals prove the text is correct\n2.  No, independent source/field comparison is still needed\n3.  Yes, if confidence exceeds a threshold\n\nAnswer and reasoning\n\nNo, independent source/field comparison is still needed\n\nConsistency constrains relationships between fields; it does not prove that those fields were read correctly.\n\n## Evidence and scope\n\nThis is a worked explanation, not an executing external platform, model or robot. The quantities and fixtures are authored. Source scope is recorded in the automation learning review manifest; no source benchmark or private system behavior is claimed. Synthetic invoice; nonnegative integer quantities and exact integer-cent prices. Tax, currency conversion, discounts and rounding policies are outside the example.\n\nThe worked example explains this mechanism. General numerical labs are a reference; they do not execute this lesson’s full mechanism.\n\n## Sources\n\n-   [OCR-free Document Understanding Transformer](https://arxiv.org/abs/2111.15664v5)\n\n[Published lesson data](https://semiaifoundry.com/ai-atlas/lesson-data/document-extraction-validation-b08a723accbd1c21.json) · [Atlas releases and licensing](https://semiaifoundry.com/ai-atlas/licenses.html)\n\n## Continue exploring\n\n### Foundations\n\n-   [Evaluation & the AGI frontier](https://semiaifoundry.com/learn/atlas/evaluation/)\n-   [Tool schemas and semantic validation](https://semiaifoundry.com/learn/atlas/tool-contracts-schemas/)\n\n### Related lessons\n\n-   [Tools, memory & agent loop](https://semiaifoundry.com/learn/atlas/tool-loop/)"
}
