From spot fixes to measured gains: improving document extraction accuracy with ai_extract and MLflow Prompt Registry
A Databricks engineering post describes extracting roughly 40 structured fields from partner order documents across dozens of PDF layouts, where a schema fix that halved errors on the revision field raised total errors across all fields by 9%. The authors recommend putting field rules in schema descriptions, document-level logic in global instructions, precision mode (ai_extract 2.1) for complex structures, and citations to diagnose errors, while versioning prompts and schemas in MLflow Prompt Registry with aliases such as @prod and @candidate. They evaluate candidates against a frozen human-reviewed test set, tracking accuracy, coverage and run-to-run variation, and report that restructuring the prompt and schema plus precision mode cut overall errors by 32% and revision errors by 64%.