Simplicity is Enough: ReAct Agents for Prompt Optimization
Organizations: UiPath
Abstract
Prompt optimization has recently been approached with increasingly specialized search procedures and evolutionary frameworks. In this work, we ask whether such complexity is necessary to achieve competitive performance. We introduce ReAPO (ReAct Agents for Prompt Optimization), a lightweight framework that casts prompt optimization as an agentic process built around a ReAct loop augmented with evaluation and reflection tools. Rather than relying on bespoke optimization machinery, ReAPO iteratively refines prompts through error analysis, reflective reasoning, and validation against the optimization objective. We evaluate ReAPO on several established benchmarks spanning multi-hop question answering, mathematical reasoning, fact verification, instruction following, and privacy-conscious delegation, as well as on real enterprise agentic tasks. Across these settings, this agentic optimizer can match or outperform specialized prompt optimization methods, with 2-7x fewer evaluation rollouts and a lower API cost on the public benchmarks. We also report confidence intervals over multiple independent runs and show that single-run evaluations on small benchmarks can give a misleading picture of relative performance, since LLM variance may obscure true gains. Taken together, our results suggest that effective prompt optimization need not depend on increasingly elaborate search procedures and that agentic methods can provide a more efficient alternative.
Figures & tables
| Method | HotpotQA | HoVer | AIME | LiveBench | IFBench | PUPA | |
|---|---|---|---|---|---|---|---|
| DSPy | Baseline | 39.3 [38.5, 40.1] | 43.9 [42.1, 45.8] | 46.7 [44.0, 49.3] | 59.0 [56.7, 61.2] | 48.4 [47.8, 48.8] | 80.5 [79.8, 81.4] |
| MIPROv2-ND | 34.3 [33.5, 34.9] | 47.1 [46.3, 47.6] | 47.3 [42.0, 52.7] | 59.4 [58.7, 60.2] | 50.2 [49.1, 51.0] | 87.9 [87.1, 88.7] | |
| MIPROv2 | 62.7 [61.9, 63.3] | 48.9 [47.2, 50.4] | 44.7 [40.0, 51.3] | 57.5 [55.5, 60.0] | 51.6 [50.7, 52.5] | 84.3 [83.5, 85.2] | |
| GEPA | GEPA | 68.5 [67.5, 69.5] | 52.3 [50.6, 53.9] | 48.0 [45.3, 51.3] | 61.2 [60.0, 62.3] | 50.8 [49.7, 52.2] | 93.0 [92.1, 93.5] |
| GEPA-Merge | 67.1 [66.7, 67.6] | 51.3 [49.9, 52.7] | 48.0 [45.3, 51.3] | 60.2 [59.2, 61.5] | 51.7 [50.9, 52.6] | 95.3 [94.5, 96.0] | |
| ReAPO | 68.5 [67.9, 69.3] | 54.3 [52.3, 55.6] | 50.7 [48.7, 52.7] | 61.6 [59.8, 63.5] | 50.8 [50.1, 51.4] | 91.4 [90.3, 92.4] |
| Method | HotpotQA | HoVer | AIME | LiveBench | IFBench | PUPA |
|---|---|---|---|---|---|---|
| GEPA | 68.5 [66.8, 69.6] | 54.6 [53.1, 56.1] | 44.7 [40.7, 50.7] | 61.2 [59.0, 63.3] | 50.5 [48.9, 52.1] | 91.1 [90.2, 91.9] |
| ReAPO | 68.2 [66.9, 69.3] | 59.1 [57.9, 60.3] | 54.0 [51.3, 56.7] | 61.8 [60.1, 63.4] | 52.0 [50.8, 53.3] | 93.1 [92.7, 93.5] |
| Benchmark | Baseline | GEPA | ReAPO |
|---|---|---|---|
| Qwen3.5-9B as optimizer and system model | |||
| HotpotQA | 60.2 [59.1, 61.0] | 69.7 [69.3, 70.0] | 67.1 [66.7, 67.4] |
| HoVer | 36.9 [35.3, 38.2] | 57.3 [56.4, 58.5] | 57.1 [56.1, 58.0] |
| AIME | 63.0 [59.7, 66.3] | 60.7 [56.7, 63.3] | 72.0 [66.0, 76.0] |
| LiveBench | 63.2 [62.1, 64.0] | 70.6 [69.2, 71.6] | 71.6 [69.3, 73.0] |
| Qwen3.5-122B-A10B as optimizer and system model | |||
| Method | HotpotQA | HoVer | AIME | LiveBench | IFBench | PUPA |
|---|---|---|---|---|---|---|
| Baseline | 60.2 [59.1, 61.0] | 36.9 [35.3, 38.2] | 63.0 [59.7, 66.3] | 63.2 [62.1, 64.0] | 61.1 [60.0, 62.1] | 83.7 [82.9, 84.7] |
| GEPA | 67.9 [66.8, 69.3] | 49.9 [47.5, 51.7] | 63.0 [58.3, 68.0] | 70.5 [69.5, 71.1] | 63.6 [61.9, 65.6] | 90.5 [90.1, 90.8] |
| ReAPO | 68.9 [68.4, 69.6] | 53.5 [52.5, 54.3] | 65.0 [61.7, 68.0] | 71.4 [70.7, 72.3] | 63.7 [61.2, 66.1] | 95.9 [95.3, 96.7] |
| Method | Claim History | Customer Support | Meeting Management | Product Qs | SQL |
|---|---|---|---|---|---|
| Baseline | 57.3 [55.3, 59.5] | 75.5 [74.8, 76.4] | 44.0 [39.2, 48.3] | 83.7 [80.0, 86.7] | 69.8 [67.8, 71.4] |
| GEPA | 90.3 [86.1, 94.4] | 75.5 [74.8, 76.4] | 70.0 [65.6, 74.3] | 73.3 [65.9, 78.5] | 80.8 [78.0, 83.6] |
| ReAPO | 80.2 [76.5, 82.9] | 75.5 [74.8, 76.4] | 85.9 [81.0, 88.5] | 92.6 [90.4, 94.8] | 84.9 [84.1, 85.5] |
| GPT-5 Optimizer | GPT-4.1 Mini Optimizer | |||||
|---|---|---|---|---|---|---|
| Bench. | Full | Score-Only | Macro | Full | Score-Only | Macro |
| HotpotQA | 68.2 [66.9, 69.3] | 66.8 [65.3, 68.1] | 66.6 [65.4, 67.8] | 68.5 [67.9, 69.3] | 39.3 [38.5, 40.1] | 36.1 [35.0, 37.1] |
| HoVer | 59.1 [57.9, 60.3] | 58.5 [57.3, 59.8] | 55.7 [54.8, 56.5] | 54.3 [52.3, 55.6] | 51.9 [50.7, 53.1] | 52.6 [51.2, 53.7] |
| IFBench | 52.0 [50.8, 53.3] | 51.0 [49.6, 52.3] | 53.3 [51.5, 54.5] | 50.8 [50.1, 51.4] | 50.6 [49.5, 51.8] | 51.1 [49.8, 52.2] |
| LiveBench | 61.8 [60.1, 63.4] | 59.8 [58.5, 61.1] | 59.5 [58.0, 61.0] | 61.6 [59.8, 63.5] | 59.0 [56.7, 61.2] | 59.1 [57.7, 60.4] |
| Method | Claim History | Customer Support | Meeting Management | Product Qs | SQL |
|---|---|---|---|---|---|
| Baseline | 66.6 [58.9, 71.8] | 79.8 [78.3, 81.3] | 51.4 [49.4, 53.3] | 73.0 [66.3, 76.7] | 70.7 [68.4, 72.9] |
| Score-Only | 90.2 [87.4, 92.6] | 72.3 [72.0, 72.7] | 36.1 [34.1, 38.7] | 76.7 [76.7, 76.7] | 76.5 [75.5, 77.5] |
| Full | 97.8 [97.6, 97.9] | 76.3 [73.4, 79.0] | 71.1 [68.0, 75.3] | 77.5 [76.7, 78.2] | 77.1 [73.8, 80.1] |
| Method | HotpotQA | HoVer | AIME | LiveBench | IFBench |
|---|---|---|---|---|---|
| 63.6 [62.4, 64.9] | 51.7 [50.9, 52.5] | 50.0 [50.0, 50.0] | 59.0 [56.7, 61.2] | 52.2 [50.8, 53.7] | |
| 68.2 [66.9, 69.3] | 59.1 [57.9, 60.3] | 54.0 [51.3, 56.7] | 61.8 [60.1, 63.4] | 52.0 [50.8, 53.3] |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Tool | Category | Functionality |
|---|---|---|
| get_agent_files | Inspection | List the files that constitute an agent’s directory. |
| read_agent_file | Inspection | Read the raw contents of any agent file (e.g. agent.yaml ). |
| summarize_agent | Inspection | Produce a concise summary of input/output schemas, prompts, and tools. |
| inspect_agent | Inspection | Return detailed agent metadata (full schemas, tags, evaluators). |
| inspect_tools | Inspection | Enumerate the tools attached to an agent with their signatures. |
| get_prompt | Inspection | Read a single named prompt (e.g. system , user ). |
| Agentic task | Baseline | ReAPO | ReAPO |
|---|---|---|---|
| Claim History | 46.0 [41.1, 50.9] | 87.4 [83.8, 91.6] | 93.7 [91.6, 95.8] |
| Product Questions | 63.0 [58.5, 67.4] | 88.6 [81.9, 95.2] | 87.8 [79.7, 95.2] |
| Method | Claim History | Customer Support | Meeting Management | Product Qs | SQL |
|---|---|---|---|---|---|
| Baseline | 62.9 [60.7, 64.4] | 74.9 [72.5, 77.0] | 51.0 [42.5, 56.9] | 84.4 [80.7, 88.1] | 73.8 [72.4, 75.3] |
| GEPA | 89.6 [86.4, 93.2] | 74.9 [72.5, 77.0] | 72.1 [67.9, 77.4] | 85.2 [81.5, 88.1] | 80.4 [79.2, 81.7] |
| ReAPO | 94.4 [92.6, 96.0] | 74.9 [72.5, 77.0] | 92.3 [91.8, 92.8] | 91.8 [90.4, 92.6] | 84.5 [82.8, 86.3] |
| Tokens (M) | ||||||
| Benchmark | Method | Rollouts | In | Out | Total | Cost ($) |
| HotpotQA | GEPA | 6,871 | 21.43 | 3.31 | 24.74 | 13.9 |
| ReAPO | 900 | 3.82 | 0.47 | 4.30 | 2.3 (1.9) | |
| HoVer | GEPA | 7,051 | 21.06 | 4.84 | 25.90 | 16.2 |
| ReAPO | 900 | 5.56 | 1.07 | 6.63 | 3.9 (3.2) | |
| AIME | GEPA | 1,839 | 4.52 | 9.92 | 14.44 | 17.7 |
| Method | HotpotQA | HoVer | AIME | LiveBench | IFBench | PUPA | Total |
|---|---|---|---|---|---|---|---|
| GEPA | 2h 52m | 3h 09m | 7h 16m | 1h 21m | 1h 25m | 4h 26m | 20h 29m |
| ReAPO | 22m | 1h 23m | 46m | 35m | 36m | 1h 38m | 5h 20m |
| System model | Method | Privacy | Quality | PUPA |
|---|---|---|---|---|
| GPT-4.1 Mini | GEPA | 93.9 | 92.0 | 93.0 |
| ReAPO | 88.9 | 93.8 | 91.4 | |
| Qwen3.5-9B | GEPA | 86.9 | 94.0 | 90.5 |
| ReAPO | 96.1 | 95.8 | 95.9 |
| Benchmark | Baseline | GPT-5 | Opus |
|---|---|---|---|
| HotpotQA | 39.3 [38.5, 40.1] | 68.2 [66.9, 69.3] | 69.5 [68.7, 70.3] |
| HoVer | 43.9 [42.1, 45.8] | 59.1 [57.9, 60.3] | 58.6 [58.2, 59.2] |
| AIME | 46.7 [44.0, 49.3] | 54.0 [51.3, 56.7] | 54.7 [50.7, 58.0] |
| LiveBench | 59.0 [56.7, 61.2] | 61.8 [60.1, 63.4] | 62.1 [61.1, 63.2] |
| IFBench | 48.4 [47.8, 48.8] | 52.0 [50.8, 53.3] | 55.1 [54.4, 55.8] |
| PUPA | 80.5 [79.8, 81.4] | 93.1 [92.7, 93.5] | 93.3 [92.7, 94.2] |
| Benchmark | Scoring function |
|---|---|
| HotpotQA | Binary normalized exact match between the final and gold answers |
| HoVer | Binary: 1 if every gold evidence-document title is retrieved |
| AIME | Exact match of the extracted and normalized integer answer |
| LiveBench-Math | The released problem-family scorers for answer extraction and equivalence |
| IFBench | Fraction of the requested instructions satisfied, over eight meaning-preserving variants of the response |
| PUPA | , with GEPA’s GPT-4.1 Mini judges |
| ReAPO | GEPA | MIPROv2 | |
|---|---|---|---|
| Training evidence | Labeled training examples with expected behavior | Labeled training and validation examples, with validation driving Pareto tracking and selection | Labeled training and validation examples, with training building demonstrations and validation scoring candidates |
| Candidate results | Outputs with per-example and aggregate scores | Selected-module inputs and outputs with per-example scores | Aggregate validation scores only, for Bayesian search and selection |
| Execution evidence | Intermediate LLM and tool inputs and outputs from execution traces | Selected-module inputs and outputs, with feedback functions that may inspect the full trace | Metric-accepted training inputs and outputs, distilled into per-module demonstrations, without full traces |
| Diagnostic feedback | Evaluator results, including textual justifications and expected and actual values | Hand-crafted task-specific feedback grounded in gold labels and, where applicable, traces | No per-failure text, as scalar scores filter demonstrations and select candidates |
| Program context | Indirect: prompts, agent configuration, and observed intermediate inputs and outputs | No full-program source for the reflector | Direct: the DSPy program and signature text, generated descriptions, and input and output names |
| APO | GEPA | ReAPO | |
|---|---|---|---|
| Candidates | Beam | Pareto archive | Single lineage |
| Selection | UCB / bandits | Pareto sampling | Best-on-train |
| Mutation | Textual gradient | Reflective rewrite | Agentic revision |
| Multi-module | No | Yes | Yes |
| Feedback signal | Failures only | + feedback functions | + raw traces |
| Control | Algorithmic | Algorithmic | Natural-language |
Automatic Prompt Optimization
Automatic prompt optimization uses model or task feedback to revise instructions for stronger, more reliable language-model performance.
See all 113 papers