Practical technical guides / AI engineering: evaluation

Score Document Extraction for Invented Values: Blank-Field Probes and Per-Field Acceptance

Accuracy on present values hides extractors that fill blanks. Plant blank-field probes, count invented values separately and accept each field on both rates.

By Sandeep Belgavi · Published 2026-11-28

Accuracy on present values hides extractors that fill blanks. Plant blank-field probes, count invented values separately and accept each field on both rates.

The extractor that never says it does not know

Field extraction is one of the most common production uses of language models: read a form, an email or a scanned document and return structured fields. The usual evaluation compares predicted values with gold values on a labelled set and reports accuracy, per field or overall. That number answers one question well, "when the value is on the page, does the model read it correctly?", and almost ignores another: "when the value is not on the page, does the model leave the field empty?"

Models are good at producing plausible values. A missing quantity becomes 1. A missing return reason becomes the most common reason. A missing phone number becomes something that looks like a phone number, sometimes assembled from digits elsewhere on the page. Every one of those is worse than an empty field, because downstream code treats it as fact.

The fix is an evaluation design, not a model change: plant blank fields deliberately, count what the model does with them separately from what it does with present values, and accept or reject each field on both numbers.

Five outcomes, not two

For each document and each field, compare the normalised gold value with the prediction. There are five outcomes, and they need to stay separate:

  • correct: gold present, prediction matches;
  • wrong: gold present, prediction differs;
  • missed: gold present, prediction empty;
  • abstained: gold absent, prediction empty, which is the right behaviour;
  • invented: gold absent, prediction present, which is the failure that accuracy hides.

From these, two rates per field matter: accuracy on present values, and the invention rate on blank values. A flat accuracy that counts "abstained" as correct and "invented" as wrong mixes them, and because most fields are usually present, the blanks barely move it.

Question answering went through the same lesson. SQuAD 2.0 (Rajpurkar, Jia and Liang, 2018) added over 50,000 unanswerable questions to the original dataset precisely because systems could score well while guessing an answer to everything. Extraction is the same problem with a schema.

Blank-field probes

Natural data rarely contains enough blanks, and the blanks it does contain cluster in a few optional fields. A quantity or an order number is almost never missing in real forms, so an evaluation set drawn from real forms never tests what the model does when one is.

A blank-field probe is a copy of a labelled document with one field's text removed, and that field's gold value set to absent. Probes are cheap to generate from data you already have, and they give every field a measured invention rate. Remove the field's label and value together, so the model is not simply reading an empty label; if your documents have layouts where an empty box is common, add probes of that form too.

A worked example

The companion example extraction_blank_field_probes generates 40 synthetic order forms for Belgavi's Book Store, each with an order id, ISBN, quantity, return reason and, sometimes, a gift note and a phone number. For 32 of them it adds a probe with one field removed, cycling through the fields. Two stand-in extractors replace a model so the arithmetic is reproducible: a careful one that reads only what is on the page, and an eager one that fills a missing quantity with 1, a missing reason with the most common reason, and a missing phone with digits from the order id.

On the 40 original documents alone, the eager extractor scores 95.8% flat accuracy. Its only visible problem is the phone field, which is naturally blank on 10 forms and which it fills every time. Quantity and return reason are never blank in the originals, so the evaluation has no evidence either way about them.

With the probes added, the picture changes:

FieldAccuracy on present valuesBlank casesInventedAccepted
order_id100%70yes
isbn100%70yes
quantity100%77no
return_reason100%77no
gift_message100%580yes
phone100%2020no

Accuracy on present values is perfect for every field, and flat accuracy is still 92.1%. Three fields fail, and only the probes reveal two of them. The careful extractor passes every field with the same accuracy and no inventions.

The scoring loop is short:

for d in docs:
    pred = extract(d)
    for f in FIELDS:
        g, p = norm(d['gold'][f]), norm(pred.get(f))
        if g is None:
            counts[f]['abstained' if p is None else 'invented'] += 1
        elif p is None:
            counts[f]['missed'] += 1
        else:
            counts[f]['correct' if p == g else 'wrong'] += 1

Acceptance thresholds per field

Fields differ in what an invention costs. An invented order id or phone number can send a refund or a message to the wrong person, so the example allows zero. An invented gift note is embarrassing but cheap. Set two thresholds per field, a minimum accuracy on present values and a maximum invention rate on blanks, and require a minimum number of blank cases before a field can be accepted at all. The example refuses to accept a field with no blank cases, because a zero invention rate measured on zero blanks is not evidence.

Report the thresholds next to the counts. A single summary score invites people to trade a field that invents values against one that reads well, and that trade is rarely what the business wants.

How many probes are enough

A field that produced no inventions on seven probes has not been shown to be safe. When an event has not occurred in n independent trials, the rule of three gives an approximate 95% upper bound of 3/n on its rate. Zero inventions in 7 probes is consistent with a true invention rate as high as about 43%. Zero in 100 bounds it near 3%, and zero in 300 near 1%.

That arithmetic sets the probe budget. For a field whose threshold is zero inventions, such as an order id or a phone number, plan for a few hundred probes before calling the result evidence. For a field that tolerates a few percent, a hundred is often enough. The example's 7 probes per field are sized to make the counts readable, not to certify anything.

Probes also age. When the document templates change, a probe built from last year's layout may no longer resemble what the model sees. Regenerate probes from a recent sample of real documents each quarter, and keep the old set as a regression check.

Making the model abstain, and checking it did

Evaluation finds the problem; the extraction contract has to allow the right answer. Make every optional field nullable in the output schema and say in the instructions that absent information must be returned as null, not inferred. Where a value can be legitimately derived, such as a total computed from line items, make that a separate derived field computed by code, so the extracted field stays a reading of the page.

Then re-run the probes. Instructions reduce invention but rarely remove it, and a model upgrade can change the rate in either direction. Keep the probe set fixed and versioned so results are comparable across models and prompts.

Failure modes in the evaluation itself

  • Normalisation that hides errors. Stripping spaces and dashes is fine for phone numbers and ISBNs; lowercasing a case-sensitive code is not. Normalise per field.
  • Probes that leak. If the removed value appears elsewhere in the document, such as a phone number in a signature, the field is not really blank. Remove every occurrence or exclude the probe.
  • Gold that is wrong. Labelled sets contain blanks that are actually present in an attachment or a second page. Review invented values by hand before blaming the model.
  • Imbalanced probes. Cycling through fields gives each the same number of probes; weighting by real-world blank frequency instead hides the rare fields again.

At Belgavi's Book Store, Tanishka keeps 300 probes in the extraction regression suite and blocks any model or prompt change that raises the phone or order-id invention rate above zero.

Verification checklist

  • Generate at least one probe per field per document type, with the field's label and value removed.
  • Report correct, wrong, missed, abstained and invented counts per field.
  • Set per-field thresholds and a minimum number of blank cases for acceptance.
  • Review a sample of invented values by hand to confirm the gold is truly blank.
  • Re-run the probe set on every model, prompt or schema change and compare per field.

Primary references and authorship

Original explanation and synthetic examples by Sandeep Belgavi. Time-sensitive sources are limited to material dated on or before 2026-11-28. Companion code: Sandeep-BA/agent-decision-lab/examples/python/extraction_blank_field_probes. Views are my own and do not represent any employer, past or present.