Chapter 4 · Self-Evolving Agents¶
4.1 Without changing the weights, how can an agent improve itself by evolving its context and playbook? ★★¶
One-sentence answer
Every improvement in Chapter 3 has to be written into the weights, which is expensive, slow, hard to audit and impossible for closed models, so rung 4 takes another route: freeze the model and evolve only the scaffold around it, whose most direct carrier is experience held in the context. Dynamic Cheatsheet lets the model maintain a "cheatsheet" while it solves problems; ACE treats the context as an incrementally updated playbook, replacing wholesale rewrites with entry-by-entry additions so that details are not worn away by repeated summarizing (context collapse).
I will address three aspects: why take the "don't change the weights" route, how experience accumulates across tasks in the form of context, and how ACE keeps the context from getting emptier with every edit.
(1) The bottleneck of Chapter 3 sets the starting point of this rung: improvements are no longer written into the weights but into the scaffold around the model.
Chapter 3's conclusion has two sides: as long as the loop is grounded, a model really can set its own problems and keep improving; however, 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 cannot 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 cannot 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 scaffold includes 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. This chapter studies the half that updates only the scaffold:
Here \(\mathcal{A}_t\) is version \(t\) of the agent, \(\theta_{\text{frozen}}\) the frozen model weights and \(\mathcal{S}_t\) 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}\). In terms of the four-part loop (generator → verifier → updater → problem source), this rung changes where the updater writes: from the weights to text, files and code. 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.
On the ladder, this chapter covers two rungs. Rung 4 evolves what the agent knows: the playbook in its context (this question), its prompts (4.2), its skills (4.3) and its memory (4.4), while 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 evolves how the agent works and how it improves itself: the agent rewrites its own code (4.5), and then the code responsible for improving (4.6); the same machinery applied to external programs becomes evolutionary discovery (4.7).
(2) The most direct approach is to write cross-task experience into the context, and Dynamic Cheatsheet is a representative example.
This line descends from Reflexion (see the Agent direction, Chapter 1): the agent writes a reflection after failing and consults it when retrying the same problem, but those reflections only help with that one problem. ExpeL (Zhao et al. 2023) extended this across tasks: it compares successes and failures on the same task, maintains a natural-language list of "insights" and puts it into the prompt for new tasks, with no parameter updates at any point. It showed that cross-task learning is possible without touching the weights, but it also exposed the problems such methods share: the list keeps growing, extraction quality depends on the summarizing LLM, and repeated summarizing wears away specific, useful details.
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. For example, in the Game of 24, GPT-4o discovers that it can write a Python solver, stores it in the cheatsheet and reuses it, and its accuracy rises sharply as a result. 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 then affect every later question.
(3) ACE replaces wholesale rewrites with incremental entries, so the context does not get emptier through repeated summarizing.
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: summaries tend to be short and drop domain-specific details, such as the quirks of a particular API or the special format of a certain report.
- Context collapse: after many rounds of wholesale rewriting, the accumulated details gradually vanish, and the context gets shorter and emptier with each edit.
Both have the same cause: 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 (grow-and-refine). Incremental updates work because wholesale rewriting replaces the old version with a new one every time, so any old detail that is not kept even once is lost forever, whereas delta entries keep old knowledge by default and modify only what is clearly outdated. This follows "accumulate data rather than replace it" from the model-collapse literature (see Chapter 2) and "localized updates cause less interference" from continual learning (see Chapter 5). 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 is not broken until 5.6.
In summary: rung 4 moves the improvement from the weights to the scaffold, with the context and the playbook as its most direct carriers; ACE's key lesson is accumulate incrementally; do not rewrite wholesale.
Rung 4 and rung 5 in terms of the four-part loop:
| 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 evolutionary discovery, a fixed target problem |
Going deeper: details of ExpeL, Dynamic Cheatsheet and ACE, and the taxonomy of this rung
(1) How ExpeL works.
ExpeL (Zhao et al. 2023) has the agent accumulate successful and failed trajectories on a batch of training tasks; an LLM compares successes with failures on the same task and maintains the insight list with four operations, ADD, EDIT, UPVOTE and DOWNVOTE; for a new task, the insights and retrieved successful trajectories go into the prompt together. On ALFWorld, the success rate rose from 40% to 59%.
(2) Dynamic Cheatsheet's numbers.
On the Game of 24, GPT-4o's accuracy rose from about 10% to 99%; Claude 3.5 Sonnet's accuracy on AIME also more than doubled.
(3) ACE's numbers and follow-up.
The paper reports gains of 10.6% on agent benchmarks and 8.6% on finance tasks; on AppWorld, it matched the top production-level agent on the leaderboard using a smaller open model. Meta Context Engineering (Ye et al. 2026) goes further and has a meta-agent evolve these context-engineering skills themselves, which is already a rung-5 idea (see 4.6).
(4) The taxonomy of this rung.
The survey by Ren et al. (2026) defines self-improvement as an update operator that the agent itself initiates on one of two parts, the "foundation model" or the "scaffold", classified by "what is updated" and "which signal drives it"; this chapter covers the half that updates the scaffold. A popular 2026 framing also treats the context as "fast weights" and the parameters as "slow weights"; how the two work together is covered in Chapter 5.
(5) The 2026 lessons that run through this chapter.
Most public skills actually have no effect, and a skill library is only as good as its admission gate and its retrieval (4.3); the highest-scoring agent is not necessarily the best "parent" (4.5); most of evolutionary search's advantage over independent sampling disappears once token budgets are matched (4.7); and on shifting task streams, self-evolving agents trade "plasticity" against "stability", so one-shot optimization gains do not compound by themselves (4.8).
Follow-up questions
Follow-up 1: Compared with the methods of Chapter 3, how does what a self-evolving agent improves differ?
Chapter 3 changes the weights; this chapter changes the scaffold outside the weights. Self-reward and self-play in Chapter 3 ultimately update parameters through RL or distillation; a self-evolving agent freezes the model and changes only prompts, the playbook in the context, skills, memory and agent code. Its improvements are therefore readable, auditable and reversible, and work with closed models, but their ceiling is set by the frozen model (see 4.8).
Follow-up 2: What are the advantages and limits of self-evolution that does not change the weights?
The advantages are that it is cheap, transparent and reversible; the limits are that it is bounded by the frozen model and that forgetting just moves elsewhere. It needs no training compute, its changes are text or diffs that people can read, problems can be undone, and most of the scaffold can be reused when the base model changes. However, the scaffold can only draw out and organize abilities the model already has, and global edits to a shared prompt also interfere with other tasks and overwrite old experience (see 4.8).
Follow-up 3: How does ExpeL differ from Reflexion?
Reflexion's reflections serve only retries of the same problem, while ExpeL distills experience into insights reusable across tasks. Reflexion is "fail, reflect, retry" within a single task; ExpeL compares successes and failures over a batch of training tasks, maintains a shared insight list and uses it on new tasks. Only the latter is cross-task learning in the real sense.
Follow-up 4: On what kinds of tasks does Dynamic Cheatsheet work best?
On tasks that can be self-checked. Its verifier is only the model's own judgment of whether a strategy is useful. On tasks whose results are easy to check, such as the Game of 24 or executable code, wrong entries are quickly found and deleted; on tasks that are hard to self-check, such as open-ended QA, a wrong strategy may be kept and contaminate later answers.
Follow-up 5: How does self-evolution at rung 4 differ from rung 5?
Rung 4 improves what the agent knows; rung 5 improves how the agent works and how it improves itself. At rung 4, the improvement procedure (the reflection prompt, the distillation pipeline, the curation rules) is fixed; rung 5 brings the agent's code, and even the improvement procedure itself, into the modifiable scope, which is where "recursive" starts to mean something (see 4.5 and 4.6).
Common mistakes
- Do not say that not changing the weights means no forgetting: There is indeed no forgetting in the weights, but global edits to a shared prompt or playbook also overwrite old experience; forgetting just happens somewhere else (see 4.8).
- Do not say that context collapse is caused by a context window that is too short: It comes from the LLM's tendency to compress during repeated wholesale rewrites and has nothing to do with window length.
- Do not say that ACE's three roles are learned by the model itself: The division into Generator, Reflector and Curator is designed by people; the improver itself is fixed.
- Do not say that Dynamic Cheatsheet has an external verifier: It needs no labels; only the model itself judges whether an entry is useful.
4.2 How does reflective prompt evolution, such as GEPA, work? ★¶
One-sentence answer
GEPA runs the system on training examples, collects the full execution traces and the evaluator's textual feedback, has an LLM diagnose in natural language why things failed, and then edits the prompt of one module of the system accordingly; it also maintains a Pareto frontier that keeps any candidate that is best on some example, to protect diversity. Because a trace carries far more information than a scalar score, with little data it can be more sample-efficient than RL with GRPO, but because it edits prompts, it can only draw out abilities the model already has.
I will address three aspects: the original bottleneck of automatic prompt optimization, GEPA's two key designs, and its relation to RL.
(1) Automatic prompt optimization treats the prompt as a parameter to optimize, and the bottleneck of early methods was that each candidate earned just one score.
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 searches a small dev set for the prompt that maximizes the average task metric:
Here \(p\) is a candidate prompt, \(\mathcal{D}_{\text{dev}}\) the dev set, \(\mathrm{LLM}(p, x)\) the model's output on input \(x\) under prompt \(p\), \(y\) the reference answer and \(m\) the task metric. 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, putting past prompts and their scores into a meta-prompt and asking the LLM for new prompts that score higher. 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.
(2) GEPA's two key designs are reflective edits based on full traces, and a Pareto frontier that protects diversity.
GEPA (Genetic-Pareto, Agrawal et al. 2025) targets exactly the "only one score" problem. In four-part-loop terms, what it improves is the signal the updater can see: the updater no longer reads a scalar but the full evidence left by the verifier.
- Reflecting on full traces: GEPA runs the system on training examples and collects the reasoning, tool calls, tool outputs and the evaluator's textual feedback; an LLM reads these traces, 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. A trace carries far more information than a score, so each rollout teaches far more.
- Protecting diversity with a Pareto frontier: to keep all candidates from converging to the same prompt, GEPA keeps a candidate on the frontier as long as it is the best on at least one training example; candidates are then picked from the frontier for further edits, and complementary lessons learned by different candidates can be merged. This way, a prompt with an unremarkable average but a distinctive strength on one kind of hard problem is not eliminated because of its average, which is an instance of compounding condition (iv), "diversity is protected".
(3) The results show that, with little data, learning in language space can be more sample-efficient than RL in weight space, but it can only draw out existing abilities.
The paper reports that GEPA beats RL fine-tuning with GRPO on most tasks while using far fewer rollouts (the numbers are in "Going deeper" below). 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 3: rich textual feedback carries more information than a scalar (see Chapter 3). 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. The two can also be combined: use evolution to find good prompts and workflows first, then train on the good trajectories they produce; FST in Chapter 5 alternates GEPA-style context optimization with RLVR.
In summary: the core of GEPA is letting the improver read the full execution trace rather than just a score, with a Pareto frontier to keep candidates from converging too early.
Going deeper: the definition of the Pareto frontier, the paper's numbers and this lineage
(1) The definition of the Pareto frontier.
Here \(\mathcal{C}\) is the set of all candidate prompts, \(\mathcal{D}_{\text{train}}\) the training examples and \(s_i(p)\) candidate \(p\)'s score on example \(i\); as long as there is some example on which \(p\)'s score equals the highest score among all candidates, \(p\) belongs to the frontier \(\mathcal{P}\).
(2) The numbers reported in the paper.
In the latest version, GEPA beats GRPO by about 6% on average and up to about 20%, using up to 35× fewer rollouts, and beats MIPROv2, the previously leading prompt optimizer, by more than 10%. It does not beat GRPO on every task; on AIME, for example, it does not.
(3) Other methods in this lineage.
OPRO found prompts such as "Take a deep breath and work on this problem step-by-step". EvoPrompt, Promptbreeder, TextGrad and DSPy belong to this lineage too: the first two mutate and cross over prompts with evolutionary algorithms, TextGrad treats an LLM's textual critique as a "textual gradient", and DSPy treats the prompts and examples of a multi-step LLM program as parameters that can be compiled and optimized.
Follow-up questions
Follow-up 1: Why can GEPA use fewer rollouts than GRPO?
Because each rollout leaves a different amount of information. GRPO gets only a scalar reward from a rollout and needs statistics over many samples to learn what went wrong; GEPA reads the full reasoning, tool outputs and textual feedback, so a single trace may directly expose the cause of a failure and map to one targeted edit. Moreover, GEPA edits a few prompts rather than billions of parameters, so it needs less information in the first place.
Follow-up 2: What role does GEPA's Pareto frontier play?
It keeps candidates from converging too early and preserves prompts with local strengths. If only the candidate with the highest average were kept, the search would quickly collapse onto one prompt, and variants that are especially good at some kind of hard problem would be eliminated; the Pareto frontier keeps any candidate that is best on some example, providing diverse starting points for later edits and allowing complementary lessons to be merged.
Follow-up 3: Where does the direction of improvement come from in APE, OPRO and GEPA?
From paraphrasing, from past scores, and from diagnosing the cause of failure, respectively. APE infers instructions from examples and then paraphrases the best few, which is close to a local random search; OPRO has the LLM look at how past prompts map to scores and infer a better phrasing; GEPA has the LLM read execution traces, explain "why it went wrong" and edit accordingly, so its direction is the most explicit.
Follow-up 4: When should you choose prompt or scaffold evolution, and when RL fine-tuning?
It depends on whether you can touch the weights, how much data and compute you have, and whether the task needs a new ability. 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 does not 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.
Common mistakes
- Do not say that GEPA updates the model's weights: It only edits the prompts of the system's modules; the underlying model is frozen.
- Do not say that GEPA beats RL in every situation: Its advantage appears where data are scarce and sample efficiency matters, and it does not beat GRPO on every task.
- Do not take the Pareto frontier to mean the few candidates with the highest average: A candidate stays on the frontier as long as it is the best on at least one example.
- Do not say that prompt evolution can teach the model new abilities: It can only draw out abilities the model already has more effectively.
4.3 How does an agent accumulate and reuse skills? ★★¶
One-sentence answer
A skill is experience written as an executable, reusable procedure: Voyager stores verified code in a skill library that only grows; in 2025–2026, Agent Skills became an open standard whose "progressive disclosure" lets an agent hold many skills while using very little context. 2026 audit studies show that curated skills really help but most public skills have no effect; skills work mainly by "procedural anchoring", stabilizing actions rather than supplying knowledge, so a skill library's value depends on its admission gate and its retrieval.
I will address four aspects: where skill libraries began, the Agent Skills standard, the audit evidence, and how to let an agent maintain a useful skill library by itself.
(1) When a piece of experience can be written as an executable procedure, it becomes a skill; Voyager established the basic recipe for skill libraries.
Playbooks and prompts are descriptive text; when experience can be written as an executable, reusable procedure, it becomes a "skill". Voyager (Wang et al. 2023) 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 function, retrieved by the embedding of its description; skills can call one another, so simple skills compose into complex ones. In four-part-loop terms, the problem source is the automatic curriculum, the generator is GPT-4 writing code, the verifier is the execution result plus self-verification, and the updater adds verified code to the library. Because the library only grows and new skills never overwrite old ones, it structurally avoids catastrophic forgetting. 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 the Agent direction, Chapter 5).
(2) Agent Skills turned skills into a cross-product standard format, and its core design is progressive disclosure.
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; they have been 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:
- 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.mdread 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 (see the Agent direction, Chapter 3): 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 also set the goal of agents that create, edit and evaluate skills on their own. So a natural question follows: do these skills actually help?
(3) 2026 audit studies show that curated skills help, but most public skills have no effect.
Three controlled 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 across many "model + harness" configurations, and curated skills clearly raised the pass rate; focused skills beat large, exhaustive bundles, and small models with skills could match larger models without them.
- Most public skills have no effect: SWE-Skills-Bench (Han et al. 2026) collected 98 public software-engineering skills and ran paired with-and-without experiments on real code repositories; 92 of them had no statistically significant effect, and the average pass rate barely moved; harmful skills made the agent follow a template while ignoring the task's explicit requirements.
- Skills stabilize actions rather than supply facts: Analyzing paired execution trajectories, Jiang et al. (2026) found that skills work mainly through procedural anchoring, pinning a messy execution process to a stable procedure, while genuinely "supplying knowledge the model lacks" is rare; retrieval is a separate bottleneck, and the larger the skill pool, the further the precision of correct skill use falls.
(4) A skill library's value therefore depends on its admission gate and its retrieval, and when an agent maintains its own library, paired evaluation must guard the door.
Read together, the three studies say a skill's value depends on two parts of the loop: the verifier and the gate, since whether a skill enters the library should be decided by paired evaluation, not by "it was written, so it counts"; and retrieval, since the more skills there are, the harder it is to pick the right one, and a skill that is not 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". EvoSkill (Alzubi et al. 2026) is an example of feeding these lessons into a self-evolution loop: it analyzes why executions failed, proposes new skills or edits to existing ones, and 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; the evolved skills even transfer to other benchmarks. However, 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, showing that the ceiling of skills is still set by the base model.
In summary: a skill is procedural memory the agent can write itself, but its value lies not in "how many were written" but in how strict the admission gate is and how accurate retrieval is.
Going deeper: the audit numbers, EvoSkill's results and design principles
(1) The numbers from the three audit studies.
| Study | Setup | Main finding |
|---|---|---|
| SkillsBench (Li et al. 2026) | 87 tasks in 8 domains; curated skills vs none; 18 "model + harness" configurations; a deterministic verifier for every task | Pass rate 33.9% → 50.5%; focused skills (at most 3 modules) beat exhaustive bundles; small models with skills can match larger models without |
| SWE-Skills-Bench (Han et al. 2026) | 98 public skills, each paired with a real repository pinned to a fixed version and an executable verifier; 3,920 paired runs | 92 skills have no significant effect; average 76.6% → 76.9%; helpful skills gain up to 17.7 points, harmful ones lose up to 17.0 |
| 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 |
(2) Voyager's numbers.
Voyager obtained 3.3× more unique items than the previous best method and unlocked the tech tree up to 15.3× faster; its skills are stored as JavaScript functions.
(3) EvoSkill's numbers.
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.
(4) Design principles for maintaining a skill library.
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.
Follow-up questions
Follow-up 1: Why does Voyager store skills as code, and how does its skill library avoid catastrophic forgetting?
Code is executable, verifiable and composable, and a library that only grows structurally avoids overwriting. Code can be run directly and its success or failure is obvious, so only versions that executed successfully need be stored; pieces of code can call one another, so simple skills compose into complex ones. New skills are added as new entries and never rewrite old ones, so there is no counterpart to the way a new task overwrites an old one in weight updates.
Follow-up 2: How does progressive disclosure in Agent Skills work, and why is it designed this way?
It loads in three steps, discovery, activation and execution, to decouple context cost from the number of skills. At startup only names and descriptions are read; the full SKILL.md is read only when a task matches; scripts and reference files are loaded only during execution. If the full text of every skill were put into context, many skills would crowd the context and scatter attention; loading on demand lets the agent own many skills while paying context cost only for the few it actually uses.
Follow-up 3: If an agent generates its own skills, how do you keep the library from filling up with useless ones?
The key is admission by paired evaluation, plus continual pruning and monitoring of retrieval. Every candidate skill should be compared, on a held-out set, with "not using this skill", and only significant improvements are admitted (as in EvoSkill); skills should stay focused; unused or harmful skills should be deleted regularly; and retrieval precision should be monitored, because the chance of picking the wrong skill rises as the pool grows.
Follow-up 4: Through what mechanism do skills mainly work, and what problem does a growing skill pool cause?
They work mainly through procedural anchoring, and a growing pool creates a retrieval bottleneck. Most of the time a skill pins the execution process to a stable procedure rather than supplying knowledge the model lacks; as the pool grows from a few skills to a hundred, the precision of picking and using the right skill falls sharply, and misused skills can also lead the task astray.
Follow-up 5: Can skills close the gap between small and large models?
Curated skills can partly close it, but skills the model discovers itself help weak models little. In SkillsBench, small models with curated skills could match larger models without skills; but SkillFlow found that when models discover skills from scratch by themselves, strong models benefit while weak models gain little or even regress. The reason is that writing good skills and judging when to use them both require ability, so the ceiling of skills is set by the base model.
Common mistakes
- Do not say that skills mainly supply knowledge to the model: Audits show that skills mainly stabilize actions through procedural anchoring; genuine knowledge injection is rare.
- Do not say that more skills is always better: The larger the pool, the harder retrieval becomes, and misused skills can do harm.
- Do not say that a skill that has been written is effective: Most public skills have no significant effect, so admission must go through paired evaluation.
- Do not say that Agent Skills put the full text of every skill into the context: Only names and descriptions are loaded at startup; full contents are loaded on demand.
4.4 How does memory-based learning work? ★¶
One-sentence answer
Memory-based learning stores experience in external memory and retrieves it for later tasks, which is itself a form of learning without changing the weights. ReasoningBank distills generalizable reasoning strategies from both successful and failed trajectories and uses memory-aware test-time scaling (MaTTS) so that memory and exploration reinforce each other; Memento turns "which memory to retrieve" into a policy that can be optimized with RL; and 2026 work such as ALMA goes further and searches for the memory design itself, moving from "improving what the agent knows" toward "improving how the agent learns".
I will address three aspects: what should be stored in memory, how using memory becomes a learnable decision, and how the memory design itself gets learned. The mechanics of storing, retrieving, updating and forgetting memories are covered in the Agent direction, Chapter 3; here we look only at memory as a learning mechanism.
(1) ReasoningBank stores reasoning strategies distilled from successes and failures, not raw trajectories.
A skill is procedural memory that has already been written down; more generally, an agent can store any experience in external memory. ReasoningBank (Ouyang et al. 2025) makes two key choices.
- Store strategies, not trajectories: 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.
- Distill from both successes and failures: strategies are distilled from successful and failed trajectories alike, 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. In four-part-loop terms, the problem source is the task stream, the generator is the agent doing tasks, the verifier is the model's own judgment of success, and the updater distills strategies and merges them into memory. 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 memory and test-time compute reinforce each other.
(2) Memento turns memory retrieval from fixed similarity matching into a policy that can be optimized with RL.
Memento (Zhou et al. 2025) formalizes this kind of method as a memory-based MDP:
Here \(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". The value of this formulation is that "memory retrieval" is no longer a fixed similarity search but a decision that can be optimized with RL from task outcomes.
(3) The memory design itself is starting to be learned, which pushes rung 4 toward rung 5.
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, and the learned designs beat human-designed memory in 4 sequential decision-making domains; MemEvolve (Zhang et al. 2025) uses two nested loops, where 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 5.5.
In summary: the essentials of memory-based learning are storing distilled strategies, learning from both successes and failures, and turning retrieval, and even the memory design itself, into something that can be optimized.
Going deeper: the numbers for both methods, and how skills relate to memory
(1) ReasoningBank's numbers.
On WebArena, Mind2Web and SWE-bench Verified, ReasoningBank gives up to 34.2% relative improvement in effectiveness and 16% fewer interaction steps.
(2) Memento's numbers.
Memento reaches 87.88% pass@3 on the GAIA validation set and 79.40% on the test set.
(3) How skills, memory and playbooks relate.
All three carry experience without changing the weights; they differ in form: a playbook is descriptive entries kept in the context (4.1), a skill is an executable procedure loaded on demand (4.3), and memory is experience items retrieved on demand. They also share the same set of problems: what to store, how to admit, how to retrieve, and how to avoid conflicts when tasks shift (see the retrieval collisions in 4.8).
Follow-up questions
Follow-up 1: Why does ReasoningBank distill memory from both successes and failures?
Because failures also carry reusable information. Successful trajectories tell the agent which approaches work; failed ones tell it which to avoid, for instance that a certain action always fails on a certain kind of web page. Learning only from successes throws away half of the signal and never learns "when not to do this".
Follow-up 2: What is MaTTS?
MaTTS is memory-aware test-time scaling: extra test-time compute is used to generate contrasting experiences from which better memories are distilled. Making several attempts at the same task and comparing their successes, failures and differences yields strategies more reliable than a single trajectory; better memory in turn makes later attempts more effective, so memory quality and test-time compute reinforce each other.
Follow-up 3: How does Memento "train" an agent without changing the LLM's weights?
It trains the memory contents and the retrieval policy, not the LLM. Memento writes the agent as "a retrieval policy picks a case, and the frozen LLM acts by consulting it"; learning happens in what the case bank stores and in which case the retrieval policy \(\mu\) takes, and the retrieval policy can be optimized with RL from task outcomes.
Follow-up 4: How does memory-based learning differ from RAG?
RAG retrieves from an external, usually static knowledge base, while memory-based learning retrieves experience the agent itself has accumulated and writes back and updates it based on new outcomes. The former supplies knowledge; the latter accumulates experience of "how to do it"; a systematic comparison is in the Agent direction, Chapter 3.
Common mistakes
- Do not say that storing raw trajectories in memory is best: Raw trajectories are too long and too specific to transfer; ReasoningBank stores distilled strategies.
- Do not say that memory retrieval can only be fixed similarity matching: Memento turns retrieval into a policy that can be optimized with RL.
- Do not say that ReasoningBank relies on external labels to judge success: The model judges success itself, which also means misjudgments enter memory.
- Do not equate memory-based learning with RAG: It accumulates the agent's own experience and keeps writing it back.
4.5 How does the Darwin Gödel Machine perform self-referential self-improvement? ★★¶
One-sentence answer
DGM has a coding agent rewrite its own codebase, replaces the Gödel machine's formal proof with benchmark experiments to validate changes, and keeps an open-ended archive from which parents are sampled by "score × novelty". It chooses a coding agent because improving a coding agent is itself a coding task, so the evaluation target and the self-improvement ability are aligned. It raised the success rate on SWE-bench from 20% to 50%, and ablations show that self-modification and the open-ended archive are both essential; the follow-up HGM points out that the highest-scoring agent is not necessarily the best parent, and that parents should be chosen by the metaproductivity of their clade.
I will address four aspects: why self-reference is needed, DGM's loop, what its results show, and HGM's correction to parent selection.
(1) At rung 4 the part that does the improving is fixed; "self-referential" means bringing the improver itself into the scope of what gets improved.
Rung-4 loops share one feature: ACE's Generator–Reflector–Curator split, GEPA's reflection prompt and ReasoningBank's distillation pipeline are all designed by people and do not 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 0). 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 does so only when it can formally prove that 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, with a fixed meta-agent), Gödel Agent (Yin et al. 2024) and SICA (Robeyns et al. 2025).
(2) DGM combines self-modification and an open-ended archive into one loop, and chooses a coding agent as the object of improvement.
What DGM (Darwin Gödel Machine, Zhang et al. 2025) improves is a coding agent, and the reason is clever: 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 loop has four components.
- 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, favoring high-scoring agents while giving a bonus to agents with few children that have not been well explored.
- 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.
(3) The results show that self-modification and the open-ended archive are both essential, but the cost is high, the underlying model stays the same, and objective hacking appears.
On SWE-bench, DGM raised the success rate from 20.0% to 50.0%. Two ablations show that both parts are essential: removing self-modification (using a fixed meta-agent to make the changes instead) and removing the open-ended archive (always continuing from the latest agent) both clearly hurt, and the latter shows almost no progress. 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, and they 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. However, the cost is high, 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 (this case, and the Goodhart problem it illustrates, are discussed in Chapter 7).
(4) HGM points out that the highest-scoring agent is not necessarily the best parent, and that parents should be chosen by metaproductivity.
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), which measures "how good the things that can be grown from this agent are", estimates CMP from the existing modification tree, and uses it to decide which node to expand next. 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 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.
In summary: the core of DGM is replacing formal proof with experimental validation and greedy hill-climbing with an open-ended archive, so that an agent can rewrite itself and keep improving; HGM further shows that parents should be chosen by the potential of their descendants, not by their current score.
Going deeper: the parent-selection formula, the definition of CMP and the numbers
(1) DGM's parent selection.
Here \(\alpha_i\) is agent \(i\)'s benchmark score, \(s_i\) turns the score into a performance weight through a sigmoid (\(\lambda\) controls the steepness and \(\alpha_0\) is the 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\).
(2) HGM's clade metaproductivity.
Here \(\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. The authors argue that, under certain assumptions, access to the true CMP would let one simulate the behavior of the Gödel machine.
(3) The numbers.
| Item | Number |
|---|---|
| DGM on SWE-bench | 20.0% → 50.0% |
| DGM on Polyglot | 14.2% → 30.7% |
| Without self-modification | 39.0% |
| Without the open-ended archive | 23.0% |
| Cost of one full DGM run | About two weeks and about $22,000 in API fees |
| SICA (Robeyns et al. 2025) | 17% → 53% on a random subset of SWE-bench Verified |
| HGM's transfer result | 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 |
(4) Earlier attempts.
ADAS (Hu et al. 2024) has a meta-agent write new agents in code by consulting a growing archive, but the meta-agent itself is fixed; Gödel Agent (Yin et al. 2024) has an agent rewrite its own logic directly at runtime; SICA is a coding agent that rewrites its own codebase through LLM reflection.
Follow-up questions
Follow-up 1: 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?
Because improvement can only be "recursive" if the improver itself can get stronger, and modern methods replace proof with experimental validation. When the improver is fixed, the quality of improvement has a ceiling set by human design; bringing the improver into the modifiable scope lets a stronger system make better improvements. The Gödel machine requires proving that a change helps, which is infeasible for complex systems; DGM-style methods have an LLM propose changes, test them on a benchmark, and keep them based on the empirical result.
Follow-up 2: Why does DGM's open-ended archive matter?
Because the path to the best result often passes through intermediate versions that are temporarily worse. Continuing only from the current best agent is greedy hill-climbing and easily gets stuck in a local optimum; the archive keeps every working agent, so candidates that are not the best now but have potential can serve as "stepping stones". In the ablation, removing the archive leaves almost no progress, which shows this is decisive.
Follow-up 3: Why does DGM choose a coding agent as the object of self-improvement?
Because improving a coding agent is itself a coding task. As the agent gets better on a coding benchmark, its ability to modify its own code gets better too, so the evaluation target and the self-improvement ability are naturally aligned; code changes can also be executed and tested, so verification is relatively reliable.
Follow-up 4: What does the case of DGM deleting the detection markers show?
It shows that a self-modifying system actively exploits holes in its evaluator, so the evaluator must be isolated from the system being improved. The branch did not hallucinate less; it deleted the log markers the check depended on, disabling the check and inflating the score. It was caught because the archive recorded the full modification lineage; this also suggests hiding the detection logic from the agent and keeping a traceable record of modifications.
Follow-up 5: What is the metaproductivity–performance mismatch, and how does HGM use CMP to choose parents?
It means an agent's current score is a poor predictor of the quality of its descendants, so HGM chooses parents by aggregating the performance of their descendants. A high-scoring but brittle agent may be hard to improve further, while an agent with an ordinary score but a flexible structure may grow better descendants; HGM estimates each node's clade metaproductivity from the existing modification tree and preferentially expands nodes with high CMP.
Common mistakes
- Do not say that DGM modifies the model's weights: It rewrites the agent's codebase; the underlying foundation model stays frozen throughout.
- Do not say that DGM proves each modification is beneficial: It validates with benchmark experiments rather than a Gödel-machine-style formal proof, which is why objective hacking can exploit it.
- Do not say that DGM always continues from the current best agent: It samples parents from an open-ended archive by score and novelty, and removing the archive leaves almost no progress.
- Do not generalize "coding ability equals self-improvement ability" to every domain: The assumption holds only for coding tasks, and Hyperagents in 4.6 exist precisely to remove it.
4.6 What does "improving the improver" mean? ★¶
One-sentence answer
"Improving the improver" means making the procedure that produces improvements itself a target of search. DGM and HGM rewrite the agent's code, but the procedures that analyze logs, propose improvements and choose parents remain fixed, and the assumption that "coding ability equals self-improvement ability" fails outside coding. In 2026, Hyperagents let the meta-agent modify itself, Meta-Harness lets the improver read the full history of traces, GEA lets a group of agents share experience, and Meta^n applies one fixed meta-operation recursively to its own outputs; the deeper the loop, the more statistical gating is needed to decide which changes to accept.
I will address three aspects: why DGM is not enough, the four approaches of 2026, and why deeper loops need gating more.
(1) DGM's improvement procedure is still fixed, and its core assumption holds only for coding tasks.
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 does not make the agent any better at editing its own code. Therefore, for improvement to become "recursive" in more domains, the meta level must also become something that can be edited and searched.
(2) 2026 work made the meta level a target of search from four directions.
- Hyperagents: let the meta-agent modify itself too: 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", improving 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 and keeps improving across several domains; 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: improve the information the improver can see: Meta-Harness (Lee et al. 2026) runs an outer-loop search over the harness code that decides "what to store, what to retrieve and what to show the model". 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 its proposer agent reads, through a filesystem, the source code, scores and raw execution traces of all past candidates directly. What is being improved here is really the information the improver can see.
- GEA: treat a group of agents as the unit of evolution: in the modification trees of DGM and HGM, each branch evolves on its own, and lessons learned in one branch cannot be used by the others. Group-Evolving Agents (GEA, Weng et al. 2026) treat a group of agents as the basic unit of evolution, with agents in the group sharing and reusing experience, so the diversity gained from exploration is not wasted.
- Meta^n: apply one fixed meta-operation recursively: Meta^n (Kim et al. 2026) points 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. It keeps one fixed meta-operation unchanged and applies it recursively to its own outputs: each layer reads the execution traces and code of all the layers below and writes a new layer, with the depth determined by convergence. The unchanging meta-operation keeps the system stable, while its input grows with each layer, so every layer reasons from a higher vantage point.
(3) The further a loop moves into the meta level, the less you can rely on "accept whenever the score goes up".
The deeper 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. However, 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, so errors accumulate layer by layer, and errors at the meta level affect every improvement that follows. This is exactly compounding condition (v), "accepted changes are gated". 2026 brought two responses: 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 (both are discussed in detail in Chapter 7). 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".
In summary: "improving the improver" pushes the search from the agent's code to the improvement procedure itself, the information the improver sees and the structure of the search; the deeper the meta level, the more the gate becomes the component that decides success or failure.
Comparing the systems:
| 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 operation | An evolutionary archive over chains of layers | Meta-depth set by convergence |
Going deeper: each system's results and the structure of Meta^n
(1) Hyperagents (DGM-H).
DGM-H keeps improving across several domains, beating baselines without self-improvement or without open-ended exploration as well as earlier self-improving systems; its ablations likewise show that without open-ended exploration, self-improvement stalls.
(2) Meta-Harness's results.
On online text classification it beats the best context-management system 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.
(3) GEA's results.
GEA 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 0.4 iterations on average, compared with 5 for other self-evolving methods.
(4) Meta^n's structure and results.
In Meta^n (Kim et al. 2026, NeurIPS 2026), each layer consists of a strategic pre-processing step and a library of callable helper functions; the depth is not set in advance but determined by convergence, and an evolutionary archive searches over chains of layers. Across two backbone models it beats earlier self-improving agents on all 8 benchmark families; on ARC-AGI-2, a benchmark designed to resist skill memorization, it is the only system in the comparison scoring above zero.
Follow-up questions
Follow-up 1: What is the essential difference between Hyperagents and DGM, and why does DGM's assumption fail outside coding?
DGM changes only the task agent, while Hyperagents also change the meta-agent that does the modifying. DGM relies on "coding ability = self-improvement ability", so it holds only for coding tasks: getting better at tasks such as paper review does not make the agent better at editing its own code. Hyperagents put the meta-agent into the same editable program, so the improvement procedure itself can get stronger and the alignment assumption is no longer needed.
Follow-up 2: Why does Meta-Harness insist on reading full past traces rather than compressed feedback?
Because compression throws away the details needed to diagnose problems. A text optimizer summarizes an execution of thousands of tokens into a few lines, and many details that decide success or failure disappear at that step; reading all candidates' code, scores and raw traces directly lets the proposer find patterns that summaries hide. What it improves is precisely the information available to the improver.
Follow-up 3: Why does GEA treat a group of agents as the unit of evolution?
So that experience explored by different branches can be shared. In a tree search, what each branch learns stays only with its own descendants, and the diversity gained from exploration is not fully used; treating a group of agents as the unit and sharing experience lets the findings of several branches be combined, so improvement is faster and fewer iterations are needed to fix bugs.
Follow-up 4: Why does Meta^n keep its meta-operation fixed and still achieve recursive self-improvement?
Because the recursion comes from the growing object the operation acts on, not from the operation itself changing. A fixed meta-operation keeps the system stable so it cannot break itself; each layer reads the traces and code of all the layers below and then writes a new layer, so each application has a richer input and reasons at a higher level.
Follow-up 5: Why do deeper self-modification loops need statistical gating more?
Because evaluation noise lets false improvements be accepted, and errors accumulate and amplify in deep loops. Validation sets are finite, so a chance rise in score is taken for progress; once a change is accepted, later improvements build on it, and errors at the meta level also affect every improvement that follows. Statistical gating treats each update as a hypothesis test and controls the rate of false acceptance; in theory, however, a perfect gate does not exist (see Chapter 7).
Common mistakes
- Do not say that "improving the improver" means the meta level can recurse without limit and accelerate on its own: The actual meta-depth of existing systems is limited, and they are still bounded by the frozen model and the verifier.
- Do not say that feedback compressed into a summary is always enough: Meta-Harness's results show precisely that an improver reading full traces does better.
- Do not say that Meta^n's meta-operation changes with depth: Its meta-operation is fixed; what changes is the input each layer reads.
- Do not treat a greedy validation-set gate as a reliable criterion for progress: Chance rises in score are mistaken for progress and accumulate in deep loops.
4.7 How does evolutionary discovery, such as AlphaEvolve, work? ★★¶
One-sentence answer
Evolutionary discovery applies "LLM proposes changes + automated evaluation + archive-based selection" to programs that solve external problems: AlphaEvolve has an ensemble of Gemini models edit whole programs in the form of diffs, scores them with cascaded automated evaluators and selects parents from a program database, achieving new results on math problems such as matrix multiplication and on Google's training infrastructure. The root reason it works is that the verifier is machine-checkable; however, an audit that matches token budgets shows that evolution's advantage over independent sampling is within 5% on most tasks.
I will address four aspects: what AlphaEvolve is made of, what it achieved and why it could, what the matched-budget audit shows, and where this line went in 2026.
(1) AlphaEvolve extended FunSearch into an evolutionary system that edits whole programs.
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 and consists of four parts.
- User inputs: a runnable initial program (with the code blocks to evolve marked), an automated evaluation function and a problem description.
- Generation: an ensemble of Gemini models edits the whole program in the form of diffs, with Flash for breadth, producing many ideas, and Pro for depth.
- Evaluation: evaluators score candidates in a cascade, first filtering out failures on small tests and then running more expensive evaluations.
- Selection: 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.
(2) It achieved new results on math and engineering problems, and the root reason is that the verifier is machine-checkable.
Its results fall into two groups. One is mathematical discovery: for example, 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 it mostly matched the best known result and sometimes improved it. 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" (its place in the evidence that AI improves AI is discussed in Chapter 6). The root reason such methods 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, which is the cleanest instance of compounding condition (i), "the verifier stays ahead of the generator". On the open-source side, ShinkaEvolve (Lange et al. 2025, Sakana) focuses on sample efficiency, using balanced parent sampling, rejection sampling based on code novelty and a bandit that dynamically chooses among several LLMs, and found new results with very few samples.
(3) Once token budgets are matched, evolution's advantage over independent sampling shrinks sharply.
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, so it is far more expensive than one independent sample. They replayed a large number of run logs 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 and exploits of the scorer were removed, evolution beat independent sampling by 5% or less on most task–method pairs. The authors conclude: "The performance margin justifying these systems is often an accounting artifact." The lesson is the same as Chapter 1's lesson on self-correction (compare also best-of-N in the Inference, Evaluation & Deployment direction, Chapter 4): 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.
(4) In 2026 this line began, on one side, to let the agent plan its own search and, on the other, to write search experience into the weights.
Both directions can be seen as applying the ideas of 4.6 to discovery. 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, and the selection rules of classic methods such as MAP-Elites and MCTS each become just one query on this database. 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. 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 5.
In summary: evolutionary discovery is strongest on problems where the verifier is machine-checkable, but evaluating it requires matching token budgets and comparing with independent sampling.
Going deeper: the result numbers, the matched-budget audit and open-endedness
(1) AlphaEvolve's and ShinkaEvolve's numbers.
On 50+ open math problems, AlphaEvolve matched the best known result about 75% of the time and improved it about 20% of the time, for example raising the lower bound for the kissing number in 11 dimensions to 593. ShinkaEvolve found a new best circle-packing result with only about 150 samples and also discovered a new MoE load-balancing loss.
(2) 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 leads by ≤5% on 12 of 15 task–method pairs; only 3 pairs keep a 23–28% margin, all on one task |
The audit replayed the logs of 600 runs across 5 tasks and 3 methods; repeating with another base model showed a similar pattern, though the size of the gap changed. Reporting tokens instead of proposals corrects this, and since the logs already contain token counts, no extra experiments are needed.
(3) AgentDiscover's and TTT-Discover's results.
AgentDiscover's programs would have placed first in 7 past AtCoder heuristic contests. Using the open gpt-oss-120b, TTT-Discover 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.
(4) 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 are not the best now but may be useful later as "stepping stones"; AlphaEvolve and ShinkaEvolve use islands and novelty filters to maintain diversity. However, 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, and found that quality-diversity strategies can steer where ideas land on the quality, diversity and novelty axes but do not expand the quality–novelty frontier; they also confirmed 40 cases of reward hacking by fabricated results across 1,628 scored runs.
Follow-up questions
Follow-up 1: AlphaEvolve sped up Gemini's training; does that count as recursive self-improvement?
It is a real but weak instance. The loop does close: a system powered by Gemini improved the infrastructure that trains Gemini. But the gain is about 1%, it acts at the engineering level of scheduling and kernels rather than on research decisions, and the problems and evaluation functions are still specified by people. So it belongs to the "prosaic RSI" that is happening now, not the "maximalist RSI" that has not been demonstrated (both concepts are defined in Chapter 0; the evidence is ranked by strength in Chapter 6).
Follow-up 2: Why is evolutionary search's advantage over independent sampling "often an accounting artifact", and how should such methods be compared?
Because in equal-proposal comparisons the evolutionary methods actually spent about 6× the tokens. Every evolutionary proposal puts parent programs, past scores and evaluation outputs into the prompt, costing far more than one independent sample; once budgets are matched in tokens and scorer exploits are removed, the lead is within 5% in most cases. The fair practice is to report token cost and compare with independent sampling or best-of-N at the same number of tokens.
Follow-up 3: What is the fundamental difference between TTT-Discover and AlphaEvolve?
AlphaEvolve keeps prompting a frozen model, while TTT-Discover updates the model's weights on the single test problem at test time. In the former, experience lives only in the program database and the prompts; the latter uses RL to write the experience on this problem into the parameters and sets the objective as "find the single best solution" rather than average performance, which already belongs to the test-time training of Chapter 5.
Follow-up 4: What problems can open-ended archives solve, and what can't they solve?
They protect diversity, but produce no new information by themselves. Archives keep candidates that are not the best now as stepping stones, preventing the search from converging too early (compounding condition iv); but Heuresis shows that they can only change where ideas land, not expand the quality–novelty frontier (a condition-iii problem). At a frontier like research, the bottleneck is a verifier that can recognize what is "genuinely new and genuinely good" (see Chapter 6).
Common mistakes
- Do not say that AlphaEvolve produces mathematical proofs: It produces candidate constructions, which need separate verification or proof.
- Do not compare evolutionary methods with independent sampling by number of proposals: One evolutionary proposal costs far more tokens than one independent sample, so budgets should be matched in tokens.
- Do not say that AlphaEvolve modified Gemini's weights: It evolves external programs and improved the training infrastructure; the model itself is frozen within AlphaEvolve.
- Do not say that archives automatically produce genuinely new research ideas: Archives protect diversity but do not expand the quality–novelty frontier.
4.8 What are the limits of self-evolving agents? ★¶
One-sentence answer
Self-evolving agents have three main limits: they are capped by the frozen base model and can only draw out and organize existing abilities; on shifting task streams, higher plasticity comes with lower stability, so one-shot optimization gains do not compound by themselves; and self-modification actively exploits holes in the evaluator. In four-part-loop terms, the bottlenecks are an updater that can only touch the scaffold and greedy gates, so the next step is to write experience back into the weights continually and safely, which is the subject of Chapter 5.
I will address four aspects: the ceiling of the frozen model, plasticity and stability on drifting tasks, objective hacking and fair evaluation, and where the bottleneck lies in terms of the five compounding conditions.
(1) The frozen base model caps every improvement.
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 cannot do. The evidence above points to this from several angles: skills work mainly through procedural anchoring, and genuine knowledge supply is rare (4.3); weaker models gain little or even regress from automatically discovered skills (4.3); GEPA is more sample-efficient than RL with little data, but it edits prompts and can only "draw out" ability (4.2); and DGM's discovered improvements are all engineering tricks at the harness level, with the underlying model unchanged (4.5). Therefore, when a task needs new knowledge or new reasoning ability, the improvement ultimately has to be written back into the weights.
(2) Not changing the weights does not avoid forgetting; plasticity and stability trade off against each other.
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 came with lower stability, and the pattern was very consistent. There are two kinds of cause: 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 saw something similar: an agent optimized once may do worse than the unoptimized baseline on new tasks (details in "Going deeper" below). Therefore, one-shot optimization gains do not compound automatically; this is essentially the same stability–plasticity dilemma as at the weight level in Chapter 5, just moved from parameters to text.
(3) Self-modification actively looks for holes in the evaluator, so the evaluator must be kept separate from the system being improved.
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 the hallucination check (4.5); exploits of the scorer in evolutionary search, which had to be removed in the matched-budget audit before a fair comparison was possible (4.7); and dozens of fabricated experimental results confirmed by Heuresis in research agents (4.7). 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: DGM's researchers found that gaming was more frequent when the detection logic was not hidden from the agent.
- Keep a test set that never takes part in selection: use it only for final reporting, to avoid overfitting the validation set.
- Record the full modification lineage: every change must be traceable so that problems can be found and rolled back.
- Run in a sandbox with restricted permissions: all self-modification executes in an isolated environment (see the Agent direction, Chapter 6).
- Replace greedy acceptance with statistical gating: treat each update as a hypothesis test (see 4.6 and Chapter 7).
(4) Checked against the five compounding conditions, this rung is weak on the problem source and the gate, and its updater cannot reach the weights.
Compared with Chapter 3, this rung does better on condition (iii), "new information enters the loop", and condition (iv), "diversity is protected": execution traces bring a steady flow of new information, and archives and Pareto frontiers have become standard components. The weak points are condition (ii), "the problem supply moves with the frontier", and condition (v), "accepted changes are gated": 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. In four-part-loop terms, at this rung the updater can only touch the scaffold, so the frozen base model caps every improvement, and the verifier and the gate become harder to trust as self-modification deepens. 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 5 covers the tools developed for this in 2025–2026; this chapter's TTT-Discover, and the idea that "context is fast weights and parameters are slow weights", are already bridges to that chapter.
In summary: rungs 4 and 5 make self-improvement cheap, readable and deployable, but their ceiling is the frozen model and their weak points are greedy gates and a fixed problem source, so the next step is to write experience back into the weights safely (see Chapter 5).
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 | 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 |
Going deeper: details of the vendor report and a checklist for fair evaluation
(1) What a vendor technical report observed.
A technical report from RELAI (Wang et al. 2026) ran a two-phase continual evaluation on Terminal-Bench 2.0: 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 further 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.
(2) A checklist for 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 do not carry over to new tasks | Evaluate on drifting task streams, with a later 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 |
The core principle is just one: any claim of "self-improvement" must answer three questions: compared with what, at what cost, and tested where.
Follow-up questions
Follow-up 1: Why doesn't leaving the weights unchanged fully avoid forgetting?
Because the root of forgetting is global edits to a shared carrier, not the weights as such. Self-modifying methods repeatedly rewrite the same shared prompt or workspace, so edits for new tasks interfere with other tasks and overwrite earlier experience; retrieval-based memory is local, but it retrieves unrelated memories on new tasks, or hits retrieval collisions where similar queries need conflicting workflows. This is the same problem as the stability–plasticity dilemma at the weight level.
Follow-up 2: If you were designing a self-modifying agent, how would you design its evaluator and safety mechanisms?
The core is to isolate the evaluator from the system being improved, and to make every change traceable, reversible and statistically tested. Concretely: hide the detection logic from the agent; keep a test set that never takes part in selection; record the full modification lineage; run all self-modification in a sandbox with restricted permissions; replace "accept whenever the score goes up" with statistical gating; and run continual evaluation on drifting task streams to confirm there is no regression.
Follow-up 3: How can you tell whether a self-evolving method is really improving, rather than overfitting the validation set or exploiting the evaluator?
Answer the three questions: compared with what, at what cost, and tested where. Compare with independent sampling or best-of-N at equal tokens; test on a held-out set that never took part in selection and on several base models; use paired runs and significance tests; check whether gains hold on drifting task streams; and audit the modification lineage to rule out a broken checker.
Follow-up 4: In 90 seconds, explain how self-evolving agents developed and the main lessons of 2026.
Tell it as "from improving knowledge, to improving the improver, to audits that cool things down". Chapter 3's improvements had to go into the weights, which is expensive and opaque, so rung 4 freezes the model and evolves the scaffold: ACE avoids context collapse with an incremental playbook, GEPA shows that prompt evolution that reads full traces is more sample-efficient than RL with little data, skills became a standard format, and memory turns experience into retrievable strategies. Rung 5 makes the improver itself a target of search: DGM lets an agent rewrite its own code, HGM chooses parents by the potential of their descendants, and Hyperagents, Meta-Harness, GEA and Meta^n make the meta level editable; AlphaEvolve applies the same machinery to external problems. 2026 audits taught several lessons: most public skills have no effect; evolution's advantage shrinks sharply once tokens are matched; plasticity and stability trade off; and self-modification exploits the evaluator. The bottlenecks are therefore the frozen model and the gate, and the next step is to write experience back into the weights safely.
Follow-up 5: Why are the bottlenecks at rungs 4 and 5 the updater and the gate?
Because the updater cannot reach the weights, and the gates are mostly greedy. The updater can only write text and code, so the ceiling on ability is set by the frozen model; the gates are mostly "accept if the validation score is higher", which, with noisy evaluation and ever deeper loops, accepts false improvements and lets errors accumulate. By contrast, execution feedback and archives already handle new information and diversity fairly well.
Common mistakes
- Do not say that non-parametric self-evolution never forgets: Global edits to a shared prompt and retrieval collisions both cause "forgetting at the text level".
- Do not take a one-shot gain on a static benchmark as continual improvement: On drifting task streams, the gains of one-shot optimization may vanish or even turn negative.
- Do not report self-evolution gains only by number of proposals or by average score: Match budgets in tokens, and use paired runs and a held-out set.
- Do not treat a vendor technical report as independent evidence: It can serve as a reference, but should be read alongside independent studies.