A deep dive into Self-Evolving Prompt Optimization, the framework that turns the prompt agent's own system prompt into an optimization target — and beats manual chain-of-thought prompting by 4.49 points across five benchmarks.

June 4, 2026


Every prompt optimization system has a skeleton in its closet. The task agent gets better. The prompts get sharper. But the prompt agent — the one doing the optimizing — sits frozen, hand-written by a human, never improving. It is the fixed point in an otherwise adaptive system. A black box inside the optimization loop that the loop never touches.

A new paper from the National University of Singapore and City University of Hong Kong finally opens that box. SePO: Self-Evolving Prompt Agent for System Prompt Optimization, published June 3, 2026, by Wangcheng Tao, Han Wu, and Weng-Fai Wong, treats the prompt agent's own system prompt as an optimization target alongside the task agents it serves. The result: a self-referential evolutionary loop where the optimizer optimizes itself, closing the last open loop in prompt engineering.

The numbers speak clearly. Across five benchmarks — AIME'25 (math), ARC-AGI-1 (abstract reasoning), GPQA (graduate-level science), MBPP (code generation), and Sudoku (logic puzzles) — SePO improves average accuracy by 4.49 points over manual chain-of-thought prompting, and outperforms TextGrad and MetaSPO on every single task.

The Problem Nobody Was Solving

Prompt optimization has evolved through several generations. The earliest methods, like APE and OPRO, treated prompt search as black-box optimization: run a prompt, score it, propose a better one. Evolutionary approaches like PromptBreeder and EvoPrompt maintained populations of candidate prompts, applying mutation and selection. More recently, TextGrad backpropagated natural language critiques through agent compute graphs, and MetaSPO formulated prompt optimization as cross-task meta-learning.

All of these methods share the same architecture. A prompt agent reads evaluation feedback and proposes refined prompts for the task agent. The prompt agent is the optimizer. The task agent is the optimizee. The loop runs. Prompts get better.

But the prompt agent itself never changes. Its system prompt — the instructions that tell it how to optimize — stays exactly as a human wrote it. No matter how many tasks the system sees, the optimizer never accumulates experience. It never gets better at its job.

This is not a minor oversight. Consider the analogy: a personal trainer who helps athletes get stronger but never improves their own coaching methodology. A teacher who refines lesson plans for students but never refines their own teaching philosophy. The asymmetry limits the ceiling of the entire system.

SePO identifies this gap precisely. The authors call it the self-referential closure: the prompt agent treats itself as a special task agent whose task is to improve task agent prompts. The same evolutionary procedure that refines any task agent's prompt also refines the prompt agent's own prompt. The loop closes.

How SePO Works

The Core Insight: Self-Referential Optimization

In the standard setup, you have:

  • A task agent A with system prompt p, model M, and workflow W
  • A prompt agent à with system prompt p̃ that proposes refined prompts

The optimization target is finding p* that maximizes task accuracy. The prompt agent's p̃ is hand-engineered and frozen.

SePO's key move: define a prompt task T̃ where the "inputs" are tuples of (task, task agent, evaluation results), and the "score" measures whether the prompt agent's proposed refinements actually improve task agent accuracy. Now optimizing p̃ over T̃ is formally identical to optimizing p over T. The same algorithm handles both.

The prompt agent becomes both optimizer and optimizee. It is a Gödelian structure: a system that rewrites the instructions governing its own rewriting process.

The Archive: Stepping Stones, Not Just Winners

SePO runs open-ended evolutionary search over a population of candidate prompts, inspired by recent work on archive-based evolutionary search for agents (Zhang et al., 2026). It maintains an archive of all candidate prompts that pass an admission criterion. New prompts are generated by sampling a parent from the archive and asking the prompt agent to propose a child. If the child outperforms its parent, it enters the archive.

The archive matters because it preserves stepping stones — prompts that are not the best overall but carry useful innovations that later prompts build on. This is a core insight from open-ended evolution: the path to the summit winds through valleys, and you need to remember the valleys, not just the peaks.

The algorithm runs for G generations with K children per generation. At each step:

  1. Sample a parent from the archive
  2. Generate a child prompt via the prompt agent
  3. Score the child on the task
  4. If it passes the admission criterion, add it to the archive
  5. Return the highest-scoring prompt in the archive

Two-Stage Training: Pre-Training Then Fine-Tuning

SePO mirrors the standard deep learning paradigm of pre-training followed by fine-tuning, and this split is critical to its success.

Stage 1: Pre-training. The self-referential loop runs on a pool of multiple tasks. The prompt agent's own system prompt p̃ is evolved from a seed to p̃. This is where the self-referential closure activates: at each generation, the parent prompt p̃ used by the prompt agent is itself the thing being optimized*. The agent improves a copy of itself.

The pre-training stage can use either a single task (SePO-Specialist) or a multi-task mixture (SePO-Generalist). The Generalist variant is the default, because diverse training data produces a more robust optimizer — the same principle that makes multi-task pre-training effective in deep learning.

Stage 2: Fine-tuning. The pre-trained prompt agent (now using p̃* as its frozen system prompt) optimizes a task agent's system prompt for a specific target task. The prompt agent is no longer evolving itself; it applies the accumulated skill from pre-training to the new task.

This split amortizes the expensive self-evolution of the prompt agent across many fine-tuning runs. Pre-train once, fine-tune many times.

The Results: Consistent Wins Across Domains

SePO is evaluated on five benchmarks that span very different reasoning demands:

Benchmark Domain What It Tests
AIME'25 Mathematics Multi-step competition math
ARC-AGI-1 Abstract reasoning Novel visual pattern completion
GPQA Science Graduate-level reasoning
MBPP Code generation Python programming
Sudoku Logic puzzles Constraint satisfaction

Against three baselines — Manual Chain-of-Thought (Manual-CoT), TextGrad, and MetaSPO — SePO achieves the best accuracy on every single task. The average improvement over Manual-CoT is 4.49 percentage points.

This consistency matters more than the magnitude. It is one thing to excel at math or code alone. It is another to win across math, abstract reasoning, science, code, and logic — domains that stress very different cognitive capacities. SePO's self-referential optimization produces a prompt agent that generalizes, not one that memorizes.

Generalist Beats Specialist

The paper introduces two variants. SePO-Specialist pre-trains on the same single task it will later fine-tune on. SePO-Generalist pre-trains on a mixture of tasks. The Generalist variant outperforms the Specialist variant, confirming that multi-task pre-training transfers prompt optimization skill across domains.

This is a significant finding. It means the prompt agent is learning how to optimize prompts as a general skill, not memorizing task-specific tricks. The optimization capability transfers to tasks it has never seen during pre-training.

Not Memorization, But Skill

One of the paper's most important ablation studies tests whether SePO's pre-training merely memorizes per-task prompts. The answer is no. When the pre-training tasks exclude the fine-tuning target, the prompt agent still performs well. The optimization skill generalizes beyond the pre-training mixture.

This distinguishes SePO from approaches that overfit to the training distribution. The evolved system prompt encodes general prompt-optimization strategies — things like "focus on error patterns in failed examples" or "prioritize structural changes over wording tweaks" — rather than task-specific prompt templates.

Why This Matters

Closing the Meta-Loop

Prior work came close to self-referential optimization but never closed the loop. PromptBreeder co-evolves task prompts alongside mutation prompts, but its meta-stack has a fixed, hand-written hyper-mutation prompt at the top. The self-reference is bounded. The loop is open at the top.

SePO closes the loop. There is no fixed meta-level. The prompt agent treats itself as a task agent. The same procedure refines both. This is a clean formalization that transforms the optimization from asymmetric (optimizee improves, optimizer stays fixed) to symmetric (both improve under the same process).

Human-Readable and Model-Agnostic

Unlike weight-based optimization (fine-tuning, RLHF), SePO operates entirely on natural language system prompts. The outputs are human-readable instructions that can be inspected, understood, and transferred across models. You can take a SePO-evolved prompt from GPT-4 and use it with Claude, or Gemini, or any model that accepts system prompts.

This is a practical advantage that weight-based methods cannot match. A LoRA adapter is model-specific. A system prompt is universal.

The Amortization Argument

Pre-training the prompt agent is expensive. It requires running the self-referential evolutionary loop across multiple tasks, evaluating many candidate prompts. But this cost is paid once. The resulting p̃* is then reused across all fine-tuning runs.

Think of it as building a specialized optimization tool. The upfront investment in crafting a better optimizer pays dividends every time you need to optimize a new task agent's prompt. The more tasks you fine-tune on, the more the amortized cost shrinks.

From Tool to Skill

The deepest implication of SePO is conceptual. Prompt optimization has always been a tool: you run it, it produces a better prompt, you use the prompt. The tool itself never gets better.

SePO turns prompt optimization from a tool into a skill. The prompt agent accumulates optimization experience across tasks. It gets better at optimizing prompts the way a human gets better at a craft: through varied practice, not memorization of specific cases.

This skill-based framing connects to broader trends in AI. We are moving from systems that learn tasks to systems that learn how to learn tasks. Meta-learning, in-context learning, and now self-evolving prompt optimization all point in the same direction: AI that improves its own improvement process.

Limitations and Open Questions

SePO is not without limitations, and the paper is transparent about them.

Compute cost. Each generation of the evolutionary loop requires evaluating candidate prompts on the target task. For expensive benchmarks, this can be costly. The two-stage pipeline helps (fine-tuning uses a frozen prompt agent), but pre-training still requires significant compute.

Archive management. The open-ended evolutionary search maintains an archive that grows over time. Managing this archive, including pruning and prioritization, is an open research question.

Scalability to very large models. The paper evaluates on specific benchmarks with specific models. Whether SePO's gains hold when scaled to frontier models with different prompting characteristics remains to be seen.

The bootstrapping problem. The self-referential loop needs a seed prompt to start. While the paper shows that SePO is robust to different seeds, the quality of the initial prompt still matters. A very poor seed may require more generations to converge.

The Bigger Picture

SePO sits at the intersection of several active research threads: open-ended evolutionary search, self-referential systems, meta-learning, and prompt optimization. Its contribution is not just a new method, but a clean formalization that unifies these threads.

The self-referential closure — treating the optimizer as an optimizee — is an idea with roots in Schmidhuber's Gödel Machine (2003) and recent work on open-ended self-improving agents. But SePO applies it to a practical, interpretable domain: natural language system prompts. This makes the approach transparent, model-agnostic, and immediately usable.

The two-stage training pipeline borrows the pre-training/fine-tuning paradigm from deep learning and applies it to prompt optimization. This is not just an engineering convenience. It enforces a separation between learning how to optimize (pre-training) and applying that skill (fine-tuning), which is what enables cross-task generalization.

As AI systems become more autonomous and self-improving, the question of what gets improved matters as much as how. SePO makes a specific choice: improve natural language instructions, not weights, not code, not architectures. This choice trades raw optimization power for interpretability and transferability. It is a trade-off that may not always be optimal, but it produces results that humans can read, understand, and trust.

The 4.49-point average improvement over Manual-CoT is not just a number. It is evidence that the gap between hand-engineered and self-evolved prompt optimizers is real, measurable, and consistent across diverse domains. Closing that gap — by letting the optimizer optimize itself — is an idea whose time has come.


Paper: SePO: Self-Evolving Prompt Agent for System Prompt Optimization, arXiv:2606.04465, June 3, 2026. Authors: Wangcheng Tao (NUS), Han Wu (CityU HK), Weng-Fai Wong (NUS). Code: github.com/taowangcheng/SePO