hecate

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.

API cost on 231 held-out tasksFixes = tasks whose patch passes the hidden tests
  • Always the frontier model

    163 fixes · 231 frontier calls

    $260.72
  • Best learned router so far

    163 fixes · 229 frontier calls

    $259.40
  • Perfect routing, most fixes

    172 fixes · 38 frontier calls

    $82.01
  • Perfect routing, frontier quality

    163 fixes · 29 frontier calls

    $62.43
  • Always 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. 1

    Pre-register

    Each experiment’s spec and decision rules are written and reviewed before any number is seen.

  2. 2

    Ground in execution

    Labels come from hidden tests passing, not from a model’s opinion of the patch.

  3. 3

    Persist every run

    Adapter, per-task holdout scores and an off-machine copy, or the run doesn’t count.

  4. 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.

Hecate flow: an SWE task, optionally with the cheap agent’s first few turns, goes to the Hecate router, which keeps it on the cheap agent (optionally coached by a trained advisor) or escalates it to the frontier model. Mid-run hand-off and a four-way route-or-advise decision are planned. Below, the research loop: run both agents, score patches with hidden tests, train the router and advisor on those labels, and price the result.

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. 1

    Run

    The cheap and frontier agents attempt the same real software-engineering tasks.

  2. 2

    Score

    Hidden tests decide whether each patch resolves the issue. That pass/fail is the label; no LLM judge.

  3. 3

    Train

    The router learns P(cheap agent resolves). The advisor learns from resolve reward with GRPO; PPO is next.

  4. 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

  1. Aug 2026

    Aug 2026

    First routers

    Done

    Frozen issue text, oracle code structure, then a fine-tuned router with and without the cheap agent’s first turns.

  2. Sep 2026

    Sep 2026

    Specialist and generalist routers

    Done

    Train and test on a single repository, then a generalist across repositories. Every adapter and per-task score is now saved.

  3. Oct 2026

    Oct 2026

    Route then advise

    Done

    A small advisor model trained with GRPO to coach a cheap student, tested across three students.

  4. Oct 2026

    Oct 2026

    SWE tasks benchmark review

    In progress

    Review software-engineering task benchmarks: coverage, evaluation protocols, and gaps for near–real-world work.

  5. Nov 2026

    Nov 2026

    PPO vs GRPO for the advisor

    In progress

    On the lab’s DGX Spark, with every rollout saved. The toolchain check passed: a 3-step GRPO + LoRA run with weight sync to vLLM.

  6. Next

    Next

    Router training, route or advise, hand-off

    Planned

    PPO vs GRPO for the router, a four-way route-or-advise decision, and mid-run hand-off by text, summary or KV cache.

  7. Jan 2027

    Jan 2027

    Hecate Benchmark release

    Planned

    A contamination-free benchmark of real feature work in evolving web apps, graded by hidden tests and human review.

  8. Feb 2027

    Feb 2027

    LLM task router literature review

    Planned

    A survey of task-routing methods for software engineering, separate from the Hecate system release.

  9. May 2027

    May 2027

    Hecate Router V1 release

    Planned

    Release the router with its cost–quality results.

Follow the research

Specs, runs, decisions and full write-ups, recorded as the work advances.

Open journal