Your invoice extraction pilot works on a frontier VLM, but finance says the unit economics fail at the contracted volume of one million documents a month. Design the production system: cost structure, accuracy assurance, human review, and how you keep quality from drifting.
Route cheap model first, escalate on validation failure or low confidence, layer deterministic rules, size the review queue from error tolerance, and gate releases on a golden set plus production audits.
Imagine a busy mailroom sorting a million letters a month. Most letters are simple: the address is clear, the stamp is right, an intern handles them. A few letters are weird: handwriting smudged, foreign postage, unusual addressee. Those go to the senior sorter who is slow and expensive. The intern handles the river of normal mail, the senior sorter handles the exceptions, and a supervisor spot-checks both. The mailroom also keeps a binder of tricky old letters and tests every new sorter against it before letting them work alone. Run the same pattern with two model tiers, deterministic checks, a budgeted human queue, and a golden test set, and a million invoices a month becomes affordable.
Detailed answer & concept explanation~7 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
8 minutes: the portfolio framing, the four pillars, the routing lever, and how senior teams treat the review queue as a training-data source rather than a tax.
Real products, models, and research that use this idea.
- Ramp and Brex run AP automation at this scale by routing most invoices through smaller in-house extractors and reserving frontier models like Claude Sonnet 4.6 for unusual layouts
- Stripe Tax handles invoice and receipt extraction across hundreds of jurisdictions using a similar tiered approach, with deterministic rules around currency and VAT formats as the primary escalation signal
- Mindee and Klippa offer document AI APIs that explicitly expose a cheap default model and an upgrade tier, mirroring the routing pattern at the product level
- QuickBooks Online's AP feature uses Gemini 3.1 Pro on documents where the in-house OCR confidence is below threshold, fitting the escalate-on-tail pattern
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you decide when to fine-tune the cheap model versus when to keep relying on the frontier escalation path?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Sending every document to a frontier model because the pilot did, then watching unit cost stay constant while volume grows linearly, instead of routing the cheap model first and reserving the expensive one for the tail.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.