# GEPA improved AI prompts by reading how a task went wrong

> A low score says something went wrong. A record of tool calls and replies can give the next attempt more to work with.

Published 2026-11-08

Canonical: https://machines-on-machines.anth.us/posts/gepa-learning-from-agent-traces/

A test can tell an AI system it failed without showing where it went off course. GEPA gives a language model the record of an attempt, such as which tools were called and what they returned. The model reads that record and proposes an edit to the instructions used for the next try.

::image{
  src="assets/gepa-learning-from-agent-traces/gepa.png"
  layout="inline"
  alt="A branching diagram shows an initial prompt and several revisions informed by observations from test runs."
  caption="An example from the GEPA paper shows how feedback from test runs guided successive prompt edits."
  credit="The GEPA research team, figure 5, arXiv:2507.19457."
}

[Image source](https://arxiv.org/html/2507.19457v2)

Researchers test the edits and keep alternatives that do well on different examples. The program can combine useful ideas from several alternatives. The study reports better performance on average than its chosen reinforcement-learning baseline across six tasks, sometimes with many fewer attempts.

The comparison depends on those tasks and the particular methods tested. It makes one design choice easier to see. A test run can supply useful language about what went wrong, as well as a score. For a system whose behavior depends on written instructions, that extra information gives it something specific to change.

[Read the source](https://arxiv.org/abs/2507.19457).
<!-- papyrus-source-version: 3 -->
