Blog

Research5 min read

What Refinement Takes

Before building anything, we read what’s known about AI that improves its own work. Refinement works when feedback can be checked. To go further, the judge, the loop, and the cost all have to get better.

Our aim is AI that understands what makes work exceptional, and deliberately improves its creations until they meet demanding standards. Before building anything toward it, we read what’s known — about coding agents and the harnesses around them, about inference engines, and about how machines judge quality. This is what we found, and why it led us to three projects.

Refinement works when feedback can be checked

The clearest successes of AI improving its own work have one thing in common: feedback that can be checked. FunSearch and AlphaEvolve evolve programs that an automatic evaluator scores, and have found new results in mathematics and computing that way. Sampling many attempts at a problem pays off when an automatic verifier can pick out the right one; with a vote or a reward model instead, the gains level off (Brown et al.).

Take the checkable feedback away, and the picture changes. Asked to find and correct their own mistakes, models often don’t improve, and sometimes get worse (Huang et al.). A survey of self-correction found no convincing success with feedback from the model itself, except on tasks unusually suited to it (Kamoi et al.).

Another model as the judge helps less than it seems. Revising against a model judge can raise the judge’s scores while the quality people see stalls (Pan et al.): the loop learns to please its judge. And when a verifier lets wrong answers through, no amount of resampling gets past it (Stroebl et al.).

So refinement works today where work can be checked: code with tests, proofs, problems with known answers. Most work that matters can’t be checked that way — an essay, a research plan, a design, a change a maintainer would actually merge. For refinement to work there, and to be trusted and affordable where it already works, three things have to get better.

The judge

Machine judges are good at deciding whether an answer is correct, or which of two replies people prefer; the original benchmark for reward models is close to saturated. They’re much weaker where excellence lives. In studies that compare them with experts on open-ended work, the best judges agree about two times in three. They favor the first answer they see, the longer one, and their own. Asked again, they can change their minds. A single token can fool them.

Passing a check isn’t the same as being good, either. When maintainers reviewed AI-written changes that passed SWE-bench’s tests, they would not have merged roughly half of them (METR). The agents never got to revise in response to review, as a person would — and that’s the point. Getting from passing to good takes a judge that knows the difference, and a loop that uses it.

Mothfire Taste is our project on judgment: judges that tell great work from merely good work, know how sure they are, give the same verdict twice, hold up against work that’s trying to fool them, and give critiques measured by whether acting on them makes the work better.

The loop

Where work can be checked, agents already refine it — coding agents now do it for hours at a time. The program around the model, its harness, decides much of how that goes: with the same model, harnesses have differed by more than twice in cost at equal quality (Databricks). What no harness has settled is who decides that the work is done. Agents declare victory early, and grade their own work generously (Anthropic). Given tests they couldn’t see, frontier models have tried to game them (METR). The goal loops harnesses have begun to ship leave the decision to a model reading the conversation, or to no one. And the session that records the work is fragile: a crash, or a lossy summary of a long history, can’t be undone or audited.

Mothfire Loops is our project on the process: a small coding-agent harness, built from scratch, where done means verified. The definition of done is explicit and frozen for each run; an independent verifier runs the checks itself, including ones the agent never sees; and every session is a durable record that can be resumed, audited, and measured. Past done, it keeps improving the work, in batches of attempts from the best so far, and keeps only what the verifier measures as better.

The cost

Refinement means many passes over the same growing context — and so does every agent session. In public traces of coding agents, a typical call re-reads over a hundred thousand tokens of context to add under a thousand, and re-reading context is the largest part of the cost (TraceLab). Caching what an engine has already computed is what makes it affordable; hosted APIs now sell cache lifetimes of an hour or more.

Open engines were built for independent requests. They rediscover each session by matching prefixes, miss the cache without a word when a template rewrites earlier history, and can’t tell a session that’s paused for a tool from one that’s over. Session features are arriving in pieces — soft protection, timers, routing hints — but no open engine treats the session as one object it owns. And measurements of real agent sessions have only just begun.

Mothfire Inference is our project on cost: an inference engine, built from scratch, that serves agent sessions, not just requests — keeping their tokens, holding their cache through pauses, and scheduling them as sessions. It’s built for the best open models, which are hybrids: their state can be reused only where it was saved — and an engine that knows where each step ends knows where to save it. It starts by measuring the best open engines on replayed agent sessions, so its own results have something honest to beat.

Three projects, one aim

The three are independent. Each has its own repository, charter, roadmap, and releases, and none depends on another: a Taste judge can work in any harness, Loops works with any frontier model and any judge, and Inference can serve any agent. They share an aim, not a codebase.

All three are in research exploration. We’re studying the problems, and there’s nothing to install yet. We’ll write here about what we learn — including what doesn’t work.