A vendor demo reads 100 scanned loan documents. The team reports the result as evidence that the system can handle new lenders. But 80 of those documents were made from a single statement template the team used to tune its prompts. The other 20 are photocopies of cases it already reviewed. The test may show that the system handles some poor scans. It does not show that it handles a new lender’s layout.
This is a split problem, not a scoring problem. Before you measure field accuracy, decide what must be unfamiliar at test time. Then keep whole groups of related files out of the development set. The same rule applies whether you train a model, write extraction rules, tune prompts, choose confidence thresholds, or hand examples to a vendor.
Split according to the claim you want to make
Start with the release decision. Different claims require different holdouts:
- New records on familiar forms. Keep the borrower, claim, patient encounter or other relevant business case together. You can use the same template on both sides if the claim explicitly assumes familiar layouts. Do not put the front of an ID in development and the back, a crop or a rescanned copy of the same ID in the test.
- New layouts or document sources. Hold out the template family, issuer or source that represents what is genuinely new. Changing a logo, font or background does not make a new family if the positions and meaning of the fields are effectively the same. If the promise is about new issuers, holding out individual templates from issuers already used for tuning may not be sufficient.
- New conditions on a familiar document population. Compare readable and degraded versions of the same records inside a held-out set. Then you can ask how much a fax, fold or shadow changes results without also changing the underlying field values. Use a separate unseen-layout slice if that is also a launch requirement.
- Future intake. Where dates and authorized samples are available, reserve a later intake window. Check whether a case spans the cutoff. Keep linked items on one side or exclude crossing cases from the comparison and disclose what you excluded. A temporal split is not automatically a new-template test.
Grouped cross-validation is one implementation of non-overlapping groups. The software will not tell you whether your groups match the business claim. The WILDS research benchmark illustrates the broader reason for testing on deliberately different sources or periods: a system can perform differently when the deployment population changes. Neither source supplies a universal split ratio for document AI.
Assign the group before you render or transform
For an illustrative mortgage intake benchmark, a case contains a fictional application, income evidence and an account statement. Those original files and their transformed copies belong together. A cropped page from a bank statement still belongs to its parent case; a re-rendered application with new fictional names can be a new case but an instance of the same template family.
Record both relationships. Your test manifest can carry a case ID, source or template-family ID, parent artifact ID, variant condition, split, and the version of the reference labels. Use references your team can recognize without putting customer identifiers in the manifest. If a holdout must exclude both familiar cases and familiar templates, check both for overlap. Grouping on the combined case-and-template label alone can miss the same case or template recurring in a different pair. Where the shared relationships make a clean split impossible, reserve entire linked groups or build separate evaluations for the two claims.
Start the overlap check with exact file hashes. Then reconcile related files using parent IDs and known generation or preprocessing history. Two different hashes do not mean two independent examples: exporting a PDF again, rasterizing it, or changing its compression can produce different files from identical content. If provenance is incomplete, check plausible near-duplicates within the approved environment. Report remaining uncertainty rather than declaring the set clean.
Count cases, families and files separately
Suppose a test contains 120 PDFs: six scan variants for each of 20 fictional cases, made from four held-out template families. Say all three numbers. The files tell you how many processing attempts you ran. The cases tell you how many distinct records you saw. The families tell you how broad the layout test was. Do not present 120 variant results as if they came from 120 independent cases or issuers.
Show field-level results separately for familiar layouts and held-out layouts. Include the condition that matters: for example, correct statement-period dates on original renders versus low-resolution copies, with the planned denominator and the number of files the system failed to process. Keep single-family results visible even when the overall result looks good. A large easy family can otherwise conceal a smaller one that fails.
If testing reveals that an unseen layout needs a new extraction rule, fix it. But an example the team has repeatedly inspected now belongs in the regression suite, not the next blind acceptance test. Freeze a fresh holdout for the next generalization claim. Make sure any vendor comparison holds preparation time, permitted examples and scoring rules constant, and report whether either vendor had prior exposure to the fixtures when known.
Put one release decision on paper
Pick a document workflow and finish this sentence before assembling fixtures: “We will ship if this configuration handles ___ that the team did not use to tune it.” Name the group you will hold out, keep descendants together, and run an overlap check. Decide which error types can block release before the first run. Where you have only a few suitable cases or families, call it a targeted failure-mode test rather than a production accuracy estimate.
Start with matched fictional examples from the GritWorks free dataset library to see what changes when input quality changes. Keep each matched set together. If the release decision is about unseen layouts or issuers, build a separate holdout that represents those layouts. GritRender can generate controlled variants and known reference values; the test owner still has to decide which templates and cases must stay out of tuning.
The useful question at the end is not “How many PDFs did we run?” It is “What was genuinely new to the system, and what did it do when it encountered it?”



