From Monolithic to Modular: Segment-level Automatic Prompt Optimization
Summary
This paper introduces SAPO, a segment-level automatic prompt optimization method that decomposes prompts into role, context, tasks, and output format, then applies targeted improvements based on weak and strong examples. Evaluated across several benchmarks, SAPO outperforms strong APO baselines including APE, OPRO, EvoPrompt, GEPA, and StraGO on GPT-3.5-Turbo and GPT-4o-mini.
View Cached Full Text
Cached at: 08/13/26, 03:21 PM
# From Monolithic to Modular: Segment-level Automatic Prompt Optimization
Source: [https://arxiv.org/html/2608.11219](https://arxiv.org/html/2608.11219)
Viktor Zhuravlev2Artur Khairullin3Sergey Muravyov4Ilya Makarov5Daniil Sukhorukov6&Ekaterina Averkova7 1,2,3,4,7ITMO University 5,6AXXX nikita\.kulin@itmo\.ru1, vnzhuravlev@itmo\.ru2, arkhairullin@itmo\.ru3, smuravyov@itmo\.ru4, iamakarov@hse\.ru5, d\.sukhorukov@axxx\.tech6, ekaterina\.averkova@itmo\.ru7
###### Abstract
Automatic Prompt Optimization \(APO\) often rewrites prompts monolithically, which can improve one behavior while degrading others\. We present SAPO, a segment\-level APO method that decomposes prompts into role, context, tasks, and output format, then applies targeted improvements based on top\-5 and bottom\-5 examples\. The optimization loop uses one LLM with static meta\-prompts and structured outputs for segmentation, weakness analysis, and candidate generation\. We describe a train/validation protocol and a two\-stage generation process: \(1\) segment\-level diagnosis and recommendation extraction, \(2\) candidate synthesis constrained by weak/strong segment signals\. Using the evaluation setup across SQuADv2, TweetEval, XSUM, CommonGen, and GSM8K on GPT\-3\.5\-Turbo and GPT\-4o\-mini, SAPO achieves the best average score against Zero\-shot and strong APO baselines including APE, OPRO, EvoPrompt, GEPA, and StraGO\.
## 1Introduction
Large language models \(LLMs\) are increasingly used as general\-purpose interfaces for NLP tasks, including instruction following, reasoning, and generation\(Brownet al\.,[2020](https://arxiv.org/html/2608.11219#bib.bib1); Weiet al\.,[2022](https://arxiv.org/html/2608.11219#bib.bib2); Ouyanget al\.,[2022](https://arxiv.org/html/2608.11219#bib.bib3)\)\. In many practical settings, adaptation has shifted from finetuning toward prompt design, where system behavior is controlled through natural\-language instructions\(Zhouet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib4)\)\. As a consequence, prompt quality becomes a primary reliability bottleneck: small wording changes can produce large behavioral shifts, while manual prompt iteration remains costly and unstable\(Zhouet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib4); Pryzantet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib5)\)\.
Automatic Prompt Optimization \(APO\) addresses this problem by iteratively generating and selecting improved prompts from data and model feedback\(Zhouet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib4); Pryzantet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib5); Yanget al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib6); Guoet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib7); Agrawalet al\.,[2026](https://arxiv.org/html/2608.11219#bib.bib25)\)\. Such approaches are particularly attractive because they are deployment\-friendly and compatible with black\-box APIs\.
A persistent limitation, however, is that many APO pipelines still optimize prompts as monolithic strings\. In practice, prompts are compositional artifacts: role framing, context grounding, task directives, and output\-format constraints contribute differently to downstream behavior\. Prior work reports prompt drifting and instability in iterative optimization, where edits that fix one subset of cases may degrade previously correct behavior\(Wuet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib11)\)\. Additional studies show that optimizer effectiveness is sensitive to model capability and setup choices\(Zhanget al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib9); Maet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib10)\), and that gains can be regime\-dependent in compound systems\(Zhanget al\.,[2026](https://arxiv.org/html/2608.11219#bib.bib16)\)\. Thus, the core challenge is not merely generating more prompt variants, but controlling*where*and*how*edits are applied\.
This paper presents Segment\-level APO \(SAPO\), a modular optimization strategy over explicit prompt segments\. Instead of one global rewrite, the method diagnoses weak and strong segments from ranked evidence and synthesizes candidates that preserve strengths while fixing weaknesses\. Here,strong segmentsare segments associated with correct model behavior on top\-ranked examples, whileweak segmentsare segments associated with incorrect behavior on bottom\-ranked examples\.
Figure 1:SAPO loop\. Starting from the initial promptP\(0\)P^\{\(0\)\}, the method first segments instructions into role/context/tasks/output format, then performs contrastive evidence extraction on train data to diagnose weak and strong segments\. Next, it generates constrained candidates that preserve strong segments while revising weak ones, evaluates them on validation data, applies edit\-distance tie\-break under equal scores, and accepts an update only when validation performance improves; otherwise the current prompt is retained\.Compared with prior autoprompting methods, SAPO contributes:
1. 1\.Segment\-explicit optimization objective:prompts are decomposed into role, context, tasks, and output format, enabling targeted rather than monolithic edits\.
2. 2\.Constrained candidate synthesis and selection:candidates preserve strong segments, revise weak segments, and use an edit\-distance tie\-break for conservative updates\.
3. 3\.Contrastive diagnostic stage:update decisions are grounded in top/bottom evidence, including class\-aware handling for discrete per\-example metrics\.
We evaluate SAPO on five datasets with different task types: SQuADv2, TweetEval, XSUM, CommonGen, and GSM8K, and report results on two model backbones: GPT\-3\.5\-Turbo and GPT\-4o\-mini\. SAPO achieves the best average score against APE, OPRO, EvoPrompt, GEPA, and StraGO\. Relative to the strongest competing baseline by average score, gains are\+5\.13%on GPT\-3\.5\-Turbo and\+7\.25%on GPT\-4o\-mini\.
## 2Related Work
#### Search\-based APO methods\.
Early and widely used APO methods formulate prompt improvement as iterative search over textual candidates\. APE optimizes instruction candidates via generation and selection\(Zhouet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib4)\), while ProTeGi applies textual gradients with beam search and bandit\-style selection\(Pryzantet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib5)\)\. OPRO and EvoPrompt further extend search with trajectory\-conditioned optimization and evolutionary operators, respectively\(Yanget al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib6); Guoet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib7)\)\. GEPA introduces reflective prompt evolution, providing modular modifications through optimization\(Agrawalet al\.,[2026](https://arxiv.org/html/2608.11219#bib.bib25)\)\. Despite their effectiveness, these methods primarily operate as global prompt\-level rewrites rather than as explicit segment\-constrained updates\(Zhouet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib4); Yanget al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib6); Guoet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib7); Fernandoet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib8)\)\.
#### Structured and modular optimization trends\.
In parallel, the field is moving toward structured optimization workflows\. DSPy and TextGrad cast optimization in programmatic or graph\-based forms rather than single prompt rewrites\(Khattabet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib12); Yuksekgonulet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib13)\)\. Promptomatix emphasizes modular orchestration and cost\-aware refinement\(Murthyet al\.,[2025](https://arxiv.org/html/2608.11219#bib.bib14)\)\. More recently, section\-local optimization explicitly operates over fixed prompt components and reports improved robustness in small\-model settings\(Sharma and Henley,[2026](https://arxiv.org/html/2608.11219#bib.bib15)\)\. Collectively, this line of work indicates that structural decomposition can improve interpretability and reduce destructive interference between edits\.
#### Gap summary\.
Existing literature provides either strong search performance or improved robustness diagnostics\(Yanget al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib6); Guoet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib7); Wuet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib11); Sharma and Henley,[2026](https://arxiv.org/html/2608.11219#bib.bib15); Agrawalet al\.,[2026](https://arxiv.org/html/2608.11219#bib.bib25)\), but there is still limited evidence on simple black\-box pipelines that jointly enforce segment\-level controllability, preserve known\-strong prompt components, and remain implementation\-light under a unified multi\-task protocol\.
#### Positioning of SAPO\.
SAPO sits at the intersection of static meta\-prompting and structure\-aware optimization\. It preserves the deployment simplicity of black\-box APO, while introducing explicit segment\-level diagnosis and constrained updates that preserve strong components and localize revisions\.
## 3Method
### 3\.1Problem Formulation
Figure[1](https://arxiv.org/html/2608.11219#S1.F1)provides the high\-level pipeline view, while Algorithm[1](https://arxiv.org/html/2608.11219#alg1)specifies the executable optimization procedure\.
Let an initial prompt template beP\(0\)P^\{\(0\)\}with placeholder\{input\}\. Let datasets be split into training and validation parts:
𝒟train=\{\(xi,yi\)\}i=1Ntr,𝒟val=\{\(xj,yj\)\}j=1Nval\.\\mathcal\{D\}\_\{train\}=\\\{\(x\_\{i\},y\_\{i\}\)\\\}\_\{i=1\}^\{N\_\{tr\}\},\\quad\\mathcal\{D\}\_\{val\}=\\\{\(x\_\{j\},y\_\{j\}\)\\\}\_\{j=1\}^\{N\_\{val\}\}\.\(1\)
Given one LLMℳ\\mathcal\{M\}and task\-dependent metricQτQ\_\{\\tau\}, the objective is:
P∗=argmaxP∈𝒫Qτ\(P;𝒟val,ℳ\)\.P^\{\*\}=\\arg\\max\_\{P\\in\\mathcal\{P\}\}Q\_\{\\tau\}\(P;\\mathcal\{D\}\_\{val\},\\mathcal\{M\}\)\.\(2\)
At iterationtt, the optimizer applies an update operator𝒰\\mathcal\{U\}to the current prompt:
P\(t\+1\)=𝒰\(P\(t\),𝒟train,𝒟val\)\.P^\{\(t\+1\)\}=\\mathcal\{U\}\\\!\\left\(P^\{\(t\)\},\\mathcal\{D\}\_\{train\},\\mathcal\{D\}\_\{val\}\\right\)\.\(3\)The operator isacceptance\-constrained: if the best candidate generated at iterationttdoes not improve validation quality, the prompt is kept unchanged\. This converts the procedure into a monotone, validation\-gated search over prompt space, which directly targets robustness against destructive rewrites\.
Prompt structure is represented as four explicit segments:
S\(P\)=\{srole,scontext,stasks,soutput\_format\}\.S\(P\)=\\\{s\_\{role\},s\_\{context\},s\_\{tasks\},s\_\{output\\\_format\}\\\}\.\(4\)
### 3\.2Algorithm Overview
The optimization loop can be summarized as:
1. 1\.Decompose the current prompt into segments \{role, context, tasks, output\_format\}\.
2. 2\.Run Stage A: evaluate on train, extract top\-5/bottom\-5 evidence, infer weak/strong segments and recommendations\.
3. 3\.Run Stage B: generateKKconstrained prompt candidates\.
4. 4\.Evaluate candidates on validation; choose the best by score, with edit\-distance tie\-break\.
5. 5\.Accept the candidate only if validation score improves; otherwise keep the current prompt\.
Figure[1](https://arxiv.org/html/2608.11219#S1.F1)and Algorithm[1](https://arxiv.org/html/2608.11219#alg1)formalize this loop\.
Algorithm 1Segment\-level APO \(SAPO\)\.1:Initial prompt
PP, train set
𝒟train\\mathcal\{D\}\_\{train\}, validation set
𝒟val\\mathcal\{D\}\_\{val\}, candidates
KK, iterations
TT
2:
P∗←PP^\{\*\}\\leftarrow P;
Q∗←−∞Q^\{\*\}\\leftarrow\-\\infty
3:for
t=1t=1to
TTdo
4:Segment current prompt into \{role, context, tasks, output\_format\}
5:Stage A: evaluate
PPon
𝒟train\\mathcal\{D\}\_\{train\}, build top\-5/bottom\-5 evidence, infer weak/strong segments and recommendations
6:Stage B: generate
KKimproved candidates
7:Evaluate candidates on
𝒟val\\mathcal\{D\}\_\{val\}and choose best candidate
P~\\tilde\{P\}\(tie: minimum edit distance\)
8:if
Qτ\(P~;𝒟val\)\>Qτ\(P;𝒟val\)Q\_\{\\tau\}\(\\tilde\{P\};\\mathcal\{D\}\_\{val\}\)\>Q\_\{\\tau\}\(P;\\mathcal\{D\}\_\{val\}\)then
9:
P←P~P\\leftarrow\\tilde\{P\}
10:endif
11:if
Qτ\(P;𝒟val\)\>Q∗Q\_\{\\tau\}\(P;\\mathcal\{D\}\_\{val\}\)\>Q^\{\*\}then
12:
P∗←PP^\{\*\}\\leftarrow P;
Q∗←Qτ\(P;𝒟val\)Q^\{\*\}\\leftarrow Q\_\{\\tau\}\(P;\\mathcal\{D\}\_\{val\}\)
13:endif
14:endfor
15:return
P∗P^\{\*\}
### 3\.3Prompt Segment Design
SAPO optimizes four segments because they map to distinct and operationally separable control dimensions in instruction\-based LLM use\.
#### Role \(sroles\_\{role\}\)\.
This segment defines behavioral stance \(e\.g\., classifier, summarizer, analyst\)\. Prior prompt engineering literature shows that instruction framing can materially affect downstream behavior\(Zhouet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib4); Pryzantet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib5)\)\.
#### Context \(scontexts\_\{context\}\)\.
This segment encodes task grounding, input injection, and domain constraints \(including\{input\}placement\)\. It controls what information is available and how the model conditions on it\.
#### Tasks \(staskss\_\{tasks\}\)\.
This segment specifies actionable requirements and decision rules\. It is the main locus for correcting underspecified or ambiguous instructions\.
#### Output format \(soutput\_formats\_\{output\\\_format\}\)\.
This segment governs the response schema and formatting constraints\. It is critical in tasks where metric outcomes depend on strict label/output conventions \(e\.g\., classification labels or short\-form answers\)\.
These four segments were selected because they provide a compact decomposition that is expressive enough for heterogeneous NLP tasks while remaining small enough for stable, low\-cost iterative optimization\. This design choice is aligned with broader prompt\-structure taxonomies and recent trends toward structured and section\-local prompt optimization\(Liuet al\.,[2021](https://arxiv.org/html/2608.11219#bib.bib23); Schulhoffet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib24); Khattabet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib12); Yuksekgonulet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib13); Sharma and Henley,[2026](https://arxiv.org/html/2608.11219#bib.bib15)\)\.
### 3\.4Two\-stage Generation Pipeline
#### Stage A: Evidence extraction and segment\-level diagnosis\.
At iterationtt, the current promptP\(t\)P^\{\(t\)\}is first evaluated on𝒟train\\mathcal\{D\}\_\{train\}:
y^i=ℳ\(P\(t\),xi\),qi=Qτ\(P\(t\);\(xi,yi\),ℳ\)\.\\hat\{y\}\_\{i\}=\\mathcal\{M\}\(P^\{\(t\)\},x\_\{i\}\),\\quad q\_\{i\}=Q\_\{\\tau\}\\\!\\left\(P^\{\(t\)\};\(x\_\{i\},y\_\{i\}\),\\mathcal\{M\}\\right\)\.\(5\)Examples are ranked byqiq\_\{i\}, and two contrastive evidence sets are extracted:
ℬgood\(t\)=Top\-5\(qi\),ℬbad\(t\)=Bottom\-5\(qi\)\.\\mathcal\{B\}\_\{good\}^\{\(t\)\}=\\text\{Top\-5\}\(q\_\{i\}\),\\quad\\mathcal\{B\}\_\{bad\}^\{\(t\)\}=\\text\{Bottom\-5\}\(q\_\{i\}\)\.\(6\)For discrete per\-example metrics \(e\.g\., ExactMatch withqi∈\{0,1\}q\_\{i\}\\in\\\{0,1\\\}\), we use class\-aware evidence selection:ℬgood\(t\)\\mathcal\{B\}\_\{good\}^\{\(t\)\}is drawn first from positive examples \(qi=1q\_\{i\}=1\), andℬbad\(t\)\\mathcal\{B\}\_\{bad\}^\{\(t\)\}is drawn first from negative examples \(qi=0q\_\{i\}=0\)\. If one side has fewer than five examples, the remainder is backfilled from the global rank order\. Given\(ℬgood\(t\),ℬbad\(t\)\)\(\\mathcal\{B\}\_\{good\}^\{\(t\)\},\\mathcal\{B\}\_\{bad\}^\{\(t\)\}\)and segment decompositionS\(P\(t\)\)S\(P^\{\(t\)\}\), one LLM with static meta\-prompts infers structured diagnostic outputs:weak\_segments,strong\_segments, andrecommendations\. Intuitively, strong segments are associated with consistently successful evidence, while weak segments are associated with failure cases and become primary targets for revision\.
#### Stage B: Candidate synthesis\.
The same LLM receives current prompt, segment decomposition, weak/strong labels, and recommendations, then generatesKKimproved prompt candidates\{Pk\(t\)\}k=1K\\\{P\_\{k\}^\{\(t\)\}\\\}\_\{k=1\}^\{K\}\. Candidate synthesis is explicitly constrained to preserve segments listed instrong\_segmentsand primarily modify segments listed inweak\_segments, reducing cross\-segment interference\.
Each candidatePk\(t\)P\_\{k\}^\{\(t\)\}is evaluated on𝒟val\\mathcal\{D\}\_\{val\}:
Qk,τ\(t\)=Qτ\(Pk\(t\);𝒟val,ℳ\)\.Q\_\{k,\\tau\}^\{\(t\)\}=Q\_\{\\tau\}\(P\_\{k\}^\{\(t\)\};\\mathcal\{D\}\_\{val\},\\mathcal\{M\}\)\.\(7\)The best candidate is accepted only if it improves the current validation score\. Under score ties, we select the candidate with the smallest edit distance to the current prompt:
P~\(t\)=argmaxPk\(t\)Qk,τ\(t\),tie\-break bymindedit\(Pk\(t\),P\(t\)\)\.\\tilde\{P\}^\{\(t\)\}=\\arg\\max\_\{P\_\{k\}^\{\(t\)\}\}Q\_\{k,\\tau\}^\{\(t\)\},\\quad\\text\{tie\-break by \}\\min d\_\{\\text\{edit\}\}\(P\_\{k\}^\{\(t\)\},P^\{\(t\)\}\)\.\(8\)This conservative tie\-break favors minimal edits and helps preserve validated prompt behavior\.
For compactness, Stages A–B define an update operator:
P~\(t\)=𝒰\(P\(t\),ℬgood\(t\),ℬbad\(t\)\),\\tilde\{P\}^\{\(t\)\}=\\mathcal\{U\}\\\!\\left\(P^\{\(t\)\},\\mathcal\{B\}\_\{good\}^\{\(t\)\},\\mathcal\{B\}\_\{bad\}^\{\(t\)\}\\right\),\(9\)where𝒰\\mathcal\{U\}performs diagnosis, constrained candidate synthesis, and tie\-aware selection\.
An example of SAPO optimization trajectory is shown in Figure[2](https://arxiv.org/html/2608.11219#A2.F2)\. Meta\-prompts for each stage and method complexity analysis are provided in Appendix[C](https://arxiv.org/html/2608.11219#A3)and Appendix[A\.2](https://arxiv.org/html/2608.11219#A1.SS2)\.
## 4Experimental Setup
#### Datasets and task coverage\.
We evaluate on five datasets spanning extractive QA, social NLP classification, abstractive summarization, constrained commonsense generation, and mathematical reasoning: SQuADv2\(Rajpurkaret al\.,[2018](https://arxiv.org/html/2608.11219#bib.bib18)\), TweetEval\(Barbieriet al\.,[2020](https://arxiv.org/html/2608.11219#bib.bib21)\), XSUM\(Narayanet al\.,[2018](https://arxiv.org/html/2608.11219#bib.bib19)\), CommonGen \(CG\)\(Linet al\.,[2020](https://arxiv.org/html/2608.11219#bib.bib20)\), and GSM8K\(Cobbeet al\.,[2021](https://arxiv.org/html/2608.11219#bib.bib22)\)\. This mix is intended to stress different prompt components \(role, task specification, response format, and domain context\) under a shared APO loop\. In our evaluation, we use BERTScore F1\(Zhanget al\.,[2020](https://arxiv.org/html/2608.11219#bib.bib17)\)for \(XSUM, CG, SQuAD2\), F1 – \(TweetEval\), and ExactMatch – \(GSM8K\)\.
#### Models\.
We report results for GPT\-3\.5\-Turbo and GPT\-4o\-mini to cover two commonly used API models with different capability/cost profiles\.
#### Data split and protocol\.
Each dataset is split into train/validation/test with sizes 150/100/all\. The train split is used for top/bottom evidence extraction, validation is used for candidate selection during optimization, and the held\-out test split is used for final reporting\. This separation is strictly enforced for all iterative methods to reduce selection leakage\.
#### Generation settings and baselines\.
For candidate generation, we useK=5K=5candidates per iteration and a sampling temperature of0\. These values are fixed across all experiments and are kept identical for SAPO and all iterative APO baselines for fairness\. We compare against Zero\-shot prompting \(as a baseline and as an initial prompt for optimization\) and representative APO methods: APE\(Zhouet al\.,[2023](https://arxiv.org/html/2608.11219#bib.bib4)\), OPRO\(Yanget al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib6)\), EvoPrompt\(Guoet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib7)\), GEPA\(Agrawalet al\.,[2026](https://arxiv.org/html/2608.11219#bib.bib25)\), and StraGO\(Wuet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib11)\)\.
#### Runs and reporting\.
Each method/model setup is run five times with different random seeds and data samples\. Main tables report mean values across runs\.
## 5Results
Across both model settings, SAPO delivers the highest average score among compared baselines on the reported benchmark suite\. Unless explicitly stated otherwise, all numbers in this section are evaluated on the held\-out test split\. The largest relative gains appear on GSM8K and XSUM, consistent with the value of segment\-level control in settings that require strict answer extraction or tightly constrained generation\. The SAPO\-optimized prompts are provided in Appendix[C](https://arxiv.org/html/2608.11219#A3)\.
On GPT\-3\.5\-Turbo, SAPO achieves the highest average score\. It yields gains on SQuAD2, GSM8K, CommonGen, and TweetEval, while trailing GEPA on XSUM\. The largest relative gain appears on GSM8K, suggesting that segment\-level control and task\-focused refinement are particularly beneficial for exact\-answer reasoning settings\.
On GPT\-4o\-mini, SAPO again delivers the highest average score and outperforms all compared baselines on all five datasets\. This pattern indicates that segment\-level optimization is complementary to model capability scaling rather than specific to one backbone\.
The average gain relative to the best competing baseline by average score is \+5\.13% on GPT\-3\.5\-Turbo and \+7\.25% on GPT\-4o\-mini, indicating consistent benefits from constrained segment\-local updates\.
Table 1:Test\-split comparison on GPT\-3\.5\-Turbo\. Best values per column are inbold\. “Difference vs best baseline” is computed per column against the strongest non\-SAPO method in that column\.Table 2:Test\-split comparison on GPT\-4o\-mini\. Best values per column are inbold\. “Difference vs best baseline” is computed per column against the strongest non\-SAPO method in that column\.
## 6Discussion
#### Why segment\-level updates help\.
The observed gains are consistent with the hypothesis that explicit weak/strong segment separation reduces destructive interference between edits\. Instead of globally rewriting prompts, SAPO localizes revisions to weak components while preserving high\-performing structure, aligning with recent observations on prompt drifting in iterative APO\(Wuet al\.,[2024](https://arxiv.org/html/2608.11219#bib.bib11)\)\.
#### When improvements are likely\.
Improvements are most pronounced when tasks depend on strict output conventions or multi\-part instructions\. In such settings, preserving strong format/context segments appears as important as improving task wording; this is consistent with recent evidence that optimization success is regime\-dependent and tied to task structure\(Zhanget al\.,[2026](https://arxiv.org/html/2608.11219#bib.bib16)\)\.
#### Limitations\.
A key limitation of this work is that SAPO uses a fixed and relatively small segment set\. While this decomposition is practical and interpretable, it may not capture finer\-grained prompt structure needed for some tasks\. Future work should explore richer segment taxonomies and adaptive segment discovery, including LLM\-based automatic generation of new segment types during optimization\. This would allow the optimizer to expand or refine its own editing space dynamically, rather than relying on a predefined segmentation scheme\. Meanwhile, our current setup uses fixed top\-5/bottom\-5 evidence windows, which may miss finer\-grained error modes\.
## 7Conclusion
We presented SAPO, a modular APO framework that replaces monolithic rewrites with segment\-level optimization\. Under this protocol, SAPO achieves the strongest average performance against strong APO baselines and offers an interpretable pathway for future extensions in APO\.
## 8Acknowledgments
This work supported by the Ministry of Economic Development of the Russian Federation \(IGK 000000C313925P4C0002\), agreement No139\-15\-2025\-010
## References
- L\. A\. Agrawal, S\. Tan, D\. Soylu, N\. Ziems, R\. Khare, K\. Opsahl\-Ong, A\. Singhvi, H\. Shandilya, M\. J\. Ryan, M\. Jiang, C\. Potts, K\. Sen, A\. G\. Dimakis, I\. Stoica, D\. Klein, M\. Zaharia, and O\. Khattab \(2026\)GEPA: reflective prompt evolution can outperform reinforcement learning\.arXiv preprint arXiv:2507\.19457\.Note:Accepted to ICLR 2026 \(Oral\)External Links:[Document](https://dx.doi.org/10.48550/arXiv.2507.19457),[Link](https://arxiv.org/abs/2507.19457)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p2.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px1.p1.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px3.p1.1),[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px4.p1.2)\.
- F\. Barbieri, J\. Camacho\-Collados, L\. Espinosa\-Anke, and L\. Neves \(2020\)TweetEval: unified benchmark and comparative evaluation for tweet classification\.InFindings of the Association for Computational Linguistics: EMNLP 2020,pp\. 1644–1650\.External Links:[Document](https://dx.doi.org/10.18653/v1/2020.findings-emnlp.148),[Link](https://aclanthology.org/2020.findings-emnlp.148/)Cited by:[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px1.p1.1)\.
- T\. B\. Brown, B\. Mann, N\. Ryder, M\. Subbiah, J\. Kaplan, P\. Dhariwal, A\. Neelakantan, P\. Shyam, G\. Sastry, A\. Askell,et al\.\(2020\)Language models are few\-shot learners\.InAdvances in Neural Information Processing Systems 33 \(NeurIPS 2020\),External Links:[Link](https://papers.nips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html),[Document](https://dx.doi.org/10.48550/arXiv.2005.14165)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p1.1)\.
- K\. Cobbe, V\. Kosaraju, M\. Bavarian, M\. Chen, H\. Jun, L\. Kaiser, M\. Plappert, J\. Tworek, J\. Hilton, R\. Nakano, C\. Hesse, and J\. Schulman \(2021\)Training verifiers to solve math word problems\.arXiv preprint arXiv:2110\.14168\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2110.14168),[Link](https://arxiv.org/abs/2110.14168)Cited by:[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px1.p1.1)\.
- C\. Fernando, D\. Banarse, H\. Michalewski, S\. Osindero, and T\. Rocktäschel \(2023\)Promptbreeder: self\-referential self\-improvement via prompt evolution\.arXiv preprint arXiv:2309\.16797\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2309.16797),[Link](https://arxiv.org/abs/2309.16797)Cited by:[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px1.p1.1)\.
- Q\. Guo, R\. Wang, J\. Guo, B\. Li, K\. Song, X\. Tan, G\. Liu, J\. Bian, and Y\. Yang \(2024\)Connecting large language models with evolutionary algorithms yields powerful prompt optimizers\.InInternational Conference on Learning Representations \(ICLR\),External Links:[Link](https://proceedings.iclr.cc/paper_files/paper/2024/hash/9156b0f6dfa9bbd18c79cc459ef5d61c-Abstract-Conference.html),[Document](https://dx.doi.org/10.48550/arXiv.2309.08532)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p2.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px1.p1.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px3.p1.1),[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px4.p1.2)\.
- O\. Khattab, A\. Singhvi, P\. Maheshwari, Z\. Zhang, K\. Santhanam, S\. Vardhamanan, S\. Haq, A\. Sharma, T\. T\. Joshi, H\. Moazam, H\. Miller, M\. Zaharia, and C\. Potts \(2023\)DSPy: compiling declarative language model calls into self\-improving pipelines\.arXiv preprint arXiv:2310\.03714\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2310.03714),[Link](https://arxiv.org/abs/2310.03714)Cited by:[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px2.p1.1),[§3\.3](https://arxiv.org/html/2608.11219#S3.SS3.SSS0.Px4.p2.1)\.
- B\. Y\. Lin, W\. Zhou, M\. Shen, P\. Zhou, C\. Bhagavatula, Y\. Choi, and X\. Ren \(2020\)CommonGen: a constrained text generation challenge for generative commonsense reasoning\.InFindings of the Association for Computational Linguistics: EMNLP 2020,pp\. 1823–1840\.External Links:[Document](https://dx.doi.org/10.18653/v1/2020.findings-emnlp.165),[Link](https://aclanthology.org/2020.findings-emnlp.165/)Cited by:[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px1.p1.1)\.
- P\. Liu, W\. Yuan, J\. Fu, Z\. Jiang, H\. Hayashi, and G\. Neubig \(2021\)Pre\-train, prompt, and predict: a systematic survey of prompting methods in natural language processing\.arXiv preprint arXiv:2107\.13586\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2107.13586),[Link](https://arxiv.org/abs/2107.13586)Cited by:[§3\.3](https://arxiv.org/html/2608.11219#S3.SS3.SSS0.Px4.p2.1)\.
- R\. Ma, X\. Wang, X\. Zhou, J\. Li, N\. Du, T\. Gui, Q\. Zhang, and X\. Huang \(2024\)Are large language models good prompt optimizers?\.arXiv preprint arXiv:2402\.02101\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2402.02101),[Link](https://arxiv.org/abs/2402.02101)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p3.1)\.
- R\. Murthy, M\. Zhu, L\. Yang, J\. Qiu, J\. Tan, S\. Heinecke, C\. Xiong, S\. Savarese, and H\. Wang \(2025\)Promptomatix: an automatic prompt optimization framework for large language models\.arXiv preprint arXiv:2507\.14241\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2507.14241),[Link](https://arxiv.org/abs/2507.14241)Cited by:[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px2.p1.1)\.
- S\. Narayan, S\. B\. Cohen, and M\. Lapata \(2018\)Don’t give me the details, just the summary\! topic\-aware convolutional neural networks for extreme summarization\.InProceedings of the 2018 Conference on Empirical Methods in Natural Language Processing \(EMNLP\),pp\. 1797–1807\.External Links:[Document](https://dx.doi.org/10.18653/v1/D18-1206),[Link](https://aclanthology.org/D18-1206/)Cited by:[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px1.p1.1)\.
- L\. Ouyang, J\. Wu, X\. Jiang, D\. Almeida, C\. Wainwright, P\. Mishkin, C\. Zhang,et al\.\(2022\)Training language models to follow instructions with human feedback\.InAdvances in Neural Information Processing Systems 35 \(NeurIPS 2022\),External Links:[Link](https://papers.nips.cc/paper_files/paper/2022/hash/b1efde53be364a73914f58805a001731-Abstract-Conference.html),[Document](https://dx.doi.org/10.48550/arXiv.2203.02155)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p1.1)\.
- R\. Pryzant, D\. Iter, J\. Li, Y\. T\. Lee, C\. Zhu, and M\. Zeng \(2023\)Automatic prompt optimization with ”gradient descent” and beam search\.InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing \(EMNLP\),pp\. 7957–7968\.External Links:[Document](https://dx.doi.org/10.18653/v1/2023.emnlp-main.494),[Link](https://aclanthology.org/2023.emnlp-main.494/)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p1.1),[§1](https://arxiv.org/html/2608.11219#S1.p2.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px1.p1.1),[§3\.3](https://arxiv.org/html/2608.11219#S3.SS3.SSS0.Px1.p1.1)\.
- P\. Rajpurkar, R\. Jia, and P\. Liang \(2018\)Know what you don’t know: unanswerable questions for squad\.InProceedings of the 56th Annual Meeting of the Association for Computational Linguistics \(ACL 2018\),pp\. 784–789\.External Links:[Document](https://dx.doi.org/10.18653/v1/P18-2124),[Link](https://aclanthology.org/P18-2124/)Cited by:[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px1.p1.1)\.
- S\. Schulhoff, M\. Ilie, N\. Balepur, K\. Kahadze, A\. Liu, C\. Si, Y\. Li, A\. Gupta, H\. Han, S\. Schulhoff,et al\.\(2024\)The prompt report: a systematic survey of prompt engineering techniques\.arXiv preprint arXiv:2406\.06608\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2406.06608),[Link](https://arxiv.org/abs/2406.06608)Cited by:[§3\.3](https://arxiv.org/html/2608.11219#S3.SS3.SSS0.Px4.p2.1)\.
- P\. Sharma and A\. Z\. Henley \(2026\)Modular prompt optimization: optimizing structured prompts with section\-local textual gradients\.arXiv preprint arXiv:2601\.04055\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2601.04055),[Link](https://arxiv.org/abs/2601.04055)Cited by:[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px2.p1.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px3.p1.1),[§3\.3](https://arxiv.org/html/2608.11219#S3.SS3.SSS0.Px4.p2.1)\.
- J\. Wei, X\. Wang, D\. Schuurmans, M\. Bosma, B\. Ichter, F\. Xia, E\. H\. Chi, Q\. V\. Le, and D\. Zhou \(2022\)Chain\-of\-thought prompting elicits reasoning in large language models\.InAdvances in Neural Information Processing Systems 35 \(NeurIPS 2022\),External Links:[Link](https://papers.nips.cc/paper_files/paper/2022/hash/9d5609613524ecf4f15af0f7b31abca4-Abstract-Conference.html),[Document](https://dx.doi.org/10.48550/arXiv.2201.11903)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p1.1)\.
- Y\. Wu, Y\. Gao, B\. B\. Zhu, Z\. Zhou, X\. Sun, S\. Yang, J\. Lou, Z\. Ding, and L\. Yang \(2024\)StraGo: harnessing strategic guidance for prompt optimization\.InFindings of the Association for Computational Linguistics: EMNLP 2024,pp\. 10043–10061\.External Links:[Document](https://dx.doi.org/10.18653/v1/2024.findings-emnlp.588),[Link](https://aclanthology.org/2024.findings-emnlp.588/)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p3.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px3.p1.1),[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px4.p1.2),[§6](https://arxiv.org/html/2608.11219#S6.SS0.SSS0.Px1.p1.1)\.
- C\. Yang, X\. Wang, Y\. Lu, H\. Liu, Q\. V\. Le, D\. Zhou, and X\. Chen \(2024\)Large language models as optimizers\.InInternational Conference on Learning Representations \(ICLR\),External Links:[Link](https://openreview.net/forum?id=Bb4VGOWELI),[Document](https://dx.doi.org/10.48550/arXiv.2309.03409)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p2.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px1.p1.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px3.p1.1),[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px4.p1.2)\.
- M\. Yuksekgonul, F\. Bianchi, J\. Boen, S\. Liu, Z\. Huang, C\. Guestrin, and J\. Zou \(2024\)TextGrad: automatic “differentiation” via text\.arXiv preprint arXiv:2406\.07496\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2406.07496),[Link](https://arxiv.org/abs/2406.07496)Cited by:[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px2.p1.1),[§3\.3](https://arxiv.org/html/2608.11219#S3.SS3.SSS0.Px4.p2.1)\.
- T\. Zhang, V\. Kishore, F\. Wu, K\. Q\. Weinberger, and Y\. Artzi \(2020\)BERTScore: evaluating text generation with bert\.InInternational Conference on Learning Representations \(ICLR\),External Links:[Link](https://openreview.net/forum?id=SkeHuCVFDr),[Document](https://dx.doi.org/10.48550/arXiv.1904.09675)Cited by:[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px1.p1.1)\.
- T\. Zhang, J\. Yuan, and S\. Avestimehr \(2024\)Revisiting opro: the limitations of small\-scale llms as optimizers\.InFindings of the Association for Computational Linguistics: ACL 2024,pp\. 1727–1735\.External Links:[Document](https://dx.doi.org/10.18653/v1/2024.findings-acl.100),[Link](https://aclanthology.org/2024.findings-acl.100/)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p3.1)\.
- X\. Zhang, G\. Wang, Y\. Cui, W\. Qiu, Z\. Li, B\. Zhu, and P\. He \(2026\)Prompt optimization is a coin flip: diagnosing when it helps in compound ai systems\.arXiv preprint arXiv:2604\.14585\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2604.14585),[Link](https://arxiv.org/abs/2604.14585)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p3.1),[§6](https://arxiv.org/html/2608.11219#S6.SS0.SSS0.Px2.p1.1)\.
- Y\. Zhou, A\. I\. Muresanu, Z\. Han, K\. Paster, S\. Pitis, H\. Chan, and J\. Ba \(2023\)Large language models are human\-level prompt engineers\.InInternational Conference on Learning Representations \(ICLR\),External Links:[Link](https://openreview.net/forum?id=92gvk82DE-),[Document](https://dx.doi.org/10.48550/arXiv.2211.01910)Cited by:[§1](https://arxiv.org/html/2608.11219#S1.p1.1),[§1](https://arxiv.org/html/2608.11219#S1.p2.1),[§2](https://arxiv.org/html/2608.11219#S2.SS0.SSS0.Px1.p1.1),[§3\.3](https://arxiv.org/html/2608.11219#S3.SS3.SSS0.Px1.p1.1),[§4](https://arxiv.org/html/2608.11219#S4.SS0.SSS0.Px4.p1.2)\.
## Appendix AAblation Study
### A\.1Segment Importance
To quantify the contribution of individual prompt segments, we run a controlled ablation on all five datasets using the same task\-specific metrics as in the main experiments\. For each dataset, we treat the final SAPO prompt as the baseline and evaluate on test samples ablated variants relative to that baseline:
- •−\-Role: final prompt without role
- •InitTasks: final prompt with tasks replaced by initial tasks
- •InitCtx: final prompt with context replaced by initial context
- •−\-RespFmt: final prompt without response format
Table 3:Segment ablation on five datasets\. EachΔ\\Deltaentry reports variant score minus baseline score, where positive values indicate improvement over baseline and negative values indicate degradation\.The experimental results are shown in Table[3](https://arxiv.org/html/2608.11219#A1.T3)\. The updated delta table shows a clear pattern: all ablation families are negative on average, meaning the final SAPO prompt remains the strongest configuration overall\. The largest degradation comes from reverting tasks to initial wording \(AvgΔ=−0\.1038\\Delta=\-0\.1038\), with the strongest drop on GSM8K \(−0\.2800\-0\.2800\); this confirms that task\-level refinement is the main driver of improvements\.
Removing response\-format constraints also hurts on average \(AvgΔ=−0\.0354\\Delta=\-0\.0354\), and role removal is similarly unfavorable overall \(AvgΔ=−0\.0291\\Delta=\-0\.0291\)\. Although isolated positives exist \(e\.g\., SQuADv2 for−\-Role, GSM8K for−\-RespFmt\), they are not strong enough to reverse the cross\-dataset trend\.
Context reversion is the least harmful perturbation \(AvgΔ=−0\.0031\\Delta=\-0\.0031\), with near\-zero effects on SQuADv2 and GSM8K and mixed small effects elsewhere\. This suggests that, in the current setup, context edits are comparatively stable, while tasks and output constraints are the most sensitive levers\.
### A\.2Computational Costs\.
To make algorithmic cost comparable across methods, we use a call\-level proxy under a common budget \(TTiterations,KKcandidates per iteration\)\. LetNtrN\_\{tr\}andNvalN\_\{val\}denote train and validation sizes, and letcdiagc\_\{diag\},creflc\_\{refl\}, andcgenc\_\{gen\}denote per\-iteration diagnostic/reflection/generation overhead constants\. Under this proxy:
- •APO: CAPO=T\(KNtr\+KNval\+cdiag\+crefl\+Kcgen\)C\_\{\\text\{APO\}\}=T\\Big\(K\\,N\_\{tr\}\+K\\,N\_\{val\}\+c\_\{diag\}\+c\_\{refl\}\+K\\,c\_\{gen\}\\Big\)
- •OPRO: COPRO=T\(KNval\+Kcgen\)C\_\{\\text\{OPRO\}\}=T\\Big\(K\\,N\_\{val\}\+K\\,c\_\{gen\}\\Big\)
- •EvoPrompt: CEvo=T\(KNval\+Kcgen\)C\_\{\\text\{Evo\}\}=T\\Big\(K\\,N\_\{val\}\+K\\,c\_\{gen\}\\Big\)
- •StraGO: CStraGO=T\(KNtr\+KNval\+cdiag\+Kcgen\)C\_\{\\text\{StraGO\}\}=T\\Big\(K\\,N\_\{tr\}\+K\\,N\_\{val\}\+c\_\{diag\}\+K\\,c\_\{gen\}\\Big\)
- •GEPA: CGEPA=T\(KNtr\+KNval\+cdiag\+crefl\+Kcgen\)C\_\{\\text\{GEPA\}\}=T\\Big\(K\\,N\_\{tr\}\+K\\,N\_\{val\}\+c\_\{diag\}\+c\_\{refl\}\+K\\,c\_\{gen\}\\Big\)
- •SAPO: CSAPO=T\(Ntr\+KNval\+cdiag\+cgen\)C\_\{\\text\{SAPO\}\}=T\\Big\(N\_\{tr\}\+K\\,N\_\{val\}\+c\_\{diag\}\+c\_\{gen\}\\Big\)
This proxy captures dominant LLM\-call complexity, while wall\-clock time also depends on provider latency, batching, and parallelization\.
## Appendix BPrompt Optimization Example by SAPO
Figure 2:Example of SAPO optimization on GSM8K samples\. The figure traces how the LLM diagnoses and updates weak prompt segments across iterations\. At each step, performance is analyzed at the segment level; missing segments are treated as weak by default\. Segments identified as strong are preserved and not modified during candidate generation\. The best result was obtained at iteration 3 \(candidate 1\), where segment\-level expansion and reformulation yielded near\-complete coverage of correct answers on the sample\.
## Appendix CSAPO Optimized Prompts
The figures below show, for each dataset, the initial prompt \(top\) and the optimized segmented prompt \(bottom\) used in GPT\-4o\-mini experiments\.
Figure 3:SQuADv2 prompt pair \(GPT\-4o\-mini\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 4:TweetEval Sentiment prompt pair \(GPT\-4o\-mini\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 5:XSUM prompt pair \(GPT\-4o\-mini\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 6:CommonGen prompt pair \(GPT\-4o\-mini\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 7:GSM8K prompt pair \(GPT\-4o\-mini\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 8:SQuADv2 prompt pair \(GPT\-3\.5\-Turbo\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 9:TweetEval Sentiment prompt pair \(GPT\-3\.5\-Turbo\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 10:XSUM prompt pair \(GPT\-3\.5\-Turbo\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 11:CommonGen prompt pair \(GPT\-3\.5\-Turbo\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.Figure 12:GSM8K prompt pair \(GPT\-3\.5\-Turbo\): initial prompt \(top\) and optimized segmented prompt \(bottom\)\.
## Appendix DMeta\-prompts
Figure 13:Segmentation meta\-prompt used by SAPO to decompose a prompt into role, context, tasks, and output format\.Figure 14:Weakness\-analysis meta\-prompt: SAPO contrasts top/bottom evidence and outputs weak segments, strong segments, and actionable recommendations\.Figure 15:Candidate\-generation meta\-prompt used to synthesize constrained prompt variants that preserve strong segments and revise weak ones\.Similar Articles
SePO: Self-Evolving Prompt Agent for System Prompt Optimization
SePO (Self-Evolving Prompt Optimization) proposes a self-referential prompt agent that optimizes both task agents' system prompts and its own system prompt through an evolutionary search, outperforming Manual-CoT, TextGrad, and MetaSPO across five benchmarks including AIME'25, ARC-AGI-1, and GPQA.
Self-Supervised Prompt Optimization
This paper introduces Self-Supervised Prompt Optimization (SPO), a framework that optimizes prompts for LLMs without external references by using output comparisons, significantly reducing costs and data requirements.
@leanxbt: https://x.com/leanxbt/status/2070852461494202609
A detailed article introducing Loop Prompt Engineering, a method to automate prompt optimization by iteratively rewriting prompts based on evaluation against a dataset, with emphasis on avoiding recursive traps.
RLMOpt: Adaptive Prompt Optimization via Recursive Language Models
RLMOpt is a prompt optimizer that uses a recursive language model to drive the search policy itself, outperforming existing methods like GEPA across multiple benchmarks while using fewer rollouts and producing shorter prompts.
Why Prompt Optimization Works, and Why It Sometimes Doesn't: A Causal-Inspired Edit-Level Analysis
This paper conducts a causal-inspired analysis of automated prompt optimization across frameworks, LLMs, and tasks, identifying that specific edit types (e.g., complexity-increasing, meta-instructional) have systematic negative or positive effects depending on task characteristics, explaining generalization failures.