May 26, 2026· CodeEvolver Research· 5 min read

The greedy optimizer problem: why naive self-improvement gets stuck

Suppose you built the simplest possible self-improvement loop: take the current system, propose a change, keep it if the score goes up. This is called Greedy hill-climbing. It works for a while, until the score flatlines well short of what the system could be.

Why greedy gets stuck

The best program is often a different architecture from your existing program. If your program is pretty polished (i.e., in a local optimum), when you first explore that new architecture it may not outperform the local optimum until several rounds of improvement.

A greedy optimizer would reject any regressive moves, including in a new approach that shows promise. It can only collect the wins that are reachable in a single step. That set runs out fast, and you end up with a local optimum.

Evolution's answer: keep a population

Evolutionary optimizers like GEPA maintain a pool of diverse candidates instead of a single champion. Mutations branch from many parents — including ones that aren't currently the best. A candidate that dipped on the way to somewhere interesting survives long enough to get its second mutation.

Our Artificial Selection Algorithm

With code, an engineer would never start from a random branch without a plan. An evolutionary approach is simply too random.

Our artificial selection algorithm is inspired by biology. Evolution is a powerful force that creates new species in the span of hundreds of thousands of years. Meanwhile, we can create new dog breeds in the span of 50. In our artificial selection algorithm, we preserve the diversity benefits of evolution, but we allow the changes to be driven by the agent, which we describe as a scientist running experiments and testing hypotheses.

In our benchmark runs you can watch it happen in the improvement trajectories: winning systems regularly descend from candidates that were from non-best candidates. If we'd kept only each generation's best, those lines would have been culled.

Rule of Thumb

Generally speaking, systems where the solution is predictable benefit from greedier algorithms. Systems where the best program is unpredictable require a lot of experimentation and benefit from an evolutionary algorithm. Our artificial selection algorithm provides the best of both worlds. It allows the agent the flexibility to decide when to be greedy and when to experiment and explore.

Improvement isn't a ladder; it's a tree. Search it like one.

Back to the blog