Design a router that sends easy requests to a cheap model and hard ones to an expensive model. How do you train and evaluate it?
Answer
Model answer, written in a candidate's voice
In short
- Define the objective as a quality-versus-cost trade-off, not a single accuracy number.
- Compare options: rules, feature-based classifier, cascade with verifier/confidence, judge-based escalation.
- Build labels by sampling live traffic, running both models, and judging whether the cheap model suffices.
- Evaluate a quality-cost curve across thresholds, with asymmetric error costs and cascade latency.
- Monitor drift and set per-segment thresholds rather than one global cutoff.
In full
I would treat this as a routing problem with an explicit objective: maximize task quality subject to a cost and latency budget, not maximize classifier accuracy. The main options are simple rules (e.g., length, task type, required tools), a classifier on request features that predicts whether the cheap model is enough, a cascade where the cheap model answers first and a verifier or confidence score decides whether to escalate, and judge-based escalation where a judge scores the cheap answer and routes it to the expensive model when it looks weak. To train it, I would sample real traffic, run both models on that sample, and have humans or a rubric-based judge label whether the cheap model is sufficient, while recording cost, latency, and quality for each example. Evaluation should plot the quality-cost curve across thresholds, because the errors are asymmetric: sending a hard request to the cheap model risks a bad answer, while sending an easy request to the expensive model wastes money, and the cascade also adds verifier or judge latency that must be budgeted. Finally, I would monitor drift in request mix, cheap-model sufficiency rate, escalation rate, and quality, and set per-segment thresholds by task type, length, language, or user tier rather than one global cutoff, retraining or recalibrating when the curve moves.
What a strong answer covers
- Options: rules, classifier on request features, cascade with verifier/confidence, judge-based escalation
- Labels by running both models on sampled traffic and judging where the cheap model suffices
- Quality–cost curve across thresholds; asymmetric error costs; cascade latency
- Drift monitoring; per-segment thresholds
Common mistakes
- Trusting uncalibrated self-reported confidence
- ignoring cascade latency