Environment-Grounded Automated Prompt Optimization for LLM Game Agents

arXiv cs.CL Papers

Summary

Introduces an automated prompt optimization framework for LLM game agents that decomposes the observation-to-action pipeline into two agents and iteratively refines prompts via an evolutionary loop guided by environment returns. Evaluated on BabyAI tasks, it significantly improves success rates (e.g., from 0% to 72.5% on PutNext) without updating model weights.

arXiv:2606.17838v1 Announce Type: new Abstract: LLM agents in interactive environments are highly sensitive to their prompts, yet prompt engineering remains a manual, task-specific process. We introduce an automated prompt optimization framework for LLM agents that decomposes the observation-to-action pipeline into a goal-conditioned descriptor agent and an action selection agent, and iteratively refines each module's prompt through an LLM-driven evolutionary loop guided by environment returns. We propose a behavior analyzer to attribute episode outcomes to specific prompt components, and a mutator to propose targeted revisions to the prompt, before validating them through environment rollouts. We evaluate on all five BabyAI tasks in the BALROG benchmark, comparing our pipeline against BALROG's RobustCoTAgent under both plain and guided prompt initializations. Optimization improves performance consistently across tasks and conditions, without requiring updates to the model weights. On PutNext, a multi-step coordination task where the RobustCoTAgent achieves 0% success, our framework reaches up to 72.5% success rate using the same underlying LLM with optimized prompts. These results suggest that a multi-agent framework, combined with automatic prompt optimization, enhances LLMs without the need for fine-tuning or extensive human supervision.
Original Article
View Cached Full Text

Cached at: 06/17/26, 05:42 AM

# Environment-Grounded Automated Prompt Optimization for LLM Game Agents
Source: [https://arxiv.org/html/2606.17838](https://arxiv.org/html/2606.17838)
Rean Clive Fernandes Lamarr institute for ML and AI TU Dortmund University &Lukas Fehring Leibniz University Hannover &Theresa Eimer Leibniz University Hannover &Marius Lindauer L3S Research Center Leibniz University Hannover &Matthias Feurer Lamarr Institute for ML and AI TU Dortmund University

###### Abstract

LLM agents in interactive environments are highly sensitive to their prompts, yet prompt engineering remains a manual, task\-specific process\. We introduce an automated prompt optimization framework for LLM agents that decomposes the observation\-to\-action pipeline into agoal\-conditioned descriptor agentand anaction selection agent, and iteratively refines each module’s prompt through an LLM\-driven evolutionary loop guided by environment returns\. We propose abehavior analyzerto attribute episode outcomes to specific prompt components, and amutatorto propose targeted revisions to the prompt, before validating them through environment rollouts\. We evaluate on all five BabyAI tasks in the BALROG benchmark, comparing our pipeline against BALROG’s RobustCoTAgent under both plain and guided prompt initializations\. Optimization improves performance consistently across tasks and conditions, without requiring updates to the model weights\. On PutNext, a multi\-step coordination task where the RobustCoTAgent achieves0%0\\%success, our framework reaches up to72\.5%72\.5\\%success rate using the same underlying LLM with optimized prompts\. These results suggest that a multi\-agent framework, combined with automatic prompt optimization, enhances LLMs without the need for fine\-tuning or extensive human supervision\.

## 1Introduction

LLMs have demonstrated remarkable capability as general\-purpose reasoning engines, with recent work pushing towards LLMs as the backbone of embodied AI agents in decision\-making scenarios\(plaat25survey;gao2026tmlr\-survey\)\. Interactive games are an interesting testbed for the required capabilities\(paglieri2025BALROG;pokeagent2026\), including long\-term planning, decision\-making under partial information, and adaptation to environmental changes\. While current LLMs can solve simple game\-playing tasks, they fall short of human performance, consistently struggle to interpret spatial information\(paglieri2025BALROG\), and can be beaten by domain\-specific machine learning solutions such as reinforcement learning\(RL;pokeagent2026\)\. Hand\-crafted, task\-specific agent architectures\(Zhang2025GeneralMH;harnessengineeringblog2026\)have been shown to improve performance, but they must be manually adapted for each new domain\. Instead, recent work has obtained improved performance from hand\-crafted, domain\-specific prompts\(lou2026learning\)\.

![Refer to caption](https://arxiv.org/html/2606.17838v1/x1.png)

Figure 1:Our approach contains two components: the standard reinforcement learning loop \(top\), and the evolutionary prompt refinement \(bottom, simplified, not showing prompt evaluation\)\. Observations, actions, and rewards are passed in textual representation\. The actor can be any agentic language model\-based system\. In this paper, we use a chained descriptor and acting agent\.In this work, we move beyond monolithic agents, where one agent must handle multiple tasks such as state parsing, strategy adaptation and action selection at each step\. We distribute this load across multiple agents; a well\-established technique to improve LLM capabilities\(he\-icml24a\)\. Concretely, we split the monolithic agent into a descriptor agentAd​e​sA\_\{des\}and an action selectorAs​e​lA\_\{sel\}, reminiscent of actor\-critic separation in RL\(grondman12acsurvey\)\. The descriptor agentAd​e​sA\_\{des\}focuses only on extracting task\-relevant information from the current state, without the added burden of planning ahead\.

This description then serves as the basis for the next action\. This setup requires the agents’ prompts to be jointly functional, compounding the prompt engineering challenge\. Our goal is to obtain these prompts automatically and without human effort\. We optimize both sub\-agents from task feedback using a simple LLM\-powered evolutionary algorithm\(meyerson\-language\-model\-crossover\), yielding a task\-specific prompting structure that improves performance by separating state interpretation and planning\. This general agent architecture, combined with prompt optimization, offers a novel and automated way to adapt LLM agents to new tasks without costly gradient updates or task\-specific redesign\. We evaluate on all five BabyAI tasks in BALROG\(paglieri2025BALROG\), which provide high\-level natural\-language task descriptions as well as stepwise observations and rewards\.

In summary, our contributions are:\(i\)an automated prompt\-optimization framework for LLM agents, allowing to both optimize monolithic agents as well as agents with multiple sub\-agents;\(ii\)a joint prompt optimization procedure based on episode returns and behavior analysis of the agents’ outputs and the state transitions; and\(iii\)improved performance through both decomposition and optimization on the BabyAI tasks in the BALROG benchmark, a multi\-turn grid world benchmark\.Code for our pipeline is provided at[https://github\.com/ReanFernandes/rapoa](https://github.com/ReanFernandes/rapoa)\.

## 2Related Work

LLMs as Agents\.Given the success of LLMs in language\-based tasks like question answering and summarization, a natural next step is to use them for complex, multi\-step decision\-making tasks\. To test these capabilities, recent benchmarks cover scientific discovery\(lu24aiscientist;xu26medagentgym\), machine learning and coding\(pan24swegym;nathani25mlgym\), and game playing\(klissarov25survey;paglieri2025BALROG;pokeagent2026\)\. To help solve such tasks, self\-criticism methods have been developed that use feedback, e\.g\., from the environment or the agent itself\(yao2022react;shinn2023reflexion;kim24computertasks\)\. Our work continues to build upon this strain of research by focusing on the action selection mechanism\. Prior work also applies weight updates in text\-based RL environments\(carta2023glam;wen24reinforcingla;zhai24finetuning\), but LLM fine\-tuning is costly\. Not requiring access to weights, prompt optimization can instead be applied to both open and closed\-weight models\.

Agentic Architectures\.Recent work has shown that imposing a pre\-defined structure, e\.g\., separating memory and skill components, for solving decision\-making tasks can significantly improve performance\(plaat25survey\)\.he\-icml24adefine a planner\-actor\-reporter framework where the planner maintains a long\-term plan with subgoals for the actor to achieve\. The reporter summarizes progress for the planner\.wang23planninguse a similar structure optimized for LLM\-based planning\.Zhang2025GeneralMHconfirm that such a principled high\-level decomposition of LLM agents is a key factor for success in game playing\.zhou25maeven optimize for an ideal composition of different agents within a multi\-agent system\. Our approach is largely orthogonal to these architectures because we focus on integrating prompt optimization\. In principle, our method can be combined with many agentic designs\.

Automatic Prompt Optimization\.Optimizing prompts instead of weights is an alternative way to adapt LLMs to new tasks\. APE\(zhou2022large\)establishes that prompts can be optimized automatically given a performance metric\. APO/ProTeGi\(pryzant2023automatic\)introduces textual gradients where the LLM analyzes failure cases and edits the prompt in a corrective direction\. OPRO\(yang2023large\)frames the LLM as a black\-box optimizer that receives a history of \(prompt, score\) pairs and infers what to try next\. GEPA\(agrawal2025gepa\)demonstrates that reflective prompt evolution over system\-level trajectories can match or outperform weight updates via LLM fine\-tuning\. While the problem setup discusses a multi\-agent setup, the experiments do not contain such a setup\. All of these approaches evaluate on fixed datasets, tightly coupling optimized prompts to dataset quality and coverage\. Technically, it is also possible to optimize for quantities that are judged by another LLM, such as style\(baumann\-aec24a\), but this might lead to bias due to the LLM\-as\-judge model\(dorner\-llmasjudge\)\. Our approach replaces static datasets with environment reward as the optimization signal, which is non\-stationary and harder to overfit in the same way\. RePrompt\(chen2024reprompt\)is similar to our setting, using LLM\-generated immediate rewards instead of relying on a final solution checker\. However, it is intended for a non\-interactive setting and can therefore not take environment feedback into account\.

Prompt Optimization for LLM Agents\.Recent work has been concerned with improving LLMs as agents, e\.g\., by facilitating failure attribution\.liang24reflectionandyang2026evotoolboth use agent decomposition to pinpoint responsibility for failed trajectories\. AgentTracer\(zhang2025agentracer\)formalizes failure attribution for multi\-agent systems, defining the decisive error as the earliest action in a trajectory whose correction is sufficient to change the outcome\. Both of these works inform our behavior analyzer module\. Several approaches focus on extracting rules or guidance from gathered experience to improve in future interactions\(zhao2024expel;chen24automanual;gokhale25logicguard\)\. We believe this can be a good solution in safety\-critical settings, but is also more limiting than a well\-optimized prompt\. Another related, but orthogonal idea are optimized meta\-prompts that can provide environment descriptions, strategic advice, and solution ideas\(xiong25mpo;lou2026learning\)\. We complement this idea on the level of a single decision\.

## 3Problem Setting

We aim to use LLMs as decision\-makers for diverse, potentially long\-horizon tasks\. We formalize this setting as a partially observable Markov decision process \(POMDP\)\(kaelbling\-ai98a\)\(𝒮,𝒜,𝒪,T,Z,R,γ\)\(\\mathcal\{S\},\\mathcal\{A\},\\mathcal\{O\},T,Z,R,\\gamma\), following standard RL formulations\. Here,𝒮\\mathcal\{S\},𝒜\\mathcal\{A\}, and𝒪\\mathcal\{O\}denote the state, action, and observation spaces;T:𝒮×𝒜→𝒮T:\\mathcal\{S\}\\times\\mathcal\{A\}\\to\\mathcal\{S\},Z:𝒮×𝒜→𝒪Z:\\mathcal\{S\}\\times\\mathcal\{A\}\\to\\mathcal\{O\}, andR:𝒮×𝒜→ℝR:\\mathcal\{S\}\\times\\mathcal\{A\}\\to\\mathbb\{R\}are the transition, observation, and reward functions, respectively; andγ∈\[0,1\]\\gamma\\in\[0,1\]is the discount factor\. In this work, we exclusively consider LLM\-based agents\. The agentπ:𝒪→𝒜\\pi:\\mathcal\{O\}\\to\\mathcal\{A\}can be instantiated either as a monolithic agent governed by a single prompt, or as a multi\-agent system\. Formally, we define a multi\-agent system as a directed acyclic Graph\{A,EA\}\\\{A,E^\{A\}\\\}withA=\(A1,…,An\)A=\(A\_\{1\},\.\.\.,A\_\{n\}\)as nodes instantiated by subagents, andEA∈\{0,1\}nE^\{A\}\\in\\\{0,1\\\}^\{n\}as the matrix describing inter\-agent communication\.Ei,jA=1E^\{A\}\_\{i,j\}=1iffAiA\_\{i\}sends a message toAjA\_\{j\},Ei,jA=0E^\{A\}\_\{i,j\}=0otherwise\. Each subagentAiA\_\{i\}is instructed by its own promptpip\_\{i\}, and we denote the list of all promptsP=\(p1,…,p\|A\|\)P=\(p\_\{1\},\\ldots,p\_\{\|A\|\}\)\.

At each steptt, the agentic systemπ\\pireceives an observationot∈𝒪o\_\{t\}\\in\\mathcal\{O\}and selects an actionat∼πP\(⋅∣ht\)a\_\{t\}\\sim\\pi^\{P\}\(\\cdot\\mid h\_\{t\}\)according to a policyπp\\pi^\{p\}conditioned on the interaction historyht=\(o0,a0,…,ot\)h\_\{t\}=\(o\_\{0\},a\_\{0\},\\ldots,o\_\{t\}\)and the promptsPP\.111We explicitly denotePPas part of the policy as it is the target of optimization, although it is already part of the subagents\.The selected action drives a state transition viaTT, emits a new observation viaZZ, and yields a reward viaRR, generating a trajectoryτ=\(o0,a0,r0,o1,a1,r1,…\)\\tau=\(o\_\{0\},a\_\{0\},r\_\{0\},o\_\{1\},a\_\{1\},r\_\{1\},\\dots\)\. The objective is to maximize the expected discounted return,J​\(πP\)=𝔼πP​\[∑t=0∞γt​R​\(st,at\)\]\.J\(\\pi^\{P\}\)=\\mathbb\{E\}\_\{\\pi^\{P\}\}\\left\[\\sum\_\{t=0\}^\{\\infty\}\\gamma^\{t\}R\(s\_\{t\},a\_\{t\}\)\\right\]\.

Our goal in this paper is to find a collection of promptsP∗P^\{\*\}that maximizes this expected return for a given agent architecture:

P∗∈arg​maxP⁡J​\(πP\)\.P^\{\*\}\\in\\operatorname\*\{arg\\,max\}\_\{P\}J\(\\pi^\{P\}\)\.\(1\)In this*Interaction Prompt Optimization*\(IPO\) setting, we do not consider approaches that optimize model weights with gradients for a parametric policy\(sutton\-rlbook;wen24reinforcingla;zhai24finetuning\)\. Instead, we optimize promptsPPfor a fixed architectureA,EA\{A,E^\{A\}\}to maximize expected return\. The optimization problem thus shifts from parameter space to prompt space\.

## 4Reward\-driven Automatic Prompt Optimization for Agentic Systems

Our proposed methodology*Reward\-drivenAutomaticPromptOptimisation forAgentic systems*\(RAPOA\) consists of an LLM\-based agent and an automatic prompt\-evolution loop, as shown in[Figure˜1](https://arxiv.org/html/2606.17838#S1.F1)\. We alternate between two phases: In phase one, the agent and text\-based environment form a standard reinforcement learning loop\. In phase two, the optimizer assesses the aggregated episodes, identifies failure cases and inefficiencies, and constructs revised prompts\. With this methodology, we enable the automatic construction of task\-specific, optimized prompts\. All prompts used for initialization and during optimization are provided in Appendix[C](https://arxiv.org/html/2606.17838#A3)\.

Input:Initial agent

πP\\pi^\{P\}\(composed of subagents

AAwith prompts

PP\), budget

NN, threshold

δ\\delta, number of optimization and selection rollouts

ko​p​tk\_\{opt\}and

ks​e​lk\_\{sel\}, number of trajectories to analyze

ll
Sselect←GenerateSeeds​\(ks​e​l\)S\_\{\\mathrm\{select\}\}\\leftarrow\\textsc\{GenerateSeeds\}\(k\_\{sel\}\)

//held\-out, fixed for the entire run

𝒯selectA←Rollout​\(π,Sselect\)\\mathcal\{T\}\_\{\\mathrm\{select\}\}^\{A\}\\leftarrow\\textsc\{Rollout\}\(\\pi,S\_\{\\mathrm\{select\}\}\)

//Collect episodes from rollout

1

A′←∅A^\{\\prime\}\\leftarrow\\emptyset
2while*budgetNNnot exhausted*do

Ssample←Sopt←GenerateSeeds​\(ko​p​t\)S\_\{\\mathrm\{sample\}\}\\leftarrow S\_\{\\mathrm\{opt\}\}\\leftarrow\\textsc\{GenerateSeeds\}\(k\_\{opt\}\)
//fresh seeds per outer iteration

3

𝒯sampleA←Rollout​\(π,Ssample\)\\mathcal\{T\}\_\{\\mathrm\{sample\}\}^\{A\}\\leftarrow\\textsc\{Rollout\}\(\\pi,S\_\{\\mathrm\{sample\}\}\)
//Collect episodes from rollout

4while*\|Ssample\|≠0&A≠A′\|S\_\{\\mathrm\{sample\}\}\|\\neq 0\\And A\\neq A^\{\\prime\}*do

Scand,𝒯cand←Sample​\(Ssample,𝒯sample,l\)S\_\{\\mathrm\{cand\}\},\\mathcal\{T\}\_\{\\mathrm\{cand\}\}\\leftarrow\\textsc\{Sample\}\(S\_\{\\mathrm\{sample\}\},\\mathcal\{T\}\_\{\\mathrm\{sample\}\},l\)
//sample both coupled

5

Ssample←Ssample∖ScandS\_\{\\mathrm\{sample\}\}\\leftarrow S\_\{\\mathrm\{sample\}\}\\setminus S\_\{\\mathrm\{cand\}\}
6

𝒯sampleA′←𝒯sampleA′∖𝒯candA′\\mathcal\{T\}\_\{\\mathrm\{sample\}\}^\{A^\{\\prime\}\}\\leftarrow\\mathcal\{T\}\_\{\\mathrm\{sample\}\}^\{A^\{\\prime\}\}\\setminus\\mathcal\{T\}\_\{\\mathrm\{cand\}\}^\{A^\{\\prime\}\}
L←BehaviorAnalyzer​\(A,𝒯cand\)L\\leftarrow\\textsc\{BehaviorAnalyzer\}\(A,\\mathcal\{T\}\_\{\\mathrm\{cand\}\}\)
//prioritized \(issue, agent\)\-list

7foreach*\(𝑖𝑠𝑠𝑢𝑒,Ai\)∈L\(\\mathit\{issue\},A\_\{i\}\)\\in Lin order of severity*do

8

Ai′←AdaptSubagent​\(Ai,𝑖𝑠𝑠𝑢𝑒,𝒯cand\)A\_\{i\}^\{\\prime\}\\leftarrow\\textsc\{AdaptSubagent\}\(A\_\{i\},\\mathit\{issue\},\\mathcal\{T\}\_\{\\mathrm\{cand\}\}\)
9

A′←A​with subagent​Ai​replaced by​Ai′A^\{\\prime\}\\leftarrow A\\text\{ with subagent \}A\_\{i\}\\text\{ replaced by \}A\_\{i\}^\{\\prime\}
10if**Evaluate*​\(Sopt,A′\)\>*Evaluate*​\(Sopt,A\)\+δ\\textsc\{Evaluate\}\(S\_\{\\mathrm\{opt\}\},A^\{\\prime\}\)\>\\textsc\{Evaluate\}\(S\_\{\\mathrm\{opt\}\},\{A\}\)\+\\delta*then

11if**Evaluate*​\(Sselect,A′\)\>*Evaluate*​\(Sselect,A\)\+δ\\textsc\{Evaluate\}\(S\_\{\\mathrm\{select\}\},\{A^\{\\prime\}\}\)\>\\textsc\{Evaluate\}\(S\_\{\\mathrm\{select\}\},\{A\}\)\+\\delta*then

12

A←A′A\\leftarrow A^\{\\prime\}
13break

14

15

16

17

18

return

πP\\pi^\{P\}

Algorithm 1RAPOA with Severity\-Ordered Subagent Adaptation##### The RAPOA Algorithm

The pseudocode of our prompt optimization loop is provided in Algorithm[1](https://arxiv.org/html/2606.17838#algorithm1)\. The outer loop continues until the budget is depleted \(Line 4\)\. In every iteration, we drawko​p​tk\_\{opt\}new seeds that we use to collect new episodes𝒯\\mathcal\{T\}\. The inner loop takes a subset of sizellto analyze \(Lines 8\-10\), and generates a list of critique pointsLLvia theBehavior Analyzer \(BA\)\(Line 11\)\. RAPOA then iterates through the proposed changes, adapts the subagents, and evaluates the multi\-agent system’s resulting performance\. Each proposal must pass a two\-stage acceptance test: first on the in\-loop optimization seedsSoptS\_\{\\mathrm\{opt\}\}\(Line 15\), then on the held\-out selection seedsSselectS\_\{\\mathrm\{select\}\}\(Line 16\)\. Only proposals clearing both stages are accepted \(Line 17\-18\), at which point the inner loop exits and a new batch of episodes is collected\.

##### Prompt Optimization

Provided with rollouts and the current prompts, all subagentsAi∈AA\_\{i\}\\in Aare updated using the Behavior Analyzer \(BA\) and a Mutator\. The BA critically analyzes the rollouts and proposes an ordered list ranked based on severity, each item in it consisting of three things: the subagent that it considers to be the cause of certain behavior, the reason for this characterization and the suggestion on what to change in the sub agents prompt to target this behavior\. Crucially, the meta\-prompt for the BA requires the LLM to reflect on the trajectories with respect to what went wrong in failed trajectories, so that bad behavior can be corrected, what went well in successful trajectories, so that such behavior can be reinforced, and to abstain if no suggestions can be inferred from the current set of trajectories\. The length of this list is decided by the BA and RAPOA then iterates over these suggestions, utilizing the LLM\-based Mutator to adapt the prompt of a subagent, until a modification is accepted\. Once accepted, we jump back to the outer loop\.

##### Evaluating the Adapted Agent

Our acceptance criteria is the mean improvement of the mutated prompt \(candidate\) over the current prompt by a thresholdδ\\delta\. To reduce cost of added evaluation on the environment, we use two\-stage evaluation \(Lines 15–16\): In both stages, the candidate must exceed the current performance by a thresholdδ\\delta\. We study two evaluation strategies that differ in selection pressure\.High selection pressure \(HSP\)demands that the mean performance on all seeds inSoptS\_\{\\mathrm\{opt\}\}increases \(as shown in the algorithm\), reducing the probability that an accepted mutation benefits only the specific trajectories that motivated it\.Low selection pressure \(LSP\)restricts this requirement to the mean of trajectories \(i\.e\., seedsScand⊆SoptS\_\{\\mathrm\{cand\}\}\\subseteq S\_\{\\mathrm\{opt\}\}\) that were used to create feedback, accepting a noisier estimate in exchange for a more permissive gate, with the selection step \(Line 16\) providing the safeguard against poorly generalizing mutations\.

##### Agentic Architecture

Through our paper, we focus on an agent that decomposes into a descriptor agentAd​e​s:𝒪→𝒢A\_\{des\}:\\mathcal\{O\}\\to\\mathcal\{G\}and an action\-selection agentAa​c​t:𝒢→𝒜A\_\{act\}:\\mathcal\{G\}\\to\\mathcal\{A\}conditioned on promptspd​e​sp\_\{des\}andpa​c​tp\_\{act\}respectively\. Provided an observationo∈𝒪o\\in\\mathcal\{O\},Ad​e​sA\_\{des\}constructs an enriched representationgg, which is then passed toAa​c​tA\_\{act\}, resulting in an actiona∈𝒜a\\in\\mathcal\{A\}\. We hereby refer to this decomposed actor as a*Split Perception Action agent*, or SPA agent, for brevity\.

## 5Experiments

### 5\.1Experimental Setup

##### Environment\.

We evaluate on the BabyAI suite\(ChevalierBoisvert2018BabyAIAP\)using the five task families provided by the BALROG benchmark\(paglieri2025BALROG\):GoTo,PickUp,Open,PutNext, andPickUpSeqGoTo\. Each task is a partially observable grid\-world episode in which the agent receives a natural\-language mission string and a local, egocentric observation \(see Figure[1](https://arxiv.org/html/2606.17838#S1.F1)for an illustration\)\. Tasks range from single\-step navigation \(GoTo\) to multi\-step object coordination \(PutNext,PickUpSeqGoTo\), providing heterogeneous difficulty\. We use a rewardR=1R=1for successful episodes,R=0R=0for failures, and apply a step discount of0\.90\.9, as is implemented in BALROG\. For BabyAI, the environment creates different missions for each task family at random, controlled through the environment seed\. We provide a short exemplar of this in the Appendix[A\.1](https://arxiv.org/html/2606.17838#A1.SS1)\.

##### Evaluation Protocol\.

We report results using held\-out seeds: Concretely, we use 20 different environment seeds and 6 inference seeds \(characterising the stochastic decoding of the LLM\), resulting in 120 episodes\. We report success rate as the primary metric and mean steps as an efficiency metric\. We also evaluate runs with zero accepted mutations and additionally report average performance across tasks, matching BALROG practice\.

##### Inference\-time Setup\.

The agent receives the mission string and the rule\-based scene description produced by BALROG’sBabyAITextCleanLangWrapperand outputs an action\. For the SPA agent, first the descriptorAd​e​sA\_\{des\}analyzes the input observation from the BALROG environment\. Then, the action selectorAa​c​tA\_\{act\}receives the mission, the descriptor agent’s summarygg, its current carrying state, and its previous plan; outputting a single actionaaand an updated plan\. Both modules operate in single\-turn mode: the plan field is the agent’s only persistent state across steps, keeping context length constant regardless of episode length\. We evaluate two prompt initializations:*Guided*, which encodes explicit task knowledge including termination semantics and navigation heuristics; and*Plain*, a sparse initialization with no task\-specific guidance \(provided by BALROG\)\. Both initializations contain the list of possible actions, and the task the agent has to perform\. We compare against BALROG’sRobustCoTAgent\(paglieri2025BALROG\)under both initializations as a monolithic baseline\. All runs useGPT\-OSS20B\(gptoss\-report25\)at temperature0\.60\.6\.

##### Optimization\-time Setup\.

The Behavior Analyzer and Mutator each receive an*environment layer*describing the physics of the environment, a shared specification of the action space, observation format, and physical movement constraints\. This is deliberately withheld from the action selectorAa​c​tA\_\{act\}and descriptorAd​e​sA\_\{des\}at all times, in line with the BALROG implementation\. Domain knowledge reaches the runtime agent only through optimized prompts\. The BA and Mutator also receive binary mutation history \(accepted/rejected\) to avoid repeated edits and to condition new proposals without confounding from score magnitudes \(and threshold parameter magnitudes\)\. Optimization runs use environment seed 42 with inference seed 1222The inference seed, seeds the sampling process of the LLM server; however, at temperature0\.60\.6, GPU floating\-point non\-determinism and server\-side batching prevent fully deterministic outputs, i\.e\., seeding only reduces response variance\.; we setko​p​tk\_\{opt\}andks​e​lk\_\{sel\}both to 20, with fixed selection seeds for allN=20N=20optimization cycles\. In order to compare the performance of our SPA agent’s optimized prompts against the BALROG’sRobustCoTAgent, we optimize the latter with its provided default configuration \(plain prompt with 16 step rolling history window\)\.

### 5\.2Full Comparison Between Baseline and Optimized Conditions

![Refer to caption](https://arxiv.org/html/2606.17838v1/x2.png)Figure 2:Comparison of Final hold\-out evaluation scores between BALROG RobustCoTAgent and Our agent , for both non\-optimized and optimized prompts\. Bottom underline shows best overall performer per task, top dashed line shows the best performer for non optimized baselines\.∘\\circdenotes performance of prompts which were not mutated during the optimization\.Figure[2](https://arxiv.org/html/2606.17838#S5.F2)shows success rates across five tasks for four agent categories\. The first two groups report non\-optimized BALROG \(1\) and SPA \(2\); the latter two are their optimized counterparts\. The figure shows which tasks are difficult before optimization and where optimization helps most\.PutNextis notably hard, with floor\-level baseline performance across agents\.GoTois much easier and yields the highest average ceilings\. Additionally, we provide in\-depth results in Appendix[6](https://arxiv.org/html/2606.17838#A2.T6)\.

#### Optimization Comparison: How does Optimization Impact Performance?

Prompt optimization consistently improves over the respective non\-optimized baseline across all agent variants\. For SPA with guided initialization, the best prompt optimization variant increases the mean success rate from65\.5%65\.5\\%of79\.2%79\.2\\%across all five tasks\. For the plain prompt initialization, the best optimized condition reaches62\.2%62\.2\\%versus the59\.8%59\.8\\%baseline\. BALROG also benefits from optimization, improving from29\.3%29\.3\\%\(plain/16\-step baseline\) to49\.0%49\.0\\%, a gain of nearly2020pp\. The improvement is not uniform across tasks\. For tasks where the non\-optimized baseline is already near ceiling, such asGoToandPickUpfor SPA guided, the optimizer accepts few or no mutations, and performance is unchanged\. The largest gains occur on harder tasks:Openimproves from54\.2%54\.2\\%to62\.5%62\.5\\%for SPA guided, andPutNext, the hardest task, with all non\-optimized baselines near floor improves from8\.3%8\.3\\%to as high as72\.5%72\.5\\%depending on the optimization configuration\. We analyze the optimized prompts forPutNextand a selection of optimized prompts in[D](https://arxiv.org/html/2606.17838#A4)

#### Baseline Comparison: Non Prompt\-Optimized BALROG and SPA Agents

We now compare BALROG and SPA along two dimensions to shed light on the performance gap: history window length and prompt variant\. First, the monolithic BALROG agent, in its default settings, has access to the past1616actions and observations\. In contrast, our agent contains the descriptorAd​e​sA\_\{des\}and action selectorAs​e​lA\_\{sel\}sub\-agents, but cannot see the run history\. To establish a lower bound on SPA’s performance, we use the plain case in which it only knows the past action leading to the current preprocessed observation\. Second, given that BALROG ships with a plain BabyAI prompt, we adopt the same for SPA, and also craft the guided version in order to quantify the effect of the prompt quality on performance, before optimization\.

Within the baseline, we first note that the prompt performance for BALROG varies more \(29\.3±4\.2%29\.3\\pm 4\.2\\%for plain vs\.58\.5±4\.1%\\mathbf\{58\.5\\pm 4\.1\\%\}for guided\) than for SPA \(59\.8±6\.7%59\.8\\pm 6\.7\\%plain vs\.65\.5±3\.8%\\mathbf\{65\.5\\pm 3\.8\\%\}guided\)\. The BALROG agent is therefore more susceptible to the prompt variant than to the size of its history window\. For the guided variant, extending the history from 1 to 16 steps adds less than11pp \(57\.7%57\.7\\%vs\.58\.5%58\.5\\%\), whereas for the plain variant it adds approximately1111pp \(18\.5%18\.5\\%vs\.29\.3%\\mathbf\{29\.3\\%\}\), and even then the prompt variant remains the dominant effect \(≈29\\approx 29pp\)\. SPA is less sensitive to the prompt variants, which differ not only in verbosity but also in the task\-specific win conditions the guided prompt encodes, showing the robustness of SPA’s decomposition to the prompt variants we designed\. Notably, SPA plain \(59\.8±6\.7%\\mathbf\{59\.8\\pm 6\.7\\%\}\) already matches BALROG guided/16\-step \(58\.5±4\.1%58\.5\\pm 4\.1\\%\) despite having no task\-specific guidance and access only to its previous plan\.

![Refer to caption](https://arxiv.org/html/2606.17838v1/x3.png)Figure 3:Progression of the selection phase scores for every mutation cycle, forδ=0\.05\\delta=0\.05andδ=−∞\\delta=\-\\infty\. Markers indicate which cycle’s prompt was used for the held out evaluation\. Horizontal dashed lines in the upper row indicate that no proposed mutation cleared the evaluation threshold\.

### 5\.3Ablation Study and Sensitivity Analysis

##### Does an Acceptance Criterion Affect Performance?

Since the optimizer has access to the history of proposed prompt mutations together with their acceptance outcomes and also acts on a critical reflection of recent trajectories; the input to it should, in principle, provide sufficient information for providing beneficial mutation proposals\. Thus, one might ask if it is necessary to only accept a newly proposed prompt if it improves over the current best, or if one could simply accept every mutation regardless of its evaluation performance\.

![Refer to caption](https://arxiv.org/html/2606.17838v1/x4.png)Figure 4:Final hold\-out evaluation scores across all 5 tasks for varying thresholds and selection pressures for SPA\. Interaction between the threshold and the size of the optimization set directly impacts the performance on the hold\-out evaluation score\.Figure[3](https://arxiv.org/html/2606.17838#S5.F3)illustrates acceptance based on the validation step \(top\) vs accepting all proposals regardless of their performance \(bottom\)\. When requiring a performance improvement, accepted mutations are relatively sparse, but lead to monotonic performance increase\. When all proposed mutations are accepted, the optimizer is still capable of discovering well\-performing prompts\. However, it does not consistently preserve performance or improve upon these mutations over subsequent cycles\. Since all past mutations are observed as accepted, the optimizer lacks a contrasting signal between beneficial and detrimental changes, which likely causes the prompt to drift away from its best\-performing state\.

To quantify the peak performance achieved by the unconstrained optimizer, we select post\-hoc, the promptT∗T^\{\*\}from the cycle with the highest performance on𝒯select\\mathcal\{T\}\_\{\\mathrm\{select\}\}\(the selection seed set\) and compare it against the final prompt at the end of the same optimization run on the holdout set\. The resulting gap betweenT∗T^\{\*\}and the end\-of\-run prompt measures the direct cost of operating without an optimization signal\. We report this performance gap in Figure[4](https://arxiv.org/html/2606.17838#S5.F4)\. This degradation is particularly pronounced forPutNextbecause the task is sufficiently difficult, making rewards extremely sparse across episodes; success counts for SPA on average at≈5\\approx 5and for BALROG at≈1\\approx 1out of the 20𝒯select\\mathcal\{T\}\_\{\\mathrm\{select\}\}seeds\. As a result, the best optimized prompt is highly sensitive to the accumulation of unfiltered mutations\.

##### Sensitivity Analysis of the Threshold Parameter ’δ\\delta’

In Figure[4](https://arxiv.org/html/2606.17838#S5.F4)we consider the interaction effect between the selection pressure and the thresholdδ\\deltaon the performance, as their compound effect controls the "strictness" of accepting mutations\.

We can observe that the different thresholds behave relatively similar, and that there is no clear winner except forPutNext, and that the prompt initialization has a bigger impact\. Comparing low and high selection pressure, we find that low selection pressure can lead to slightly better results, but again do not find any clear winner\. The performance onPutNextis remarkably different, indicating that a too highδ\\deltacan stifle the optimization process, while a low selection pressure appears to increase chances of finding an improvement\. We follow that while the starting quality of the prompt directly affects optimization outcome, optimization still gives improvement over the baselines\.

We show in Appendix[B\.3](https://arxiv.org/html/2606.17838#A2.SS3)the full scores for these all the conditions shown along with the frequency of ’no mutation’ runs spread across the tasks in Table[7](https://arxiv.org/html/2606.17838#A2.T7)\.

### 5\.4Success Rate Through the Lens of Token Usage

![Refer to caption](https://arxiv.org/html/2606.17838v1/x5.png)Figure 5:Final hold\-out evaluation scores for all optimized and non\-optimized conditions, showing success rate against total tokens consumed per task, averaged across all tasks\. The best performers jump in success rate comes directly from improvement on the hardest task, as shown in Figure[4](https://arxiv.org/html/2606.17838#S5.F4)\.To assess the direct effect of prompts on model performance, token counts provide useful context\. They correlate with several factors in the environment, especially the number of actor steps per episode\. Decomposing the actor into descriptor and action selector also introduces two inference calls per state transition, which further increases tokens\. With this motivation, the average tokens generated per episode provide a good proxy for estimating the efficiency of both our decomposition and optimized prompts relative to baseline prompts\.

From Figure[5](https://arxiv.org/html/2606.17838#S5.F5)we see that SPA for both its baseline prompt and the optimized prompts consistently yields higher success rates, with the jump for the SPA \(LSP/guided prompt/δ=0\.05\\delta=0\.05\) variant coming from its improvement onPutNextaccounting for94%94\\%of this total gain on the performance\. A similar concentration holds for BALROG \(LSP, plain,δ=0\.05\\delta=0\.05\), where63%63\\%of its\+18\.3\+18\.3pp mean gain comes fromPickUpalone \(16\.7%→74\.2%16\.7\\%\\to 74\.2\\%\), withPutNextremaining at floor\. For SPA \(LSP, plain,δ=0\.05\\delta=0\.05\), the total gain is modest at\+2\.3\+2\.3pp, with small regressions onPickUpandOpenpartially offsetting gains elsewhere\. The optimized plain prompt does not fall below its baseline, suggesting the optimiser finds marginal improvements rather than inducing degradation when working from a weaker starting point\. All other ablation conditions are plotted in Appendix[8](https://arxiv.org/html/2606.17838#A2.F8)

## 6Conclusion and Future Work

We introduce RAPOA, an actor composition and optimization framework that uses prompt optimization to improve language\-based agents on decision\-making tasks\. Our experiments show that action\-step decomposition and behavior\-driven prompt optimization yield significant gains over monolithic prompts without requiring weight updates\. Our SPA agent with optimized prompts also reduces the need for analyzing the history of previous states and improves from both weak and strong initial prompts\. Because the framework is simple and flexible, it can be combined with other agentic architectures, including long\-term planning modules\.

While our results show the potential of automated prompt optimization for multi\-step decision\-making agents, several limitations remain\. First, our experiments are restricted to a single domain and one LLM; future work should test generalization across environments, task distributions, and larger meta\-LLMs\. Second, we instantiate only one optimization architecture\. The framework could be extended with alternative evaluation harnesses, memory mechanisms, and mutation operators\. Finally, we maintain a single incumbent prompt throughout optimization\. Population\-based variants with crossover, diversity preservation, and selection may improve exploration and reduce premature convergence\. More broadly, understanding how to optimize from simple prompts toward richer, guided meta\-prompts remains an open question\.

Lastly, we find that procedurally generated game environments are useful testbeds for prompt optimization\. Since they can produce near\-infinite initial states, they may reduce test\-set contamination risk and open a promising direction for developing and evaluating prompt optimization methods\.

## Acknowledgments and Disclosure of Funding

This work was supported by the Federal Ministry of Research, Technology and Space \(BMFTR\), Germany under the AI service center KISSKI \(grant no\. 16IS22093C\) and the state of North Rhine\-Westphalia as part of the Lamarr Institute for Machine Learning and Artificial Intelligence\. TE acknowledges funding by the German Research Foundation \(DFG\) under LI 2801/10\-1\. LF and ML acknowledge funding by the European Union \(ERC, “ixAutoML”, grant no\.101041029\)\. Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency\. Neither the European Union nor the granting authority can be held responsible for them\.

![[Uncaptioned image]](https://arxiv.org/html/2606.17838v1/x6.png)
## References

## Overview of the Appendix

## Appendix AExperimental Details Continued

### A\.1Environment Task Details

The BabyAIMixedTrainLocalenvironment used in our evaluation samples episodes from a fixed set of*task families*\. Each family is defined by a goal template and a termination criterion\. A specific instantiation of a task family, with concrete objects and colors filled into the template, is referred to as a*mission*\. The mission is the natural language string the agent receives at the start of each episode; the task family determines what success means and which objects appear in the room\.

For example, the goto task family produces missions of the form “go to<article\><color\><object\>”, with success defined as the agent occupying a cell adjacent to the named target\. Each call togym\.makesamples a task family uniformly at random and then samples a mission within that family\. The five task families used throughout this paper are described below, with example missions drawn directly from the trajectory logs of our evaluation runs\.

Table 1:The five BabyAI task families evaluated in this paper\. The mission is the natural language string presented to the agent at the start of each episode and instantiates the task family with concrete objects \(ball,key,box,door\) and colors \(red,green,blue,purple,yellow,grey\)\. The optimiser receives task family identity through the run configuration; the agent and descriptor at inference time receive only the mission string\.
### A\.2Computational Cost

Table[4](https://arxiv.org/html/2606.17838#A1.T4)reports per\-cycle token consumption broken down by component and task\. Episode inference \(agent and descriptor LLM calls\) accounts for over 98% of total tokens in every condition; the optimiser overhead \(Behavior Analyser and Mutator\) is negligible \(<<2%\)\. Compute therefore scales almost entirely with the number and length of evaluation episodes, both of which grow with task difficulty\.PutNextepisodes average at 59\.5 steps and consume∼\\sim10M tokens per cycle, versus 14\.7 steps and∼\\sim1\.6M tokens forGoTo\.

The dominant cost also determines the natural parallelism strategy\. Because each evaluation episode is fully independent, a single H100 runninggpt\-oss\-20b333[https://huggingface\.co/openai/gpt\-oss\-20b](https://huggingface.co/openai/gpt-oss-20b)via vLLM444Version 0\.19\.1,[https://github\.com/vllm\-project/vllm/releases/tag/v0\.19\.1](https://github.com/vllm-project/vllm/releases/tag/v0.19.1)can be saturated by launchingNNlightweight CPU workers, each executing an environment and streaming requests to the shared inference server concurrently\. No additional GPUs are required for parallelism; throughput scales withNNup to the point of GPU saturation\. Our experiments used 8 H100s for model serving but did not fully exploit this episode\-level parallelism, resulting in observed wall times of 2–16 hours per cycle depending on task, versus a theoretical minimum governed by GPU token throughput alone\.

We usegpt\-oss\-20brather than a smaller reasoning model because it matches the performance of contemporaneous models on the BALROG benchmark555BALROG Benchmark[https://BALROGai\.com/](https://balrogai.com/), providing a well\-characterised testbed for validating the optimisation process\. One consequence is that completion tokens exceed prompt tokens on harder tasks \(PutNextratio: 1\.41\), reflecting the cost of extended reasoning traces; this should be considered when estimating compute for reasoning\-capable models\.

Table 2:Per\-episode token cost for cross\-task evaluations using the SPA, grouped by evaluation task \(1,285 runs total\)\. Token counts in thousands \(k\)\. Prompt \(complete\) refers to the prompt tokens given to \(tokens generated by the\) Action Selector \(Ag\.\) and Description Generator \(Desc\.\)\.Table 3:Per\-episode token cost for cross\-task evaluations using the single\-LLM BALROG baseline pipeline \(no descriptor\), grouped by evaluation task \(450 runs total\)\. Agent prompt tokens are higher than the two\-LLM case because the agent receives the full scene description directly rather than a descriptor summary\.Table 4:Per\-cycle token cost breakdown by task \(means across all optimisation conditions\)\. All token counts in millions \(M\)\. Episode inference \(agent \+ descriptor\) accounts for\>\>98% of total tokens across every task; optimiser overhead \(BA \+ Mutator\) is negligible\.
### A\.3Hyperparameters

Table 5:Hyperparameters of the prompt optimisation framework\. All values are fixed across primary experiments unless a sweep is explicitly stated \(δ\\delta\)\.

## Appendix BSupplementary results

### B\.1Performance of Baseline Models on the Hold\-Out Set

Table 6:Per\-inference\-seed success rates across all five tasks and six non\-optimized conditions\. Each cell: success rate over 20 episodes\. Mean and±\\pmStd computed across the six inference seeds\. 5pp indicates a single episode\.To highlight the intrinsic spread of the performance that stems from an LLM’s stochastic sampling, we show in[6](https://arxiv.org/html/2606.17838#A2.T6)performance of all the baseline configurations of SPA and BALROG across all the inference seeds for each task\. The per\-seed breakdown reveals three patterns obscured by the headline means\. First, variance is strongly task\- and prompt\-dependent:Openunder the plain SPA prompt shows by far the widest spread in the table, with some seeds consistently outperforming others by a large margin, indicating that inference stochasticity is the dominant performance driver on medium\-difficulty tasks with sparse starting prompts\. Second, BALROG achieves exactly0%0\\%onPutNextacross every condition and every seed without exception, establishing that the optimized result reported in the main paper is attributable entirely to the optimization loop\. Third, the guided SPA prompt onGoTois the only condition in the table with zero variance across all six seeds; this ceiling behavior is the direct reason the optimizer accepts no mutations there\.

### B\.2Direct Comparison Between Hold\-Out Performances Based on Strictness of the Acceptance Criteria

Figures[7](https://arxiv.org/html/2606.17838#A2.F7)and[7](https://arxiv.org/html/2606.17838#A2.F7)allows further scrutiny into which the interaction effects between the threshold value and the selection pressure through the individual values performance value per task\.

For the plain prompt, we can see that on the performance comparison between the selection pressure conditions is almost comparable, and the trend within the thresholds is also not instantly apparent\. For the guided case however, we see that while both instances show similar performance on the Easy to Medium level tasks, the stark difference between the performance onPutNexthighlights that for a difficult task i\.e\. one in which the rewards are extremely sparse, the noisier estimation allows more explorative behaviors in a sparse reward landscape\.

This difficulty of the tasks is also in effect confounded by the fact that the optimizer is a black box; there is no quantifiable way to measure the ’step’ size of a mutation\. We allow the Optimizer to make a multitude of choices with the implication that the signal which it makes its decision over needs to be modeled well\. With the environment as a source of a constant direction, the use of a gating mechanism and finer control over these interacting hyperparameters would allow better control in steering the optimizer towards consistent and semantically meaningful prompts\.

![Refer to caption](https://arxiv.org/html/2606.17838v1/x7.png)

Figure 6:Threshold heatmap for Plain prompt\. We see for the plain prompt case that a higher selection pressure yields the better performance compared to a lower selection pressure\.![Refer to caption](https://arxiv.org/html/2606.17838v1/x8.png)

Figure 7:Threshold heatmap for Guided prompt\. The guided prompt shows direct benefit when optimized in a low selection pressure condition\.
### B\.3Threshold Sensitivity Analysis

Table[7](https://arxiv.org/html/2606.17838#A2.T7)shows the number of accepted mutations per condition for all 20 optimization cycles\. Threshold stringency directly controls optimizer activity: atδ=0\.10\\delta=0\.10, six of ten conditions reject all mutations under both HSP and LSP, while atδ=0\.00\\delta=0\.00almost all conditions accept at least one candidate mutation\. This reflects the diverse difficulties of the tasks rather than optimizer failure\. The near\-ceiling task such asGoToand guidedPickUpdirectly produce zero accepted mutations at stricter thresholds, as no candidate can clear a bar that is above 100% acceptance \(e\.g\., 98% success and a threshold of 0\.05 require 103% success for a new prompt to be accepted\)\.

Table 7:Accepted mutation counts per task, prompt variant, selection pressure, and thresholdδ\\delta\.0means that no mutation cleared the threshold, throughout the optimisation process\.
### B\.4Full Token Efficiency Plot Across All Optimized Conditions

![Refer to caption](https://arxiv.org/html/2606.17838v1/x9.png)Figure 8:Efficiency plot for all optimized conditions\. Directly overlaid on Figure[5](https://arxiv.org/html/2606.17838#S5.F5)\.Figure[8](https://arxiv.org/html/2606.17838#A2.F8)shows all the conditions we optimise over\. SPA guided shows the best performance, and shows a wider variance in performance efficiency\. SPA plain however, shows clustering in its performance, suggesting that the minimally crafted prompt does not provide enough of a strong starting point for the optimiser to improve\. The performance for BALROG sees a steady increase with an overall decrease in the number of tokens and its optimized versions approach closer to the SPA plain variant\.

### B\.5How Well do the Optimized Prompts Generalize to Other Tasks?

In order to test the generalisation of the prompts, to see if a prompt optimized for one task, actually transfers to another task from the same environment, given that they would be sharing similar environmental semantics and require the following of similar base rules, we perform this test over a small subset of our optimized conditions, namely the BALROG, SPA with guided and plain prompt variant, and also compare the best performerT∗T\*from the always accept \(δ=−∞\\delta=\-\\infty\) case\.

![Refer to caption](https://arxiv.org/html/2606.17838v1/x10.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x11.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x12.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x13.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x14.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x15.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x16.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x17.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x18.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x19.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x20.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x21.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x22.png)
![Refer to caption](https://arxiv.org/html/2606.17838v1/x23.png)

Figure 9:Cross Task Hold\-Out performance, for both SPA and BALROG, between always accept criteriaIn an effort to see how the performance of one task transfers to the other, we test out SPA and BALROG, under both selection pressures\. Figure[9](https://arxiv.org/html/2606.17838#A2.F9)shows all of these together for a qualitative comparison\. The five BabyAI task families share subskills in a nested structure:GoTois a component of every other task;PickUpis a prerequisite of bothPickUpSeqGoToandPutNext;Openpartially overlaps through its key\-retrieval phase which depending on the mission, may or may not be required to open the door\. This structure predicts that improvements to universal subskills should transfer broadly, while task\-specific logic should not\.

Figure[9](https://arxiv.org/html/2606.17838#A2.F9)confirms this prediction\. Across all conditions, prompts optimized for more compositionally complex source tasks likePickUpSeqGoToandPutNextproduce the strongest off\-diagonal performance, since their induced mutations address navigation recovery and multi\-step coordination that appear in every task\. In the SPA/guided/LSP condition, thePutNextsource prompt reaches65\.0%65\.0\\%onOpenand90\.8%90\.8\\%onPickUpin addition to its76\.7%76\.7\\%on\-diagonal result\.

Openis the most structurally isolated task\. Source prompts optimized onOpendo not propagate well to other tasks, and no other source task improvesOpensubstantially beyond its non\-optimized baseline\. The Key\-door toggle logic is sufficiently task\-specific that the BA encodes it in a form that provides no transfer value\.

PutNextshows the sharpest asymmetry optimising for it might allow the prompt to adapt to other tasks when used as a source, but cannot receive them\. No source task other thanPutNextitself raisesPutNextperformance above15%15\\%, regardless of selection pressure or prompt variant\. The sequential subgoal structure requires failure\-signal fromPutNextepisodes specifically; simpler tasks do not generate the trajectory evidence the BA needs to synthesise the relevant mutations\. We also investigate qualitatively what exactly the prompt mutation that allows the agent to perform remarkably well in this task, in Appendix[D\.1](https://arxiv.org/html/2606.17838#A4.SS1)

#### B\.5\.1Which Candidate Rank in a Given Batch Was Accepted for Mutation?

Given that the BA implicitly ranks candidates by severity of failure, we examine which rank in the candidate list actually resulted in acceptance and thus, implicitly, better performance\. This reveals how often the BA correctly identified the most pressing issue\. Table[8](https://arxiv.org/html/2606.17838#A2.T8)reports, for each condition and task where at least one mutation was committed, the rank of the final incumbent candidate, the selection pool scores at the moment of acceptance, and the fresh evaluation SR\. Zero\-mutation tasks are excluded; their fresh SR matches the non\-optimized baseline by construction\.

Rank\-1 candidates account for the majority of final incumbents across all thresholds\. Fifteen fallback cases arise \(rank 2 or 3\), concentrated in harder tasks and permissive thresholds where the primary candidate more frequently fails the gate\. The sole rank\-3 acceptance occurs at HSP /δ=0\.02\\delta=0\.02/ guidedPickUpSeqGoTo: both ranks 1 and 2 failed the selection gate, rank 3 cleared it with a T\-Δ\\Deltaof\+15\+15pp, and fresh evaluation confirms76\.7%76\.7\\%SR which is among the strongest results for that task across all conditions\.

Fallback candidates produce comparable or better hold\-out evaluation performance to rank\-1 acceptances in1313of1515cases\. The two exceptions are bothPutNextunder HSP \(6\.7%6\.7\\%and10\.8%10\.8\\%\) which shows that at strict thresholds and near\-floor baseline performance, even a cleared selection pool candidate does not reliably generalise\.

The selection pool delta at acceptance is a conservative and noisy predictor of fresh\-eval gain\. LSP,δ=0\.00\\delta=0\.00, guidedPutNextshows T\-Δ=\+5\\Delta=\+5pp yet achieves77\.5%77\.5\\%fresh SR, while HSP,δ=0\.00\\delta=0\.00, guidedPutNextshows T\-Δ=\+20\\Delta=\+20pp but only41\.7%41\.7\\%fresh SR\. The magnitude of the selection pool signal does not reliably predict the magnitude of generalisation; it only establishes a directional threshold for commitment\.

Table 8:Final incumbent candidate rank, selection pool scores at acceptance, and fresh evaluation SR for all SPA threshold conditions\. Only tasks where at least one mutation was accepted are shown \(zero\-mutation tasks are excluded\)\. Bold rank indicates a fallback candidate \(rank\>\>1\)\. T\-Δ\\Delta= challenger minus incumbent on the fixed T seeds\. Fresh SR aggregates 120 episodes \(6 seeds×\\times20 episodes\)\.SPδ\\deltaVariantTaskCycleRankT\-incT\-chalT\-Δ\\DeltaFresh SRHSPδ\\delta=0\.00plainGoTo121100%100%\+0\+0pp100\.0%HSPδ\\delta=0\.00plainPickUp20185%85%\+0\+0pp97\.5%HSPδ\\delta=0\.00plainOpen2145%50%\+5\+5pp45\.0%HSPδ\\delta=0\.00plainPU→\\toGoTo13175%80%\+5\+5pp68\.3%HSPδ\\delta=0\.00plainPutNext5115%25%\+10\+10pp13\.3%HSPδ\\delta=0\.00guidedPickUp9190%90%\+0\+0pp90\.8%HSPδ\\delta=0\.00guidedOpen10250%70%\+20\+20pp59\.2%HSPδ\\delta=0\.00guidedPU→\\toGoTo1185%90%\+5\+5pp75\.8%HSPδ\\delta=0\.00guidedPutNext14235%55%\+20\+20pp41\.7%HSPδ\\delta=0\.02plainGoTo3185%95%\+10\+10pp100\.0%HSPδ\\delta=0\.02plainPickUp7185%85%\+0\+0pp93\.3%HSPδ\\delta=0\.02plainOpen13240%45%\+5\+5pp56\.7%HSPδ\\delta=0\.02plainPU→\\toGoTo17165%65%\+0\+0pp58\.3%HSPδ\\delta=0\.02plainPutNext525%20%\+15\+15pp6\.7%HSPδ\\delta=0\.02guidedGoTo112100%100%\+0\+0pp100\.0%HSPδ\\delta=0\.02guidedPickUp5185%95%\+10\+10pp98\.3%HSPδ\\delta=0\.02guidedOpen16165%75%\+10\+10pp61\.7%HSPδ\\delta=0\.02guidedPU→\\toGoTo3380%95%\+15\+15pp76\.7%HSPδ\\delta=0\.02guidedPutNext20240%55%\+15\+15pp49\.2%HSPδ\\delta=0\.05plainOpen7240%50%\+10\+10pp47\.5%HSPδ\\delta=0\.05plainPU→\\toGoTo20180%85%\+5\+5pp58\.3%HSPδ\\delta=0\.05plainPutNext10110%15%\+5\+5pp13\.3%HSPδ\\delta=0\.05guidedPickUp5285%85%\+0\+0pp93\.3%HSPδ\\delta=0\.05guidedOpen19155%60%\+5\+5pp62\.5%HSPδ\\delta=0\.05guidedPU→\\toGoTo1185%95%\+10\+10pp77\.5%HSPδ\\delta=0\.05guidedPutNext10220%25%\+5\+5pp10\.8%HSPδ\\delta=0\.10plainPickUp11175%85%\+10\+10pp88\.3%HSPδ\\delta=0\.10plainOpen1230%50%\+20\+20pp46\.7%HSPδ\\delta=0\.10guidedOpen15145%55%\+10\+10pp66\.7%HSPδ\\delta=0\.10guidedPutNext115%30%\+25\+25pp8\.3%LSPδ\\delta=0\.00plainGoTo161100%100%\+0\+0pp98\.3%LSPδ\\delta=0\.00plainPickUp7185%100%\+15\+15pp95\.0%LSPδ\\delta=0\.00plainOpen17145%50%\+5\+5pp43\.3%LSPδ\\delta=0\.00plainPU→\\toGoTo19175%85%\+10\+10pp50\.0%LSPδ\\delta=0\.00plainPutNext110%30%\+30\+30pp10\.8%LSPδ\\delta=0\.00guidedGoTo16295%100%\+5\+5pp100\.0%LSPδ\\delta=0\.00guidedPickUp2180%95%\+15\+15pp96\.7%LSPδ\\delta=0\.00guidedOpen3150%65%\+15\+15pp62\.5%LSPδ\\delta=0\.00guidedPU→\\toGoTo6280%85%\+5\+5pp70\.8%LSPδ\\delta=0\.00guidedPutNext18275%80%\+5\+5pp77\.5%Continuation from above tableSPδ\\deltaVariantTaskCycleRankT\-incT\-chalT\-Δ\\DeltaFresh SRLSPδ\\delta=0\.02plainGoTo6190%95%\+5\+5pp99\.2%LSPδ\\delta=0\.02plainPickUp4175%85%\+10\+10pp86\.7%LSPδ\\delta=0\.02plainOpen6140%55%\+15\+15pp52\.5%LSPδ\\delta=0\.02plainPU→\\toGoTo9180%80%\+0\+0pp61\.7%LSPδ\\delta=0\.02plainPutNext11115%20%\+5\+5pp7\.5%LSPδ\\delta=0\.02guidedPickUp82100%100%\+0\+0pp98\.3%LSPδ\\delta=0\.02guidedPutNext13150%65%\+15\+15pp64\.2%LSPδ\\delta=0\.05plainGoTo4195%90%−5\-5pp100\.0%LSPδ\\delta=0\.05plainPickUp12175%90%\+15\+15pp90\.0%LSPδ\\delta=0\.05plainOpen2135%50%\+15\+15pp46\.7%LSPδ\\delta=0\.05plainPU→\\toGoTo2165%75%\+10\+10pp62\.5%LSPδ\\delta=0\.05guidedGoTo31100%100%\+0\+0pp100\.0%LSPδ\\delta=0\.05guidedOpen6145%60%\+15\+15pp60\.0%LSPδ\\delta=0\.05guidedPU→\\toGoTo6185%90%\+5\+5pp75\.8%LSPδ\\delta=0\.05guidedPutNext13160%70%\+10\+10pp72\.5%LSPδ\\delta=0\.10plainPutNext12110%25%\+15\+15pp9\.2%LSPδ\\delta=0\.10guidedPickUp15185%95%\+10\+10pp91\.7%LSPδ\\delta=0\.10guidedPU→\\toGoTo7175%85%\+10\+10pp75\.8%LSPδ\\delta=0\.10guidedPutNext5140%70%\+30\+30pp63\.3%
#### B\.5\.2What Is the Proportion of Failure / Insight / Skip Outputs From the BA, and Which Characterizations Yielded Test Acceptance?

In theory, starting from a prompt that always results in failure, we expect the BA to consistently output failure characterisations more often in the earlier rounds of optimisation\. As optimisation progresses and we start improving the prompt, we would expect to see more ’good’ behaviors encoded into the prompt through mutations\. Table[9](https://arxiv.org/html/2606.17838#A2.T9)shows us how many insights and failures are proposed by the BA, and how many of these actually pass the selection phase\. We see that over the entire optimisation process, failures are in early stages a richer source of improvement, and posit that our current environment cycles are not sufficient to allow us to see this progression, but we do see however that there are already in these stages some insights, which mostly fail in the earlier rounds either due to a false positive where the BA thinks an action was good, or due to a truly good change only targetting local behaviors of the agent that might not help it towards the goal\.

Table 9:BA output type and gate\-acceptance rate per condition\. F = failure, I = insight, S = skip\. Acc% = proportion of that type accepted by the T gate\. Aggregated across all 5 tasks and both prompt variants\.

### B\.6What Happens When the BA Is Allowed to Mutate Only One Module?

Figure[10](https://arxiv.org/html/2606.17838#A2.F10)shows fresh evaluation performance for the full SPA pipeline \(HSP,δ=0\.05\\delta=0\.05\), two module ablations, and BALROG optimized \(HSP,δ=0\.05\\delta=0\.05\) as a structural reference\. The ablations constrain the BA to propose mutations for one module only: agent\-only mirrors the BALROG setup, where no descriptor exists; descriptor\-only isolates whether the descriptor alone can carry performance gains\.

Both SPA ablations exceed BALROG optimized in mean success rate \(agent\-only: 58\.2% plain, 75\.2% guided; descriptor\-only: 64\.7% plain, 64\.8% guided; BALROG: 47\.7%\)\. This holds even though all three conditions share the same single\-module constraint structure, suggesting SPA’s decomposed architecture gives the BA more addressable failure modes even within a single module\.

The agent\-only guided ablation is the strongest single\-module condition at 75\.2%, driven by a 49\.2% success rate onPutNextwhich requires guided agent prompt encodes explicitly\. The BA refines this existing structure rather than synthesising it from scratch\. In the plain variant, agent\-only achieves only 7\.5% onPutNext, confirming that the guided prompt’s structural anchors are the enabling condition\.

Descriptor\-only performance converges to similar levels across variants \(64\.7% vs 64\.8%\), whereas agent\-only shows a large variant gap \(58\.2% vs 75\.2%\)\. Descriptor improvements are relatively prompt\-agnostic; agent improvements depend critically on what is already in the prompt for the BA to refine\.

Table[10](https://arxiv.org/html/2606.17838#A2.T10)supports a mechanistic reading of these results\. The BA attributes approximately 81% of failures to the agent module across all unconstrained runs\. Under the agent\-only constraint it redirects to 93% agent attribution; under descriptor\-only it inverts to 92% descriptor attribution, with a 1\.8% constraint violation rate across 400 cycles\. The BA follows the module constraint with high fidelity, and the performance of each ablation reflects what the BA finds when it actively looks at one module rather than defaulting to agent attribution\.

![Refer to caption](https://arxiv.org/html/2606.17838v1/x24.png)Figure 10:Comparison of the SR based on constrained and unconstrained Optimizer functioning\. The ablation on agentSSand descriptorDDessentially mimics the optimization of the BALROG agent\.Table 10:BA module attribution and constraint violations for unconstrained gated runs and module\-ablation constrained runs\. Attribution columns show the fraction of optimisation cycles where the BA diagnosed a failure in each module\. Violations count cycles where the BA attributed the locked module, requiring a re\-sample\. All violations occur in descriptor\-only runs; agent\-only runs produced zero violations\.ConditionVariantAgentDescriptorSkipCyclesViolationsViol\. rateHSPplain83%17%0%100——HSPguided79%21%0%100——LSPplain80%20%0%100——LSPguided83%17%0%100——Agent\-onlyplain95%5%0%10000\.0%Agent\-onlyguided92%8%0%10000\.0%Descriptor\-onlyplain3%96%1%10011\.0%Descriptor\-onlyguided6%88%6%10066\.0%Total \(constrained\)40071\.8%

## Appendix CDetails of the Prompts for All Agents and Optimizer Modules

This appendix documents all prompts used in the pipeline, organised by*when*they are active\. The Agent and Descriptor receive only their own instruction files at rollout time — they never see the environment layer, the BA instructions, or the Mutator instructions\. Environment physics and pipeline contracts live exclusively in the optimiser’s context, grounding its attributions without leaking privileged information into agent behaviour\.

### C\.1Inference\-Time Prompts

Exact system prompts presented to each LLM during episode rollouts\. Neither the Acting Agent nor the Descriptor Agent receives the environment layer shown in Section[C\.2](https://arxiv.org/html/2606.17838#A3.SS2)\.

#### C\.1\.1Descriptor Prompts

##### Descriptor — Plain\.

One\-sentence instruction\. Provides no task\-specific context; the Descriptor must produce a goal\-conditioned summary from the raw observation alone\.

Descriptor — plainSPA pipeline[⬇](data:text/plain;base64,WW91IGFyZSBhIHBlcmNlcHRpb24gbW9kdWxlIGZvciBhIG5hdmlnYXRpb24gYWdlbnQuIEdpdmVuIGEgc2NlbmUgZGVzY3JpcHRpb24gYW5kIGEgbWlzc2lvbiwgd3JpdGUgYSBjb25jaXNlIHN1bW1hcnkgb2Ygd2hhdCBpcyByZWxldmFudCB0byBjb21wbGV0aW5nIHRoZSBtaXNzaW9uLiBEbyBub3Qgc3VnZ2VzdCBhY3Rpb25zLg==)Youareaperceptionmoduleforanavigationagent\.Givenascenedescriptionandamission,writeaconcisesummaryofwhatisrelevanttocompletingthemission\.Donotsuggestactions\.

##### Descriptor — Guided\.

Handcrafted perceptual guidance: explicit output rules, prioritisation criteria, and boundary conditions\. Optimiser starting point for the descriptor module under the guided variant\.

Descriptor — guidedSPA pipeline[⬇](data:text/plain;base64,WW91IGFyZSBhIHBlcmNlcHRpb24gbW9kdWxlIGZvciBhIGdyaWQtd29ybGQgbmF2aWdhdGlvbiBhZ2VudC4KWW91IHdpbGwgcmVjZWl2ZSBhIHNjZW5lIGRlc2NyaXB0aW9uIHByb2R1Y2VkIGRpcmVjdGx5IGJ5IHRoZSBlbnZpcm9ubWVudCwKbGlzdGluZyBlYWNoIHZpc2libGUgb2JqZWN0IGFuZCBpdHMgcG9zaXRpb24gcmVsYXRpdmUgdG8gdGhlIGFnZW50LCBwbHVzCnRoZSBjdXJyZW50IG1pc3Npb24uCgpZb3VyIGpvYiBpcyB0byB3cml0ZSBhIGZvY3VzZWQgbmF0dXJhbCBsYW5ndWFnZSBkZXNjcmlwdGlvbiBvZiB0aGUgc2NlbmUKdGhhdCBoaWdobGlnaHRzIHdoYXQgaXMgcmVsZXZhbnQgdG8gY29tcGxldGluZyB0aGUgbWlzc2lvbi4KCiMjIE91dHB1dCBydWxlcwotIExlYWQgd2l0aCBhbnl0aGluZyB0aGF0IGRpcmVjdGx5IGNvbmNlcm5zIHRoZSBtaXNzaW9uIHRhcmdldDogd2hlcmUgaXQgaXMsCiAgd2hldGhlciBpdCBpcyByZWFjaGFibGUsIHdoZXRoZXIgYW55dGhpbmcgaXMgYmV0d2VlbiB5b3UgYW5kIGl0LgotIEFsd2F5cyBub3RlIGlmIGZvcndhcmQgbW92ZW1lbnQgaXMgYmxvY2tlZCAoYSB3YWxsIG9yIG9iamVjdCAxIHN0ZXAgZm9yd2FyZCkuCi0gRm9yIGRvb3JzLCBhbHdheXMgc3RhdGUgdGhlaXIgY3VycmVudCBzdGF0ZSAob3BlbiwgY2xvc2VkLCBvciBsb2NrZWQpLgotIElmIHRoZSBhZ2VudCBpcyBjYXJyeWluZyBzb21ldGhpbmcsIG1lbnRpb24gaXQgb25seSBpZiBpdCBpcyByZWxldmFudCB0bwogIHRoZSBtaXNzaW9uIChlLmcuIGNhcnJ5aW5nIHRoZSBrZXkgbmVlZGVkIHRvIG9wZW4gYSBkb29yKS4KLSBEbyBub3QgbGlzdCBpcnJlbGV2YW50IGJhY2tncm91bmQgb2JqZWN0cyBpbiBkZXRhaWwg4oCUIHN1bW1hcmlzZSBvciBvbWl0IHRoZW0uCi0gRG8gbm90IHN1Z2dlc3QgYWN0aW9ucyBvciByZWFzb24gYWJvdXQgd2hhdCB0byBkbyBuZXh0LiBEZXNjcmliZSBvbmx5IHdoYXQKICB5b3Ugb2JzZXJ2ZS4KLSBCZSBjb25jaXNlLiBJbmNsdWRlIGV2ZXJ5dGhpbmcgcmVsZXZhbnQgYnV0IGF2b2lkIHBhZGRpbmcuCi0gT3V0cHV0IE9OTFkgdGhlIGRlc2NyaXB0aW9uLiBObyBwcmVhbWJsZSwgbm8gc2lnbi1vZmYu)Youareaperceptionmoduleforagrid\-worldnavigationagent\.Youwillreceiveascenedescriptionproduceddirectlybytheenvironment,listingeachvisibleobjectanditspositionrelativetotheagent,plusthecurrentmission\.Yourjobistowriteafocusednaturallanguagedescriptionofthescenethathighlightswhatisrelevanttocompletingthemission\.\#\#Outputrules\-Leadwithanythingthatdirectlyconcernsthemissiontarget:whereitis,whetheritisreachable,whetheranythingisbetweenyouandit\.\-Alwaysnoteifforwardmovementisblocked\(awallorobject1stepforward\)\.\-Fordoors,alwaysstatetheircurrentstate\(open,closed,orlocked\)\.\-Iftheagentiscarryingsomething,mentionitonlyifitisrelevanttothemission\(e\.g\.carryingthekeyneededtoopenadoor\)\.\-Donotlistirrelevantbackgroundobjectsindetail\-\-\-summariseoromitthem\.\-Donotsuggestactionsorreasonaboutwhattodonext\.Describeonlywhatyouobserve\.\-Beconcise\.Includeeverythingrelevantbutavoidpadding\.\-OutputONLYthedescription\.Nopreamble,nosign\-off\.

#### C\.1\.2Agent Prompts

##### Agent — Plain\.

BALROG\-style minimal agent instructions\. Provides the action set and a minimal output format; no task\-specific win conditions or planning guidance\.

Agent — plainSPA pipeline[⬇](data:text/plain;base64,WW91IGFyZSBhbiBhZ2VudCBpbiBhIGdyaWQtd29ybGQgbmF2aWdhdGlvbiBnYW1lLgpUaGUgZm9sbG93aW5nIGFyZSB0aGUgcG9zc2libGUgYWN0aW9ucyB5b3UgY2FuIHRha2U6Cgp0dXJuIGxlZnQ6IHR1cm4gdG8gdGhlIGxlZnQsCnR1cm4gcmlnaHQ6IHR1cm4gdG8gdGhlIHJpZ2h0LApnbyBmb3J3YXJkOiB0YWtlIG9uZSBzdGVwIGZvcndhcmQsCnBpY2sgdXA6IHBpY2sgdXAgdGhlIG9iamVjdCBpbiBmcm9udCBvZiB5b3UsCmRyb3A6IGRyb3AgdGhlIG9iamVjdCB5b3UgYXJlIGNhcnJ5aW5nLAp0b2dnbGU6IG1hbmlwdWxhdGUgdGhlIG9iamVjdCBpbiBmcm9udCBvZiB5b3UuCgpUaXBzOgotIFJlYWQgdGhlIG1pc3Npb24gY2FyZWZ1bGx5IOKAlCB0aGUgcmVxdWlyZWQgZmluYWwgYWN0aW9uIGRlcGVuZHMgb24gd2hhdCB0aGUgbWlzc2lvbiBhc2tzIHlvdSB0byBkby4KLSBJdCBkb2VzIG5vdCBtYWtlIHNlbnNlIHRvIHJlcGVhdCB0aGUgc2FtZSBhY3Rpb24gaWYgdGhlIG9ic2VydmF0aW9uIGRvZXMgbm90IGNoYW5nZS4KCkZvcm1hdCB5b3VyIGFuc3dlciBhczoKUExBTjogPHlvdXIgcGxhbiwgb3IgIk5vIGNoYW5nZXMuIiBpZiB1bmNoYW5nZWQ+CkFDVElPTjogPG9uZSBvZjogdHVybiBsZWZ0LCB0dXJuIHJpZ2h0LCBnbyBmb3J3YXJkLCBwaWNrIHVwLCBkcm9wLCB0b2dnbGU+)Youareanagentinagrid\-worldnavigationgame\.Thefollowingarethepossibleactionsyoucantake:turnleft:turntotheleft,turnright:turntotheright,goforward:takeonestepforward,pickup:pickuptheobjectinfrontofyou,drop:droptheobjectyouarecarrying,toggle:manipulatetheobjectinfrontofyou\.Tips:\-Readthemissioncarefully\-\-\-therequiredfinalactiondependsonwhatthemissionasksyoutodo\.\-Itdoesnotmakesensetorepeatthesameactioniftheobservationdoesnotchange\.Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>

##### Agent — Guided\.

Handcrafted reasoning strategy: explicit win conditions for all five task families, partial observability handling, a structured planning format, and action\-set semantics\. Optimiser starting point for the agent module under the guided variant\.

Agent — guidedSPA pipeline[⬇](data:text/plain;base64,WW91IGFyZSBjb250cm9sbGluZyBhbiBhZ2VudCBpbiBhIGdyaWQgd29ybGQuIEVhY2ggdHVybiB5b3UgcmVjZWl2ZToKLSBUaGUgbWlzc2lvbiB5b3UgbXVzdCBjb21wbGV0ZS4KLSBBIG5hdHVyYWwgbGFuZ3VhZ2UgZGVzY3JpcHRpb24gb2Ygd2hhdCB5b3UgY3VycmVudGx5IHNlZS4KCkFsbCBwb3NpdGlvbnM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SBzdGVwIHRoYXQgeW91IGludGVuZCB0byB1c2Ugbm93LCByZXBlYXRpbmcgaXQgY291bGQgYWx0ZXIgeW91ciB0cmFqZWN0b3J5LiBUaGUgY3VycmVudCBwbGFuIGhpZ2hsaWdodHMgdGhlIHBsYW4geW91IGRlY2lkZWQgb24gaW4gdGhlIHByZXZpb3VzIHN0ZXAsIGFuZCB0aGlzIG1pZ2h0IG5vdCBob2xkIGdpdmVuIHRoZSBuZXcgb2JzZXJ2YXRpb25zIHlvdSByZWNlaXZlZC4gQXMgc3VjaCwgY29uc2lkZXIgYm90aCB5b3VyIHByZXZpb3VzIHN0ZXAncyBhY3Rpb24gYW5kIHRoZSBjdXJyZW50IHBsYW4sIHdoaWNoIHlvdSB0aGVuIHdpbGwgZ2VuZXJhdGUgdGhlIG5ldyBwbGFuIGZyb20uCgpGb3JtYXQgeW91ciBhbnN3ZXIgYXM6ClBMQU46IDx5b3VyIHBsYW4sIG9yICJObyBjaGFuZ2VzLiIgaWYgdW5jaGFuZ2VkPgpBQ1RJT046IDxvbmUgb2Y6IHR1cm4gbGVmdCwgdHVybiByaWdodCwgZ28gZm9yd2FyZCwgcGljayB1cCwgZHJvcCwgdG9nZ2xlPg==)Youarecontrollinganagentinagridworld\.Eachturnyoureceive:\-Themissionyoumustcomplete\.\-Anaturallanguagedescriptionofwhatyoucurrentlysee\.Allpositionsintheobservation\(forward,left,right\)arerelativetoyourcurrentfacingdirection\-\-\-"1stepforward"alwaysmeansonestepinthedirectionyouarecurrentlymoving,regardlessofcompassorientation\.\#\#WinconditionReadthemissioncarefully\-\-\-therequiredfinalactiondependsonthetasktype:\-\*\*"goto"missions\*\*:navigateuntilthetargetobjectisexactly1stepdirectlyaheadofyou\.Theepisodeendsautomatically\-\-\-nofurtheractionneeded\.\-\*\*"pickup"missions\*\*:navigatetothetargetobjectanduse"pickup"whenitisexactly1stepdirectlyaheadofyou\.\-\*\*"open"missions\*\*:navigatetothedooranduse"toggle"whenitisexactly1stepdirectlyaheadofyou\.Ifthedoorislocked,firstfindandpickupthematchingkey,thenreturntothedoorandtoggleit\.\-\*\*"putnextto"missions\*\*:pickupthefirstnamedobject,navigatetothesecondnamedobject,thenuse"drop"whenyouareadjacenttoit\.\-\*\*"pickupXthengotoY"missions\*\*:pickupobjectXfirst\(use"pickup"whendirectlyinfrontofit\),thennavigatetoobjectYuntilitis1stepahead\.Inallcases,youmustbefacingthetargetdirectly\-\-\-beingadjacentbutfacingthewrongdirectiondoesnotsatisfythewincondition\.\#\#PartialobservabilityYourobservationisasmallwindowoftheenvironmentdirectlyinfrontofyou\-\-\-notthewholemap\.Objectsoutsidethiswindowaresimplynotvisibleyet\.Ifthetargetisnotinthecurrentdescription,itexistssomewhereelseonthemapandyouhavenotfoundityet\.Neverassumetheinformationiswrong\.Explore\.Ifincaseyoudonotreceiveadescriptionbuthaveaplanfromapreviousstep,thenbesmart,lookatyourpreviousaction,extrapolatewiththecurrentplanandproposeanactionalongwiththenextplan\.Shouldboththedescriptionandpreviousplanbeunavailable,treatitasanexploratorystepandsimplyselectatrandom\.\#\#ExplorationWhenthetargetisnotvisible,considerturninginalldirectionstoscanyoursurroundings\.Ifyourpathisblockedbyawall,turnandtryadifferentdirection\.\#\#ActionsetThereareexactly7validactions:turnleft\-\-\-rotate90°totheleft\(doesNOTmoveyou,onlychangesfacingdirection\)turnright\-\-\-rotate90°totheright\(doesNOTmoveyou,onlychangesfacingdirection\)goforward\-\-\-moveonestepinthedirectionyouarecurrentlyfacingpickup\-\-\-pickuptheobjectdirectlyinfrontofyoudrop\-\-\-droptheobjectyouarecarryingtoggle\-\-\-openorunlockthedoordirectlyinfrontofyou\#\#KeyruleThereisnoactiontomovesideways,backward,orinacompassdirection\."turnleft"and"turnright"rotateyou90°butdonotmoveyou\.Theonlyactionthatmovesyouis"goforward"\.\#\#PlanningMaintainashortplanandupdateiteachturn\.Considerthepreviousplanalongsidethecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthepastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow,repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyoudecidedoninthepreviousstep,andthismightnotholdgiventhenewobservationsyoureceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrentplan,whichyouthenwillgeneratethenewplanfrom\.Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>

##### Agent — BALROG Plain\.

Verbatim RobustCoTAgent Prompt From the BALROG, Reproduced Without ModificationUsed as the starting prompt for all BALROG optimisation runs\. The\{mission\}placeholder is substituted at runtime by the BALROG runner\.

Agent — BALROG plain \(verbatim\)BALROG baseline, unchanged[⬇](data:text/plain;base64,WW91IGFyZSBhbiBhZ2VudCBwbGF5aW5nIGEgc2ltcGxlIG5hdmlnYXRpb24gZ2FtZS4gWW91ciBnb2FsIGlzIHRvIHttaXNzaW9ufS4KVGhlIGZvbGxvd2luZyBhcmUgdGhlIHBvc3NpYmxlIGFjdGlvbnMgeW91IGNhbiB0YWtlIGluIHRoZSBnYW1lLCBmb2xsb3dlZCBieSBhIHNob3J0IGRlc2NyaXB0aW9uIG9mIGVhY2ggYWN0aW9uOgoKdHVybiBsZWZ0OiB0dXJuIHRvIHRoZSBsZWZ0LAp0dXJuIHJpZ2h0OiB0dXJuIHRvIHRoZSByaWdodCwKZ28gZm9yd2FyZDogdGFrZSBvbmUgc3RlcCBmb3J3YXJkLApwaWNrIHVwOiBwaWNrIHVwIHRoZSBvYmplY3QgYmVsb3cgeW91LApkcm9wOiBkcm9wIHRoZSBvYmplY3QgdGhhdCB5b3UgYXJlIGhvbGRpbmcsCnRvZ2dsZTogbWFuaXB1bGF0ZSB0aGUgb2JqZWN0IGluIGZyb250IG9mIHlvdS4KCkluIGEgbW9tZW50IEkgd2lsbCBwcmVzZW50IHlvdSBhbiBvYnNlcnZhdGlvbi4KClRpcHM6Ci0gT25jZSB0aGUgZGVzaXJlZCBvYmplY3QgeW91IHdhbnQgdG8gaW50ZXJhY3Qgb3IgcGlja3VwIGluIGZyb250IG9mIHlvdSwgeW91IGNhbiB1c2UgdGhlICd0b2dnbGUnIGFjdGlvbiB0byBpbnRlcmFjdCB3aXRoIGl0LgotIEl0IGRvZXNuJ3QgbWFrZSBzZW5zZSB0byByZXBlYXQgdGhlIHNhbWUgYWN0aW9uIG92ZXIgYW5kIG92ZXIgaWYgdGhlIG9ic2VydmF0aW9uIGRvZXNuJ3QgY2hhbmdlLgoKUExBWSE=)Youareanagentplayingasimplenavigationgame\.Yourgoalisto\{mission\}\.Thefollowingarethepossibleactionsyoucantakeinthegame,followedbyashortdescriptionofeachaction:turnleft:turntotheleft,turnright:turntotheright,goforward:takeonestepforward,pickup:pickuptheobjectbelowyou,drop:droptheobjectthatyouareholding,toggle:manipulatetheobjectinfrontofyou\.InamomentIwillpresentyouanobservation\.Tips:\-Oncethedesiredobjectyouwanttointeractorpickupinfrontofyou,youcanusethe’toggle’actiontointeractwithit\.\-Itdoesn’tmakesensetorepeatthesameactionoverandoveriftheobservationdoesn’tchange\.PLAY\!

##### Agent — BALROG Guided\.

Guided variant of the BALROG prompt in BALROG’s free\-form chain\-of\-thought style \(<\|ACTION\|\>extraction, no structured PLAN/ACTION format\)\. Used in BALROG guided baseline experiments\.

Agent — BALROG guidedBALROG pipeline[⬇](data:text/plain;base64,WW91IGFyZSBhIHBlcmNlcHRpb24gbW9kdWxlIGZvciBhIGdyaWQtd29ybGQgbmF2aWdhdGlvbiBhZ2VudC4KWW91IHdpbGwgcmVjZWl2ZSBhIHNjZW5lIGRlc2NyaXB0aW9uIHByb2R1Y2VkIGRpcmVjdGx5IGJ5IHRoZSBlbnZpcm9ubWVudCwKbGlzdGluZyBlYWNoIHZpc2libGUgb2JqZWN0IGFuZCBpdHMgcG9zaXRpb24gcmVsYXRpdmUgdG8gdGhlIG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5b3VyIHBhdGggaXMgYmxvY2tlZCBieSBhIHdhbGwsIHR1cm4gYW5kIHRyeSBhIGRpZmZlcmVudCBkaXJlY3Rpb24uCgojIyBBY3Rpb24gc2V0ClRoZXJlIGFyZSBleGFjdGx5IDcgdmFsaWQgYWN0aW9uczoKICB0dXJuIGxlZnQgIOKAlCByb3RhdGUgOTDCsCB0byB0aGUgbGVmdCAgKGRvZXMgTk9UIG1vdmUgeW91LCBvbmx5IGNoYW5nZXMgZmFjaW5nIGRpcmVjdGlvbikKICB0dXJuIHJpZ2h0IOKAlCByb3RhdGUgOTDCsCB0byB0aGUgcmlnaHQgKGRvZXMgTk9UIG1vdmUgeW91LCBvbmx5IGNoYW5nZXMgZmFjaW5nIGRpcmVjdGlvbikKICBnbyBmb3J3YXJkIOKAlCBtb3ZlIG9uZSBzdGVwIGluIHRoZSBkaXJlY3Rpb24geW91IGFyZSBjdXJyZW50bHkgZmFjaW5nCiAgcGljayB1cCAgICDigJQgcGljayB1cCB0aGUgb2JqZWN0IGRpcmVjdGx5IGluIGZyb250IG9mIHlvdQogIGRyb3AgICAgICAg4oCUIGRyb3AgdGhlIG9iamVjdCB5b3UgYXJlIGNhcnJ5aW5nCiAgdG9nZ2xlICAgICDigJQgb3BlbiBvciB1bmxvY2sgdGhlIGRvb3IgZGlyZWN0bHkgaW4gZnJvbnQgb2YgeW91CgojIyBLZXkgcnVsZQpUaGVyZSBpcyBubyBhY3Rpb24gdG8gbW92ZSBzaWRld2F5cywgYmFja3dhcmQsIG9yIGluIGEgY29tcGFzcyBkaXJlY3Rpb24uCiJ0dXJuIGxlZnQiIGFuZCAidHVybiByaWdodCIgcm90YXRlIHlvdSA5MMKwIGJ1dCBkbyBub3QgbW92ZSB5b3UuClRoZSBvbmx5IGFjdGlvbiB0aGF0IG1vdmVzIHlvdSBpcyAiZ28gZm9yd2FyZCIu)Youareaperceptionmoduleforagrid\-worldnavigationagent\.Youwillreceiveascenedescriptionproduceddirectlybytheenvironment,listingeachvisibleobjectanditspositionrelativetotheagent,plusthecurrentmission\.Yourjobistowriteafocusednaturallanguagedescriptionofthescenethathighlightswhatisrelevanttocompletingthemission\.\#\#Observationrules\-Leadwithanythingthatdirectlyconcernsthemissiontarget:whereitis,whetheritisreachable,whetheranythingisbetweenyouandit\.\-Alwaysnoteifforwardmovementisblocked\(awallorobject1stepforward\)\.\-Fordoors,alwaysstatetheircurrentstate\(open,closed,orlocked\)\.\-Iftheagentiscarryingsomething,mentionitonlyifitisrelevanttothemission\(e\.g\.carryingthekeyneededtoopenadoor\)\.\-Donotlistirrelevantbackgroundobjectsindetail\-\-\-summariseoromitthem\.\-Donotsuggestactionsorreasonaboutwhattodonext\.Describeonlywhatyouobserve\.\-Beconcise\.Includeeverythingrelevantbutavoidpadding\.\-OutputONLYthedescription\.Nopreamble,nosign\-off\.Onceyoudothisyoumustthencontroltheagentinagridworldtocompletethefollowingmission:\{mission\}Eachturnyoureceive:\-Themissionyoumustcomplete\.\-Thenaturallanguagedescriptionyouproduced\.Allpositionsintheobservation\(forward,left,right\)arerelativetoyourcurrentfacingdirection\-\-\-"1stepforward"alwaysmeansonestepinthedirectionyouarecurrentlymoving,regardlessofcompassorientation\.\#\#WinconditionReadthemissioncarefully\-\-\-therequiredfinalactiondependsonthetasktype:\-\*\*"goto"missions\*\*:navigateuntilthetargetobjectisexactly1stepdirectlyaheadofyou\.Theepisodeendsautomatically\-\-\-nofurtheractionneeded\.\-\*\*"pickup"missions\*\*:navigatetothetargetobjectanduse"pickup"whenitisexactly1stepdirectlyaheadofyou\.\-\*\*"open"missions\*\*:navigatetothedooranduse"toggle"whenitisexactly1stepdirectlyaheadofyou\.Ifthedoorislocked,firstfindandpickupthematchingkey,thenreturntothedoorandtoggleit\.\-\*\*"putnextto"missions\*\*:pickupthefirstnamedobject,navigatetothesecondnamedobject,thenuse"drop"whenyouareadjacenttoit\.\-\*\*"pickupXthengotoY"missions\*\*:pickupobjectXfirst\(use"pickup"whendirectlyinfrontofit\),thennavigatetoobjectYuntilitis1stepahead\.Inallcases,youmustbefacingthetargetdirectly\-\-\-beingadjacentbutfacingthewrongdirectiondoesnotsatisfythewincondition\.\#\#PartialobservabilityYourobservationisasmallwindowoftheenvironmentdirectlyinfrontofyou\-\-\-notthewholemap\.Objectsoutsidethiswindowaresimplynotvisibleyet\.Ifthetargetisnotinthecurrentdescription,itexistssomewhereelseonthemapandyouhavenotfoundityet\.Neverassumetheinformationiswrong\.Explore\.Ifincaseyoudonotreceiveadescriptionbuthaveaplanfromapreviousstep,thenbesmart,lookatyourpreviousaction,extrapolatewiththecurrentplanandproposeanactionalongwiththenextplan\.Shouldboththedescriptionandpreviousplanbeunavailable,treatitasanexploratorystepandsimplyselectatrandom\.\#\#ExplorationWhenthetargetisnotvisible,considerturninginalldirectionstoscanyoursurroundings\.Ifyourpathisblockedbyawall,turnandtryadifferentdirection\.\#\#ActionsetThereareexactly7validactions:turnleft\-\-\-rotate90°totheleft\(doesNOTmoveyou,onlychangesfacingdirection\)turnright\-\-\-rotate90°totheright\(doesNOTmoveyou,onlychangesfacingdirection\)goforward\-\-\-moveonestepinthedirectionyouarecurrentlyfacingpickup\-\-\-pickuptheobjectdirectlyinfrontofyoudrop\-\-\-droptheobjectyouarecarryingtoggle\-\-\-openorunlockthedoordirectlyinfrontofyou\#\#KeyruleThereisnoactiontomovesideways,backward,orinacompassdirection\."turnleft"and"turnright"rotateyou90°butdonotmoveyou\.Theonlyactionthatmovesyouis"goforward"\.

### C\.2Optimization\-Time Prompts

These prompts run only during the optimization loop\.

##### Environment Layer\.

Shared read\-only context injected into both the BA and Mutator at every optimization cycle\. Encodes world structure, observation format, action space, physical constraints, and partial observability rules\. This was richly handcrafted in order to make certain that the BA and Mutator would follow the exact instructions that they were given\. The resulting prompts were crafted over multiple retries of both components in isolation and then used in our pipeline\.

Environment LayerBA and Mutator only[⬇](data:text/plain;base64,IyMgRW52aXJvbm1lbnQ6IEJhYnlBSSAvIE1pbmlHcmlkCgojIyMgV29ybGQgc3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Rvb3IgcmVxdWlyZXMgdGhlIG1hdGNoaW5nIGtleSB0byBiZSBjYXJyaWVkIGJlZm9yZSB0b2dnbGluZy4KLSBPbmx5IG9uZSBvYmplY3QgY2FuIGJlIGNhcnJpZWQgYXQgYSB0aW1lLgoKIyMjIFBhcnRpYWwgb2JzZXJ2YWJpbGl0eQpPYmplY3RzIG91dHNpZGUgdGhlIDd4NyB3aW5kb3cgYXJlIG5vdCB2aXNpYmxlLiBBYnNlbmNlIGZyb20gdGhlIGN1cnJlbnQKb2JzZXJ2YXRpb24gZG9lcyBub3QgbWVhbiBhbiBvYmplY3QgZG9lcyBub3QgZXhpc3Qg4oCUIGl0IG1heSBiZSBpbiBhbgp1bmV4cGxvcmVkIHBhcnQgb2YgdGhlIG1hcC4gTmV2ZXIgYXNzdW1lIHRoZSB0YXJnZXQgaXMgYWJzZW50OyBleHBsb3JlLg==)\#\#Environment:BabyAI/MiniGrid\#\#\#Worldstructure2Dgridworld\.Theagentoccupiesonecellandfacesoneoffourcompassdirections\(right,down,left,up\)\.Onlythecellsdirectlyinfrontoftheagentarevisible\-\-\-theobservationisa7x7partialwindow,notthefullmap\.\#\#\#ObservationformatPositionsintheobservationarerelativetotheagent’scurrentfacingdirection\."1stepforward"alwaysmeansonestepinthedirectiontheagentiscurrentlyfacing,regardlessofcompassorientation\.Leftandrightarealsorelativetofacing\-\-\-notcompassdirections\.Theagentisalwaysatposition\(row=6,col=3\)inthe7x7view\.Row0isdirectlyahead\.Cellsbehindrow6arenotvisible\.\#\#\#ActionspaceThereareexactly7validactions:turnleft\-\-\-rotate90°left\(nomovement,onlychangesfacingdirection\)turnright\-\-\-rotate90°right\(nomovement,onlychangesfacingdirection\)goforward\-\-\-moveonestepinthedirectioncurrentlybeingfacedpickup\-\-\-pickuptheobjectdirectly1stepaheaddrop\-\-\-droptheobjectcurrentlybeingcarriedtoggle\-\-\-openorunlockthedoordirectly1stepaheaddone\-\-\-declarethetaskcomplete\(onlyusewhenwinconditionismet\)Thereisnoactionformovingsideways,backward,orinacompassdirection\."goforward"istheonlyactionthatchangestheagent’sposition\.\#\#\#Physicalconstraints\-Theagentcannotmovethroughwallsorclosed/lockeddoors\.\-Attempting"goforward"intoawallorcloseddoorleavestheagentinplace\.\-Adoormustbetoggled\(opened\)beforetheagentcanmovethroughit\.\-Alockeddoorrequiresthematchingkeytobecarriedbeforetoggling\.\-Onlyoneobjectcanbecarriedatatime\.\#\#\#PartialobservabilityObjectsoutsidethe7x7windowarenotvisible\.Absencefromthecurrentobservationdoesnotmeananobjectdoesnotexist\-\-\-itmaybeinanunexploredpartofthemap\.Neverassumethetargetisabsent;explore\.

##### Behaviour Analyser Instructions\.

The BA’s core instruction file: staged reasoning process \(Stages 1–3\), output format specification, and hard constraints\. Shown verbatim\. At runtime the BA additionally receives \(after these instructions\): the environment layer, the*current*agent prompt, the*current*descriptor prompt, and the prior mutation history \(last 10 hereditary entries\)\.

Behaviour Analyser InstructionsBA only[⬇](data:text/plain;base64,WW91IGFyZSBhIEJlaGF2aW91ciBBbmFseXNlciBmb3IgYW4gTExNIGFnZW50IHBpcGVsaW5lIG9wZXJhdGluZyBpbiBhIGdyaWQtd29ybGQgZW52aXJvbm1lbnQuIFlvdXIgdGFzayBpcyB0byByZWFkIG9uZSBvciBtb3JlIGVwaXNvZGUgdHJhamVjdG9yaWVzIGFuZCBwcm9kdWNlIGEgc2luZ2xlLCBhY3Rpb25hYmxlIGRpYWdub3NpcyB0aGF0IHRoZSBwcm9tcHQgb3B0aW1pc2F0aW9uIGxvb3AgY2FuIGFjdCBvbi4KCllvdXIgb3V0cHV0IGRyaXZlcyBtdXRhdGlvbiBvZiB0aGUgYWdlbnQncyBwcm9tcHQgY29tcG9uZW50cy4gQSBjb25maWRlbnQgd3JvbmcgYXR0cmlidXRpb24gaXMgd29yc2UgdGhhbiBhIFNraXAg4oCUIGlmIHRoZSBzaWduYWwgaXMgZ2VudWluZWx5IGluc3VmZmljaWVudCB0byBhdHRyaWJ1dGUgdGhlI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0VfVFlQRSwgTE9DQVRJT04sIFNVR0dFU1RFRF9DSEFOR0UsIGFuZCBBRERJVElPTkFMX0NBTkRJREFURVMgbWF5IGJlIG9taXR0ZWQ7IFNLSVBfUkVBU09OIGlzIHJlcXVpcmVk)YouareaBehaviourAnalyserforanLLMagentpipelineoperatinginagrid\-worldenvironment\.Yourtaskistoreadoneormoreepisodetrajectoriesandproduceasingle,actionablediagnosisthatthepromptoptimisationloopcanacton\.Youroutputdrivesmutationoftheagent’spromptcomponents\.AconfidentwrongattributionisworsethanaSkip\-\-\-ifthesignalisgenuinelyinsufficienttoattributethefailureorsuccesstoaspecificmodule,outputSkip\.\-\-\-\#\#TrajectoryformatEachepisodeisdelimitedby:====================EpisodeN\-\-\-FAILED/SUCCESS====================Eachstepwithinanepisodeisformattedas:E\{episode\}\.S\{step\}\|facing<direction\>\|pos:\[x,y\]\[\|targetinscene\]TheE\{episode\}\.S\{step\}identifieruniquelyidentifieseverystepacrossallepisodes\-\-\-useitwhencitingevidenceandwhenfillingtheSTEPfieldinyouroutput\.Rawscene:<environmentobservation\-\-\-groundtruthfromtheenvironment\>Descriptor:<descriptormodule’sgoal\-conditionedsummarypassedtotheAgent\>Action:<actiontaken\>\[PARSEFAILED\]\[BLOCKED\]Plan:<agent’splanatthisstep\>\*\*Inlineflags:\*\*\-‘targetinscene‘\-\-\-themissiontargetwasconfirmedpresentintheagent’sobservableareaatthisstep\.ThisannotationusesaheuristicthatisreliableonlyforGoTo\-familytasks\("gotoX"\)\.Forothertaskfamilies\(pickup,open,putnext,pick\_up\_seq\_go\_to\)thisannotationisabsentregardlessofwhetherthetargetisvisible\-\-\-donottreatitsabsenceasevidencethetargetwasnotinview\.Forthosetasks,readRawsceneandDescriptortextdirectly\.\-‘PARSEFAILED‘\-\-\-themodule’sresponsecouldnotbeparsed;theactionshownistheparse\-failuredefault\.\-‘BLOCKED‘\-\-\-agoforwardactionwasattemptedbuttheagentdidnotmove\(wallorcloseddoordirectlyahead\)\.Asingleoccurrenceisnormalandrecoverable\.Flagitonlywhenitappearsonconsecutivesteps,whichindicatestheagentfailedtoupdateitsnavigationstrategyafterhittinganobstacle\.\*\*Episodeboundary:\*\*episodesarecausallyindependent\.Donotconstructcausallinksbetweenstepsindifferentepisodes\.\-\-\-\#\#StagedreasoningprocessWorkthroughthesethreestagesbeforewritingyouroutput\.\*\*Stage1\-\-\-Step\-levelreview\*\*First,notetheoutcomeofeachepisodefromitsheader\(SUCCESSorFAILED\)\.ASUCCESSepisodereachedthewincondition\-\-\-thefinalactionworked\.Donotflagtheterminalstepofasuccessfulepisodeasafailure\.Inasuccessfulepisode,step\-levelissuesareinefficiencies,notfailures;onlyflagthemiftheycausedsignificantunnecessarydetour\.Foreachstep,assesswhethertheactiontakenwasappropriategiventheRawscene,theDescriptoroutput,theagent’splan,andthemission\.Astepisworthflaggingif:\-TheDescriptoromittedsomethingpresentinRawscenethatwasdirectlyrelevanttothemission\.\-TheDescriptordescribedsomethingthatwasnotinRawscene\(hallucination\)\.\-TheAgent’sactioncontradictsitsownplanwithoutavisiblereason\.Note:planstepsaregoals,notliteralimmediateactions\."PickupX"asaplanstepmeanstheagent’sgoalistopickupX\-\-\-itdoesnotrequirethenextactiontoliterallybe"pickup"\.TheagentmustnavigatetoXfirst\(goforward,turn\)beforepickingup\.Onlyflagacontradictioniftheactionmovestheagentawayfromtheplantargetorignorestheplanentirely\.\-TheAgent’splanwasnotupdateddespitenewinformationinthescene\.\-APARSEFAILEDflagappears\.\-BLOCKEDappearsonconsecutivesteps\-\-\-theagentrepeatedlyattemptedtomoveintothesameobstaclewithoutupdatingitsplan\.Writeonesentenceperflaggedstep\.Alsonotestepswheresomethingwentparticularlywell\-\-\-theDescriptorgaveanunusuallyclearorwell\-prioritisedsummary,ortheAgentrecoveredfromadifficultsituation,updateditsplanappropriately,ornavigatedefficiently\.ThesearecandidatesfortheinsighttrackinStage2\.\*\*Stage2\-\-\-Attribution\*\*Fromtheflaggedsteps,identifythesinglemostimportantfailureorsuccessbehaviour\.Considercross\-episodepatternsifmultipleepisodesareprovided\-\-\-apatternthatrepeatsacrossepisodesismorelikelytobeasystematicpromptfailurethananidiosyncraticone\.Forafailure,ask:\-WastherootcauseintheDescriptor?TheDescriptorgavetheAgentacorruptedorincompleteviewofthescene,andtheAgent’ssubsequentbehaviourisconsistentwiththatcorruptedinput\.\-WastherootcauseintheAgent?TheDescriptorprovidedcorrectandcompleteinformation,buttheAgentmisplanned,selectedawrongaction,orfailedtoupdateitsplanwhenthesituationchanged\.Forasuccess,ask:\-Whatspecificbehaviourcontributedtosuccess?\-Isthisbehaviouralreadyexplicitlyencodedintherelevantmodule’scurrentprompt,orisitemergent\-\-\-somethingtheoptimisershouldencodetomakeitreliable?Skipwhen:\-Thefailureappearstoresultfromtheenvironmentratherthaneithermodule\(e\.g\.thetargetwasnevervisibleacrossthefullepisode\-\-\-noinformationwasavailabletoacton\)\.\-Theflaggedstepsareconsistentwithbothmodulesbeingresponsibleandnoevidencedistinguishesthem\.\-Allepisodessucceededandnoemergentbehaviourstandsoutasworthencoding\.\*\*Stage3\-\-\-Candidates\*\*Yourprimaryattributionisthetop\-rankedcandidate\.IfStage2identifiedadditionalplausiblecandidates,recordtheminADDITIONAL\_CANDIDATES\-\-\-theyarenotdiscardedbutqueuedforthenextmutationcycleiftheprimaryattributionfailsevaluation\.\-\-\-\#\#OutputformatAfteryourstagedreasoning,produceexactlythefollowingblock\.Theparserisstrict\-\-\-matchthefieldnamesanddelimitersexactly\.\-\-\-OUTPUT\-\-\-TYPE:failure\|insight\|skipMODULE:descriptor\|agent\|noneSTEP:<E\{episode\}\.S\{step\}identifier,ornone\>CHANGE\_TYPE:add\|modify\|removeCHARACTERISATION:<REQUIRED\-\-\-donotomitthisfieldforanyoutputtype\.Oneparagraph\.Forfailure:whatwentwrong,atwhichstep,whyyouattributeittothismoduleratherthantheother\.Forinsight:whattheagentdidwellandwhyitisworthencoding\.Forskip:whyattributionwasnotpossible\.\>LOCATION:<Quotetheexactsectionheaderfromthecurrentprompt\(e\.g\."\#\#Planning"\)\.Thenquotethe1\-2linesnearestthechangepointasananchor\.Formodifyorremove,quotetheexactsentenceorparagraphtobechangedordeleted\.Write"none"forskip\.\>SUGGESTED\_CHANGE:<Oneparagraph\.Foradd:theexactnewtexttoinsertatthelocation\.Formodify:quotetheoldtext,thenprovidethereplacement\.Forremove:quotethetexttobedeletedandexplainwhy\.Write"none"forskip\.IMPORTANT\-\-\-architecturalboundary:theDescriptorandAgentarestrictlyseparatedbydesign\.TheDescriptorisapureperceptionmodule:itobservesandreportswhatispresentinthescene\.Itmustneverreasonabouttaskstate,taskcompletion,orwhatactionshouldfollow\.TheAgentisthereasoningmodule:itinterpretsdescriptionsanddecidesactions\.AnySUGGESTED\_CHANGEthatmovesacapabilityacrossthisboundaryisinvalid\.FortheDescriptor:theproposedrulemustdescribewhattoobserveandreport\-\-\-neverwhattoconclude\.Arulecontainingphraseslike"thepick\-upstepiscomplete","themissiongoalhasbeenreached",or"theagentshouldnowdoX"violatesthisboundary\.IfcorrectingthefailurerequirestheDescriptortoreasonabouttaskprogress,thisisasignalthatthefailureactuallybelongstotheAgent\-\-\-revisetheattributionbeforeproposingachange\.FortheDescriptormodulespecifically:SUGGESTED\_CHANGEmustbeageneralbehavioralrule\(e\.g\."alwaysmentionanyobjectdirectly1stepforwardthatblocksmovement"\),neveraverbatimexampleofdescriptoroutputtextfromaspecificstep\.Useonlythetermsthatappearverbatimintheimplicatedmodule’scurrentprompt\.DoNOTusepipeline\-levelwordslike"descriptor","agent","pipeline",or"module"unlessthoseexactwordsalreadyappearinthatmodule’sprompt\.Forexample,iftheAgentisimplicated,donotwrite"ifthedescriptorindicatesX"\-\-\-insteadusetheterminologytheAgentpromptusesforitssceneinput,e\.g\."ifthecurrentdescriptionstatesX"\.\>SKIP\_REASON:ambiguous\_attribution\|clean\_successADDITIONAL\_CANDIDATES:\-MODULE:descriptor\|agent\|STEP:E\{ep\}\.S\{step\}\|none\|CHANGE\_TYPE:add\|modify\|removeLOCATION:<sectionheaderandanchor\-\-\-oneortwolines\>CHARACTERISATION:<onesentence\>SUGGESTED\_CHANGE:<onesentence\>\-\-\-END\_OUTPUT\-\-\-Rules:\-TYPEmustbeexactlyoneof:failure,insight,skip\-MODULEmustbeexactlyoneof:descriptor,agent,none\(usenoneonlyforskip\)\-STEPmustbeanE\{episode\}\.S\{step\}identifierorthewordnone\-CHANGE\_TYPE:add=newinstructionnotpresentanywhere;modify=existinginstructionneedschanging\(quoteit\);remove=aspecificexistinginstructionisharmfulorconflicts\-\-\-quotetheexacttexttodelete\.REMOVEmustalwaystargetaspecificquotedinstructionwithintheprompt\.Itmustnevermeanremovingorblankingtheentiremoduleprompt\.Ifthepromptissominimalthatnospecificinstructioncanbetargeted,outputSkipwithambiguous\_attributioninstead\.\-SKIP\_REASON:ambiguous\_attribution=signalexistsbutattributionisnotpossible;clean\_success=allepisodessucceededandnothingemergenttoencode\.OnlyrequiredwhenTYPEisskip\.\-LOCATION,CHARACTERISATION,andSUGGESTED\_CHANGEmayspanmultiplelines\-CHARACTERISATIONisrequiredforalloutputtypesincludingskip\-\-\-alwayswriteatleastonesentence\-EachADDITIONAL\_CANDIDATESentrymustincludeLOCATION,CHARACTERISATION,andSUGGESTED\_CHANGE\-ADDITIONAL\_CANDIDATESmaybeomittediftherearenosecondarycandidates\-Forskip:MODULE,STEP,CHANGE\_TYPE,LOCATION,SUGGESTED\_CHANGE,andADDITIONAL\_CANDIDATESmaybeomitted;SKIP\_REASONisrequired

Module ablation note\.In module\-ablation runs a\#\# Module Constraintsection is appended after the hereditary context, restricting the BA to propose changes only to the agent module \(agent\-only ablation\) or only to the descriptor module \(descriptor\-only ablation\)\.

##### Mutator Instructions\.

The Mutator’s instruction file: staged reasoning process \(Stages 1–3\), hard constraints \(minimal diff, no cross\-module references, prompt must never be emptied\), and output format\. Shown verbatim\. At runtime the Mutator additionally receives: the environment layer, the*current*target module’s prompt, and the prior mutation history\.

Mutator InstructionsMutator only[⬇](data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kIGZvcm0gdGhpcyBjaGFuZ2UgZW5jb2RlcyDigJQgd3JpdGUgYXMgbXVjaCBhcyBuZWVkZWQsIG5vIGxlbmd0aCBsaW1pdD4KQ09ORkxJQ1RfTk9URTogPG9uZSBzZW50ZW5jZSBpZiB0aGUgYW5jaG9yIHdhcyBpbXByZWNpc2Ugb3IgYSBjb25mbGljdCB3YXMgZm91bmQgYW5kIHJlc29sdmVkOyBvdGhlcndpc2Ugd3JpdGUgIm5vbmUiPgotLS1FTkRfUkFUSU9OQUxFLS0tCgpSdWxlczoKLSBCb3RoIGJsb2NrcyBhcmUgcmVxdWlyZWQuIERvIG5vdCBlbmQgeW91ciByZXNwb25zZSB3aXRob3V0IGJvdGggY2xvc2luZyBkZWxpbWl0ZXJzLgotIFJFVklTRURfUFJPTVBUIG11c3QgYmUgdGhlIGNvbXBsZXRlIHByb21wdCB0ZXh0LCBub3QgYSBwYXRjaCBvciBleGNlcnB0LgotIEFsbCBmb3VyIFJBVElPTkFMRSBmaWVsZHMgYXJlIHJlcXVpcmVkLgotIFNFQ1RJT04gbXVzdCBxdW90ZSBhbiBleGFjdCBzZWN0aW9uIGhlYWRlciBmcm9tIHRoZSBjdXJyZW50IHByb21wdCAoZS5nLiAiIyMgUGxhbm5pbmciKS4KLSBDSEFOR0UgbXVzdCBiZSBleGFjdGx5IG9uZSBzZW50ZW5jZS4KLSBQUklOQ0lQTEUgbWF5IHNwYW4gbXVsdGlwbGUgbGluZXMg4oCUIHdyaXRlIHRoZSBmdWxsIHByaW5jaXBsZSwgbm90IGEgc3VtbWFyeSBvZiBpdC4KLSBDT05GTElDVF9OT1RFIG11c3QgYmUgIm5vbmUiIGlmIG5vdGhpbmcgdW51c3VhbCBvY2N1cnJlZC4=)YouareaPromptMutatorforanLLMagentpipelineoperatinginagrid\-worldenvironment\.YourtaskistoapplyadiagnosisfromtheBehaviourAnalysertoamodule’scurrentprompt,producinganimprovedversionthataddressestheidentifiedfailureorinefficiency\.Eachmutationmustbetraceabletothediagnosisthatmotivatedit\.Aminimal,well\-targetedchangethatiscoherentwiththerestofthepromptisbetterthanasweepingrewrite\.\-\-\-\#\#Whatyoureceive\-\*\*Diagnosis\*\*:themoduleimplicated,thechangetype\(add/modify/remove\),alocationwithinthecurrentprompt\(sectionheaderandanchortext\),acharacterisationofwhatwentwrong,andasuggestedchange\.\-\*\*Environmentlayer\*\*:thephysicalrulesofthegridworld\-\-\-actionspace,observationformat,movementconstraints\.Read\-only\.Usethistoensureanynewinstructiontextyouwriteisconsistentwithwhattheagentcanactuallydo\(e\.g\.thereareexactly7validactions;movementisonestepatatime;"directlyahead"means1stepinthefacingdirection\)\.\-\*\*Currentprompt\*\*:thefulltextoftheimplicatedmodule’sprompt\.Thisiswhatyouwilledit\.\-\*\*Taskcontext\*\*\(ifprovided\):task\-layerinstructionsthatcontextualisethecurrentmissiontype\.Read\-only\-\-\-donotmodifyorreproducetask\-layertextinREVISED\_PROMPT\.\-\*\*Priormutationhistory\*\*\(ifprovided\):arecordofchangespreviouslyappliedtothispromptandtheiroutcomes\.Usethistostaycoherentwithaccumulatededitsandtoavoidrepeatingmutationsthatwerealreadyrejected\.\-\-\-\#\#StagedreasoningprocessWorkthroughthesethreestagesbeforewritingyouroutput\.\*\*Stage1\-\-\-Understandthediagnosis\*\*Readthediagnosisfields:\-CHANGE\_TYPE:‘add‘=insertnewtextthatdoesnotexist;‘modify‘=replaceexistingtext;‘remove‘=deleteexistingtext\.\-CHARACTERISATION:therootcause\.Understanditbeforedecidingwhattowrite\-\-\-thesuggestedchangeisastartingpoint,notnecessarilythefinalform\.\-SUGGESTED\_CHANGE:ifwrittenasmeta\-instruction\("addthefollowingsentenceafter\.\.\."\),extracttheactualtextandapplythat\.Ifwrittenasverbatimreplacement,useitdirectly,adaptingvocabularyifneeded\.\*\*Stage2\-\-\-Locateandcheck\*\*Readthecurrentpromptinfullbeforewritinganything\.\-FindthesectionnamedinLOCATION\(matchthesectionheaderexactly\)\.\-Findtheanchortextwithinthatsection\.For‘modify‘and‘remove‘,theanchoristhetexttoreplaceordelete\.For‘add‘,theanchoristhepointafterwhichtoinsert\-\-\-typicallytheendoftheanchorsentenceortheendofthesection\.\-Iftheanchordoesnotappearverbatiminthecurrentprompt,findtheclosestcontextuallyappropriatelocationandnotethediscrepancyinCONFLICT\_NOTE\.\-Checkwhethertheproposedchangeconflictswithanyexistinginstruction\.Ifitdoes,resolvebothsotheyareconsistent,andnotewhatwasresolvedinCONFLICT\_NOTE\.\-Identifythevocabularythecurrentpromptusesforitsinputs\.FortheAgentpromptthisis"anaturallanguagedescriptionofwhatyoucurrentlysee"\.FortheDescriptorpromptthisis"ascenedescriptionproduceddirectlybytheenvironment"\.Usetheseexactterms\-\-\-orwhatevertermsalreadyappearintheprompt\-\-\-inanynewtextyouwrite\.\-\*\*Cross\-modulereferencesinSUGGESTED\_CHANGE:\*\*Thetwomodulesinthispipeline\-\-\-AgentandDescriptor\-\-\-arearchitecturallyisolated\.TheAgentLLMdoesnotknowaDescriptorexists;itonlyknowsitreceivesanaturallanguagedescription\.TheDescriptorLLMdoesnotknowanAgentexists;itonlyknowsitreceivesarawscenetextandamission\.Becauseofthisisolation,anyinstructioninsertedintoonemodule’spromptthatreferencestheothermodulebynameismeaninglesstotheLLMreadingitatruntime\-\-\-andpotentiallyharmfulifitcausesthemodeltoreasonaboutacomponentithasnoknowledgeof\.TheBehaviourAnalyserthinksaboutthefullpipelineandwillsometimesproduceSUGGESTED\_CHANGEtextthatcontainscross\-modulereferences\(e\.g\."ifthedescriptorindicatesX"inachangetargetingtheAgentprompt\)\.Beforeinsertinganysuchtext,rephraseittoremovethecross\-modulereferencewhilefullypreservingtheintendedmeaning\.Useonlywhatthetargetmoduleknows\.Example:"ifthedescriptorindicatesthetargetis1stepforward"→\\rightarrow"ifthecurrentdescriptionstatesthetargetis1stepforward"\.\*\*Stage3\-\-\-Producethechange\*\*Applythechangewiththeminimummodificationrequired:\-‘modify‘:replacetheanchortextwiththeimprovedversion\.Keepeverythingelseinthesectionidentical\.\-‘add‘:insertthenewtextaftertheanchor\.Donotaltersurroundingtextunlessaconflictrequiresit\.\-‘remove‘:deletetheanchortext\.Adjustwhitespaceorpunctuationifneededforreadability,butchangenothingelse\.Whenchoosingthescopeofgeneralisation:\-Asingle\-stepfailureinthediagnosissupportsaspecific,narrowly\-scopedrule\.\-Across\-episodepatternsupportsabroaderprinciplethatcoversthepattern\.\-DonotgeneralisebeyondwhatthetrajectoryevidenceinCHARACTERISATIONexplicitlysupports\.Donotintroducerulesthatapplytotaskfamiliesorscenariosnotmentionedinthediagnosis\.Writenewtextinthesamevoiceandstyleasthesurroundingprompt\.\-\-\-\#\#Hardconstraints\-\*\*Minimaldiff\*\*:everychangedwordmusttracetothediagnosis\.Ifsomethingelselookswrong,leaveit\-\-\-itisoutsidescopeforthiscycle\.\-\*\*Completetext\*\*:REVISED\_PROMPTmustcontainthefullprompt\-\-\-allsections,includingunchangedones\.Donottruncate,elide,orreplaceunchangedsectionswithcommentslike"\.\.\.\(restunchanged\)\.\.\."\.Theblockwillbewrittendirectlytoafile\.\-\*\*Neverproduceanemptyprompt\*\*:REVISED\_PROMPTmustneverbeblankornear\-blank\.IfapplyingaREMOVEwoulddeletetheentirepromptcontent,donotapplyit\.Instead,writeaCONFLICT\_NOTEexplainingthattheremovalwoulddestroytheentireprompt,andproducethecurrentpromptunchanged\.Afunctioningprompt\-\-\-evenaflawedone\-\-\-isalwaysbetterthannoprompt\.\-\*\*Nometa\-commentaryinREVISED\_PROMPT\*\*:theblockcontainsonlytheprompttextitself\.Noheadings,noexplanatorysentences,no"hereistherevisedprompt:"\.\-\*\*Nocross\-modulereferencesinnewtext\*\*:theAgentandDescriptordonotknowabouteachother’sexistence\.Neverinserttextintoonemodule’spromptthatnamesorreferencestheothermodule\.IfSUGGESTED\_CHANGEcontainssuchareference,rephraseitbeforeinserting\-\-\-themeaningmustbepreserved,onlythereferenceisremoved\.\-\-\-\#\#OutputformatAfteryourstagedreasoning,produceexactlythefollowingtwoblocks\.Theparserisstrict\-\-\-matchthedelimitersexactly\.\-\-\-REVISED\_PROMPT\-\-\-<completerevisedprompttext\-\-\-verbatimexceptfortheappliedchange\>\-\-\-END\_REVISED\_PROMPT\-\-\-\-\-\-RATIONALE\-\-\-SECTION:<exactsectionheaderthatwasedited,e\.g\."\#\#Planning"\>CHANGE:<onesentence\-\-\-whatwasadded,modified,orremovedandwhere\>PRINCIPLE:<thegeneralisedformthischangeencodes\-\-\-writeasmuchasneeded,nolengthlimit\>CONFLICT\_NOTE:<onesentenceiftheanchorwasimpreciseoraconflictwasfoundandresolved;otherwisewrite"none"\>\-\-\-END\_RATIONALE\-\-\-Rules:\-Bothblocksarerequired\.Donotendyourresponsewithoutbothclosingdelimiters\.\-REVISED\_PROMPTmustbethecompleteprompttext,notapatchorexcerpt\.\-AllfourRATIONALEfieldsarerequired\.\-SECTIONmustquoteanexactsectionheaderfromthecurrentprompt\(e\.g\."\#\#Planning"\)\.\-CHANGEmustbeexactlyonesentence\.\-PRINCIPLEmayspanmultiplelines\-\-\-writethefullprinciple,notasummaryofit\.\-CONFLICT\_NOTEmustbe"none"ifnothingunusualoccurred\.

## Appendix DSelected Examples of Changes to Mutated Prompts

### D\.1An Analysis of How Thresholding Impacts the Performance on PutNext: Analysis for SPA

All diffs in this section use inline highlighting to annotate semantic categories \(\+added,\-removed;GOOD= addresses a diagnosed failure mode;CONFLICT= creates a risk or contradicts an existing rule;STRUCT= format or structure change, not reasoning;SYNTH= generated from scratch\)\. Noise lines such as reflowed text with no logical change are left unmarked\.

In this section, we look at the exact changes that were made to the non optimised prompts that resulted in the best overall score for thePutNexttask\. The gated run accepts exactly one mutation across 20 cycles\. The entire jump from near\-zero to72\.5%72\.5\\%traces to a single block added to the Planning section \(Box[D\.1](https://arxiv.org/html/2606.17838#A4.SS1)\)\.

The addition encodes drop geometry\. PutNext requires placing object A adjacent to object B\. The drop action deposits the held object onto the tile directly in front of the agent, so approaching B head\-on places A on top of B rather than beside it\. The BA identified this from failure trajectories and encoded the constraint explicitly: position yourself so the empty cell in front is adjacent to B, not B itself\. There was no counterpart to this rule anywhere in the original prompt\. The selection mechanism accepted it on the first valid candidate\.

Low selection Pressure / Guided prompt /δ=0\.05\\delta=0\.0572\.5% SR[⬇](data:text/plain;base64,QEAgLTU0LDggKzU0LDE3IEBACiAjIyBQbGFubmluZwoKIE1haW50YWluIGEgc2hvcnQgcGxhbiBhbmQgdXBkYXRlIGl0IGVhY2ggdHVybi4gQ29uc2lkZXIgdGhlIHByZXZpb3VzIHBsYW4gYWxvbmdzaWRlCiB0aGUgY3VycmVudCBvYnNlcnZhdGlvbiAoYmxvY2thZ2VzLCB3YWxscywgb2JqZWN0cykuIElmIHRoZSBwbGFuIGlzIG5vIGxvbmdlciB2YWxpZCwKIHJldmlzZSBpdCB0byBhdm9pZCBsb29wcy4gVGhpbmsgYWJvdXQgdGhlIGZ1bGwgcGF0aCwgbm90IGp1c3QgdGhlIHNob3J0ZXN0IGRpc3RhbmNlLgoKLVNpbmNlIHlvdSB3aWxsIG9ubHkgYmUgYWxsb3dlZCB0byBwZXJmb3JtIG9uZSBhY3Rpb24gcGVyIHN0ZXAsIGNvbnNpZGVyIGZyb20gdGhlIHBhc3QgYWN0aW9uIHRoYXQgeW91IG1heSBhbHJlYWR5IGhhdmUgZXhlY3V0ZWQgYSBzdGVwIHRoYXQgeW91IGludGVuZCB0byB1c2Ugbm93LCByZXBlYXRpbmcgaXQgY291bGQgYWx0ZXIgeW91ciB0cmFqZWN0b3J5LiBUaGUgY3VycmVudCBwbGFuIGhpZ2hsaWdodHMgdGhlIHBsYW4geW91IGRlY2lkZWQgb24gaW4gdGhlIHByZXZpb3VzIHN0ZXAsIGFuZCB0aGlzIG1pZ2h0IG5vdCBob2xkIGdpdmVuIHRoZSBuZXcgb2JzZXJ2YXRpb25zIHlvdSByZWNlaXZlZC4gQXMgc3VjaCwgY29uc2lkZXIgYm90aCB5b3VyIHByZXZpb3VzIHN0ZXAncyBhY3Rpb24g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jZWxscyBhd2F5IGFuZCBmYWNpbmcgdG93YXJkcyBpdCwKCitzbyB0aGF0IHRoZSBjZWxsIGRpcmVjdGx5IGluIGZyb250IGlzIGVtcHR5IGFuZCB0aGUgdGFyZ2V0IGlzIGFkamFjZW50IHRvIHRoYXQgY2VsbC4gPEdPT0QhPgoKCgogRm9ybWF0IHlvdXIgYW5zd2VyIGFzOgoKIFBMQU46IDx5b3VyIHBsYW4sIG9yICJObyBjaGFuZ2VzLiIgaWYgdW5jaGFuZ2VkPgoKLUFDVElPTjogPG9uZSBvZjogdHVybiBsZWZ0LCB0dXJuIHJpZ2h0LCBnbyBmb3J3YXJkLCBwaWNrIHVwLCBkcm9wLCB0b2dnbGU+CgorQUNUSU9OOiA8b25lIG9mOiB0dXJuIGxlZnQsIHR1cm4gcmlnaHQsIGdvIGZvcndhcmQsIHBpY2sgdXAsIGRyb3AsIHRvZ2dsZT4=)\#\#PlanningMaintainashortplanandupdateiteachturn\.Considerthepreviousplanalongsidethecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.\-Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthepastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow,repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyoudecidedoninthepreviousstep,andthismightnotholdgiventhenewobservationsyoureceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrentplan,whichyouthenwillgeneratethenewplanfrom\.\+Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthe\+pastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow,\+repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyou\+decidedoninthepreviousstep,andthismightnotholdgiventhenewobservations\+youreceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrent\+plan,whichyouthenwillgeneratethenewplanfrom\.<\!GOOD\>Whenyoudropanobject,\+usethe’drop’actiononlywhenyouareadjacenttothetargetobject\.Youmay\+onlydropanobjectifthespacedirectlyinfrontofyouisempty\.Whencarrying\+anobject,onlydropwhenthetargetistwocellsawayandfacingtowardsit,\+sothatthecelldirectlyinfrontisemptyandthetargetisadjacenttothatcell\.<GOOD\!\>Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>\-ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>

##### Post Hoc, Best Selection Pool Performer

The always\-accept run reaches70\.0%70\.0\\%at its best selection pool checkpoint through a mutation that arrives at the same spatial insight, expressed differently \(Box[D\.1](https://arxiv.org/html/2606.17838#A4.SS1.SSS0.Px1)\)\.

The original Planning paragraph is reflowed onto a single line, which is formatting noise\. The substantive content is one sentence appended at the end: move to a position adjacent to the target but not directly facing it, so the drop places the object onto the empty tile in front, which is adjacent to the target\.

Comparing the two diffs is instructive\. Both encode the same underlying rule, but the gated version describes it in terms of distances and the always\-accept version describes it in terms of facing direction\. Two independently sampled failure episodes produced two formulations of the same constraint\. Both cleared the gate equivalent they were evaluated against\.

Guided prompt/δ=−∞\\delta=\-\\infty/ Post Hoc best incumbent70\.0% SR[⬇](data:text/plain;base64,CiAjIyBQbGFubmluZwotTWFpbnRhaW4gYSBzaG9ydCBwbGFuIGFuZCB1cGRhdGUgaXQgZWFjaCB0dXJuLiBDb25zaWRlciB0aGUgcHJldmlvdXMgcGxhbiBhbG9uZ3NpZGUKLXRoZSBjdXJyZW50IG9ic2VydmF0aW9uIChibG9ja2FnZXMsIHdhbGxzLCBvYmplY3RzKS4gSWYgdGhlIHBsYW4gaXMgbm8gbG9uZ2VyIHZhbGlkLAotcmV2aXNlIGl0IHRvIGF2b2lkIGxvb3BzLiBUaGluayBhYm91dCB0aGUgZnVsbCBwYXRoLCBub3QganVzdCB0aGUgc2hvcnRlc3QgZGlzdGFuY2UuCi1TaW5jZSB5b3Ugd2lsbCBvbmx5IGJlIGFsbG93ZWQg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B0byBtb3ZlIHRvIGEgcG9zaXRpb24gYWRqYWNlbnQgdG8gdGhlIHRhcmdldCAod2l0aCB0aGUgdGFyZ2V0IG5vdCBkaXJlY3RseSBpbiBmcm9udCBvZiB0aGUgYWdlbnQpLCBlbnN1cmluZyB0aGF0IHRoZSBhZ2VudCBpcyBub3QgZmFjaW5nIHRoZSB0YXJnZXQgd2hlbiBwZXJmb3JtaW5nIGEgZHJvcCBhY3Rpb247IHRoZSBkcm9wIGFjdGlvbiB3aWxsIHRoZW4gcGxhY2UgdGhlIG9iamVjdCBvbnRvIHRoZSB0aWxlIGRpcmVjdGx5IGluIGZyb250LCB3aGljaCBzaG91bGQgYmUgYW4gZW1wdHkgdGlsZSBhZGphY2VudCB0byB0aGUgdGFyZ2V0LiA8R09PRCE+CgogRm9ybWF0IHlvdXIgYW5zd2VyIGFzOgogUExBTjogPHlvdXIgcGxhbiwgb3IgIk5vIGNoYW5nZXMuIiBpZiB1bmNoYW5nZWQ+Ci1BQ1RJT046IDxvbmUgb2Y6IHR1cm4gbGVmdCwgdHVybiByaWdodCwgZ28gZm9yd2FyZCwgcGljayB1cCwgZHJvcCwgdG9nZ2xlPgorQUNUSU9OOiA8b25lIG9mOiB0dXJuIGxlZnQsIHR1cm4gcmlnaHQsIGdvIGZvcndhcmQsIHBpY2sgdXAsIGRyb3AsIHRvZ2dsZT4=)\#\#Planning\-thecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,\-reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.\-Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthepastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow,repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyoudecidedoninthepreviousstep,andthismightnotholdgiventhenewobservationsyoureceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrentplan,whichyouthenwillgeneratethenewplanfrom\.\+Maintainashortplanandupdateiteachturn\.Considerthepreviousplanalongsidethecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.<\!GOOD\>Ifthetargetisvisiblebutnotadjacent,theagentshouldgenerateasequenceofactionstomovetoapositionadjacenttothetarget\(withthetargetnotdirectlyinfrontoftheagent\),ensuringthattheagentisnotfacingthetargetwhenperformingadropaction;thedropactionwillthenplacetheobjectontothetiledirectlyinfront,whichshouldbeanemptytileadjacenttothetarget\.<GOOD\!\>Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>\-ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>

##### End\-of\-Round Incumbent, Without Gating

This diff shows what the optimizer added after the70\.0%70\.0\\%checkpoint \(Box[D\.1](https://arxiv.org/html/2606.17838#A4.SS1.SSS0.Px2)\)\. The collapse is explained by two consecutive sentences that directly contradict each other\.

The first states that the agent must drop only when it is directly facing the target\. The second states that if the agent is facing the target, it must turn away before dropping\. These two instructions cannot both be satisfied simultaneously\. The good rule from the diff in Box[D\.1](https://arxiv.org/html/2606.17838#A4.SS1.SSS0.Px1), which said not to face the target when dropping, has been replaced by a rule that oscillates in both directions within the same paragraph\.

The optimizer had no mechanism to detect the degradation\. Its hereditary history recorded every previous candidate as accepted, so it continued mutating\. This is the clearest example in the dataset of why the acceptance gate is necessary\. The gate is not only a quality filter on individual candidates\. It is the only signal that tells the optimizer when to stop\.

Guided prompt /δ=−∞\\delta=\-\\infty/ End of optimisation Incumbent8\.3% SR[⬇](data:text/plain;base64,LS0tIGFhX2Jlc3RfdF9yaWNoX3B1dG5leHQKKysrIGFhX2VuZF9vZl9ydW5fcmljaF9wdXRuZXh0CkBAIC01MSw4ICs1MSw3IEBACiBUaGUgb25seSBhY3Rpb24gdGhhdCBtb3ZlcyB5b3UgaXMgImdvIGZvcndhcmQiLgoKCgogIyMgUGxhbm5pbmcKCi1NYWludGFpbiBhIHNob3J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\-51,8\+51,7@@Theonlyactionthatmovesyouis"goforward"\.\#\#Planning\-Maintainashortplanandupdateiteachturn\.Considerthepreviousplanalongsidethecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.Ifthetargetisvisiblebutnotadjacent,theagentshouldgenerateasequenceofactionstomovetoapositionadjacenttothetarget\(withthetargetnotdirectlyinfrontoftheagent\),ensuringthattheagentisnotfacingthetargetwhenperformingadropaction;thedropactionwillthenplacetheobjectontothetiledirectlyinfront,whichshouldbeanemptytileadjacenttothetarget\.\-\-Formatyouransweras:\+Maintainashortplanandupdateiteachturn\.Considerthepreviousplanalongsidethecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.Ifthetargetisvisiblebutnotadjacent,theagentshouldgenerateasequenceofactionstomovetoapositionadjacenttothetarget\(withthetargetnotdirectlyinfrontoftheagent\)\.Ifthecurrentdescriptionindicatesthatforwardmovementisblocked,theagentshouldfirstturnleftorrightbeforeattemptingtomoveforward\.Iftheplancontainsa‘drop‘action,<\!CONFLICT\>theagentmustonlyexecutethedropwhenthetargetobjectisadjacent\(1stepaway\)andtheagentisdirectlyfacingit\.<CONFLICT\!\>Iftheagentiscarryinganobject,itmustnotissuea‘pickup‘actionuntilithasdroppedtheobject\.Iftheplancontainsa‘drop‘action,theagentmustonlyexecutethedropwhenthetargetobjectisadjacent\(1stepaway\)andtheagentisdirectlyfacingit\.<\!CONFLICT\>Ifthetargetisadjacentbuttheagentisfacingit,theagentmustfirstturnleftorrightbeforedropping\.<CONFLICT\!\>Ifthetargetisnotadjacentornotvisible,theagentmustignorethedropactionandgenerateanewplantomoveadjacenttothetarget\.IfthemissionistoputXnexttoY,theagentmustnotissueapickupactionforYunlessitisalreadycarryingY\.Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>\-ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+\-\-\-END\_PROMPT\-\-\-

### D\.2Other Qualitatively Analysed Mutations

Diff box[D\.2](https://arxiv.org/html/2606.17838#A4.SS2)shows one change to the Planning section in which two rules were appended at the end of the existing paragraph\.

The first covers key\-door interactions\. If the agent has the matching key and the door is one step ahead it must toggle, with no pickup step remaining in the plan\. If it does not have the key yet it must pick it up first\. The second change covers blocked movement: if any forward action in the plan would be blocked, it must be removed and replaced it with a turn\. The two rules appear in this order because the first may put a forward step toward the door into the plan, and the second then validates it before the plan is committed\.

High Selection Pressure / Guided prompt /δ=0\.05\\delta=0\.05/ TaskOpen[⬇](data:text/plain;base64,CiAjIyBQbGFubmluZwotTWFpbnRhaW4gYSBzaG9ydCBwbGFuIGFuZCB1cGRhdGUgaXQgZWFjaCB0dXJuLiBDb25zaWRlciB0aGUgcHJldmlvdXMgcGxhbiBhbG9uZ3NpZGUKLXRoZSBjdXJyZW50IG9ic2VydmF0aW9uIChibG9ja2FnZXMsIHdhbGxzLCBvYmplY3RzKS4gSWYgdGhlIHBsYW4gaXMgbm8gbG9uZ2VyIHZhbGlkLAotcmV2aXNlIGl0IHRvIGF2b2lkIGxvb3BzLiBUaGluayBhYm91dCB0aGUgZnVsbCBwYXRoLCBub3QganVzdCB0aGUgc2hvcnRlc3QgZGlzdGFuY2UuCi1TaW5jZSB5b3Ugd2lsbCBvbmx5IGJlIGFsbG93ZWQgdG8gcGVyZm9ybSBvbmUgYWN0aW9uIHBlciBzdGVwLCBjb25zaWRlciBmcm9tIHRoZSBwYXN0IGFjdGlvbiB0aGF0IHlvdSBtYXkgYWxyZWFkeSBoYXZlIGV4ZWN1dGVkIGEgc3RlcCB0aGF0IHlvdSBpbnRlbmQgdG8gdXNlIG5vdywgcmVwZWF0aW5nIGl0IGNvdWxkIGFsdGVyIHlvdXIgdHJhamVjdG9yeS4gVGhlIGN1cnJlbnQgcGxhbiBoaWdobGlna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ZW1lbnQgaXMgYmxvY2tlZCAoYnkgYSB3YWxsLCBkb29yLCBvciBvYmplY3QpLCByZW1vdmUgdGhhdCAiZ28gZm9yd2FyZCIgYWN0aW9uIGFuZCByZXBsYWNlIGl0IHdpdGggYSB0dXJuIGFjdGlvbiAocHJlZmVyYWJseSB0dXJuaW5nIGxlZnQgb3IgcmlnaHQgdG8gY2lyY3VtdmVudCB0aGUgb2JzdGFjbGUpLiA8R09PRCE+CgpGb3JtYXQgeW91ciBhbnN3ZXIgYXM6ClBMQU46IDx5b3VyIHBsYW4sIG9yICJObyBjaGFuZ2VzLiIgaWYgdW5jaGFuZ2VkPgotQUNUSU9OOiA8b25lIG9mOiB0dXJuIGxlZnQsIHR1cm4gcmlnaHQsIGdvIGZvcndhcmQsIHBpY2sgdXAsIGRyb3AsIHRvZ2dsZT4KK0FDVElPTjogPG9uZSBvZjogdHVybiBsZWZ0LCB0dXJuIHJpZ2h0LCBnbyBmb3J3YXJkLCBwaWNrIHVwLCBkcm9wLCB0b2dnbGU+)\#\#Planning\-thecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,\-reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.\-Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthepastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow,repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyoudecidedoninthepreviousstep,andthismightnotholdgiventhenewobservationsyoureceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrentplan,whichyouthenwillgeneratethenewplanfrom\.\+Maintainashortplanandupdateiteachturn\.Considerthepreviousplanalongsidethecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthepastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow;repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyoudecidedoninthepreviousstep,andthismightnotholdgiventhenewobservationsyoureceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrentplan,whichyouthenwillgeneratethenewplanfrom\.\+<\!GOOD\>Additionally,whenencounteringalockeddoor,handlekey\-doorinteractionsexplicitly:ifthedescriptionreportsalockeddoorandyouarecarryingakeyofthesamecolor,thenwhenthedooris1stepahead,thenextactionshouldbe"toggle"andno"pickup"stepshouldremainforthatkeyintheplan\.Ifthedescriptionreportsalockeddoorandyouarenotcarryingamatchingkey,includea"pickup"stepforthatkeybeforemovingtowardthedoorandtogglewhenitis1stepahead\.Aftergeneratingthenewplan,ifanyactionintheplanis"goforward"butthedescriptionindicatesthatforwardmovementisblocked\(byawall,door,orobject\),removethat"goforward"actionandreplaceitwithaturnaction\(preferablyturningleftorrighttocircumventtheobstacle\)\.<GOOD\!\>Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>\-ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>

We see in box[D\.2](https://arxiv.org/html/2606.17838#A4.SS2), one sentence added to the Planning section\. Before executing a movement action, the agent must check that the path ahead is clear\. If it is blocked, it must update the plan to avoid that move and re\-evaluate each step\. The change is specific to failures during the navigation phase of PickUp\-GoTo episodes, where the agent had already picked up the first object and then walked into a blocked cell\. The rest of the guided prompt already handles everything else\.

Low Selection Pressure / Guided prompt /δ=0\.02\\delta=0\.02/ TaskPickUpSeqGoTo[⬇](data:text/plain;base64,IHRoZSBjdXJyZW50IG9ic2VydmF0aW9uIChibG9ja2FnZXMsIHdhbGxzLCBvYmplY3RzKS4gSWYgdGhlIHBsYW4gaXMgbm8gbG9uZ2VyIHZhbGlkLAogcmV2aXNlIGl0IHRvIGF2b2lkIGxvb3BzLiBUaGluayBhYm91dCB0aGUgZnVsbCBwYXRoLCBub3QganVzdCB0aGUgc2hvcnRlc3QgZGlzdGFuY2UuCi1TaW5jZSB5b3Ugd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3lvdSByZWNlaXZlZC4gQXMgc3VjaCwgY29uc2lkZXIgYm90aCB5b3VyIHByZXZpb3VzIHN0ZXAncyBhY3Rpb24gYW5kIHRoZSBjdXJyZW50CitwbGFuLCB3aGljaCB5b3UgdGhlbiB3aWxsIGdlbmVyYXRlIHRoZSBuZXcgcGxhbiBmcm9tLgo8IUdPT0Q+QmVmb3JlIGV4ZWN1dGluZyBhIG1vdmVtZW50IGFjdGlvbiwgY2hlY2sgdGhlIGRlc2NyaXB0aW9uIHRvIGVuc3VyZSB0aGF0IHRoZSB0YXJnZXQgY2VsbCBpbiB0aGF0IGRpcmVjdGlvbiBpcyBjbGVhci4gSWYgaXQgaXMgYmxvY2tlZCwgdXBkYXRlIHRoZSBwbGFuIHRvIGF2b2lkIHRoYXQgbW92ZSAoZS5nLiwgdHVybiBvciB0YWtlIGFuIGFsdGVybmF0ZSByb3V0ZSkgYW5kIHJl4oCRZXZhbHVhdGUgdGhlIHBsYW4gZWFjaCBzdGVwLjxHT09EIT4KCiBGb3JtYXQgeW91ciBhbnN3ZXIgYXM6CiBQTEFOOiA8eW91ciBwbGFuLCBvciAiTm8gY2hhbmdlcy4iIGlmIHVuY2hhbmdlZD4KLUFDVElPTjogPG9uZSBvZjogdHVybiBsZWZ0LCB0dXJuIHJpZ2h0LCBnbyBmb3J3YXJkLCBwaWNrIHVwLCBkcm9wLCB0b2dnbGU+CitBQ1RJT046IDxvbmUgb2Y6IHR1cm4gbGVmdCwgdHVybiByaWdodCwgZ28gZm9yd2FyZCwgcGljayB1cCwgZHJvcCwgdG9nZ2xlPg==)thecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.\+Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthe\+pastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow,\+repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyou\+decidedoninthepreviousstep,andthismightnotholdgiventhenewobservations\+youreceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrent\+plan,whichyouthenwillgeneratethenewplanfrom\.<\!GOOD\>Beforeexecutingamovementaction,checkthedescriptiontoensurethatthetargetcellinthatdirectionisclear\.Ifitisblocked,updatetheplantoavoidthatmove\(e\.g\.,turnortakeanalternateroute\)andre\-evaluatetheplaneachstep\.<GOOD\!\>Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>\-ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>

We see in box[D\.2](https://arxiv.org/html/2606.17838#A4.SS2), three separate hunks across the prompt, the first two adding targeted improvements and the third introducing a problematic rule alongside a structural change\.

The first hunk adds one rule at the top of the prompt: if the target is directly ahead and the agent is not carrying anything, it must pick it up\. The second hunk extends the Exploration rule so that any non\-target object counts as a blocking obstacle, not only walls\.

The third hunk modifies the Planning section and the FORMAT block\. The Planning section gains a rule that the agent must drop whatever it is carrying before any other action, regardless of the target’s visibility\. For a PickUp task this causes a problem: the agent picks up the target, this rule fires, and it drops it again\. The intended version would apply only when the agent is carrying a non\-target object\. The pickup trigger from the first hunk is also duplicated here verbatim\. The FORMAT block is collapsed from three lines onto one, with an extra constraint about trailing characters appended\.

Guided prompt /δ=−∞\\delta=\-\\infty/ Post\-Hoc Best incumbent / TaskPickUpUnconstrained accumulation[⬇](data:text/plain;base64,IC0gVGhlIG1pc3Npb24geW91IG11c3QgY29tcGxldGUuCiAtIEEgbmF0dXJhbCBsYW5ndWFnZSBkZXNjcmlwdGlvbiBvZiB3aGF0IHlvdSBjdXJyZW50bHkgc2VlLgorCis8IUdPT0Q+SWYgdGhlIGN1cnJlbnQgZGVzY3JpcHRpb24gc3RhdGVzIHRoYXQgdGhlIHRhcmdldCBpcyBkaXJlY3RseSBhaGVhZCBhbmQgeW91IGFyZSBub3QgY2FycnlpbmcgYW4gb2JqZWN0LCB0aGUgbmV4dCBhY3Rp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dGhlIG5leHQgYWN0aW9uIHNob3VsZCBiZSBwaWNrIHVwLgorSWYgdGhlIGN1cnJlbnQgZGVzY3JpcHRpb24gc3RhdGVzIHRoYXQgdGhlIHRhcmdldCBpcyBub3QgZGlyZWN0bHkgYWhlYWQgYW5kIGZvcndhcmQgbW92ZW1lbnQgaXMgbm90IGJsb2NrZWQsIHRoZSBuZXh0IGFjdGlvbiBzaG91bGQgYmUgZ28gZm9yd2FyZDsgb3RoZXJ3aXNlLCBpZiBmb3J3YXJkIGlzIGJsb2NrZWQsIHRoZSBhZ2VudCBzaG91bGQgdHVybiBsZWZ0IG9yIHJpZ2h0LgoKLUZvcm1hdCB5b3VyIGFuc3dlciBhczoKLVBMQU46IDx5b3VyIHBsYW4sIG9yICJObyBjaGFuZ2VzLiIgaWYgdW5jaGFuZ2VkPgotQUNUSU9OOiA8b25lIG9mOiB0dXJuIGxlZnQsIHR1cm4gcmlnaHQsIGdvIGZvcndhcmQsIHBpY2sgdXAsIGRyb3AsIHRvZ2dsZT4KKyBGb3JtYXQgeW91ciBhbnN3ZXIgYXM6IFBMQU46IDx5b3VyIHBsYW4sIG9yICJObyBjaGFuZ2VzLiIgaWYgdW5jaGFuZ2VkPgoKPCFTVFJVQ1Q+IEFDVElPTjogPG9uZSBvZjogdHVybiBsZWZ0LCB0dXJuIHJpZ2h0LCBnbyBmb3J3YXJkLCBwaWNrIHVwLCBkcm9wLCB0b2dnbGU+IC0tLSB0aGUgYWN0aW9uIGxpbmUgbXVzdCBjb250YWluIG9ubHkgdGhlIGFjdGlvbiBuYW1lLCB3aXRoIG5vIHRyYWlsaW5nIHNwYWNlcyBvciBhZGRpdGlvbmFsIGNoYXJhY3RlcnMuIDxTVFJVQ1QhPg==)\-Anaturallanguagedescriptionofwhatyoucurrentlysee\.\+\+<\!GOOD\>Ifthecurrentdescriptionstatesthatthetargetisdirectlyaheadandyouarenotcarryinganobject,thenextactionshouldbepickup\.<GOOD\!\>Allpositionsintheobservation\(forward,left,right\)arerelativetoyourcurrentfacingdirection\-\-\-"1stepforward"alwaysmeansonestepinthedirectionyouare@@\-34,7\+36,7@@\#\#ExplorationWhenthetargetisnotvisible,considerturninginalldirectionstoscanyour\-surroundings\.Ifyourpathisblockedbyawall,turnandtryadifferentdirection\.\+surroundings\.Ifyourpathisblockedbyawall<\!GOOD\>oranyobjectthatisnotthetarget,turnandtryadifferentdirection\.<GOOD\!\>\#\#ActionsetThereareexactly7validactions:@@\-51,11\+53,9@@Theonlyactionthatmovesyouis"goforward"\.\#\#Planning\-Maintainashortplanandupdateiteachturn\.Considerthepreviousplanalongside\-thecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,\-reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.\-Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthepastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow,repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyoudecidedoninthepreviousstep,andthismightnotholdgiventhenewobservationsyoureceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrentplan,whichyouthenwillgeneratethenewplanfrom\.\+Maintainashortplanandupdateiteachturn\.Considerthepreviousplanalongsidethecurrentobservation\(blockages,walls,objects\)\.Iftheplanisnolongervalid,reviseittoavoidloops\.Thinkaboutthefullpath,notjusttheshortestdistance\.Sinceyouwillonlybeallowedtoperformoneactionperstep,considerfromthepastactionthatyoumayalreadyhaveexecutedastepthatyouintendtousenow;repeatingitcouldalteryourtrajectory\.Thecurrentplanhighlightstheplanyoudecidedoninthepreviousstep,andthismightnotholdgiventhenewobservationsyoureceived\.Assuch,considerbothyourpreviousstep’sactionandthecurrentplan,whichyouthenwillgeneratethenewplanfrom\.\+<\!CONFLICT\>Ifyouarecarryinganobject,thenextactionmustbedropbeforeanyotheraction,regardlessofthetargetsvisibility\.<CONFLICT\!\>\+Ifthecurrentdescriptionstatesthatthetargetisdirectlyaheadandyouarenotcarryinganobject,thenextactionshouldbepickup\.\+Ifthecurrentdescriptionstatesthatthetargetisnotdirectlyaheadandforwardmovementisnotblocked,thenextactionshouldbegoforward;otherwise,ifforwardisblocked,theagentshouldturnleftorright\.\-Formatyouransweras:\-PLAN:<yourplan,or"Nochanges\."ifunchanged\>\-ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\><\!STRUCT\>ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\-\-\-theactionlinemustcontainonlytheactionname,withnotrailingspacesoradditionalcharacters\.<STRUCT\!\>

We see in box[D\.2](https://arxiv.org/html/2606.17838#A4.SS2), three bullets added to the Tips section, which is the only available anchor in the plain prompt\.

The first states that the agent must not attempt to toggle when no door is visible and must instead continue exploring\. The second states that when in front of the door with the correct key, it must toggle\. The third states that when facing a locked door with the matching key, it must add a toggle to its plan and execute it immediately\. The third is a stricter version of the second rather than a separate rule: both address the same situation, but the third specifies the door must be locked and the action must be planned rather than simply performed\.

This diff covers the same task as in Box[D\.1](https://arxiv.org/html/2606.17838#A4.SS1), but on the plain prompt\. There, the change slotted into an existing Planning section that already had prior task knowledge in place\. Here there is no such structure, and the BA adds the task knowledge wholesale to the only section available\.

Always\-accept best\-T, plain, Open[⬇](data:text/plain;base64,IC0gUmVhZCB0aGUgbWlzc2lvbiBjYXJlZnVsbHkgLS0tIHRoZSByZXF1aXJlZCBmaW5hbCBhY3Rpb24gZGVwZW5kcyBvbiB3aGF0IHRoZSBtaXNzaW9uIGFza3MgeW91IHRvIGRvLgogLSBJdCBkb2VzIG5vdCBtYWtlIHNlbnNlIHRvIHJlcGVhdCB0aGUgc2FtZSBhY3Rpb24gaWYgdGhlIG9ic2VydmF0aW9uIGRvZXMgbm90IGNoYW5nZS4KKy0KPCFTWU5USD5JZiB0aGUgY3VycmVudCBvYnNlcnZhdGlvbiBpbmRpY2F0ZXMgdGhhdCBubyBkb29yIGlzIHByZXNlbnQsIGRvIG5vdCBhdHRlbXB0IHRvIHRvZ2dsZSBhbmQgaW5zdGVhZCBjb250aW51ZSBleHBsb3JpbmcgKGUuZy4sIHR1cm4gb3IgbW92ZSBmb3J3YXJkKS48U1lOVEghPgorLQo8IVNZTlRIPiBJZiB5b3UgaGF2ZSB0aGUgY29ycmVjdCBrZXkgZm9yIHRoZSBkb29yLCB0b2dnbGUgdGhlIGRvb3Igd2hlbiB5b3UgYXJlIGluIGZyb250IG9mIGl0LjxTWU5USCE+CistCjwhU1lOVEg+SWYgdGhlIGN1cnJlbnQgb2JzZXJ2YXRpb24gaW5kaWNhdGVzIGEgbG9ja2VkIGRvb3IgYW5kIHlvdSBhcmUgZmFjaW5nIGl0IHdpdGggdGhlIG1hdGNoaW5nIGtleSwgYWRkIGEgdG9nZ2xlIGFjdGlvbiB0byB5b3VyIHBsYW4gYW5kIGV4ZWN1dGUgaXQgaW1tZWRpYXRlbHkuPFNZTlRIIT4KCiBGb3JtYXQgeW91ciBhbnN3ZXIgYXM6CiBQTEFOOiA8eW91ciBwbGFuLCBvciAiTm8gY2hhbmdlcy4iIGlmIHVuY2hhbmdlZD4KLUFDVElPTjogPG9uZSBvZjogdHVybiBsZWZ0LCB0dXJuIHJpZ2h0LCBnbyBmb3J3YXJkLCBwaWNrIHVwLCBkcm9wLCB0b2dnbGU+CitBQ1RJT046IDxvbmUgb2Y6IHR1cm4gbGVmdCwgdHVybiByaWdodCwgZ28gZm9yd2FyZCwgcGljayB1cCwgZHJvcCwgdG9nZ2xlPg==)\-Itdoesnotmakesensetorepeatthesameactioniftheobservationdoesnotchange\.\+\-<\!SYNTH\>Ifthecurrentobservationindicatesthatnodoorispresent,donotattempttotoggleandinsteadcontinueexploring\(e\.g\.,turnormoveforward\)\.<SYNTH\!\>\+\-<\!SYNTH\>Ifyouhavethecorrectkeyforthedoor,togglethedoorwhenyouareinfrontofit\.<SYNTH\!\>\+\-<\!SYNTH\>Ifthecurrentobservationindicatesalockeddoorandyouarefacingitwiththematchingkey,addatoggleactiontoyourplanandexecuteitimmediately\.<SYNTH\!\>Formatyouransweras:PLAN:<yourplan,or"Nochanges\."ifunchanged\>\-ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>\+ACTION:<oneof:turnleft,turnright,goforward,pickup,drop,toggle\>

Similar Articles

SePO: Self-Evolving Prompt Agent for System Prompt Optimization

arXiv cs.CL

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.

SAGE: Stochastic Prompt Optimization via Agent-Guided Exploration

arXiv cs.CL

Introduces SPO, a stochastic search framework for automatic prompt optimization, with three strategies including SAGE, an agent-guided multi-agent pipeline. Evaluated on benchmarks and deployed on a mental-health chatbot, showing improvements in retention through continuous optimization.