TL;DR
Picking a single AI model for a long, multi-step engineering job is a trap: frontier models burn money on routine chores, while cheap models choke on the hard parts. Partial routing solves this by analyzing past execution logs to build a plain-text "delegation playbook," guiding a frontier lead model on exactly which subtasks to hand off to a cheaper worker. Remarkably, splitting up the work doesn't just cut costs—it actually boosts overall quality beyond what the expensive frontier model achieves on its own.
What Problem Does This Paper Address?
Imagine hiring a principal staff engineer to build a web app from scratch. You want their brainpower on the system architecture and tricky backend logic, not burning billable hours writing boilerplate CSS.
In AI, standard model routing looks at a prompt and sends the entire job to either a pricey frontier model or a budget model. That worked fine for short Q&A, but modern coding agents run for hours, tackling sprawling sequences of easy and hard subtasks ("rollouts").
Existing workarounds have frustrating catch-22s. Out-of-the-box subagent tools let a lead model spawn cheaper helpers on the fly, but the lead guesses what to delegate completely blind, without knowing the worker's actual blind spots. Meanwhile, training a custom orchestrator via reinforcement learning bakes model behaviors into weights—meaning every time a provider updates an API model, you have to retrain from scratch. We need delegation that is dynamic, grounded in real performance data, controllable, and completely training-free.
Methods
The authors introduce partial routing, a lightweight pipeline that turns historical execution traces into prompt-based delegation rules—leaving model weights untouched.
- Offline Trace Profiling: Both the expensive Lead ($\mathcal{L}$) and cheap Worker ($\mathcal{W}$) attempt a small set of profiling tasks solo. An LLM annotator reads their step-by-step logs and groups actions into recurring subtasks (like Planning, Data model/DB, or Verification). An LLM judge then grades both models' quality on each subtask, while token trackers tally the exact dollar cost.
- Compiling the Policy: For each subtask, the system weighs the percentage cost savings against the "quality risk" (combining average and worst-case quality drops when swapping $\mathcal{L}$ for $\mathcal{W}$). A single user-tunable knob, $\delta \in [0, 1]$, controls how aggressively you favor savings over safety. Subtasks are bucketed into three plain-text tiers:
DELEGATE,CONDITIONAL(decide case-by-case), orKEEP(coordination tasks like planning are always kept). - Online Execution: On new tasks, this policy goes straight into the lead model's system prompt. During execution, the lead dynamically scopes assignments and uses a tool to spin up a worker in a fresh context window. The worker shares the file workspace, runs until completion, and hands back a compact summary report.
Datasets
No new benchmarks were created; the authors evaluated on two existing benchmarks built around realistic, long-horizon software workflows:
- ViBench: Agents build full-stack web applications inside an empty container from real-world Product Requirements Documents (PRDs), graded automatically by a browser-driving evaluation agent (5 profiling apps, 10 held-out test apps).
- Terminal-Bench 4.0: Agents complete complex command-line tasks in containers and are graded against pre-written verification test suites (12 profiling tasks, 23 held-out test tasks).
Key Insights and Ideas
- Delegation acts as "context hygiene": Why does adding a weaker model make the stronger model perform better overall? The authors point to context rot. When a solo lead writes every line of code, its context window fills up with noisy implementation history. Workers execute scoped chores in fresh contexts and return crisp summaries, keeping the lead's mind uncluttered for high-level reasoning.
- Free structure from past traces: Giving the solo lead just the discovered list of recurring subtasks as a suggested plan—with no worker model at all—slashed costs by 16%–39% and even boosted Terminal-Bench accuracy. Distilling past trajectories helps the model plan more efficiently.
- Glass-box control: Because the compiled policy is just plain text in a prompt, engineers can inspect it before deployment and manually override specific tiers—for instance, forcing authentication logic to stay
KEEPregardless of what $\delta$ says.
Key Results
Partial routing beat both solo frontier models and a hindsight oracle task-level router (which cheats by peeking at final scores to pick the best single model per task):
- ViBench (GLM 5.2 lead + MiniMax M3 worker): At $\delta = 0.75$, partial routing raised the mean score from 70.2 (lead alone) to 78.5 while cutting build costs by 19% ($0.83 down to $0.67). Workers generated 34.5% of output tokens for just 8% of the total cost.
- Terminal-Bench 4.0 (GPT-6.1 Sol lead + GPT-6 Luna worker): Even though the worker passed a dismal 8.7% of tasks solo, partial routing ($\delta = 0.75$) lifted the lead's pass rate from 54.3% to 60.9% at roughly the same cost ($1.19 vs. $1.17). Unguided delegation gained zero accuracy here (54.3%).
- Profiling overhead was tiny—costing roughly $30 total on ViBench.
Limitations and Future Work
- The wall-clock tax: Because delegation happens sequentially—the lead pauses while waiting for each worker's report—wall-clock time jumps significantly. On Terminal-Bench, median task duration rose from 14 minutes (solo lead) to 69 minutes at $\delta = 0.75$.
- Narrow testbed and fixed knobs: Experiments focused exclusively on coding/CLI tasks using model pairs with steep price and capability gaps. Hyperparameters like the risk-blending weight ($\rho = 0.5$) and tier threshold ($\tau = 0.15$) were held fixed rather than swept, and LLM judge scores weren't cross-checked against human raters.
- Future directions: Testing partial routing in non-coding domains (like finance, law, or healthcare) and analyzing compliance—how faithfully lead models actually obey, bend, or override their assigned delegation tiers mid-rollout.
Summary updated