Think about what a coding agent is when you first install it. It’s a generalist. The same agent might fix a React bug in your repository this morning and write a Python module in someone else’s this afternoon, so its system prompt has to work for every codebase at once. The harness (the program that wraps the model, gives it a shell and file tools, and runs the loop) adds notes on top, but those are mostly about calling tools and formatting edits. Nothing in the prompt tells the agent which table is the source of truth for revenue, that your timestamps are stored in UTC, or that your team never drops rows with missing values without logging them.
You could write that specialization yourself, but almost nobody does. It takes time; you’d have to redo it for every model you evaluate, and it’s hard to tell which instructions help. GEPA, which we describe below, writes it for you. You give it practice tasks from your own codebase, and a stronger model reads the agent’s work logs, sees where it went wrong, and rewrites the agent’s instructions. GEPA keeps the new instructions only if they score better on the same tasks.
We wanted GEPA to raise the share of tasks each model solves, so we ran it on eight models against our Zulip coding benchmark. It didn’t work, at least not in a way we could measure. Some models solved a few more tasks and some a few less, but no change was larger than the noise between two identical runs. Our read is that instructions change how a model works, not how hard a problem it can reason through.
What we did notice was a side effect. The new instructions made the agents more focused, mostly by stopping them from running tests that could never run in the sandbox, and for five of the eight models, that alone made each task cheaper. So we ran a second experiment that added a small penalty for cost to GEPA’s score. The savings grew 40% to 70% across the models we tested, with no detectable accuracy loss for GPT-5.6 Luna and a possible small loss for the others. For an agent that works in the same codebase every day, that’s a real dent in the monthly AI bill.
Then we changed how we tested the agents. Our earlier leaderboard gave each agent one attempt per task to measure how much work it finishes without an engineer’s help. But a retry costs an engineer almost nothing. The agent is faster and cheaper than a person, and all it needs to hear is “not fixed yet,” which a failing test can say on its own. So we gave each failed fix that one-line message and up to two more tries. That message added roughly 10 points to the accuracy rate for every model, more than anything GEPA wrote. GEPA’s cost savings mostly held in this setting.
How GEPA writes and tests new instructions
GEPA stands for Genetic-Pareto (from the paper GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning). It doesn’t write instructions so much as breed them, the way a plant breeder breeds a crop.
Our harness, Pi, lets us add text about the repository on top of its generic system prompt, such as “There’s no local database, so don’t run the full test suite.” We call that text the “instructions,” and it’s what GEPA writes. The baseline adds none.
A stronger model, the “reflector” (Claude Opus 5.5 in our runs), plays the breeder. GEPA runs the agent with a set of instructions on a few practice tasks, and the reflector reads the logs, the failed tests, and the fix the engineers actually shipped. Then it writes a revised copy of the instructions aimed at what went wrong. If the revision scores better, GEPA keeps it, and the loop repeats until the budget runs out. No model weights change, so every result is plain text we can read.
The “Pareto” half means GEPA keeps the best instructions for each task, not only the best on average, the same way you’d keep the best model at each price point. That stops it from spending its whole budget polishing one set of instructions.
We ran two versions. In accuracy focus, the score is the share of hidden tests the patch passes. In cost focus, we subtract a small penalty for cost:
score = accuracy − 0.1 × (cost of this run ÷ baseline cost on the same task)
Halving the cost is worth only 0.05, so solving tasks stays the main goal and cost breaks ties.
All tasks come from the Zulip benchmark we discussed in our earlier post. GEPA trained on 20 of its harder tasks, and we tested the final instructions on 30 more that it never saw, three runs each, alongside the baseline. The tables call the single-attempt setting one-shot and the “not fixed yet” setting feedback rounds. Running the same instructions twice flipped about 22% of per-task outcomes, so a difference of one or two solved tasks out of 30 is noise.
What actually changed in the instructions
Every set of instructions GEPA wrote is plain text, so we read them all. Most of it is practical knowledge about the repository, e.g., the backend logic lives in zerver/lib/, and when you change a function, check every place that calls it.
The accuracy-focused instructions told the agent to build its own safety net, e.g., copy the logic you changed into a scratch script and run it, and find every place that calls a function you changed. That’s careful advice, but it adds work. Agents with these instructions edited test files twice as often as the baseline, and since the hidden tests grade the patch, those extra tests only cost tokens. The cost-focused instructions told the agent to work like someone who already knows the repository: read the function instead of the whole file, batch independent searches into one turn, skip tests nobody asked for, check the diff once, and stop.
Here’s what those instructions did to GPT-5.6 Luna’s behavior across its 90 held-out runs.
What the agent did, per run (GPT-5.6 Luna)
Baseline
Accuracy focus
Cost focus
Model turns, relative to baseline
1.00
0.86
0.59
Attempts to run tests or install packages (always fail)
4.4
0.3
0.1
Edits to test files
1.4
2.8
Whole-file reads
1.9
1.3
0.02
Code searches
13.8
12.8
13.6
Ranged file reads
22.9
22.2
22.9
Largest single request to the model (tokens)
80K
77K
63K
Table 1: GPT-5.6 Luna’s behavior per run across 90 held-out runs.
Notice what the cost-focused instructions didn’t cut. Luna searched and read code as often as before, so it explored the repository just as thoroughly, but it did it with 41% fewer turns. And since every turn re-sends the whole conversation so far, fewer and shorter turns compound into most of the savings.
The results
The first table is the one-shot experiment for the three models we ran in both setups. Each task ran three times. Cost is dollars per agent run at list prices.
Figure 1: How baseline, accuracy-focused, and cost-focused instructions compare across GPT-5.6 Luna, Claude Haiku 5.5, and GPT-5.6 Sol.
Two things are true of every row. No resolve rate changed by an amount we can distinguish from noise, even though GEPA’s own validation score went up by 0.06 to 0.25 for every model (the instructions that look best on 20 tasks are partly the instructions that got lucky on 20 tasks). And cost did move. Accuracy-focused instructions alone saved 14% to 22%, and asking GEPA to care about cost raised the savings to 42% for Luna and Sol and 70% for Haiku 5.5, with 29 or 30 of the 30 tasks cheaper in every case.
The second table shows the five models we ran in the accuracy-focused setup only, one-shot.
Figure 2: How accuracy-focused instructions compare across five models.
The third table is the feedback-rounds experiment. Cost includes every round. Muse Glimmer 30B ran on our own GPUs, so its dollar figures use a public hosting provider’s per-token price as a reference to give a similar per-token rate as cloud models.
Figure 3: Cost per solved task with cost-focused instructions across six model/harness combinations.
Across all three tables, the pattern is the same. GEPA’s instructions didn’t move accuracy for any model by more than the noise, but they cut cost for most of them by 40% to 70% when we asked GEPA to care about cost. That’s where we think GEPA fits for enterprise work: It won’t make your agent smarter, but it can make the same work much cheaper on tasks your agents run every day.
What this means for your codebase
When we asked GEPA to care about cost, it cut the bill by 40% to 70% for the models we tested, and for an enterprise, that’s the part that should resonate. Your agents run in the same private repositories every day, on a generic system prompt that has never seen your code. To use it on your own codebase, you’ll need examples of the kinds of tasks your agents do, anywhere from a few dozen to a few hundred, each with a way to check whether the work was done right, plus a sandbox and a stronger model to act as the reflector. GEPA isn’t free, since every training run costs real money in agent runs and reflector calls, but the savings pay it back over time. In our runs, tuning GPT-5.6 Luna cost about $30 and paid for itself after roughly 1,000 tasks. Tuning GPT-5.6 Sol cost about $400 and paid for itself after 350 to 500 tasks.
Every agent you deploy starts out as a generalist, and right now, you’re paying for it to rediscover your codebase on every task. GEPA may not make that agent smarter, but it will teach it how your codebase works and help it spend less money coming up with an answer. Our numbers come from one open source repository, so measure the savings on your own tasks to see what gains you get. The best time to start is when you’re choosing which models to run in production, because the tasks you build to compare models are the same tasks GEPA trains on. The benchmark, the harness, and every set of instructions from this post are on GitHub.












