Lesson 71.6 · 6 of 6 · 5 min read · Reviewed 24 Nov 2026
Model cascades: try small, escalate to large
By the end, you can
- Design a model cascade with a reliable escalation signal.
- Tune the escalation threshold on labelled data for cost, quality and latency.
Lesson 71.2 listed the cascadeModel routing: Sending each request to the cheapest model that can handle it well, often using a classifier. as one routingRouting: A workflow pattern that classifies an input and sends it to a specialised prompt, model or handler. strategy and showed when its cost breaks even. This lesson is about building one that keeps quality: the part that decides when to escalateEscalation: Handing a case from an agent to a person, with the context needed to continue..
The shape
request --> small model --> check --> pass --> ship the small answer
\-> fail --> large model --> ship
You can add more rungs (small, medium, large), but each rung adds a check, a call and some latencyLatency: The time from sending a request until you get the response, or until the first token arrives when streaming.. Two rungs is the usual start.
The escalation signal
The check decides everything. If it lets bad answers through, quality drops. If it fails good answers, you pay for both models on most requests.
| Signal | How reliable | Notes |
|---|---|---|
| Hard checks: schema valid, code compiles, tests pass, every claim cites a source | High, when they exist | Best for extraction, code and structured output |
| A separate scorer or grader | Good, if calibrated on labelled data | A small classifier or model that predicts “would a reviewer accept this?” |
| Agreement between samples | Moderate | Ask twice or three times; disagreement means uncertain. Costs extra calls |
| Token probabilities, where the API exposes them | Moderate | Not available from every provider |
| The model’s own “confidence: high” | Low | Models are often confidently wrong; treat as a weak hint only |
Tune the threshold on data
Take a labelled set of real requests where you know the right answer. Run the small model and the check on all of them, and record the check score. Then, for each possible threshold, count:
- Escalation rate: share sent to the large model (drives cost).
- False accepts: wrong small-model answers that passed the check (drives quality).
- False escalations: right small-model answers sent up anyway (wasted cost).
Worked example with illustrative credits: the small model costs 1 credit per request, the large one 10. Out of 1,000 tickets, the check passes 700.
cascade cost = 1,000 x 1 + 300 x 10 = 4,000 credits
always large = 1,000 x 10 = 10,000 credits
If 21 of the 700 accepted answers are wrong, the false-accept rate is 3%. If the large model alone gets 2% wrong, the cascade is slightly worse on quality and about 60% cheaper. Whether that trade is acceptable is a product decision, written down with the numbers.
Latency
The 300 escalated tickets wait for the small call, the check and then the large call. Chart p95 latency for the escalated slice separately. For a streamingStreaming: Receiving a response as a series of server-sent events while it is generated, instead of waiting for the whole reply. chat, a cascade can feel slow unless the check is fast; it suits background and agentAgent: A system where a model decides its own next steps, calling tools in a loop until the task is done. steps better than the first reply a person waits for.
When to use it
- Most traffic is easy, and you have a check that catches the hard cases.
- Wrong answers are detectable before they reach the user.
- You can afford extra latency on the escalated share.
Skip it when you have no trustworthy check, or when most requests escalate anyway (71.2 shows the break-even).
Common mistakes
- Trusting self-reported confidence as the only signal.
- Measuring only the escalation rate and never the false-accept rate.
- Tuning once. Input drift (67.4) changes the mix; re-check the threshold on fresh labelled data.
- Evaluating the cascade on average. Slice by task type; one category may slip through the check far more often.
Key points
- A cascade sends each request to a small model first and escalates to a larger one only when a check says the answer is not good enough.
- The escalation signal is the whole design: prefer checks you can verify (schema, tests, citations, a calibrated scorer) over the model saying it is confident.
- Tune the threshold on a labelled set and measure the false-accept rate: wrong answers the small model was allowed to ship.
- Escalated requests pay for both calls and wait for both, so count cost and latency together.
Tune a cascade threshold on labelled data
Choose an escalation threshold from labelled data by counting false accepts, cost and latency together.
You will have: A threshold table and a chosen threshold, with cost against always-large and the latency of the escalated slice.
Steps
- Run the starter: it picks the lowest threshold because it never counts wrong answers.
- Compute the false-accept rate: wrong small-model answers that passed the check.
- Count false escalations: right answers sent up anyway.
- Keep only thresholds within the 3% false-accept limit and pick the cheapest.
- Read the latency line and decide whether the escalated share can wait 4 seconds.
Done when
- The chosen threshold is 0.65.
- The cascade costs 3,550 credits against 10,000 for always large.
- The false-accept rate (2.6%) is recorded next to the large model's 2% error rate.
Open in the Playground No API key needed.
Starter code (Python)
# Tune a cascade's escalation threshold on a labelled set, counting cost, quality and latency together.
import random
SMALL, LARGE = 1, 10 # illustrative credits per request
LARGE_ERROR_RATE = 0.02 # the large model alone gets about 2% wrong
MAX_FALSE_ACCEPT = 0.03 # product decision: at most 3% wrong answers shipped by the small model
LAT_SMALL, LAT_CHECK, LAT_LARGE = 0.8, 0.2, 3.0 # seconds
rng = random.Random(7)
TICKETS = [] # (small model was right?, check score from a calibrated grader)
for _ in range(1000):
right = rng.random() < 0.8
score = min(1.0, max(0.0, rng.gauss(0.8, 0.12) if right else rng.gauss(0.45, 0.15)))
TICKETS.append((right, score))
def at_threshold(t):
accepted = [right for right, score in TICKETS if score >= t]
escalated = len(TICKETS) - len(accepted)
false_accept = 0.0 # TODO 1: share of accepted answers that were wrong
false_escalations = 0 # TODO 2: right small-model answers that were escalated anyway
cost = SMALL * len(TICKETS) + LARGE * escalated
return {"t": t, "escalation": escalated / len(TICKETS), "false_accept": false_accept,
"false_escalations": false_escalations, "cost": cost}
rows = [at_threshold(t / 100) for t in range(30, 95, 5)]
print("threshold escalate false-accept wasted-escalations credits")
for r in rows:
print(f" {r['t']:.2f} {r['escalation']:5.0%} {r['false_accept']:5.1%} {r['false_escalations']:4d} {r['cost']}")
ok = rows # TODO 3: keep only thresholds whose false-accept rate is within MAX_FALSE_ACCEPT
best = min(ok, key=lambda r: r["cost"])
always_large = LARGE * len(TICKETS)
print(f"chosen threshold: {best['t']:.2f}")
print(f"cascade {best['cost']} credits vs always large {always_large} ({1 - best['cost'] / always_large:.0%} cheaper)")
print(f"false accepts {best['false_accept']:.1%} vs large-only error {LARGE_ERROR_RATE:.0%}")
print(f"latency: accepted {LAT_SMALL + LAT_CHECK:.1f} s, escalated {LAT_SMALL + LAT_CHECK + LAT_LARGE:.1f} s "
f"for {best['escalation']:.0%} of tickets")
Show a solution
# Tune a cascade's escalation threshold on a labelled set, counting cost, quality and latency together.
import random
SMALL, LARGE = 1, 10 # illustrative credits per request
LARGE_ERROR_RATE = 0.02 # the large model alone gets about 2% wrong
MAX_FALSE_ACCEPT = 0.03 # product decision: at most 3% wrong answers shipped by the small model
LAT_SMALL, LAT_CHECK, LAT_LARGE = 0.8, 0.2, 3.0 # seconds
rng = random.Random(7)
TICKETS = [] # (small model was right?, check score from a calibrated grader)
for _ in range(1000):
right = rng.random() < 0.8
score = min(1.0, max(0.0, rng.gauss(0.8, 0.12) if right else rng.gauss(0.45, 0.15)))
TICKETS.append((right, score))
def at_threshold(t):
accepted = [right for right, score in TICKETS if score >= t]
escalated = len(TICKETS) - len(accepted)
false_accept = accepted.count(False) / len(accepted)
false_escalations = sum(1 for right, score in TICKETS if right and score < t)
cost = SMALL * len(TICKETS) + LARGE * escalated
return {"t": t, "escalation": escalated / len(TICKETS), "false_accept": false_accept,
"false_escalations": false_escalations, "cost": cost}
rows = [at_threshold(t / 100) for t in range(30, 95, 5)]
print("threshold escalate false-accept wasted-escalations credits")
for r in rows:
print(f" {r['t']:.2f} {r['escalation']:5.0%} {r['false_accept']:5.1%} {r['false_escalations']:4d} {r['cost']}")
ok = [r for r in rows if r["false_accept"] <= MAX_FALSE_ACCEPT]
best = min(ok, key=lambda r: r["cost"])
always_large = LARGE * len(TICKETS)
print(f"chosen threshold: {best['t']:.2f}")
print(f"cascade {best['cost']} credits vs always large {always_large} ({1 - best['cost'] / always_large:.0%} cheaper)")
print(f"false accepts {best['false_accept']:.1%} vs large-only error {LARGE_ERROR_RATE:.0%}")
print(f"latency: accepted {LAT_SMALL + LAT_CHECK:.1f} s, escalated {LAT_SMALL + LAT_CHECK + LAT_LARGE:.1f} s "
f"for {best['escalation']:.0%} of tickets")
Finished the chapter? Take the chapter check.