feat: 多专业小模型+路由模型系统 MVP(mock 全链路 + FastAPI 网关 + 论文调研)

This commit is contained in:
tzt
2026-08-12 10:40:04 +08:00
commit 1e51167ea5
50 changed files with 49382 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
# 参考文献索引
本目录收录了"多专业小模型 + 路由模型"可行性分析报告中引用的全部 15 篇参考文献。
---
## 📄 arXiv 论文(13 篇 PDF
| # | 文件名 | 标题 | 会议/期刊 | arXiv ID |
|---|--------|------|----------|----------|
| 01 | `01_Densing_Law_of_LLMs_2412.04315.pdf` | Densing Law of LLMs | **Nature Machine Intelligence** (封面文章) | [2412.04315](https://arxiv.org/abs/2412.04315) |
| 02 | `02_R2R_Token_Routing_2505.21600.pdf` | R2R: Efficiently Navigating Divergent Reasoning Paths with Small-Large Model Token Routing | **NeurIPS 2025** | [2505.21600](https://arxiv.org/abs/2505.21600) |
| 03 | `03_BEST_Route_2506.22716.pdf` | BEST-Route: Adaptive LLM Routing with Test-Time Optimal Compute | **ICML 2025** | [2506.22716](https://arxiv.org/abs/2506.22716) |
| 04 | `04_SATER_2510.05164.pdf` | SATER: A Self-Aware and Token-Efficient Approach to Routing and Cascading | **EMNLP 2025** | [2510.05164](https://arxiv.org/abs/2510.05164) |
| 05 | `05_Token_Level_Routing_2504.07878.pdf` | Token Level Routing Inference System for Edge Devices | **ACL 2025** | [2504.07878](https://arxiv.org/abs/2504.07878) |
| 06 | `06_Comp_LLM_2511.22955.pdf` | Experts are all you need: A Composable Framework for Large Language Model Inference (Comp-LLM) | arXiv 2025 | [2511.22955](https://arxiv.org/abs/2511.22955) |
| 07 | `07_Mixture_of_Parrots_2410.19034.pdf` | Mixture of Parrots: Experts Improve Memorization More than Reasoning | **ICLR 2025** | [2410.19034](https://arxiv.org/abs/2410.19034) |
| 08 | `08_DomainCodeBench_2412.18573.pdf` | Top General Performance ≠ Top Domain Performance? DomainCodeBench: A Multi-domain Code Generation Benchmark | arXiv 2025 | [2412.18573](https://arxiv.org/abs/2412.18573) |
| 09 | `09_Model_SAT_CIT_2502.17282.pdf` | Capability Instruction Tuning: A New Paradigm for Dynamic LLM Routing (Model-SAT) | **AAAI 2025** | [2502.17282](https://arxiv.org/abs/2502.17282) |
| 10 | `10_RouterRetriever_2409.02685.pdf` | RouterRetriever: Routing over a Mixture of Expert Embedding Models | **AAAI 2025** | [2409.02685](https://arxiv.org/abs/2409.02685) |
| 11 | `11_Inverse_Depth_Scaling_2602.05970.pdf` | Inverse Depth Scaling From Most Layers Being Similar | **ICML 2026** | [2602.05970](https://arxiv.org/abs/2602.05970) |
| 12 | `12_MergeBench_2505.10833.pdf` | MergeBench: A Benchmark for Merging Domain-Specialized LLMs | **NeurIPS 2025** (Datasets & Benchmarks) | [2505.10833](https://arxiv.org/abs/2505.10833) |
| 13 | `13_Doing_More_With_Less_2502.00409.pdf` | Doing More with Less: Implementing Routing Strategies in LLM-Based Systems (Extended Survey) | arXiv 2025 | [2502.00409](https://arxiv.org/abs/2502.00409) |
## 📝 博客文章(2 篇)
| 文件名 | 标题 | 来源 |
|--------|------|------|
| `RouterArena_blog.md` | Who Routes LLM Routers? — RouterArena: Building the Evaluation Foundation for LLM Routing | Hugging Face Blog (2025.11) |
| `Small_FineTuned_Models_blog.md` | Small Fine-tuned Models are All You Need | Oumi Blog (2025.10) |
## 📊 按会议/期刊分布
| 会议/期刊 | 论文数 | 论文编号 |
|----------|--------|---------|
| **NeurIPS 2025** | 2 | 02 (R2R), 12 (MergeBench) |
| **ICML 2025** | 1 | 03 (BEST-Route) |
| **EMNLP 2025** | 1 | 04 (SATER) |
| **ACL 2025** | 1 | 05 (Token Level Routing) |
| **AAAI 2025** | 2 | 09 (Model-SAT), 10 (RouterRetriever) |
| **ICLR 2025** | 1 | 07 (Mixture of Parrots) |
| **Nature Machine Intelligence** | 1 | 01 (Densing Law) |
| **ICML 2026** | 1 | 11 (Inverse Depth Scaling) |
| **arXiv / 预印本** | 3 | 06 (Comp-LLM), 08 (DomainCodeBench), 13 (Survey) |
## 🔍 按主题分类
- **Routing 路由系统:** 02, 03, 04, 05, 09, 13, RouterArena
- **小模型能力:** 07, 08, Small_FineTuned
- **Scaling Law / 架构理论:** 01, 11
- **专家模型合并:** 12
- **可组合推理系统:** 06
- **检索路由:** 10
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+82
View File
@@ -0,0 +1,82 @@
# Who Routes LLM Routers? — RouterArena: Building the Evaluation Foundation for LLM Routing
**Community Article Published November 11, 2025**
**Authors:** Yifan Lu\*, Rixin Liu\*, Jiayi Yuan\*, Xingqi Cui, Shenrun Zhang, Hongyi Liu, Jiarong Xing
*\*Equal contribution · Rice University*
**Link:** https://huggingface.co/blog/JerryPotter/who-routes-the-routers
---
## The Diversifying Landscape of LLMs
For years, our community has pursued the goal of building a single, general-purpose foundation model capable of handling all questions and tasks, and this effort has achieved remarkable success. As scaling laws kicked in, these models have rapidly expanded to trillions of parameters and now surpass human performance on a wide range of benchmarks.
However, it is becoming increasingly clear that this scaling trend may not be sustainable. We are hitting the data wall, where high-quality training data is running out, as highlighted by Ilya Sutskever, OpenAI's co-founder, at NeurIPS 2024. Future scaling will depend on generating new, high-quality data, which often requires costly human labeling and curation.
As a result, the LLM landscape is diversifying. In addition to chasing large general-purpose models, people are also exploring smaller, more efficient, and specialized ones. A good example is the Qwen family, which now includes nine categories, such as Qwen3-Coder, Qwen3-Image, and Qwen3-Guard. These models range from 0.6B to 480B parameters, with many specialized variants staying under 30B, handling relatively simple questions more efficiently.
This shift is further accelerated by startups and open-source initiatives embracing model specialization and customization. For instance, ThinkingMachine is building personalized AI systems, while rLLM provides an open framework for training domain-specific or user-tailored agents. Together, these efforts mark a clear transition from a "one-model-for-all" paradigm to a diverse ecosystem of LLMs, ranging from massive generalists to compact specialists.
---
## The Key is Model Routers
As models continue to diversify (in both sizes and skills), a new challenge emerges: how do we choose the right model for the right task? If the era of large, general models was about "one model for everything," the next era is about matching each query to the model that answers it best.
Therefore, automated query-to-model routing will be increasingly important. A helpful analogy to understand its importance is Google Search. When you type a query, the search engine scans billions of pages and routes you to the most relevant source. Similarly, as the model ecosystem expands, we'll need intelligent routers that analyze an input and decide which model (or combination of models) can handle it most effectively.
The routing can happen at many levels: selecting between models of different sizes to balance cost and accuracy, choosing among specialized experts to get the highest-quality answers, or even orchestrating a workflow of multiple models that collaborate to complete a complex task.
This idea is no longer just theoretical. As shown in the following figure, we're already seeing a wave of router systems emerging across academia and industry—some simple and rule-based, others adaptive, learned, and data-driven. The most notable example is GPT-5, which is said to incorporate an internal router that dynamically selects among different models or "experts" depending on the task.
---
## Who Routes the Routers? RouterArena!
In the near future, designing good routers will be just as important as training good models. This means that, just as we evaluate and analyze models today, we will need a rigorous study of routers to understand their performance, efficiency, and decision behaviors.
Differently, evaluating routers is far more challenging than evaluating models. Router evaluation is inherently multi-dimensional: there isn't a single metric that captures how well a router performs. People care about many different aspects, e.g., query-answer quality, cost efficiency, routing consistency, robustness, and more. Even for the same query, the optimal router decision can change depending on the available model candidates, cost constraints, or deployment settings, making fair and consistent evaluation even harder.
Unfortunately, there is currently no open platform that allows the public to evaluate routers using a comprehensive dataset and standardized metrics for fair comparison. That's why we built RouterArena!
### What is RouterArena?
RouterArena is an open platform for rigorous and comprehensive router evaluation. It provides (1) a principally constructed dataset with broad knowledge domain coverage, (2) distinguishable difficulty levels for each domain, (3) an extensive list of evaluation metrics, and (4) an automated evaluation framework. On top of that, we host a public leaderboard, giving the community a place to compare, track, and improve routers over time.
### Evaluation Dataset
RouterArena introduces a carefully constructed evaluation dataset built around two core design principles: diverse domain coverage and clear difficulty separation. For broad coverage, we draw inspiration from the Dewey Decimal Classification (DDC) system used in libraries to organize the world's knowledge. This ensures that the dataset spans a wide range of domains across science, humanities, and applied disciplines. To differentiate query complexity, we adopt Bloom's taxonomy, grouping questions into three levels—easy, medium, and hard—so routers can be tested on their ability to balance accuracy and cost when selecting between smaller and larger models.
Following these principles, we curated data from 23 open-source datasets, applied LLM-based difficulty annotation, and ensured balanced distribution across all categories. After deduplication, our final dataset contains 8,400 queries across 9 domains and 44 categories, each represented at multiple difficulty levels.
### Evaluation Metrics
RouterArena evaluates routers across 5 key dimensions:
- **Query-answer accuracy** — a router's ability to direct queries to the appropriate models such that they are correctly answered.
- **Query-answer cost** — the cost incurred by a router's routing decisions.
- **Routing optimality** — a router's ability to select the cheapest model that still produces a correct response.
- **Routing robustness** — the router's robustness against noisy inputs.
- **Routing latency** — the latency overhead introduced by routing.
### Leaderboard
The **Arena Score** is a composite metric that captures the critical accuracycost trade-off:
$$S_{i,\beta} = \frac{(1 + \beta) A_i C_i}{\beta A_i + C_i}$$
where A_i represents accuracy, β = 0.1 for balanced weight, and C_i is the normalized cost.
**Key findings:**
- **MIRT-BERT** currently stands out as the most cost-effective router, achieving accuracy comparable to Azure-Router at roughly one-fifth of the cost.
- **GPT-5** remains the performance leader but at significantly higher inference costs.
**GitHub:** https://github.com/RouteWorks/RouterArena
---
## Also available as an arXiv paper:
**RouterArena: An Open Platform for Comprehensive Comparison of LLM Routers** — arXiv:2510.00202
https://huggingface.co/papers/2510.00202
File diff suppressed because one or more lines are too long
@@ -0,0 +1,50 @@
# Small Fine-tuned Models are All You Need
**Author:** Stefan Webb
**Published:** October 16, 2025
**Source:** https://oumi.ai/blog/small-fine-tuned-models-are-all-you
---
## Core Thesis
Small fine-tuned foundation models can outperform large general-purpose ones (like GPT-4/GPT-5) on specialized tasks, with higher task-specific performance, faster inference, and lower cost. However, getting the details right requires technical expertise and intelligently designed infrastructure.
---
## Key Evidence
### Mid-2024 Empirical Study (Zhao et al., 2024)
- Researchers selected **31 tasks** across a wide range of domains.
- Fine-tuned **10 small base models** (<8B parameters: Llama, Mistral, Zephyr, Phi, Gemma) using **LoRA** on each task.
- **Main finding:** 6 of the 10 small models outperformed **GPT-4 on average** after fine-tuning. All 10 outperformed GPT-3.5-Turbo.
- Fine-tuning was done with rank-8 LoRA, 4-bit precision, 2,500 steps, batch size 16 — all on a single consumer-grade GPU (<24GB memory).
### Where Small Models Excel
- **Traditional NLP tasks (GLUE benchmark):** Largest improvement from fine-tuning and smallest gap to GPT-4.
- **Coding and math reasoning:** Initially lagged behind GPT-4 — but the base models used were pre-February 2024 and not pretrained for coding/reasoning.
### Where We Are Now (Late 2025)
- Newer base models like **Qwen3-4B-Instruct** have closed the gap on coding and reasoning performance.
- GPT-5 is stronger, but the open-source ecosystem has advanced dramatically.
- The author posits that repeating the study with late-2025 models would show small fine-tuned models closing the gap on coding and reasoning.
---
## Why Small Models Aren't Yet Ubiquitous
1. **Long development cycles** — earlier attempts at productionizing small fine-tuned models required months of custom development.
2. **Misconception about data** — belief that big data is required, but actually 1,000 carefully curated samples can suffice for successful fine-tuning.
3. **Catastrophic forgetting** — LoRA and parameter-efficient methods largely avoid this issue; RL-based methods prevent loss of generalization.
---
## Key Takeaways
- Small fine-tuned models <8B can match or exceed GPT-4 on domain-specific tasks.
- **LoRA** enables fine-tuning on a single consumer GPU.
- **1,000 high-quality samples** can be sufficient for strong fine-tuning results.
- The claim is nuanced — task type, base model choice, and fine-tuning methodology matter greatly.