Train a cheap router to send 'easy' queries to small models and save cloud cost while keeping quality

April 22, 20247 min

Overview

Decision SnapshotNeeds Validation

The method is simple to implement, backed by experiments on a broad instruction dataset, and adds minimal runtime cost; results depend on small/large model pairs and evaluation metric alignment.

Citations6

Evidence Strength0.70

Confidence0.80

Risk Signals9

Trust Signals

Findings with numeric evidence: 4/4

Findings with evidence refs: 4/4

Results with explicit delta: 3/3

Reproducibility

Status: Code + data available

Open source: Partial

At A Glance

Cost impact: 70%

Production readiness: 70%

Novelty: 60%

Authors

Dujian Ding, Ankur Mallick, Chi Wang, Robert Sim, Subhabrata Mukherjee, Victor Ruhle, Laks V. S. Lakshmanan, Ahmed Hassan Awadallah

Links

Abstract / PDF / Code / Data

Why It Matters For Business

Route cheap queries to local or smaller models to cut cloud inference costs while keeping user-facing quality high; thresholds let operators trade cost vs quality on demand.

Who Should Care

Summary TLDR

The paper introduces a light-weight router that predicts when a small, cheap LLM can match a larger, costly LLM. The router scores queries by the estimated quality gap and sends 'easy' queries to the small model. Three router designs are evaluated: deterministic, probabilistic (samples multiple responses), and probabilistic with a label transformation to handle large model gaps. On a broad MixInstruct testbed the router cuts calls to large models by ~20–40% with little quality loss in many cases. Router inference is cheap (≈0.036s) so overhead is negligible. Use the transformation when the small model is much weaker.

Problem Statement

Large LLMs give better answers but cost a lot to run. Smaller models are cheaper but often worse. Can we automatically decide, per query, which model to call so we reduce cost without hurting answer quality?

Main Contribution

A practical hybrid inference setup that routes each query to either a small or large LLM to trade cost for quality.

Three router training methods: deterministic, probabilistic (samples multiple outputs), and probabilistic with a data-label transformation to strengthen learning when gaps are large.

Key Findings

The router can route many queries to the small model and keep quality nearly unchanged.

Numbers22% fewer large-model calls with <1% BART drop (Llama-2 13b vs GPT-3.5-turbo)

Practical UseIf your small model is close to the large one, set the router threshold to route ~20% of queries to save cost with almost no quality loss.

Evidence RefFigure 1c; Table 1

Using probabilistic labels plus a data transformation (r_trans) helps when the small model is much weaker.

NumbersFor FLAN-T5 (800m) → Llama-2 (13b): 40% cost advantage → 10.3% BART drop; r_trans improves quality drop by ~2.83.5% vs.

Practical UseIf your small model is far worse, use the transformed-label probabilistic router (r_trans) to get stronger routing signal and better trade-offs.

Evidence RefTable 1; Section 4.2

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
Cost advantage vs BART drop (small gap pairs)20% cost advantage with ≤0.1% BART drop; 40%≤0.2% drop (Llama-2 7b vs 13b)All-at-large2040% fewer large-model callsMixInstruct testTable 1; Section 4.2Table 1
Cost advantage vs BART drop (medium gap pairs)20% cost advantage with ≤1% BART drop; 40% with ≤4% drop (Llama-2 13b vs GPT-3.5)All-at-large2040% fewer large-model callsMixInstruct testTable 1; Section 4.2Table 1

What To Try In 7 Days

Collect 500–1k calibration queries and compute BART gap between your small and large models.

Train a DeBERTa-based router on those examples using probabilistic labels (sample multiple outputs) and tune a threshold on validation set.

Deploy router in front of your LLM stack and measure percent of queries routed and end-to-end latency; start with conservative threshold (≈10–20% cost adv).

Optimization Features

System Optimization
Cheap encoder router (DeBERTa) in front of autoregressive LLMs
Training Optimization
Probabilistic labeling via sampling multiple outputs
Inference Optimization
Per-query model routing to avoid unnecessary large-model calls

Reproducibility

Code AvailableYes
Data AvailableYes
Open Source StatusPartial
LicenseUnknown

Data URLs

MixInstruct (public; Jiang et al. 2023)

Risks & Boundaries

Limitations

Router relies on an automatic metric (BART) for training; poor metric alignment can degrade real-world quality.

When the small model is much weaker, routing becomes harder and quality drop can be substantial without careful transformation.

When Not To Use

If your small model consistently performs much worse across tasks (large, unbridgeable gap).

If you cannot afford to sample multiple outputs per example (probabilistic labels require sampling).

Failure Modes

Router misroutes many hard queries to the small model when the small model is far weaker.

Poor choice of transformation parameter t (grid search noise) leads to suboptimal routing.

Core Entities

Models

FLAN-T5 (800m)FLAN-T5 (11b)Llama-2 (7b)Llama-2 (13b)GPT-3.5-turboDeBERTa-v3-large (router backbone)

Metrics

BART scoreGPT-4 evaluation score (1–10)Cost advantage (fraction routed to small model)Latency (seconds)

Datasets

MixInstruct (sampled 20k; 10k train, 5k val, 5k test)

Context Entities

Models

Reference to other hybrid/cascade/speculative works (Jiang et al., Kag et al., Leviathan et al.)