typed fields to drag out of a stack of actual paperwork: quantities, dates, protection limits, one structured worth per discipline. The default reflex is to ship each discipline to a GPT-4-class hosted API. It really works, and the invoice is the most important line within the pipeline’s operating price. Most of these fields are plain lookups a a lot smaller mannequin handles high quality, and you might be paying flagship costs for all of them.
The plain response is to swap in a small mannequin and pocket the financial savings. Performed blindly, it backfires. A mannequin too weak for the job returns damaged typed output, or fumbles a metamorphosis, and if no person checks, the flawed worth ships. So the reply shouldn’t be “use the large mannequin” and it’s not “use the small mannequin”. It’s to select the mannequin the best way the sooner bricks select a way: by standards, then confirm, and escalate solely when the verification fails.
This text is a companion to Enterprise Doc Intelligence, the sequence whose philosophy is specified by Amplify the Skilled, the sequence that builds enterprise RAG from 4 bricks: doc parsing, query parsing, retrieval, era. It develops one determination contained in the era brick: which mannequin runs the decision, and what occurs when a budget one shouldn’t be adequate? It leans on Article 6C (dispatch), which already reads a advised mannequin tier off the parsed query, Article 8C (validation), the sign that triggers an escalation, and Article 10 (adaptive parsing), the identical start-cheap-escalate-on-demand form utilized to the parser.
All the things under is backed by an actual benchmark: a field-extraction process of some hundred typed fields throughout dozens of paperwork, plus a targeted sweep of twenty native fashions towards one hosted flagship, all at temperature 0 with JSON output. The numbers are mixture. No doc, discipline label, or determine from that benchmark seems right here.

📓 The runnable pocket book for this text is on GitHub: doc-intel/notebooks-vol1. It runs the identical discipline by way of the cascade, prints the per-field price and the validation verdict at every rung, and reveals the escalation firing solely on the fields a budget native mannequin will get flawed.
1. Two angles: price, and the loop
There are two causes to care about mannequin choice, they usually reinforce one another.
The price angle is direct. Flagship fashions price an order of magnitude extra per name than a small native one. On an extraction job with 1000’s of field-level calls, or a corpus assistant answering 1000’s of questions a day, the mannequin invoice dominates the operating price. Most of these calls don’t want a flagship. Routing the easy ones to a less expensive mannequin is cash left on the desk till you do it.
The loop angle is about correctness below that constraint. You can not minimize price by guessing {that a} small mannequin will cope. You begin with a mannequin, verify whether or not its reply holds, and escalate to a stronger one solely when the verify fails. The loop is what makes the price saving protected: a budget mannequin is the default try, not a bet, as a result of a failed try is caught and retried on a much bigger mannequin relatively than shipped.
Price pushes you down the mannequin ladder. The loop stops you from falling off it. This cheap-first, escalate-on-failure form has a reputation within the literature: an LLM cascade.
2. What the numbers say
The design in Part 3 rests on two measured info. Take them first, as a result of they’re the rationale the cascade is formed the best way it’s.
2.1 The sweep: larger shouldn’t be higher
Have a look at what twenty native fashions did on the uncooked one-shot process: learn the retrieved snippet, return the typed worth. Similar immediate, similar fields, temperature 0.

Three conclusions come straight off that chart, and every one shapes the design.
Larger shouldn’t be higher. A 4B mannequin (qwen3:4b) and a 7B (mistral:7b) high the native discipline. A 12B and a 14B (gemma3:12b, phi4:14b) sit under them. Two fashions from the identical household, one twice the dimensions of the opposite, tie. Parameter depend is a poor predictor. The mannequin household and the way it was educated matter extra. That is precisely why the loop should not climb a blind dimension ladder: the subsequent rung up is commonly not the subsequent dimension up.
There’s a flooring. The sub-2B fashions fall off a cliff (qwen2.5:1.5b at 12%, llama3.2:1b at 6%), and a 0.5B mannequin we tried returned empty JSON on most fields: not a flawed reply, no reply in any respect. Beginning there burns a loop iteration on a rung that was by no means going to carry. Standards exist to begin above the ground, not at it.
Price shouldn’t be pace. The hosted flagship answered in about 1.4 seconds per discipline, sooner than most native 7B-to-14B fashions (roughly 2.6 to 7.6 seconds every on a single client GPU). The small-local play buys a decrease invoice and paperwork that by no means depart the machine. It doesn’t purchase latency. If pace is the constraint, a budget native mannequin is commonly the flawed default, and that belongs within the dispatcher’s standards.
Yet another sobering quantity. The most effective small native mannequin, run by itself on the uncooked process, received roughly a 3rd of the fields proper. Quick (just a few seconds a discipline) and never adequate to ship. A small native mannequin is viable solely when the loop backs it: a decent retrieval snippet, the proper immediate content material, validation on each discipline, and code doing the laborious formatting. The following three sections are that backing.
2.2 The largest lever is immediate content material, not mannequin dimension
Earlier than spending a much bigger mannequin, spend the immediate. The one largest bounce in the entire benchmark didn’t come from extra parameters. It got here from placing the duty’s enterprise vocabulary, the glossary the fields assume, into the immediate.

Each fashions bounce. The small native mannequin goes from 38% to 62% appropriate. The flagship goes from 62% to 100%. The flagship shouldn’t be magic with out the glossary both. It wanted the definitions to complete the job.
The concrete failure this fixes is vocabulary the mannequin doesn’t share with the doc. A discipline labelled deductible per declare in a single doc is retention in one other and a naked quantity in a 3rd; a premium is named one factor by one insurer and one other factor by the subsequent. A small mannequin proven the uncooked snippet guesses. Hand it the definition of the sector it’s filling, the synonyms, the items, and the guess turns right into a learn. This is identical brick-2 vocabulary that lifts retrieval, reused at era time, and it’s cheaper than any mannequin improve as a result of it helps each rung without delay.
3. The cascade: standards, loop, and splitting
Right here is the mechanism the 2 info level to. Decide a beginning rung by standards, validate its output and escalate solely on failure, and cut up the duty as a substitute of escalating when the failure is a tough transformation. Three strikes, in that order.
3.1 Decide the beginning mannequin by standards
The beginning mannequin shouldn’t be the smallest one you’ve gotten. Three standards set a wise flooring, so the loop begins on the proper rung relatively than the underside.
Confidentiality. A confidential doc can’t be despatched to a hosted API in any respect. That forces a neighborhood mannequin no matter what could be least expensive or strongest within the cloud, and the beginning alternative turns into the perfect native mannequin that matches the machine. (Detecting and labelling a doc as confidential is a later-volume concern; this text assumes the label arrives as enter.)
Typed-output reliability. The sequence reply is all the time a typed object. The extraction contract from the benchmark is small and strict: a pure quantity, its foreign money, the precision qualifier stored separate, and a boolean for whether or not the sector was there in any respect.
class ExtractedValue(BaseModel):
worth: float | None
foreign money: str | None
precision: str | None
discovered: bool
Sturdy fashions emit that cleanly. Weaker and smaller ones emit it much less reliably, dropping the foreign money, folding "per occasion" into the quantity, or inventing a worth when they need to have set discovered=False. So a small beginning mannequin is viable solely when paired with validation: you don’t belief its typed output, you verify it (Article 8C) and let the failure drive the escalation.
Transformation complexity. Some jobs disguise a tough one-shot transformation that journeys small fashions even when retrieval was excellent. That’s the third criterion, and it has its personal repair in §3.3.
The dispatcher that reads these three is small.
class GenerationPlan(BaseModel):
mannequin: str
needs_validation: bool
needs_step_split: bool
max_escalations: int = 2
def plan_generation(doc, form):
if doc.confidential:
return local_plan(form)
return tier_plan(form)
local_plan pins the perfect native mannequin and units needs_validation=True, as a result of a small mannequin’s typed output all the time will get checked. tier_plan begins from Article 6C’s advised tier and solely asks for validation when that tier is small. Each learn needs_step_split off the reply form, the third criterion, developed in §3.3.
3.2 Validate, then escalate solely on failure
With a beginning mannequin chosen, era turns into a brief bounded loop, not a single name.
def generate_with_escalation(query, context, plan, ladder):
for mannequin in ladder.from_(plan.mannequin, up_to=plan.max_escalations):
reply = generate(query, context, mannequin=mannequin)
if validate(reply, context): # Article 8C
return reply
return NotAnswered()
Run the chosen mannequin. Validate the end result with the checks from Article 8C: is the typed form appropriate, do the cited spans exist, does the quoted textual content really seem within the supply. If validation passes, ship, and a budget mannequin simply did a flagship’s job for a fraction of the price. If it fails, escalate: rerun the identical discipline on the subsequent mannequin up, and validate once more. The loop is bounded, so a pathological discipline can not spin without end; it escalates to the strongest mannequin and, if even that fails, returns a typed not answered relatively than a flawed worth.
That is the generation-side echo of Article 10. There, a web page begins on a budget parser and solely escalates to a heavier one when an affordable verify says the parse shouldn’t be adequate. Right here, a discipline begins on a budget mannequin and solely escalates when validation says the reply shouldn’t be adequate. Similar loop-engineering form: pay for the costly device solely on the instances that want it, and let a deterministic verify, not a guess, resolve which instances these are.
3.3 Cut up the duty, and the confidentiality price you measure
Escalating to a much bigger mannequin shouldn’t be the one repair for a failing one, and it’s not all the time the proper one. Some failures are a advanced transformation, not a weak mannequin, and the remedy is to decompose the step relatively than pay for extra capability.
The labored instance is a financial quantity in a clear numeric format. Proven 3M, a small mannequin could not reliably return 3000000, a 3 adopted by six zeros; it stumbles on doing the popularity and the scaling in a single shot. An even bigger mannequin papers over it, however so does splitting the transformation: let the mannequin solely level on the supply line, and let deterministic code flip 3M into 3000000. Every half is straightforward. The mannequin reads, the code computes, and the laborious formatting by no means depends upon mannequin capability in any respect.
That cut up has a second payoff: the uncooked doc can keep fully native. The mannequin picks a line, code codecs it, and solely nameless fragments are ever eligible to depart for a hosted formatter downstream. However the cut up shouldn’t be a free lunch, and the benchmark is blunt about it. Working the fully-local “mannequin factors, code codecs” structure lowered accuracy on the identical fields in contrast with letting a succesful mannequin extract and format in a single shot. The reason being easy: pointing on the proper line is itself laborious, and a flawed line dooms the sector earlier than the code ever runs.
So the cut up is an actual device with an actual price. Attain for it when the failure is a tough transformation the mannequin retains lacking, or when confidentiality forces the doc to remain native. Measure the accuracy you commerce for it. Don’t assume decomposition is all the time a win; on a process the place a succesful mannequin can extract and format cleanly in a single cross, one cross wins.
The loop subsequently has two escape hatches when validation fails, not one: escalate the mannequin, or cut up the duty into steps the present mannequin can deal with. The dispatcher’s needs_step_split flag information which one this discipline will get.
4. Reconciling with question-side dispatch and validation
This choice shouldn’t be a brand new thought bolted on. It closes a loop the sequence already opened.
Article 6C (dispatch) reads a advised mannequin tier off the parsed query: a easy factual lookup and a multi-hop synthesis carry totally different tiers earlier than era ever runs. That’s the question-side sign. This text provides the document-and-answer-side sign (confidentiality, typed-output reliability, transformation complexity) and, crucially, the suggestions: 6C proposes a beginning tier, era runs it, and Article 8C’s validation confirms the tier was sufficient or triggers the escalation. The three match collectively: 6C suggests, era makes an attempt, 8C judges, the loop escalates.
5. Conclusion
Mannequin alternative is a brick determination, not a continuing. A budget mannequin is the proper default when a criteria-driven dispatcher picks a wise beginning rung, validation guards the output, and a bounded loop escalates solely the instances that fail, splitting the duty as a substitute when the failure is a tough transformation relatively than a weak mannequin. The sweep is the rationale to belief the form and to mistrust the shortcuts: dimension doesn’t order accuracy, a small native mannequin by itself will get a 3rd of the fields, and the largest single lever is the vocabulary you set within the immediate, not the parameter depend you pay for. Price comes down as a result of most fields by no means depart a budget rung. Correctness holds as a result of those that want extra get it, on proof, not on a hunch.
6. Additional studying and sources
The sequence articles this cascade sits between, already printed:
On the model-cascade thought, the exterior anchors:
- Chen, Zaharia & Zou, FrugalGPT: How you can Use Massive Language Fashions Whereas Decreasing Price and Enhancing Efficiency (arXiv 2305.05176, 2023). The canonical cheap-to-expensive LLM cascade with a scorer between the rungs.
- Madaan et al., AutoMix: Routinely Mixing Language Fashions (arXiv 2310.12963, 2023). Self-verification on the small mannequin’s reply decides whether or not to route up: the identical verify-then-escalate loop this text builds.
- Ong et al., RouteLLM: Studying to Route LLMs with Choice Information (arXiv 2406.18665, 2024). A discovered router between a robust and a weak mannequin, the data-driven cousin of the standards dispatcher right here.















