Replace an LLM Router With a Fine-Tuned Classifier First: Savings and Latency Hinge on the Fallback Rate
A fine-tuned encoder trained on your router's own logged decisions, with the LLM kept as a fallback, is the first move. Whether it saves about $8,200 or $14,600 a month depends on one number that you have to measure.
Replace an $18,000-a-month LLM router first with a fine-tuned encoder classifier, such as RoBERTa, that is trained on the routing decisions your LLM has already logged. Keep the LLM as a fallback for requests where the classifier's calibrated confidence is low. If 10% of traffic still falls back, the monthly saving is about $13,500 after hosting and upkeep, and median routing latency drops from 1.5 seconds to tens of milliseconds. The p95 latency only falls below 1.5 seconds once fewer than about 10% of requests fall back.
The share of traffic that falls back is the number that decides everything else. No public study has measured it on real logged routing decisions, so the savings range below is arithmetic on stated assumptions until you replay your own logs.
A fine-tuned encoder matches or beats a prompted LLM when the route list is stable
The strongest recent evidence comes from a June 19, 2026 arXiv paper by Carson Rodrigues and Oysturn Vas. They compared a fine-tuned roberta-base, a TF-IDF plus logistic-regression baseline, a sentence-embedding nearest-neighbour classifier and Claude Haiku prompted zero-shot. They used two standard intent-detection datasets, ATIS and CLINC150, with full training sets.
On ATIS, which has a narrow and stable set of intents, RoBERTa scored 95.9% accuracy against 84.1% for Claude, a gap of 11.8 points. On CLINC150, which has 150 intents, the two were statistically tied at 89.1% and 88.5%. An earlier February 2026 arXiv study by Alberto Andres Valdes Gonzalez found the same pattern on general text classification. In that study, fine-tuned BERT-family encoders were competitive with zero- and few-shot LLM prompting, and often better, at one to two orders of magnitude lower cost and latency.
The latency gap is the reason that this matters for a router. The Rodrigues and Vas paper measured 1,000 calls of each system. RoBERTa ran locally at a median of 2.4 milliseconds. Claude Haiku through the API had a median of 981 milliseconds and a p95 of 1,787 milliseconds. The authors describe these figures as above "the 500 ms conversational bar."
An embedding semantic router is quicker to set up but gave up accuracy in the same tests
A semantic router embeds each request and picks the route whose example prompts are closest. It needs no training run. AWS's April 2025 post on multi-LLM routing describes it as faster than a classifier LLM and easier to extend, because a new route is added by adding reference prompts. In the AWS example, semantic classification took about 0.1 seconds, while the classifier LLM took about 0.53 to 0.59 seconds.
The accuracy cost is large in the one head-to-head test that is available. In the Rodrigues and Vas paper, cosine nearest-neighbour search over all-MiniLM-L6-v2 embeddings scored 86.2% on ATIS and 75.1% on CLINC150. That is roughly 10 and 14 points below fine-tuned RoBERTa on the same data. AWS also warns that accuracy depends on reference prompts that cover every task category.
The open-source semantic-router library from Aurelio Labs narrows this gap in one way. Its fit() method calibrates the router's scores on labelled queries, and its confidence_threshold setting makes the router return no route when no score clears the bar. That gives a semantic router the same fallback behaviour as a classifier. A semantic router is therefore a sensible stepping stone, but a trained encoder is the better first target if you have logs to train on.
Your router's own logs are the training data for the classifier
Every request that your LLM router has already handled is a labelled example: the input text and the route that the LLM chose. This removes the main cost of a fine-tuned classifier, which is hand labelling. The ATIS training set in the Rodrigues and Vas paper had 4,978 examples and CLINC150 had 15,250. A router that handles thousands of requests a day collects that many examples within days.
Training on the LLM's choices has one limit. The classifier learns to copy the LLM, including its mistakes. Agreement with the LLM is therefore the metric that you can measure cheaply, while downstream quality needs a separate check on a sample of outcomes.
Calibrated confidence decides which requests still go to the LLM
A cascade sends each request to the classifier first. If the classifier's confidence score for its top route is above a threshold, its route is used. If the score is below the threshold, the request goes to the LLM as it does today.
Raw neural-network scores are a poor basis for that threshold. Guo and colleagues showed in a 2017 ICML paper that modern neural networks are poorly calibrated. They found that temperature scaling, a one-parameter variant of Platt scaling, was effective at calibrating predictions on most datasets that they tested. After calibration, a score of 0.95 means that the classifier is right about 95% of the time at that score, so a threshold can be set from a target agreement rate.
RouteLLM, the open-source router framework from LMSYS, uses the same idea for a different problem. Its README recommends calibrating the threshold on a sample of incoming queries. It ships a calibrate_threshold command that picks the threshold for a target share of calls to the strong model.
Three threshold settings give a useful range to test on your logs:
- A conservative threshold accepts the classifier's route only where held-out agreement with the LLM is about 99%, which sends the most traffic to the fallback.
- A middle threshold accepts routes at about 97% agreement, which usually trades a small amount of agreement for a much lower fallback share.
- An aggressive threshold accepts routes at about 95% agreement, which gives the lowest fallback share and the largest saving.
These targets are design choices. The fallback share that each one produces on real routing traffic has not been measured in any published study.
The classifier loses on new routes, out-of-scope requests and noisy input
The same paper that favours RoBERTa on stable intents shows where it fails. These failures are the reason to keep the LLM in the loop.
- A classifier trained on one app's new label sets cannot handle another app's labels. RoBERTa trained on 75 intents scored 96.8% on them and 0% on a second set of 75, while Claude scored 94.3% and 93.9% with no retraining.
- The classifier missed more out-of-scope requests. On CLINC150, Claude caught 85.6% of out-of-scope inputs and RoBERTa caught 58.1%.
- Noisy speech input hurt a simple word-based classifier more than the LLM. At 0 dB of noise, Claude scored 92.5% against 80.0% for the TF-IDF classifier. RoBERTa was not tested on noisy speech.
The authors recommend a fast classifier with LLM fallback when confidence is low, and LLM-based out-of-scope routing on top of a fast classifier. Calibrated deferral does this. Requests that use a new route, fall outside every route or arrive garbled should get low confidence scores, so they reach the LLM. The replay should check that they do. Every time the route list changes, the classifier needs retraining before it can handle the new route.
The saving equals the LLM cost that you avoid minus hosting and upkeep
The monthly saving can be written as one line:
saving = current LLM cost × (1 − f) − hosting − upkeep
Here f is the fallback share. The worked example uses these assumptions, and each one can be replaced with your own figure:
- The current router costs $18,000 a month and has a median latency of 1.5 seconds.
- The encoder runs on two always-on NVIDIA T4 replicas on Hugging Face Inference Endpoints. At the listed $0.50 an hour, that is about $730 a month.
- Upkeep, meaning monitoring, retraining and evaluation, is assumed at 16 engineer hours a month at $120 an hour, or $1,920.
- The encoder adds 20 milliseconds to every request, including the requests that then fall back.
| Fallback share | LLM cost left | Total monthly cost | Monthly saving |
|---|---|---|---|
| 4% | $720 | $3,370 | $14,630 |
| 10% | $1,800 | $4,450 | $13,550 |
| 25% | $4,500 | $7,150 | $10,850 |
| 40% | $7,200 | $9,850 | $8,150 |
Upkeep is the largest fixed cost in this example. If your routes change often, retraining hours rise and the saving shrinks.
The p95 latency stays high until fewer than about 10% of requests fall back
Average latency improves almost in line with the fallback share. With the assumptions above, it is about 0.08 seconds at 4% fallback, 0.17 seconds at 10%, 0.40 seconds at 25% and 0.62 seconds at 40%. The median request takes about 20 milliseconds in every row, because most requests never reach the LLM.
The p95 behaves differently. When more than 5% of requests fall back, the slowest 5% of all requests are fallback requests. Each of those pays the classifier's time plus the full LLM time.
- At 4% fallback, the p95 request is served by the classifier, so p95 is about 20 milliseconds.
- At 10% fallback, p95 equals the LLM's median plus the classifier's time, which is about 1.52 seconds.
- At 25% or 40% fallback, p95 is a point in the LLM's slower tail, above 1.5 seconds.
Today's p95 is already higher than 1.5 seconds if 1.5 seconds is your median. If your router's tail has the same shape as Claude Haiku's in the Rodrigues and Vas paper, where p95 was 1.82 times the median, today's p95 is about 2.7 seconds. A cascade at 25% fallback therefore still lowers p95, but it does not bring it under 1.5 seconds. This reasoning assumes that fallback requests are as fast as typical LLM requests. Long or unusual requests are more likely to fall back, so real fallback requests may be slower.
Decision models are a third option that avoids training but adds a fee per call
A newer category of product, the decision model, takes a request and a list of allowed options and returns one option with a probability. It needs no training run, which helps when the route list changes often. TypeSafe lists its Jev model at $42 per billion input tokens on its home page, dated November 16, 2026. The semantic-router library can call Jev as a route selector.
Parsec, a small language model lab, sells a decision model called TOD. According to Parsec's TOD page, TOD ranks the next action from a list of allowed actions and passes the turn unchanged to the parent LLM when its confidence is low. The page lists a price of $0.30 per 1,000 decisions, separate from parent-model costs, and a p95 forward pass of 121 milliseconds on one H100, excluding provider look-ups. Its repository reports slower latency on an A100, and the same page shows TOD scoring below its own untrained base model on one public benchmark. Parsec says that it also tunes decision models on a customer's own decisions, but it publishes no price or deployment options for that work. None of these products has published a fallback rate on routing logs.
A replay on a sample of your logs measures the fallback rate before you commit
The replay uses data that you already have, and it needs no change to production.
- Export several weeks of routing logs with the request text, the LLM's route and the timestamp.
- Record how many routes exist, how often the route list changed in that period, and what share of requests the LLM sent to a catch-all or no-route option.
- Split the logs by time, training on the older weeks and holding out the most recent week. A time split shows how the classifier handles drift, which a random split hides.
- Fine-tune an encoder on the training weeks, then fit temperature scaling on a slice of held-out data.
- Score the held-out week and save the LLM's route, the predicted route and the calibrated confidence for each request.
- Run the short script below to get the fallback share, agreement and saving at each threshold.
- Check downstream quality on a sample of requests where the classifier and the LLM disagreed.
import csv
def replay(path, monthly_llm_cost, fixed_monthly_cost):
rows = list(csv.DictReader(open(path, newline="")))
for t in [0.50, 0.70, 0.80, 0.90, 0.95, 0.99]:
kept = [r for r in rows if float(r["confidence"]) >= t]
f = 1 - len(kept) / len(rows)
agree = sum(r["pred_route"] == r["llm_route"] for r in kept) / max(len(kept), 1)
saving = monthly_llm_cost * (1 - f) - fixed_monthly_cost
print(f"t={t:.2f} fallback={f:.1%} agreement={agree:.1%} saving=${saving:,.0f}")
replay("heldout_predictions.csv", 18000, 2650)
The 2650 value is the hosting and upkeep total from the worked example. Pick the lowest fallback share whose agreement meets your quality bar, and read the saving from the same line.
Sources
- Rodrigues and Vas, When Do LLMs Replace Fine-Tuned NLU? (arXiv 2608.20371): https://arxiv.org/abs/2608.20371
- Rodrigues and Vas, full text: https://arxiv.org/html/2608.20371
- Valdes Gonzalez, Cost-Aware Model Selection for Text Classification (arXiv 2602.06370): https://arxiv.org/abs/2602.06370
- AWS Machine Learning Blog, Multi-LLM routing strategies for generative AI applications on AWS: https://aws.amazon.com/blogs/machine-learning/multi-llm-routing-strategies-for-generative-ai-applications-on-aws/
- Aurelio Labs, semantic-router: https://github.com/aurelio-labs/semantic-router
- Guo et al., On Calibration of Modern Neural Networks (arXiv 1706.04599): https://arxiv.org/abs/1706.04599
- LMSYS, RouteLLM repository: https://github.com/lm-sys/RouteLLM
- Hugging Face, Inference Endpoints pricing: https://huggingface.co/docs/inference-endpoints/pricing
- TypeSafe AI: https://typesafe.ai
- Parsec, TOD: https://parseclab.ai/tod/
- Parsec, TOD repository: https://github.com/daseinlabs/tod
- Parsec, Decision models: https://parseclab.ai/solutions/decision-models/