Validate the shape and meaning of an LLM extraction result before it enters a product catalogue.
Build the example
Use a synthetic label that says “length 25 cm, net mass unlisted.” Define a schema for value, unit and optional evidence, and require an explicit null for unknown mass. Validate the JSON against the schema, then normalize known units and run domain checks such as nonnegative dimensions. Retain the original excerpt.
Define one passing fixture as length 25 cm with exact source text and unknown mass. Define two failing fixtures that swap field names or omit evidence. Validate all three after updating a model or parser. The fixture set checks both the output schema and the consumer’s interpretation of the extracted values.
Three gates for extracted fields
Validate the shape and meaning of an LLM extraction result before it enters a product catalogue.
Example
- Schema
verify required fields and types
- Domain
check units and range
- Evidence
verify the excerpt supports the field
verify the excerpt supports the field
Watch the failure boundary
A good error report names the field and the rule that failed. Record the parse failure independently from failed evidence checks. This makes it possible to see whether a schema change improves formatting while leaving accuracy untouched. Keep a small fixture file of known malformed, unsupported and valid outputs for later model upgrades.
Verify the behavior
Try valid JSON that gives a length of -25 cm, or a model that assigns 25 cm to the width field. A well-formed answer can still fail the business rule or cite the wrong evidence. Route the result for correction and keep the valid length separate from fields that failed.
Sources
Technical references checked .



