# A Unified Approach to Routing and Cascading for LLMs

Cascade routing merges routing and cascading into one model selection strategy

Jasper Dekoninck, Maximilian Baader, Martin Vechev · arXiv · 2024-10-14

- **Problem** Routing makes one final model choice, and cascading forces every query through the whole chain. Their theory also lacks optimality guarantees.
- **Method** Cascade routing merges both paradigms, so each step picks among chains of models already run instead of one fixed choice.
- **Results** On RouterBench with eleven models at low noise, cascade routing scored an AUC of 87.24, compared to 83.25 for routing.

![Figure 3: Runtime of cascade routing vari- ants for different numbers of models](https://refivu.com/papers/294c4944-64cf-4c2a-8c0d-d1cb8624f2cb/figures/figure-d29cf2d62e3f98c05fe9e49c3c93fe9c.png?thumb=512)

**Figure 3** : Runtime of cascade routing vari- ants for different numbers of models.

[Original paper](https://arxiv.org/abs/2410.10347v5) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jasper Dekoninck, Maximilian Baader, Martin Vechev · A Unified Approach to Routing and Cascading for LLMs · Original paper figure · Extracted the figure area from page 22 of the original PDF.

## Why routing and cascading stall

Model selection tries to send each query to a model that answers well enough at a cost the budget allows. Routing and cascading are the two standard paradigms for this, and each one restricts the process in its own way. In routing, the initial selection of a model is final, so the strategy can't reconsider after the first decision. In cascading, each query must pass through every model in the chain, and there is no option to skip a model.

A less restrictive strategy that combines both could therefore offer significant performance improvements.

The theory behind both paradigms lags behind their practical use. The theoretical analysis of cascading, in contrast, doesn't provide optimality guarantees (Chen et al., 2023; Varshney & Baral, 2022). Prior work also doesn't explain the limitations of these strategies.

Practitioners can't tell when either paradigm actually pays off, which makes the choice between them a guess. The authors address this gap by first deriving optimal routing and cascading strategies as linear optimization problems. Their goal is to maximize output quality while staying within a given cost budget. Cascade routing then combines both paradigms, with routing and cascading as special cases of it (Figure 1).

## Routing as a linear optimization

The key idea is to let the router output a probability distribution over models instead of one hard choice, and to set that distribution by a linear trade-off between predicted quality and cost. A routing strategy is a function \\(s:\\mathcal{X}\\to\\Delta\_k\\) that maps a query to a distribution over the k models, and the router samples its choice from that distribution.

Since true quality and cost are unknown, the router works with estimates \\(\\hat q\_i(x)\\) and \\(\\hat c\_i(x)\\), built from small classifiers and from token-based or latency-based cost measures. For a fixed \\(\\lambda\\), each model gets the score \\(\\tau\_i(x,\\lambda)=\\hat q\_i(x)-\\lambda\\hat c\_i(x)\\), and the highest score wins.

When several models tie for the top score, the authors pick the cheapest tied model with probability \\(\\gamma\\) and the most expensive one otherwise. Because \\(\\gamma\\) is often neither 0 nor 1, the optimal rule is generally probabilistic. Prior work restricted routing to deterministic choices, so it can't express this optimum and falls back on the cheapest near-optimal model.

Theorem 1 says that such a \\(\\lambda\\) and \\(\\gamma\\) exist for any cost budget B.

A two-model example shows how the mixing plays out. Model m1 costs 0.9 and m2 costs 1, and the quality estimates depend on whether a query is math, code or generic. At \\(\\lambda = 1\\) and \\(\\gamma = 0.7\\), the router picks m1 on math, m2 on code, and on generic queries it picks m1 with probability 0.7. This only works if the quality estimates match the true qualities, so the authors treat ex-ante quality estimation as the critical part of routing.

Cost estimates matter less, the authors found, and are easier to approximate.

## Cascading as a sequence of routing decisions

Each cascade step becomes a routing decision once the models are grouped into supermodels, which are fixed chains that act like one model. At step j, the cascade either stops and returns the output of the best supermodel M\_{1:j-1}, or it continues by running m\_j. Supermodels M\_{1:j} through M\_{1:k} all mean continuing, yet they still count, because a weak m\_j can hide a strong m\_{j+1}.

The cost of a supermodel is simply the sum of its member costs, so the cost of M\_{1:i} adds up its first i models. Its quality is the expected value of the maximum member quality, since the strongest member can fail while another member succeeds. The authors measure the spread of these estimates as the variance of the difference between quality estimates at step j and step k over a validation dataset.

Ignoring that spread would wrongly treat a supermodel as always matching its best member.

Theorem 2 writes the optimal cascade as a per-step mix of a minimum-cost rule and a maximum-cost rule, with one λ\_j per step and one shared γ. The budget applies to the whole cascade, while the λ\_j and γ are tuned on a validation dataset. Take two models with costs (0.5, 1) and qualities (0.5, 0.8), ignoring uncertainty, before any output is seen.

After m1 runs and its confidence is only 30%, the estimates update to quality (0.3, 0.6) and cost (1, 2).

With λ2 = 1, the cascade stops and returns the output of m1, because the cost-quality tradeoff is highest for the supermodel {m1}. With λ2 = 0.1, the cascade runs m2, since the tradeoff peaks for the supermodel {m1, m2}. Algorithm 2 packages this decision as a router that compares all remaining supermodels at each step. Corollary 1 shows that the threshold rule used by prior cascades matches this optimal rule only if the costs don't depend on the query and three quality conditions hold.

## Where the threshold cascade falls short

Prior cascades approximate the optimal strategy with a threshold rule that compares one estimate against a fixed cutoff. At step j, the cascade keeps going while the latest post-hoc estimate stays below a fixed threshold τ\_j. Corollary 1 says the threshold rule matches the optimal cascade under minor technical assumptions, but only if three conditions hold.

The cost estimates for every model must not depend on the query x. The quality estimates for models i at least j must not depend on x either. The quality of a supermodel must equal the estimate for its last model.

Under the threshold rule, the ex-ante estimate is fixed, so it doesn't change any stopping decision. The authors' approach keeps both the ex-ante and the post-hoc estimates, so it can make better-informed stopping decisions. Compared with the threshold cascade, the new cascading strategy improves performance by up to 2%.

So when does a cascade beat direct routing? A cascade pays off only when the post-hoc estimate gives much better information than the ex-ante estimate. If that improvement is minimal, the router should send queries straight to the most suitable model and skip the cascade. Routing fits settings where ex-ante estimates are accurate, while cascading fits settings where post-hoc estimates are accurate.

## Cascade routing and pruning the search

Cascade routing keeps the sequential structure of cascading but lets the router pick among every supermodel that starts with the models already run. Definition 5 writes this as a sequence of routing strategies, one per step, where each step routes between all supermodels that start with the j-1 models already computed. Theorem 3 gives the optimal form, with a per-step λj and a shared γ, mixing the minimum-cost and maximum-cost choices.

The step then returns the cheapest unrun model in the chosen supermodel, or stops if no unrun model is left. Models inside the chosen supermodel are sorted by cost, so the cheapest one runs first, which matches how cascading works.

Supermodel quality and cost are order-independent, so supermodels with the same models in a different order get identical scores. The authors reduce this search with negative marginal gains, since the model selection step must stay cheap next to model computation. The marginal gain of a model m with respect to a supermodel M is τ\_M(x, λ) minus τ\_{M\\{m}}(x, λ).

If that marginal gain is strictly negative for a query, the optimal rule never runs a supermodel that contains all models in M. For example, if m1 hurts the supermodel {m1, m2}, every supermodel containing both m1 and m2 is pruned. The authors say this negative contribution is quite common, so pruning removes much of the search space.

A two-model example shows how this differs from cascading, using costs (0.5, 1) and qualities (0.5, 0.8) for m1 and m2. With λ1 = 0.1, the router runs m2 first, while with λ1 = 1 it follows the classic order and runs m1 first. If m2's output turns out poor and its quality estimate drops to (0.5, 0.1), λ2 = 0.1 sends the query back to m1. Cascade routing therefore can reorder models within a query, which a fixed-order cascade cannot do.

## RouterBench results: when does cascade routing win?

RouterBench is a benchmark for comparing model selection strategies, and the authors test it with three, five and eleven models. It includes questions from seven benchmarks, such as MMLU, GSM8k and MBPP, with answers from eleven models ranging from GPT-4 to Mistral-7B. The estimates are the true values plus zero-centered Gaussian noise, so the quality estimate is written as W(q(x)+ε)+b with ε drawn from N(0, σ²).

The authors define σ²ante for the noisy signal before model computation and σ²post for the signal after it. Low, medium and high noise levels set these variances, and the exact values are given in §D.1.

Each method is scored by AUC over cost budgets, running from the cheapest model to the most expensive one. The baselines are routing, the threshold-based cascade from Corollary 1, the optimal cascade from Theorem 2, and a linear interpolation on the Pareto frontier. With eleven models at low noise, cascade routing reaches 87.24 AUC, compared to 83.25 for routing and 84.48 for the baseline cascade.

The gap narrows under higher noise, so the authors read cascade routing as strongest with large model sets and accurate estimates. The new cascade beats the threshold cascade by up to 2%, which supports the cascading result from the theory.

In the noise sweep with five models, the authors compare cascade routing against routing in one panel and against cascading in the other. Routing is hurt mainly by high ex-ante noise, so high σante sharply lowers its AUC relative to cascade routing. Cascading is hurt mainly by high post-hoc noise, and higher σpost causes substantial performance degradation.

Cascade routing stays robust because it uses low σante and low σpost together.

## Real-world benchmarks with good and poor estimates

On SWE-Bench, the authors score each response by running it against the ground-truth test cases, which gives accurate post-hoc estimates. Routing doesn't beat the trivial baseline there, since ex-ante quality estimates are insufficient for this benchmark. The baseline cascade falls to 38.52 there, even though its post-hoc estimates are perfect.

The SWE-Bench cost estimator is latency-based, while the Minerva Math and LiveCodeBench estimator uses the cost of generation.

![Table 2: AUC scores on practical benchmarks. On the left, resp. right, side we show the benchmarks with good, resp. poor, quality estimates. The highest number…](https://refivu.com/papers/294c4944-64cf-4c2a-8c0d-d1cb8624f2cb/figures/figure-94152bebf386f9c609723ad9716f17e6.png?thumb=512)

**Table 2** : AUC scores on practical benchmarks. On the left, resp. right, side we show the benchmarks with good, resp. poor, quality estimates. The highest numbers are bolded, and underlined numbers are within the95%confidence intervals of the highest number. For a discussion on confidence intervals, refer to §E. In §G, we present benchmark-specific AUC values for results averaged over several benchmarks.

[Original paper](https://arxiv.org/abs/2410.10347v5) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

For Minerva Math and LiveCodeBench, the authors use the QWEN-2.5 Math and Coder models and add the sample's origin benchmark as a feature. Because the ex-ante estimates are accurate here, routing reaches 58.20 on this setup. Post-hoc estimates are poor on these benchmarks, so cascade routing ties routing at 58.20. The authors' cascade reaches 52.56, compared to 47.03 for the baseline cascade.

The paper says the new cascade uses ex-ante estimates to make informed decisions, while the baseline cascade relies on a fixed threshold.

Classification and open-form tasks have no known accurate quality estimator, so the authors use the log-probability estimator from Gupta et al. (2024). With LLAMA and GEMMA, cascade routing performs on par with or above all baselines, with margins of up to 1.2%. On LLAMA classification, cascade routing scores 75.52, compared to 74.92 for routing.

The authors attribute the smaller gains to very noisy quality and cost estimates, similar to the high-noise RouterBench settings.

## Limitations: what bounds the evidence for cascade routing

RouterBench evaluates cascade routing with simulated estimates, because quality and cost are true values plus zero-centered Gaussian noise. The variances of that noisy signal are set separately for ex-ante estimates and post-hoc estimates. So the RouterBench results measure how estimate quality affects the strategies, not the accuracy of a real predictor.

Across noise levels, cascade routing keeps its lead, but the gap narrows as noise increases. The authors tie this narrowing to noisy estimates, which is why they test under a broader range of noise levels with five models. Cascade routing gains are largest when ex-ante and post-hoc estimates are both low-noise.

On Minerva Math and LiveCodeBench, cascade routing performs on par with routing. The authors attribute this to poor post-hoc quality estimation on these benchmarks. The QWEN models use the sample's origin benchmark as a feature, so their ex-ante estimates are accurate.

Its margin reaches only up to 1.2% on these benchmarks. The authors attribute the narrow margin to very noisy quality and cost estimates.

On SWE-Bench, the post-hoc quality signal comes from testing responses on the ground-truth test cases. Its cost estimator is latency-based, which means cascade routing adapts to a different cost definition than on Minerva Math. The paper's evidence therefore depends on these estimator choices, and the authors don't test other estimators on the same tasks.

## Paper info

- **Authors**: Jasper Dekoninck, Maximilian Baader, Martin Vechev
- **Venue**: arXiv · Preprint
- **First published**: 2024-10-14
- **Added**: 2026-10-31
- **Updated**: 2026-10-26
- **Version**: v5
- **arXiv**: 2410.10347
- **Category**: cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2410.10347v5) · [PDF ↗](https://arxiv.org/pdf/2410.10347v5)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

The availability of a wide range of large language models (LLMs) embedded in various agentic systems has significantly increased the potential of model selection strategies to improve the cost-performance tradeoff. Existing strategies involve either routing, where a single model is chosen per query, or cascading, which sequentially runs increasingly larger models until a satisfactory answer is found. However, current approaches face three key limitations: they (1) lack formal proofs of optimality, (2) fail to identify the conditions under which these strategies are most effective to improve the cost-performance tradeoff, and (3) are unable to combine both paradigms for further improvements. To address these issues, we first derive a novel optimal strategy for cascading and prove the optimality of an existing routing strategy. Further, we propose cascade routing, a unified framework that integrates routing and cascading into a theoretically optimal strategy. Through our analysis, we identify good quality estimators as the critical factor for the success of model selection paradigms. Finally, in our experiments, we show that cascade routing consistently outperforms the individual approaches by a large margin and we analyze quality estimators to determine when routing and/or cascading are useful paradigms for model selection.

## Quote from the paper

Jasper Dekoninck, Maximilian Baader, Martin Vechev (2024). A Unified Approach to Routing and Cascading for LLMs. arXiv:2410.10347v5. https://arxiv.org/abs/2410.10347v5

**BibTeX**

```
@misc{dekoninck2024unified,
  title = {{A Unified Approach to Routing and Cascading for LLMs}},
  author = {Jasper Dekoninck and Maximilian Baader and Martin Vechev},
  year = {2024},
  eprint = {2410.10347},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.10347v5}
}
```

## Other paper commentary

- [DataDecide: How to Predict Best Pretraining Data with Small Experiments](https://refivu.com/en/papers/b2e5b927-f525-4063-8956-246603aff1fb-datadecide-how-to-predict-best-pretraining-data-with.md)
- [NestQuant: Nested Lattice Quantization for Matrix Products and LLMs](https://refivu.com/en/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d-nestquant-nested-lattice-quantization-for-matrix-products.md)
- [InfAlign: Inference-aware language model alignment](https://refivu.com/en/papers/c8a29ed9-8ab2-4e59-9865-5055bb8ee487-infalign-inference-aware-language-model-alignment.md)
- [MixMin: Finding Data Mixtures via Convex Minimization](https://refivu.com/en/papers/1812a7ac-7070-4e11-93d3-514e69d7cf83-mixmin-finding-data-mixtures-via-convex-minimization.md)
- [The Geometry of Refusal in Large Language Models: Concept Cones and Representational Independence](https://refivu.com/en/papers/fd13f7d8-7e4a-4bc8-9f04-ace7e79ab349-the-geometry-of-refusal-in-large-language-models.md)
- [Evolution Strategies at the Hyperscale](https://refivu.com/en/papers/77d44b80-fbe4-419d-a33e-e5ab69fb2914-evolution-strategies-at-the-hyperscale.md)
- [Multi-Token Prediction Done Right](https://refivu.com/en/papers/96cce8ac-487a-47a2-8b3b-075193f1d020-multi-token-prediction-done-right.md)
- [Near-Optimal Consistency-Robustness Trade-Offs for Learning-Augmented Online Knapsack Problems](https://refivu.com/en/papers/7433999f-8924-4307-bafb-589d81cd9d20-near-optimal-consistency-robustness-trade-offs-for-learning.md)
- [Solving Probabilistic Verification Problems of Neural Networks using Branch and Bound](https://refivu.com/en/papers/bb7ed38f-7636-44c4-921c-7a661fe6cf0f-solving-probabilistic-verification-problems-of-neural.md)
- [Compositional Risk Minimization](https://refivu.com/en/papers/7f0b2d82-eb6c-417e-a42e-8b6899343b6c-compositional-risk-minimization.md)
- [Feature Learning beyond the Lazy-Rich Dichotomy: Insights from Representational Geometry](https://refivu.com/en/papers/145cac59-29af-46bd-915b-28b2501ff19d-feature-learning-beyond-the-lazy-rich-dichotomy-insights.md)
- [Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers](https://refivu.com/en/papers/d0ed8609-fa25-4225-88a2-81bbc32dbac9-lower-bounds-for-chain-of-thought-reasoning-in.md)

## Terms in this paper

- [GSM8K](https://refivu.com/en/terms/e48f0e01064d-gsm8k)
- [LiveCodeBench](https://refivu.com/en/terms/a42eecb00259-livecodebench)
- [MMLU-Pro](https://refivu.com/en/terms/bfee57e68dd0-mmlu-pro)
- [ARC-Challenge](https://refivu.com/en/terms/af83d76dba8c-arc-challenge)
- [SWE-bench](https://refivu.com/en/terms/d2a8e736795c-swe-bench)
- [Area Under the Curve (AUC)](https://refivu.com/en/terms/ac2f03bbbd4f-area-under-the-curve-auc)
- [Cascading](https://refivu.com/en/terms/8c8c438976d1-cascading)
- [model selection](https://refivu.com/en/terms/c4cd33556dd8-model-selection)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/294c4944-64cf-4c2a-8c0d-d1cb8624f2cb-a-unified-approach-to-routing-and-cascading-for)
