ConceptsINTERNALS.md

Confidence routing

Let a cheap model decide when it is sure, and pass the rest to an expensive model or a person. How agents with a decision model save money.

  • Run the cheap model first. If its confidence reaches a threshold, accept its answer.
  • If not, hand the decision to a strong model, or ask a person.
  • The threshold sets the trade: a higher bar costs more and lets fewer mistakes through.
  • It only works when “sure” means something, which is what calibration checks.

Try this: drag the threshold from 50% to 99% and watch the orange dot slide along the line from always cheap to always strong.

Try it

This page needs JavaScript.

What just happened

  1. There are decisions. The cheap model costs 1 per decision. The strong model costs and is assumed to be right of the time. Used alone, the cheap model is right of the time at of the cost of always using the strong one.
  2. At a threshold of , the cheap model keeps the of decisions it is at least that sure of, and it is right of those. The remaining decisions go to the strong model.
  3. Overall the result is accurate at of the cost: about saved, for a small loss against the strong model alone. The cheap model still runs on every decision, which is why the cost never falls to zero.
  4. Raise the bar to 95% and the cheap model keeps only . Accuracy is and the cost . Each step along the line buys less accuracy for more money.
What is assumed

The cost ratio and the strong model’s accuracy are assumptions, and you can change the ratio above. The cheap model is the calibrated toy from the Calibration page, so what it says is how often it is right. Real strong models are not right at a flat rate: they fail more on the same hard cases the cheap model is unsure about, and a person who is asked has a cost and a delay of their own.

Where you meet it

Where it breaks

Everything above assumes the threshold means what it says. Switch the cheap model to Overconfident and leave the bar at 90%.

At the overconfident model keeps of the decisions. It says it is right of the time on those, and it is right . Overall accuracy is at of the cost. A calibrated model at the same bar keeps , gets and costs . The line is the same. The blue ring and the orange dot are two points on it, and the same threshold lands in different places. Fix the numbers by calibrating on your own decisions, then pick the bar from the accuracy you can measure.

Check yourself

You raise the bar from 90% to 95%. What happens to cost, to accuracy, and to the share the cheap model keeps?

The cheap model keeps fewer decisions, so more go to the strong model and cost rises. Accuracy rises a little, because the decisions that remain are the ones it is surest about. Here the share drops from 38% to 24% and the cost goes from 64.5% to 78.7%.

Why does an overconfident model hurt a routing scheme?

It admits decisions it is less sure of than it claims. The cost looks good, because fewer decisions reach the strong model, but the mistakes go up in exactly the place nobody is checking.

Why use a different bar for different actions?

The price of a mistake differs. Looking up the weather can run at a low bar. Deleting a file or changing a database should need a high one, with a person in the loop when the model is unsure.

Used in

Go deeper