用置信度阈值实现模型分级升级路由
Key Highlights
OpenRouter published a tutorial on letting a cheap model return a 0-to-1 confidence field through structured output, then escalating low-confidence requests to a stronger model. The core idea is to use the model's own sense of certainty as a routing switch, saving money without flying blind on quality for the hard cases that actually need a bigger brain.
What Happened
The method adds a confidence field to the cheap model's output. Every request first hits the small model, and if confidence falls below a threshold, the same task is sent to the large model to redo. Most simple requests stay on the cheap tier while only the uncertain ones spend real money, so the bill drops and quality holds instead of degrading across the board.
Technical Details
Confidence is a self-reported score, not a calibrated probability, so it cannot be used directly as accuracy. The right way is to set the threshold from the error-rate ranking on your own traffic: if below 0.3 the error rate is 40%, draw the line at 0.3. After launch, keep monitoring the score distribution, escalation rate, and the error rate of non-escalated answers.
Comparison with Competitors
Hard routing assigns models by task type, while confidence routing assigns by "is this specific request hard," which is finer. It complements hand-set rules: rules handle the broad categories, confidence handles the fuzzy boundary, reducing both wrong escalations and wrong retentions that waste either money or quality.
Industry Impact and Use Cases
High-volume, heterogeneous scenarios gain the most: support, content moderation, extraction. Auto-escalating the uncertain ones controls cost while catching quality, making it one of the highest-leverage moves in model routing for teams that cannot afford to over-provision every call.
Data and Methodology
The tutorial gives a general method, but the threshold must be calibrated on your real traffic. Different models mean different things by their self-reported confidence, so do not copy numbers across models; keep the error-rate curve updated, or drift will quietly invalidate the threshold you set months ago.
Risks and Limitations
The biggest trap is treating the self-reported score as a true probability and mis-setting the threshold, causing mass wrong escalations or missed catches. Guard against "saving at any cost" degrading quality, and use the error rate of non-escalated answers as a backstop monitor that triggers a rollback the moment it spikes.
Further Analysis
Put simply, confidence routing lets the small model say "I am not sure about this one" and hands the uncertain ones to the big class. It bases routing on the real difficulty of each request, cheaper than fixed rules. But you must calibrate the score on your own data; do not worship the model's self-report, it is honest but ungraded, like a student who admits doubt without knowing the exact chance of being wrong.
How to Deploy
Add a confidence field to the cheap model's output, set the threshold from the error-rate ranking on your traffic, and escalate to the large model below the line. After launch watch three things: the score distribution, the escalation rate, and the error rate of non-escalated answers. When error rate spikes, roll the threshold back instead of setting it once and walking away from the dashboard.
Common Pitfalls
Pitfall one is treating the self-reported score as a true probability and mis-setting the threshold so it wrongly escalates or misses. Pitfall two is pushing the line too low to save money and watching quality slide. Pitfall three is copying scores across models. The right move is calibrate on your own data, monitor on real error rates, and roll the threshold as your distribution drifts.
One-Line Conclusion
Put simply, confidence routing lets the small model say "I am not sure about this one" and hands uncertain requests to the big class. It assigns models by the real difficulty of each request, cheaper than fixed rules, but you must calibrate the score on your data and not worship a self-report that is honest yet ungraded.
Extended Observation
Confidence routing is the embryo of "model self-service": the system decides for itself how much to spend. Combined with batch routing and caching, it pushes the inference bill toward its floor. Future intermediaries will compete not on model coverage but on this cost intelligence that prices dynamically by difficulty, and that is exactly the lever small teams need to stay solvent while shipping real features.