Isaac Flath walks Hamel Husain through a PDF pipeline that spends more on hard pages and shows exactly what each extra pass fixed.
Start with the cheapest useful pass
- Read text already stored in the PDF before asking a model to read an image. A typed lease can be cheap to process while its handwritten signature and pet-fee forms need more work.
- Flath uses LiteParse in a text-layer-first pass. Cheap signals such as sparse text, embedded images and likely tables help his routing code decide which whole pages go to Docling.
- When Docling merges two numbers into one cell, a quick check can flag the table. Crop that region and send it to Qwen. The crop worked better in the demo, but Qwen still placed two values under the wrong year.
Count mistakes in both directions
- Stopping too soon: Docling got the text from an invoice but read the blocks in the wrong order. The service address was separated from its label. Checks for missing tables or characters missed the problem.
- Escalating too readily: A sparse page triggered Docling even though the cheap pass had already recovered everything the product needed. Better line breaks cost an extra pass.
- Set the bar for the job. A dropped page number may be minor. A blank allergy field means the answer is unknown; changing it to “no allergies” adds a claim the document never made.
Trace the wrong answer back to the page
- Flath follows a wrong census answer through the tool output to the cited part of the page. The agent found the right paragraph and repeated a citation that OCR had misread. His document-evaluation write-up shows the same debugging workflow on other examples.
- Inspect the original, the extracted text and the highlighted source region together. Use a model to suggest annotations if helpful, then verify them against the page.
- Start with rules based on real errors. At scale, run two tiers on the same sample and use cheap page statistics to predict the extra quality and time each escalation would buy. Flath presents this as a design, with illustrative savings rather than a measured all-document cost reduction.
Error analysis is how you become a domain expert. — Isaac Flath, 18:21