模型路由的首要原则
First Principles of Model Routing

原始链接: https://try.works/first-principles-of-model-routing

构建一个有效的模型路由策略,重点应在于策略本身,而非单纯增加系统的复杂性。以下是优化模型路由的四个核心原则: 1. **优先选择差异化模型:** 不要让两个功能相似的“前沿”模型相互路由。相反,应将一个高性能模型与一个在成本或速度上具有明显优势的模型进行配对。显著的性能差异能让路由决策更简单、更有效。 2. **保持模型池精简:** 避免“模型臃肿”。模型池越大,路由逻辑就越复杂且越容易出错。默认情况下,请将模型数量限制在两个,仅当额外的模型能带来速度、质量或成本方面可衡量的显著改进时,再考虑增加。 3. **使用基于实际业务的基准测试:** 标准元数据和公共基准测试通常过于通用。为了获得准确的性能评估,请根据特定的工作负载、功能需求(如工具使用)和任务类型,进行量身定制的基准测试。 4. **利用历史数据:** 将过往的路由决策和遥测数据作为反馈循环。通过评估模型在实际历史请求中的表现,你可以优化路由逻辑,使其超越静态基准测试,从而在现实场景中取得最佳效果。 遵循这些原则,可以确保你的路由架构保持高性能、高性价比且易于管理。

这篇 Hacker News 讨论对文章《模型路由的第一性原理》(First Principles of Model Routing)进行了点评。文中指出,尽管这一概念很有用,但应将其视为建议而非死板的“第一性原理”。 评论者 *aeon_ai* 强调,在不同前沿模型之间进行路由可以利用“合金效应”(alloying effect)来提升性能,即通过让任务接触多样化的数据分布,打破模型陷入无效反馈循环的局面。然而,他们认为仅使用少量模型并不能成为万能方案。相反,作者建议最有效的策略是为每一次路由决策制定明确的依据。 针对大流量工作流,评论者建议最大限度地扩大初始模型池以扩展搜索空间,从而针对特定任务实现更精确、由数据驱动的模型匹配。总的来说,人们认为模型路由虽然是一种有效且强大的技术,但其实现需要基于具体任务进行细致考量,而非采用“一刀切”的框架。
相关文章

原文

Here are a few principles for model routing that I've developed while building role-model, a model router, a routing protocol and a Pi extension. These principles will be useful for anyone that uses a model router, or builds their own. 

1. Keep models distinct
I sometimes see people using the latest GPT model with the latest Opus model, each assigned different roles in a coding workflow. This is not wrong per se, but it also isn't optimal from a routing perspective. 

While people have different experiences of and preferences for the GPT and Opus model, they are both generalist models with a bent for coding, in the same performance and cost tiers. 

This means that routing between them is difficult, because it is hard enough to determine the difficulty of a request in order to match it with a model, but after this is done it is even harder to make the decision which model it should go to when they are neck and neck in every area.

Instead of routing between two frontier models it is better to route between one frontier model and another model that excels in at least one of the sides of the triangle of constraints: speed, quality and cost. 

For example, use a router together with GPT 5.5 to extend the quota of your subscription by routing medium and easy requests to DeepSeek V4 Pro. It is significantly cheaper and also significantly less capable on very difficult tasks so routing decisions are easier to make here.

2. Keep the model pool small
This point follows from the previous point. You might think that increasing the pool size with more models to route between is a good thing. 

As an example, I could configure role-model to use GPT 5.5, Kimi 2.7, DeepSeek V4 Pro and DeepSeek V4 Flash, and even a couple of smaller GPT models. 

But if each model does not have distinct characteristics, adding more models just makes routing decision making harder. In reality, this pool is likely to just end up routing between GPT 5.5 due to performance, and one of the other models that is selected and then kept for smaller tasks due to cache being warm.

So unless you have models with distinct differences, do not add more to the pool. Limit the pool size to 2 by default and only add more models when you can clearly define the roles of each of them. Does adding one increase speed, quality or cost? If not, don't add it.

3. Use relative, real-world benchmarks
I sometimes see some routers that simply route based on model metadata like cost, and other routers that add external benchmarks from sources like Artifical Analysis to the metadata. This is better than nothing but not ideal because the benchmarks may not provide a granular enough performance profile, may not reflect your real workloads, may not be strictly relative and may lack data for certain models.

Additionally, models perform differently on different remote endpoints, may change over time, and perform different on different local systems.

To get clear data for for the profiles of models in the pool it is best to run benchmarks in your router that runs benchmark with individual test tagged with capabilities (tool use, vision, etc), tasks or roles, then scores the model performance side by side relative to each other to build out a richer routing profile. 

4. Evaluate past historic decisions to enrich routing decision data
The benchmark should only be seen as a starting point. When we route requests we aim to in a way predict the future: which model will perform optimally on this request given various parameters including cost and speed. 

These decisions should be revisited by creating user-specific evaluations based on past requests and to run them as a benchmark across the model pool. This is the best signal you get on how models perform and how to route them. 

Additionally, telemetry data tell us about an endpoint's stability, turn around time for a request, and other things that are not captured in catalog metadata.

If you made it all the way here, you can give model routing with your own choice of model a go with role-model. Check out the repo link in the comment below.

联系我们 contact @ memedata.com