When should a coding agent call the frontier model?
Hecate Lab at UC Santa Cruz trains routers and advisors for AI coding agents.
87%
of the tasks we held out didn’t need the frontier model. Matching its 163 fixes took the frontier model on only 29 of 231 tasks.
That is hindsight. Our best generalist router so far recovers almost none of it: to keep the same 163 fixes it still sent 229 tasks to the frontier model. The distance between those two bars is the research problem.
Always the frontier model
163 fixes · 231 frontier calls
$260.72Best learned router so far
163 fixes · 229 frontier calls
$259.40Perfect routing, most fixes
172 fixes · 38 frontier calls
$82.01Perfect routing, frontier quality
163 fixes · 29 frontier calls
$62.43Always the cheap model
134 fixes · 0 frontier calls
$39.28
Source: our analysis of public coding-agent runs on a repository held out from training.
Three questions, one lab
1
Route
issue → P(cheap agent resolves)
From the issue, and maybe the cheap agent’s first few turns, can a model predict whether the cheap agent will fix it?
2
Advise
advisor + cheap agent
Can a small trained advisor coach a cheap agent well enough that the task never needs to escalate?
3
Train
cross-entropy · GRPO · PPO
Which objective trains the router and the advisor best: cross-entropy, GRPO or PPO?
1
Pre-register
Each experiment’s spec and decision rules are written and reviewed before any number is seen.
2
Ground in execution
Labels come from hidden tests passing, not from a model’s opinion of the patch.
3
Persist every run
Adapter, per-task holdout scores and an off-machine copy, or the run doesn’t count.
4
Keep the nulls
Rejected hypotheses and failed checks stay on the record and constrain what we claim.
A cheap agent starts every task.
Hecate decides when to escalate.
SWE task
Issue text and the repository. Some router variants also read the cheap agent’s first few turns.
hecate router
A small fine-tuned model scores the chance the cheap agent resolves the task.
Stay cheap
A low-cost model, optionally coached by a small trained advisor.
Escalate
Hand the task to a frontier model.
Hand off mid-run
Escalate partway through, passing full text, a summary or the KV cache.
Route or advise
One decision over four options: cheap, cheap + advisor, mid or premium.
1
Run
The cheap and frontier agents attempt the same real software-engineering tasks.
2
Score
Hidden tests decide whether each patch resolves the issue. That pass/fail is the label; no LLM judge.
3
Train
The router learns P(cheap agent resolves). The advisor learns from resolve reward with GRPO; PPO is next.
4
Price
Sweep the escalation threshold λ. Report Route-AUC and the dollars it takes to match always-frontier quality.
Built and testedPlanned, not run
From first router to V1 release, May 2027
- Aug 2026
Aug 2026
First routers
DoneFrozen issue text, oracle code structure, then a fine-tuned router with and without the cheap agent’s first turns.
- Sep 2026
Sep 2026
Specialist and generalist routers
DoneTrain and test on a single repository, then a generalist across repositories. Every adapter and per-task score is now saved.
- Oct 2026
Oct 2026
Route then advise
DoneA small advisor model trained with GRPO to coach a cheap student, tested across three students.
- Oct 2026
Oct 2026
SWE tasks benchmark review
In progressReview software-engineering task benchmarks: coverage, evaluation protocols, and gaps for near–real-world work.
- Nov 2026
Nov 2026
PPO vs GRPO for the advisor
In progressOn the lab’s DGX Spark, with every rollout saved. The toolchain check passed: a 3-step GRPO + LoRA run with weight sync to vLLM.
- Next
Next
Router training, route or advise, hand-off
PlannedPPO vs GRPO for the router, a four-way route-or-advise decision, and mid-run hand-off by text, summary or KV cache.
- Jan 2027
Jan 2027
Hecate Benchmark release
PlannedA contamination-free benchmark of real feature work in evolving web apps, graded by hidden tests and human review.
- Feb 2027
Feb 2027
LLM task router literature review
PlannedA survey of task-routing methods for software engineering, separate from the Hecate system release.
- May 2027
May 2027
Hecate Router V1 release
PlannedRelease the router with its cost–quality results.
Follow the research
Specs, runs, decisions and full write-ups, recorded as the work advances.