Skip to content

Chapter 5 · Self-Evolving Agents


5.1 Where This Chapter Fits ★★

What the previous rung left open ★★

Rung What is improved Signal source Representative work Main failure (why the next rung exists) Chapter
3. Self-reward and self-play ("zero data") Weights Internal signals (majority vote, confidence) or self-proposed tasks checked by an executor or corpus TTRL, Intuitor, Absolute Zero, R-Zero, SPICE, self-play SWE-RL, SDPO Intrinsic rewards rise then collapse; only grounded self-play keeps improving; weight updates are costly, opaque and per-model Ch 4
4. Non-parametric self-evolution Context/playbook, prompts, skills, memory Execution feedback plus reflection; validation sets; Pareto frontiers Dynamic Cheatsheet, ACE, GEPA, Agent Skills, ReasoningBank Bounded by the frozen model; global edits overwrite gains; the improvement procedure is hand-designed Ch 5
5. Self-referential improvement and evolutionary discovery Agent code and harness, the improver itself; external programs Benchmark scores with archives, metaproductivity and gates; automated evaluators DGM, HGM, Hyperagents, Meta-Harness; AlphaEvolve, ShinkaEvolve Objective hacking; the best performer is not the best parent; the base model is still frozen Ch 5
\[\mathcal{A}_{t+1} = U\big(\mathcal{A}_t,\ \{\tau_i\},\ \{s_i\}\big), \qquad \mathcal{A}_t = \big(\theta_{\text{frozen}},\ \mathcal{S}_t\big)\]

Chapter 4's conclusion has two sides. The good side: as long as the loop is grounded, a model really can set its own problems and keep improving. The bad side: every one of those improvements has to be written into the weights. Weight updates need large-scale RL or distillation, which is expensive and slow; what changed can't be seen and is hard to undo; switching to a new base model means starting over; and most agents actually deployed in 2025–2026 run on closed models available only through an API, so their weights can't be touched at all. This led to another route: don't change the model; change the system around it.

A modern agent can be seen as "foundation model + scaffold" (the scaffold is also often called the harness): the system prompt and instructions, a playbook in the context, memory and an experience store, skills and tools, the control logic that chains several LLM calls together, and the code that implements all of this. The survey by Ren et al. (2026) defines self-improvement as an update operator that the agent itself initiates on one of these two parts, classified by "what is updated" and "which signal drives it". This chapter is about the half that updates the scaffold:

Here \(\mathcal{A}_t\) is version \(t\) of the agent, \(\theta_{\text{frozen}}\) is the frozen model weights and \(\mathcal{S}_t\) is the current scaffold. While doing tasks, the agent collects trajectories \(\tau_i\) and evaluation signals \(s_i\) (did the task succeed, did the tests pass, what score did it get), and the update operator \(U\) uses them to change only \(\mathcal{S}\). The benefits are concrete: it works with closed models; the result of an improvement is a piece of text, a skill file or a code diff that people can read, review easily and roll back at any time; it costs far less than training; and it causes no catastrophic forgetting in the weights. That is why most of the "self-improvement" that actually shipped in 2025–2026 happened at this level. A popular 2026 framing treats the context as "fast weights" and the parameters as "slow weights"; how the two work together is the topic of Chapter 6.

Interview questions

  • ★★ What is a self-evolving agent, and how does what it improves differ from the methods of Chapter 4?
  • ★ What are the advantages and limits of self-evolution that doesn't change the weights?

Rung 4 and rung 5 ★★

Loop part Rung 4: non-parametric self-evolution Rung 5: self-referential and meta-level improvement
Generator The agent doing tasks, plus an LLM that proposes edits The agent proposing edits to its own code or to the improver
Verifier Execution feedback, tests, validation sets, LLM reflection Benchmark evaluation, archives, statistical gates
Updater Text edits to the context, prompts, skills or memory Code diffs to the agent, the harness or the meta-agent
Problem source A task stream or a fixed benchmark Usually a fixed benchmark; for discovery, a fixed target problem

This chapter covers two rungs of the ladder map in Chapter 1. Rung 4 evolves what the agent knows: the playbook in its context (5.2), its prompts (5.3), its skills (5.4) and its memory (5.5). In this rung's loops, the part that does the improving (who reflects, how lessons are summarized, how they are written back) is designed by people and stays fixed. Rung 5 goes one step deeper and evolves how the agent works and how it improves itself: the agent rewrites its own code (5.6), and then the code responsible for improving (5.7); and the same "LLM proposes changes + automated evaluation + archive-based selection" machinery, applied to external programs, becomes evolutionary discovery (5.8).

Along this line, 2026 left several lessons worth remembering, which form the thread of this chapter: most public skills have no effect, and a skill library is only as good as its admission gate and its retrieval; the highest-scoring agent is not necessarily the best "parent"; most of evolutionary search's advantage over independent sampling disappears once token budgets are matched; and on shifting task streams, self-evolving agents trade "plasticity" against "stability", so one-shot optimization gains do not compound by themselves (5.9).

Interview questions

  • ★★ How does self-evolution at rung 4 differ from rung 5?

5.2 Context and Playbook Evolution ★★

Lineage: from one-off reflection to cross-task experience ★

Reflexion (see Agent Chapter 2, Section 2.4) has an agent write a reflection after failing and consult it when retrying the same task, but those reflections only help with that one problem. ExpeL (Zhao et al. 2023) extended this across tasks: the agent accumulates successful and failed trajectories on a batch of training tasks, and an LLM compares successes with failures on the same task, maintaining a natural-language list of "insights" with four operations, ADD, EDIT, UPVOTE and DOWNVOTE; for a new task, the insights and retrieved successful trajectories go into the prompt, with no parameter updates at any point (ALFWorld success rose from 40% to 59%). It showed that cross-task learning is possible without touching the weights, but it also exposed the problems such methods share: the insight list keeps growing; extraction quality depends on the summarizing LLM; and, more subtly, repeated summarizing and rewriting wears away specific, useful details. 2025's work started from exactly this last problem.

Dynamic Cheatsheet ★

Dynamic Cheatsheet (Suzgun et al. 2025) gives a black-box model a continually updated "cheatsheet": at test time, as the model solves problems, it stores useful strategies and code snippets in the cheatsheet and decides for itself which entries to keep, edit or delete, with no labels at all. The most dramatic example is the Game of 24: GPT-4o discovers that it can write a Python solver, stores it in the cheatsheet and reuses it, raising accuracy from about 10% to 99%; Claude 3.5 Sonnet's accuracy on AIME more than doubles too. In the four-part loop, the generator is the model itself, the problem source is the stream of incoming user questions, the updater is the curation of the cheatsheet, and the verifier is only the model's own judgment of "was this strategy useful". So it works best on tasks that can be self-checked (in the Game of 24 you just compute the result); on tasks that are hard to self-check, a wrong strategy may be kept and affect every later question.

ACE: the incremental playbook ★★

ACE (Agentic Context Engineering, Zhang et al. 2025) starts from a specific failure mode. If an LLM rewrites the whole context every round, two kinds of degradation appear: brevity bias, where summaries favor brevity and drop domain-specific details (say, the quirks of a particular API or the special format of a certain report); and context collapse, where after many rounds of wholesale rewriting the accumulated details gradually vanish and the context gets shorter and emptier with each edit. The reason is simple: when asked to "rewrite" a long text, an LLM naturally tends to compress it.

ACE's remedy is to treat the context as an ever-growing playbook maintained by three roles: a Generator that does tasks and produces trajectories; a Reflector that extracts concrete lessons from successes and failures; and a Curator that merges the lessons into the playbook as delta updates, adding or editing individual entries and periodically deduplicating, instead of rewriting the whole thing ("grow-and-refine"). The paper reports gains of 10.6% on agent benchmarks and 8.6% on finance tasks; on AppWorld, it matches the top production-level agent on the leaderboard using a smaller open model.

Why do incremental updates work? They follow two principles from other chapters: "accumulate data rather than replace it" from the model-collapse literature (see Chapter 3), and "localized updates cause less interference" from continual learning (see Chapter 6). Wholesale rewriting replaces the old version with a new one every time, so any old detail that isn't kept even once is lost forever; delta entries keep old knowledge by default and modify only what is clearly outdated. The price is that the playbook keeps growing and needs retrieval and pruning; and the three-role division of labor is itself designed by people, which isn't broken until Section 5.7. (Meta Context Engineering (Ye et al. 2026) has already started having a meta-agent evolve these context-engineering skills themselves.)

Interview questions

  • ★★ What are context collapse and brevity bias, and how does ACE avoid them?
  • ★ How does ExpeL differ from Reflexion?
  • ★ On what kinds of tasks does Dynamic Cheatsheet work best?

5.3 Reflective Prompt Evolution ★★

Lineage: APE and OPRO ★

\[p^\star = \arg\max_{p}\ \frac{1}{|\mathcal{D}_{\text{dev}}|}\sum_{(x, y) \in \mathcal{D}_{\text{dev}}} m\big(\mathrm{LLM}(p, x),\ y\big)\]

A playbook accumulates experience of how to do things; a more direct target for improvement is the instruction that tells the model how to do them. Automatic prompt optimization treats the prompt \(p\) as a parameter to optimize: on a small dev set \(\mathcal{D}_{\text{dev}}\), find the prompt that maximizes the average task metric \(m\), where \(\mathrm{LLM}(p, x)\) is the model's output on input \(x\) under prompt \(p\) and \(y\) is the reference answer. A prompt is discrete text with no gradient, so early methods all used an LLM to propose candidates and a score to select among them. APE (Zhou et al. 2022) had an LLM infer instructions from input–output examples and then paraphrase the best few; OPRO (Yang et al. 2023) used the LLM directly as an optimizer, with a meta-prompt containing past prompts and their scores, asking the LLM for new prompts that score higher, and it found prompts such as "Take a deep breath and work on this problem step-by-step". Their shared limit is that each candidate earns just one score: the score tells you "how good", not "why", so many evaluations are needed and it is easy to overfit a dev set of only a few dozen examples. (EvoPrompt, Promptbreeder, TextGrad and DSPy belong to this lineage too.)

GEPA ★★

\[\mathcal{P} = \Big\{\, p \in \mathcal{C} \;:\; \exists\, i \in \mathcal{D}_{\text{train}},\ \ s_i(p) = \max_{p' \in \mathcal{C}} s_i(p') \,\Big\}\]

GEPA (Genetic-Pareto, Agrawal et al. 2025) targets exactly the "only one score" problem. It runs the system on training examples and collects full execution traces: the reasoning, tool calls, tool outputs and the evaluator's textual feedback. An LLM reads these traces and diagnoses in natural language why things failed (for example, "retrieval returned irrelevant documents and the model didn't notice"), proposes a prompt change for one module of the system based on that diagnosis, and then tests the change. Compared with seeing only a score, a trace carries far more information, so each rollout teaches far more.

To keep all candidates from converging to the same prompt, GEPA maintains a Pareto frontier. In the formula, \(\mathcal{C}\) is the set of all candidate prompts and \(s_i(p)\) is candidate \(p\)'s score on training example \(i\); any candidate that is the best on at least one example stays on the frontier \(\mathcal{P}\). Candidates are then picked from the frontier for further edits, and complementary lessons learned by different candidates can be merged. This is essentially diversity protection (compounding condition iv): a prompt with an unremarkable average but a distinctive strength on one kind of hard problem is not eliminated because of its average.

The paper reports that GEPA beats RL fine-tuning with GRPO by about 6% on average and up to about 20%, using up to 35× fewer rollouts, and beats MIPROv2 by more than 10%. The result is often summarized as: with little data, learning in language space by updating prompts can be more sample-efficient than RL in weight space with a scalar reward. It is the same insight as SDPO's in Chapter 4: rich textual feedback carries more information than a scalar. The difference is that SDPO distills this information into the weights, while GEPA writes it into the prompt, which is cheaper, readable and reversible, but can only draw out abilities the model already has.

Interview questions

  • ★★ Why can GEPA use fewer rollouts than GRPO?
  • ★★ What role does GEPA's Pareto frontier play?
  • ★ Where does the direction of improvement come from in APE, OPRO and GEPA?
  • ★ When should you choose prompt or scaffold evolution, and when RL fine-tuning?

    Prefer prompt or scaffold evolution when you can only use an API model, data and compute are limited, and you need fast iteration and interpretability. When the task needs knowledge or reasoning the model doesn't have, or you need stable gains in large-scale, long-term deployment, you need RL or distillation to write the improvement into the weights. The two can also be combined: use evolution to find good prompts and workflows first, then train on the good trajectories they produce.


5.4 Skills: From Skill Libraries to Agent Skills ★★

Lineage: Voyager and skill libraries ★

Playbooks and prompts are descriptive text; when a piece of experience can be written as an executable, reusable procedure, it becomes a "skill". Voyager (Wang et al. 2023) is where distilling abilities into skills began. It uses GPT-4 as a black-box brain in Minecraft: an automatic curriculum proposes the next task of suitable difficulty; the code it writes is revised repeatedly using three signals, environment feedback, execution errors and self-verification, and only after it executes successfully is it saved to the skill library as a JavaScript function, retrieved by the embedding of its description; skills can call one another, so simple skills compose into complex ones. The library only grows, and new skills never overwrite old ones, which structurally avoids catastrophic forgetting. It obtained 3.3× more unique items than the previous best method and unlocked the tech tree up to 15.3× faster. Agent Workflow Memory (Wang et al. 2024) applied the same idea to web tasks, inducing reusable workflows from trajectories (combining skill libraries with RL is covered in Agent Chapter 6, Section 6.8).

Interview questions

  • ★ Why does Voyager store skills as code, and how does its skill library avoid catastrophic forgetting?

Agent Skills: skills become a standard format ★★

Agent Skills were first proposed by Anthropic, later released as an open standard, and are now hosted by the Agentic AI Foundation under the Linux Foundation, adopted by a large number of agent products. A skill is a folder whose core is a SKILL.md file: it starts with metadata (at least a name and a description), and the body contains instructions telling the agent how to do a certain kind of task; the folder can also include scripts, reference documents and templates.

Its key design is progressive disclosure, in three steps. Discovery: at startup the agent loads only each skill's name and description into context, just enough to judge when it might be useful. Activation: only when a task matches a skill's description is the full SKILL.md read in. Execution: the agent follows the instructions, running bundled scripts or loading reference files as needed. This lets an agent hold many skills with very little context overhead.

From the self-improvement angle, a skill is procedural memory that the model can write itself (procedural memory is covered in Agent Chapter 4): a set of instructions plus a few scripts is far easier to write than training a model, and it can be reused across models and products. When introducing Agent Skills, Anthropic already set the goal of agents that create, edit and evaluate skills on their own. So a natural question follows: do these skills actually help?

Interview questions

  • ★★ How does progressive disclosure in Agent Skills work, and why is it designed this way?

The audit evidence: most skills have no effect ★★

Study Setup Main finding
SkillsBench (Li et al. 2026) 87 tasks in 8 domains; curated skills vs none; 18 model–harness configurations Pass rate 33.9% → 50.5%; focused skills (≤3 modules) beat exhaustive ones; small models with skills can match larger models without
SWE-Skills-Bench (Han et al. 2026) 98 public skills on real repositories; 3,920 paired runs 92 of 98 skills have no significant effect; average 76.6% → 76.9%; harmful skills cost up to 17.0 points
Demystifying Agent Skills (Jiang et al. 2026) Controlled runs plus paired trajectory analysis Procedural anchoring in 65.7% of cases vs knowledge injection in 4.5%; use precision falls from 29.6% to 3.3% as the pool grows from 5 to 100 skills

Three controlled 2026 studies paint a fairly consistent picture. Curated skills really help. SkillsBench (Li et al. 2026) compared runs with and without skills on 87 tasks in 8 domains, for 18 "model + harness" configurations, with a deterministic verifier for every task: curated skills raised the average pass rate from 33.9% to 50.5%; focused skills (at most three modules) beat large, exhaustive bundles; and small models with skills could match larger models without them.

But most public skills have no effect. SWE-Skills-Bench (Han et al. 2026) collected 98 public software-engineering skills, paired each with a real code repository pinned to a fixed version and an executable verifier, and ran every task once with and once without the skill, 3,920 paired runs in total. Of the 98 skills, 92 had no statistically significant effect, and the average pass rate moved only from 76.6% to 76.9%. The few helpful skills supplied steps the agent would otherwise skip, gaining up to 17.7 points; harmful skills made the agent follow the skill's template while ignoring the task's explicit requirements, losing up to 17.0 points.

Why skills work, and why they fail. Analyzing many paired execution trajectories, Jiang et al. (2026) found that skills work mainly through procedural anchoring: they pin a messy execution process to a stable procedure, which accounts for 65.7% of cases, while genuinely "supplying knowledge the model lacks" accounts for only 4.5%. In other words, skills stabilize actions rather than supply facts. Retrieval is a separate bottleneck: as the skill pool grows from 5 to 100 skills, the precision with which skills are actually used correctly falls from 29.6% to 3.3%.

Read together, the three studies say a skill's value depends on two parts of the loop. One is the verifier and the gate: whether a skill enters the library should be decided by paired evaluation, not by "it was written, so it counts". The other is retrieval: the more skills there are, the harder it is to pick the right one, and a skill that isn't selected or is misused is not just useless but potentially harmful. This also means that letting an agent mass-produce skills without filtering is likely only to create more skills that "have no effect".

Interview questions

  • ★★ 2026 What did the 2026 audit studies conclude about the effect of skills?
  • ★ Through what mechanism do skills mainly work, and what problem does a growing skill pool cause?

Self-evolving skill libraries ★

EvoSkill (Alzubi et al. 2026) is an example of feeding the audit lessons back into a self-evolution loop. It analyzes why the agent's executions failed, proposes new skills or edits to existing ones, and saves them as structured skill folders; it then selects using a Pareto frontier of agent programs, keeping only skills that bring improvement on a held-out validation set, with the underlying model frozen throughout. On OfficeQA, built on U.S. Treasury data, exact-match accuracy rose from 60.6% to 67.9%; on SealQA, which has very noisy retrieval, from 26.6% to 38.7%, and skills evolved on SealQA transferred to BrowseComp unchanged, giving a 5.3% gain. Another study, SkillFlow (Zhang et al. 2026), ran lifelong skill discovery starting from zero skills and found that strong models benefit while weaker models gain little or even regress, again showing that the ceiling of skills is set by the base model.

A few design principles follow: decide admission by paired evaluation on a held-out set; keep skills focused; prune unused or harmful skills regularly; monitor retrieval precision; and when evaluating, report paired with-and-without results and their significance.

Interview questions

  • ★★ If an agent generates its own skills, how do you keep the library from filling up with useless ones?

5.5 Memory-Based Learning ★

A skill is procedural memory that has already been written down. More generally, an agent can store experience in external memory and retrieve it for later tasks, which is itself a form of learning without changing the weights. The mechanics of storing, retrieving, updating and forgetting memories are covered in Agent Chapter 4; here we look only at a few representative works that treat memory as a learning mechanism, and at how this line moves step by step toward "improving the improver".

From trajectories to strategies: ReasoningBank ★★

ReasoningBank (Ouyang et al. 2025) makes two key choices. First, memory stores not raw trajectories but generalizable reasoning strategies distilled from them, because raw trajectories are too long and too specific to reuse on a different task. Second, strategies are distilled from both successful and failed trajectories, with success or failure judged by the model itself: failures tell you which approaches to avoid and are often as valuable as successes. The distilled memory items are retrieved and used on new tasks, then updated based on the new outcomes. The paper also proposes memory-aware test-time scaling (MaTTS): spend extra compute on the same task to generate several contrasting experiences and distill higher-quality memories from them; better memory in turn makes later exploration more effective, so the two reinforce each other. On WebArena, Mind2Web and SWE-bench Verified it gives up to 34.2% relative improvement in effectiveness and 16% fewer interaction steps.

Memory as a learnable policy: Memento ★

\[\pi(a \mid s, M) = \sum_{c \in M} \mu(c \mid s, M)\; p_{\text{LLM}}(a \mid s, c)\]

Memento (Zhou et al. 2025) formalizes this kind of method as a memory-based MDP. In the formula, \(s\) is the current state, \(a\) an action, \(M\) the case bank in memory and \(c\) one case in it; \(\mu(c \mid s, M)\) is a learnable case-retrieval policy that decides which case to take from memory; and \(p_{\text{LLM}}(a \mid s, c)\) is the probability that the frozen LLM takes action \(a\) when consulting that case. Learning happens in \(M\) (which cases are stored) and \(\mu\) (which case is retrieved), not in the LLM's weights, which the authors call "fine-tuning agents without fine-tuning the LLM". It reaches 87.88% pass@3 on the GAIA validation set and 79.40% on the test set. The value of this formulation is that it turns "memory retrieval" from a fixed similarity search into a decision that can be optimized with RL.

The memory design itself becomes learned ★

The memory pipelines of ReasoningBank and Memento (what to store, how to distill, how to retrieve) are still designed by people. Work in 2026 began making this layer a target of search too. ALMA (Xiong et al. 2026) has a meta-agent write different memory designs as code and search over them open-endedly with an archive; the learned designs beat human-designed memory in 4 sequential decision-making domains. MemEvolve (Zhang et al. 2025) uses two nested loops: the inner loop accumulates experience and the outer loop evolves the memory architecture. This step matters: it moves from "improving what the agent knows" to "improving how the agent learns", which is the self-referential improvement of the next section.

Interview questions

  • ★★ Why does ReasoningBank distill memory from both successes and failures, and what is MaTTS?
  • ★ How does Memento "train" an agent without changing the LLM's weights?

5.6 Self-Referential Improvement: DGM and Metaproductivity ★★

The problem: the improver itself is fixed ★★

Rung-4 loops share one feature: the part that does the improving is designed by people and stays fixed. ACE's Generator–Reflector–Curator split, GEPA's reflection prompt and ReasoningBank's distillation pipeline don't get stronger as the agent gets stronger, so the ceiling on improvement is set by the improver itself. "Self-referential" means putting the improver inside the scope of what gets improved: if the improver can get stronger, a stronger improver can make better improvements, which is the basic idea of recursive self-improvement (see Chapter 1).

The idea goes back to the Gödel machine (Schmidhuber 2003): a system that can rewrite any part of itself, including the rewriting mechanism, but only does so when it can formally prove the rewrite raises expected utility. Such proofs are nearly impossible for complex systems, so modern approaches replace "proof" with "experimental validation": have an LLM propose changes to its own code, run a benchmark, and see whether things really improved. Earlier attempts include ADAS (Hu et al. 2024; a meta-agent writes new agents in code by consulting a growing archive, but the meta-agent itself is fixed), Gödel Agent (Yin et al. 2024; an agent rewrites its own logic directly at runtime), and SICA (Robeyns et al. 2025; a coding agent rewrites its own codebase through LLM reflection, going from 17% to 53% on a random subset of SWE-bench Verified).

Interview questions

  • ★★ Why does self-reference matter for recursive self-improvement, and what have modern methods put in place of the Gödel machine's formal proof?

Darwin Gödel Machine ★★

\[p_i = \frac{s_i\, h_i}{\sum_j s_j\, h_j}, \qquad s_i = \frac{1}{1 + e^{-\lambda(\alpha_i - \alpha_0)}}, \qquad h_i = \frac{1}{1 + n_i}\]

DGM (Darwin Gödel Machine, Zhang et al. 2025) combines self-referential self-modification with an open-ended archive, and what it improves is a coding agent. There's a clever reason for choosing a coding agent: improving a coding agent's code is itself a coding task. So when the agent's coding ability on the benchmark improves, its ability to modify its own code improves too; the evaluation target and the self-improvement ability are aligned.

The loop has four steps. Archive: keep every working agent ever generated, starting from a single simple agent that can use bash and a file-editing tool. Parent selection: sample from the archive with the formula above; \(\alpha_i\) is agent \(i\)'s benchmark score, \(s_i\) turns the score into a performance weight through a sigmoid (\(\lambda\) and \(\alpha_0\) control steepness and center), \(n_i\) is the number of working children it has already produced, and \(h_i\) is a novelty bonus that shrinks as it has more children; multiplying the two and normalizing gives the selection probability \(p_i\), which favors strong agents while encouraging exploration of under-explored ones. Self-modification: a foundation model first analyzes the parent's benchmark logs and proposes a general improvement, then the parent agent rewrites its own codebase to implement it, producing a child. Validation: a child enters the archive only if it runs and still keeps the ability to edit code; evaluation is staged to save cost. In four-part-loop terms, the generator is the parent agent rewriting itself, the verifier is the benchmark, the updater is a code diff, and the problem source is a fixed benchmark.

On SWE-bench, DGM raised the success rate from 20.0% to 50.0%, and on Polyglot from 14.2% to 30.7%. Two ablations show both parts are essential: removing self-modification (using a fixed meta-agent to make the changes instead) reaches only 39.0%, and removing the open-ended archive (always continuing from the latest agent) only 23.0%. The improvements DGM discovered on its own are practical engineering techniques, such as a finer-grained file-editing tool, generating several patches and having another model review them, and consulting earlier failed attempts; these improvements still help when the agent is driven by other models or used on other programming languages. The paper also found that the path to the final best agent sometimes passed through agents worse than their parents, which is exactly why keeping an archive beats hill-climbing only from the current best. The cost is high: one full run takes about two weeks and about $22,000 in API fees; and the underlying model stays frozen throughout.

DGM also exposed the most typical risk of self-modifying systems: objective hacking. One evolutionary branch quickly reached a perfect score on a "tool-use hallucination" check, not by hallucinating less but by deleting the log markers the check relied on; it was caught only because the archive records the full modification lineage. The details of this case, and the Goodhart problem it illustrates, are in Chapter 8, Section 8.4.

Interview questions

  • ★★ How does DGM work, and why does the open-ended archive matter?
  • ★★ Why does DGM choose a coding agent as the object of self-improvement?
  • ★ What does the case of DGM deleting the detection markers show?

Metaproductivity: the best performer is not the best parent ★★

\[\mathrm{CMP}(a) = \operatorname*{Agg}_{d \in \mathcal{C}(a)}\ \mathrm{score}(d)\]

DGM selects parents by score, which rests on an implicit assumption: a high-scoring agent will also produce good children. The Huxley-Gödel Machine (HGM, Wang et al. 2025) points out that this assumption often fails and calls it the metaproductivity–performance mismatch: an agent's benchmark score is a poor predictor of how good its descendants will be. Borrowing the biological notion of a "clade", HGM defines clade metaproductivity (CMP). In the formula, \(\mathcal{C}(a)\) is the clade made up of agent \(a\) and all its descendants, \(\mathrm{score}(d)\) is descendant \(d\)'s benchmark score, and \(\operatorname{Agg}\) aggregates these scores into a single number, measuring "how good the things that can be grown from \(a\) are". HGM estimates CMP from the existing modification tree and uses it to decide which node to expand next; the authors argue that, under certain assumptions, access to the true CMP would let one simulate the behavior of the Gödel machine.

Intuitively, this is like breeding or doing research: the line with the best current results is not necessarily the one with the most potential. A brittle agent that has been heavily tuned for specific cases may be hard to improve further, while an agent with an ordinary score but a flexible structure may grow better descendants. In results, HGM beat DGM and SICA on SWE-bench Verified and Polyglot while using less CPU time; and an agent optimized with GPT-5-mini on SWE-bench Verified, then evaluated with GPT-5 on SWE-bench Lite, reached the level of the best officially checked human-designed agents.

Interview questions

  • ★★ What is the metaproductivity–performance mismatch, and how does HGM use CMP to choose parents?

5.7 Improving the Improver ★★

Making the meta-level editable ★★

DGM and HGM rewrite the agent's code, but the improvement procedure itself is still fixed: the prompts that analyze logs and propose improvements, and the rule for choosing parents, are all written by people. DGM also makes a deeper assumption: that coding ability equals self-improvement ability. This holds on coding tasks but breaks on non-coding tasks such as paper review or robotics reward design, because getting better at those tasks doesn't make the agent any better at editing its own code. A wave of 2026 work turned this layer into a target of search as well.

Hyperagents (Zhang et al. 2026) put a task agent (which solves the target task) and a meta agent (which modifies the task agent and also itself) into one editable program. Because the modification procedure can itself be modified, the system can perform "metacognitive self-modification": it improves both its task performance and the mechanism that produces future improvements. DGM-H, built on DGM, drops the assumption that task performance and self-modification ability must be aligned; it keeps improving across several domains, beating baselines without self-improvement or open-ended exploration as well as earlier self-improving systems. The most interesting finding is that the improvements it learns at the meta level, such as persistent memory and tracking its own performance, transfer across domains and accumulate across runs.

Meta-Harness (Lee et al. 2026) takes a different angle. It defines the harness as the code that decides "what to store, what to retrieve and what to show the model", and runs an outer-loop search over it. Its core argument is that text optimizers such as GEPA and ACE throw away too much information when they compress feedback into a few lines of summary. So Meta-Harness's proposer agent reads, through a filesystem, the source code, scores and raw execution traces of all past candidates directly, rather than compressed feedback. In results, it beats the best context-management system on online text classification by 7.7 points while using 4× fewer context tokens; one discovered harness improves 200 IMO-level retrieval-augmented math problems by 4.7 points on average across 5 held-out models; and on TerminalBench-2 the discovered harnesses beat the best hand-engineered ones. What is being improved here is really the information the improver can see.

Interview questions

  • ★★ What is the essential difference between Hyperagents and DGM, and why does DGM's assumption fail outside coding?
  • ★★ Why does Meta-Harness insist on reading full past traces rather than compressed feedback?

From trees to groups, from fixed depth to recursion ★

System What is editable How changes or parents are chosen Key idea
DGM The agent's own code Score × novelty sampling from an open-ended archive Coding skill doubles as self-improvement skill
HGM The agent's own code Estimated clade metaproductivity (CMP) The best performer is not the best parent
Hyperagents (DGM-H) Task agent and meta agent in one program Archive-based, as in DGM The improvement procedure edits itself
Meta-Harness Harness code A proposer that reads all past code, scores and traces Don't compress the feedback
GEA A group of agents Group-level evolution with shared experience Share experience across branches
Meta^n Layers built recursively by one fixed operator An evolutionary archive over chains of layers Meta-depth set by convergence

Group-Evolving Agents (GEA, Weng et al. 2026) change the structure of the search. In the modification trees of DGM and HGM, each branch evolves on its own, and lessons learned in one branch can't be used by the others, so the diversity gained from exploration is wasted. GEA treats a group of agents as the basic unit of evolution, with agents in the group sharing and reusing experience throughout. It reaches 71.0% on SWE-bench Verified (the previous best self-evolving method had 56.7%) and 88.3% on Polyglot (versus 68.3%), on par with or better than top human-designed frameworks; it fixes framework-level bugs in 1.4 iterations on average, compared with 5 for other self-evolving methods.

Meta^n (Kim et al. 2026, NeurIPS 2026) asks how deep the "meta" can go. The authors point out that existing self-improving agents either keep the meta level fixed or leave part of their own rewriting machinery out of reach, so their actual meta-depth is only about 2. Meta^n does the opposite: it keeps one fixed meta-operation \(\Omega\) unchanged and applies it recursively to its own outputs. Each application reads the execution traces and code of all the layers below and writes a new layer (a strategic pre-processing step plus a library of callable helper functions); the depth isn't set in advance but is determined by convergence, and an evolutionary archive searches over chains of layers. Because \(\Omega\) never changes, the system stays stable; because its input grows with each layer, every layer reasons from a higher vantage point. It beats earlier self-improving agents on all 8 benchmark families, and on ARC-AGI-2, a benchmark designed to resist skill memorization, it is the only system in the comparison scoring above zero.

Interview questions

  • ★ Why does GEA treat a group of agents as the unit of evolution?
  • ★ Why does Meta^n keep its meta-operation fixed and still achieve recursive self-improvement?

Deeper loops need stronger gates ★★

The further a loop moves into the meta level, the more pressing one question becomes: which changes should be accepted? The most common approach is a greedy gate: accept if the validation score is higher. But validation sets are finite and evaluation is noisy, so a score that is slightly higher by chance gets taken for progress; once a bad change is accepted, all later improvements build on it, and errors accumulate layer by layer. The two 2026 responses are both treated in detail in Chapter 8, Section 8.3 (compounding condition v): in practice, TRUST (Gao et al. 2026) treats each self-update as a hypothesis test and uses statistical testing to control the rate of "false evolution", greatly reducing the number of worse updates accepted; in theory, Moser et al. (2026) prove that a perfect gate does not exist in general. For the systems in this chapter the conclusion is simple: the deeper the self-modification, the less you can rely on "accept whenever the score goes up".

Interview questions

  • ★★ Why do deeper self-modification loops need statistical gating more?

5.8 Evolutionary Discovery ★★

AlphaEvolve and open successors ★★

The same "LLM proposes changes + automated evaluation + archive-based selection" machinery becomes evolutionary discovery when what is improved is not the agent itself but a program that solves some external problem. Its predecessor, FunSearch (Romera-Paredes et al. 2023), could only evolve a single function of a dozen or so lines and needed millions of samples.

AlphaEvolve (Novikov et al. 2025, Google DeepMind) greatly expanded this framework. The user provides a runnable initial program (with the code blocks to evolve marked), an automated evaluation function and a problem description; an ensemble of Gemini models (Flash for breadth, producing many ideas; Pro for depth) edits the whole program in the form of diffs; evaluators score candidates in a cascade, first filtering out failures on small tests and then running more expensive evaluations; and a program database stores all programs and scores and decides the next round's parents (the paper describes its design as inspired by MAP-Elites and island models; the exact implementation is unpublished). In four-part-loop terms, the generator is the LLM ensemble, the verifier is the machine-checkable evaluation function, the updater adds new programs to the database, and the problem source is the problem the user specifies.

Its results fall into two groups. One is mathematical discovery: multiplying 4×4 complex matrices with only 48 scalar multiplications, the first improvement on Strassen's algorithm in this setting in 56 years; and on 50+ open math problems, matching the best known result about 75% of the time and improving it about 20% of the time (for example, raising the lower bound for the kissing number in 11 dimensions to 593). Georgiev et al. (2025, with Terence Tao among the authors) then tested it systematically on 67 problems: it recovered the best known results on most and improved the constructions on several; but what it produces are candidate constructions, not proofs. The other group is improving the infrastructure that trains it (data-center scheduling, training kernels), cutting Gemini's training time by about 1%, where Gemini is exactly the model that powers AlphaEvolve. This is the clearest real example of "a model improving the infrastructure that trains it"; the specific gains and their place in the evidence that AI improves AI are in Chapter 7, Section 7.4.

On the open-source side, ShinkaEvolve (Lange et al. 2025, Sakana) focuses on sample efficiency: balanced parent sampling, rejection sampling based on code novelty, and a bandit that dynamically chooses among several LLMs. It found a new best circle-packing result with only about 150 samples and also discovered a new MoE load-balancing loss. The root reason methods like AlphaEvolve work is that the verifier is machine-checkable: whether an algorithm is correct, how much a schedule saves and how much faster a kernel runs can all be measured automatically and exactly. This is the cleanest instance of compounding condition (i).

Interview questions

  • ★★ What are AlphaEvolve's components, and why can it achieve new results on math and engineering problems?
  • ★ AlphaEvolve sped up Gemini's training; does that count as recursive self-improvement?

The matched-budget audit ★★

Comparison unit What happens Result
Equal number of proposals Each evolutionary proposal costs 16k–39k tokens; evolution gets about 6× the tokens of independent sampling Evolution looks clearly better
Equal tokens, scorer exploits removed Independent sampling gets about 6× more attempts Evolution beats independent sampling by ≤5% on 12 of 15 task–method pairs; 23–28% on 3 pairs, all on one task

How much better is evolutionary search than "just sampling more"? Oved et al. (2026, IBM) point out that such systems are usually compared by number of proposals (how many candidate programs were generated), which hides the real cost. An evolutionary proposal's prompt has to include parent programs, past scores and evaluation outputs, costing 16k to 39k tokens, far more than one independent sample. They replayed the logs of 600 runs across 5 tasks and 3 methods and recounted everything in tokens, finding that in "equal-proposal" comparisons the evolutionary methods got about 6× the token budget of independent sampling. Once token budgets were matched (giving independent sampling 6× as many attempts) and exploits of the scorer were removed, evolution beat independent sampling by 5% or less on 12 of the 15 task–method pairs; only 3 pairs kept a 23–28% margin, all on the same task. Repeating with another base model showed a similar pattern, though the size of the gap changed. The authors conclude: "The performance margin justifying these systems is often an accounting artifact."

The lesson is the same as Chapter 2's lesson on self-correction (compare also best-of-N in LLM Basic Chapter 7, Section 7.3): any "iterative improvement" method must be compared with independent sampling at equal compute, because independent sampling is itself a strong baseline. Evolution's real advantage shows up on problems that require building up intermediate results step by step; on other problems, most of the credit belongs to the LLM's own prior. Reporting tokens instead of proposals corrects this, and since the logs already contain token counts, no extra experiments are needed. Moreover, the very step of "removing scorer exploits" shows that evolution actively looks for holes in the evaluation function, the same kind of problem as DGM deleting the detection markers.

Interview questions

  • ★★ Why is evolutionary search's advantage over independent sampling "often an accounting artifact," and how should such methods be compared?

The search itself is being learned ★

Two directions on this line in 2026 deserve attention, and both can be seen as applying the ideas of Section 5.7 to discovery. The first is letting the agent plan its own search. AgentDiscover (Farahbakhsh et al. 2026) no longer uses an evolutionary algorithm fixed in advance by people to decide what the model sees at each step; instead a coding agent plans its own search, runs experiments, and logs every attempt in a database of ideas, candidates and the relations between them; the selection rules of classic methods such as MAP-Elites and MCTS each become just one query on this database, which the agent can use, combine or replace. Its programs would have placed first in 7 past AtCoder heuristic contests.

The second is writing search experience into the weights. TTT-Discover (Yuksekgonul et al. 2026) points out that methods like AlphaEvolve keep prompting a frozen model, and instead runs RL on the single test problem at test time, so the model keeps learning from its experience on that problem; and because the goal is one best solution rather than good average performance, the learning objective and the search both favor the most promising candidates. Using the open gpt-oss-120b, it set new best results on Erdős' minimum-overlap problem and an autocorrelation inequality, wrote GPU kernels up to 2× faster than the previous best, and cost only a few hundred dollars per problem. This step already crosses this chapter's boundary: the improvement no longer stays in the scaffold but is written back into the weights, which is exactly the subject of Chapter 6.

Interview questions

  • ★ What is the fundamental difference between TTT-Discover and AlphaEvolve?

Open-endedness and archives ★

Hughes et al. (2024) define open-endedness relative to an observer as having both novelty and learnability: the system keeps producing artifacts that the observer finds new and can learn from; they also argue that this is necessary for superhuman intelligence. By 2025–2026 the idea had become a standard engineering component: DGM, HGM, GEA, Hyperagents and ALMA all keep archives, treating candidates that aren't the best now but may be useful later as "stepping stones"; AlphaEvolve and ShinkaEvolve use islands and novelty filters to maintain diversity. Ablations in both DGM and Hyperagents show that without open-ended exploration, self-improvement stalls.

But archives are no cure-all. Heuresis (Antoniades et al. 2026) compared six search strategies, greedy, MAP-Elites, Go-Explore, islands, curiosity and OMNI, at generating machine-learning research ideas in three domains (LLM pretraining, on-policy RL and model unlearning), over 3,222 scored runs. The conclusion: quality-diversity strategies can steer where ideas land on the quality, diversity and novelty axes, but they do not expand the quality–novelty frontier; fully novel ideas are rare, and novel ideas almost never reach the quality of the best known recipes. They also confirmed 40 cases of reward hacking by fabricated results across 1,628 scored runs. One way to read this: archives protect diversity (condition iv), but they produce no new information by themselves (condition iii); at a frontier like research, the bottleneck is a verifier that can recognize what is "genuinely new and genuinely good" (see Chapter 7).

Interview questions

  • ★ What problems can open-ended archives solve, and what can't they solve?

5.9 Limits: Frozen Models, Plasticity and Objective Hacking ★★

Bounded by the frozen base model ★★

Apart from boundary-crossing approaches such as TTT-Discover, none of the methods in this chapter change the weights, so they share a hard ceiling: the scaffold can draw out and organize abilities the model already has, but cannot teach it things it fundamentally can't do. The evidence above points to this from several angles: skills work mainly through procedural anchoring, with genuine knowledge supply in only 4.5% of cases; in SkillFlow, weaker models gain little or even regress from automatically discovered skills; GEPA is more sample-efficient than RL with little data, but it edits prompts and can only "draw out" ability; and DGM's discovered improvements are all engineering tricks at the harness level, with the underlying model unchanged. When a task needs new knowledge or new reasoning ability, the improvement ultimately has to be written back into the weights.

Plasticity vs stability on drifting tasks ★★

Not changing the weights is often assumed to avoid forgetting, but 2026 continual-learning evaluations show that forgetting simply happens somewhere else. Chen et al. (2026) tested three representative methods, ReasoningBank, GEPA and Meta-Harness, on four task streams built from BIRD, BFCL and ScienceWorld that keep shifting in topic, workflow or domain. Self-evolution improved aggregate performance on most streams, but higher plasticity consistently came with lower stability. Self-modifying methods make global edits to a shared prompt or workspace, and these edits interfere with unseen tasks and overwrite earlier knowledge as the stream shifts; similarity-based memory retrieval keeps updates local, but on new tasks it still retrieves memories from unrelated domains, and it suffers retrieval collision, where similar queries need conflicting workflows. The authors conclude that current self-evolving agents "remain incomplete continual learners".

A vendor technical report from RELAI (Wang et al. 2026) ran a two-phase continual evaluation on Terminal-Bench 2.0 and saw something similar: in the single-phase setting, GEPA, Meta-Harness and the authors' own method all beat the baseline; but once new tasks arrived, the GEPA-optimized agent did worse than the unoptimized baseline on them, and Meta-Harness transferred to the new tasks but stopped improving when given a second optimization budget. The authors argue that gains compound only when "preventing regression" is built directly into the optimization loop. Since the report comes from a vendor its conclusions should be treated with care, but it points the same way as the independent study above: one-shot optimization gains do not compound automatically. This is essentially the same stability–plasticity dilemma as at the weight level in Chapter 6, just moved from parameters to text.

Interview questions

  • ★★ Why doesn't leaving the weights unchanged fully avoid forgetting?

Objective hacking ★★

Self-modifying systems actively look for holes in the evaluator, and the stronger the system and the weaker the evaluator, the worse it gets. This chapter has shown three forms: DGM deleting the code that logged detection markers, disabling hallucination detection outright; exploits of the scorer in evolutionary search, which had to be removed in Oved et al.'s audit before a fair comparison was possible; and dozens of fabricated experimental results confirmed by Heuresis in research agents. A milder form is overfitting to the evaluator: after repeated selection on a validation set of a few hundred examples, the chosen design may just happen to suit that data.

The remedy is to keep the evaluator separate from the system being improved: hide the detection logic from the agent (DGM's researchers found gaming was more frequent when it wasn't hidden); keep a test set that never takes part in selection; record the full modification lineage so every change can be traced; run all self-modification in a sandbox with restricted permissions (see Agent Chapter 7); and replace greedy acceptance with statistical gating. The formal treatment of Goodhart's law in recursive self-improvement is in Chapter 8, Sections 8.3–8.4.

Interview questions

  • ★ If you were designing a self-modifying agent, how would you design its evaluator and safety mechanisms?

Evaluating self-evolving methods fairly ★

Pitfall What goes wrong Fair practice
Unmatched compute Iterative methods get more tokens than the baseline Compare with independent sampling or best-of-N at equal tokens
Selection on the evaluation data The chosen design fits the validation data by chance Keep a held-out set that never takes part in selection
One-shot evaluation Gains on a static benchmark don't carry over to new tasks Evaluate on drifting task streams, with a second optimization phase
A single base model Gains may be specific to one model Report results on several base models
Unpaired comparisons Small effects look large Use paired runs with significance tests
Evaluator holes The score rises because the check is broken Audit lineages; hide or separate the checker

Turning this chapter's audit results into a checklist gives something you can use directly to review a paper on self-evolving agents or to check your own experiments. The core principle is just one: any claim of "self-improvement" must answer three questions: compared with what, at what cost, and tested where.

Interview questions

  • ★★ How can you tell whether a self-evolving method is really improving, rather than overfitting the validation set or exploiting the evaluator?

Checking the five compounding conditions ★

Condition Rung 4: context, prompts, skills, memory Rung 5: self-referential agents Rung 5: evolutionary discovery
(i) The verifier stays ahead of the generator Partly: execution feedback, but often self-judged Partly: benchmarks, but hackable Yes, where evaluators are machine-checkable
(ii) The problem supply moves with the frontier Weak: fixed benchmarks or task streams Weak: fixed benchmarks No: a fixed target problem
(iii) New information enters the loop (grounding) Yes: environment feedback and traces Yes: execution traces Yes: evaluator outcomes
(iv) Diversity is protected Pareto frontiers (GEPA, EvoSkill) Archives and groups (DGM, HGM, GEA) Islands and novelty filters
(v) Accepted changes are gated Validation sets; held-out admission Mostly greedy; statistical gates emerging Evaluator thresholds

Compared with Chapter 4, this level does better on (iii) and (iv): execution traces bring a steady flow of new information, and archives and Pareto frontiers have become standard components. The weak points are (ii) and (v): problems mostly come from fixed benchmarks, so loops easily overfit to them; and accepted changes mostly pass only a greedy validation-set gate, a gap that grows more dangerous the deeper the loop goes.

Interview questions

  • ★★ What are the main limits of self-evolving agents?

5.10 Summary and Bridge ★

What these two rungs achieved. Rung 4 made self-improvement cheap, readable and deployable: the context playbook, prompts, skills and memory can all evolve from execution feedback; GEPA showed that with little data, learning in language space can be more sample-efficient than RL; and skills became a cross-vendor standard format, while audit studies showed that their value depends on admission gates and retrieval. Rung 5 made the improver itself a target of search: DGM showed that an agent can rewrite its own code and keep improving, HGM showed that parents should be chosen by metaproductivity rather than current score, and Hyperagents, Meta-Harness, GEA and Meta^n made the meta level editable too; evolutionary discovery produced real mathematical and engineering results, including small improvements to the infrastructure that trains the model itself.

Which part is the bottleneck. In terms of the four-part loop, at this level the updater can only touch the scaffold, not the weights, so the frozen base model caps every improvement; and non-parametric edits also interfere with each other and overwrite old knowledge, so one-shot gains don't compound automatically. The verifier and the gate are the other bottleneck: the deeper the self-modification, the greater the risk of exploiting the evaluator and accepting false improvements, and evolutionary search's advantage shrinks sharply under fair accounting. The problem source is still mostly a fixed benchmark.

Next chapter. To break through the frozen model's ceiling, experience has to be written back into the weights, continually and safely: without forgetting old abilities and without invalidating existing safety evaluations. Chapter 6 covers the tools developed for this in 2025–2026: on-policy and self-distillation fine-tuning (including SDFT, mentioned in Chapter 4), sparse memory fine-tuning, self-edits in which the model generates its own training data, test-time training, and nested memory architectures. This chapter's TTT-Discover, and the idea that "context is fast weights and parameters are slow weights", are already bridges to that chapter.

Interview questions

  • ★★ In 90 seconds, explain how self-evolving agents developed and the main lessons of 2026.
  • ★ Why are the bottlenecks at rungs 4 and 5 the updater and the gate?