Prompt optimisation
A hosted model can only be changed through its input. These runs evolve the system prompt from task outcomes, in the style of GEPA: play, let a teacher read the traces, rewrite, keep what scores at least as well. Every candidate, diagnosis and training episode is here.
The loop
- 1EvaluateThe current prompt plays one episode on each of three training floors (the simple floor, gen01, gen02) at temperature 0; fitness is the mean goal score.
- 2Build the requestScope, a description of the observation, the rules a prompt must follow, the current prompt, one trace per episode and up to two worse rewrites.
- 3ReflectThe teacher writes a short diagnosis and one complete revised prompt.
- 4ValidateA fixed check rejects coordinates, monster names, routes, lists of allowed fights and numbers of 100 or more; one retry with the reasons.
- 5SelectThe candidate plays the same floors; it becomes the parent if it scores at least as well as the best so far.
This is a (1+1) evolutionary loop. The Pareto loop of the second study keeps every valid candidate, draws parents from those that are best on at least one floor, and merges the two best once (Section 5.7, Table 5.2).
Study 1: does evolution add anything once the observation is annotated?
Two weaker models, three prompts (rules-only, evolved from it, hand-written single-floor prompt), each under the full and the bare observation, evaluated on thirteen held-out generated floors with one episode each. Hypotheses were stated before the runs.
| Model | Observation | Rules-only | Evolved | Hand-written | Run |
|---|---|---|---|---|---|
| Llama-3.1-8B | full | 8/13 · 0.556 | 10/13 · 0.646 ᵃ | 9/13 · 0.660 | candidates |
| Llama-3.1-8B | bare | 5/13 · 0.462 | 4/13 · 0.399 | 6/13 · 0.484 | candidates |
| DeepSeek-V4-Flash | full | 10/13 · 0.821 | 11/13 · 0.846 | 11/13 · 0.850 | candidates |
| DeepSeek-V4-Flash | bare | – | – ᵃ | – | candidates |
Held-out kills / 13 · mean goal score (Table 6.6). ᵃ The optimiser returned its seed, so the evolved arm is the rules-only prompt played again: the difference is the noise floor.
What the evolved prompts contain
How often the candidates of both studies state each rule of the hand-written prompts, all written from the rules-only prompt by a teacher given no example rules (Table 6.7, counted by keyword patterns).
| Rule | Study 1 | Study 2, (1+1) | Study 2, Pareto | In the full observation as |
|---|---|---|---|---|
| collect stat items before the fights they make cheaper ᵇ | 37/40 | 7/7 | 7/7 | net stat-route line, fight-order line, cost at maximum stats |
| take the cheapest progress first (lowest effective cost) | 26/40 | 6/7 | 4/7 | effective cost, fight-order line |
| never pay HP for a fight that unlocks nothing needed | 30/40 | 7/7 | 6/7 | OPTIONAL tag, alternative-route tag |
| open doors only when what lies behind is needed | 14/40 | 7/7 | 6/7 | DEAD END tag, key line |
| no fight above 40 % of current HP | 3/40 | 2/7 | 0/7 | — |
| keys are scarce | 0/40 | 0/7 | 1/7 | key budget |
| added by evolution: trust the engine's annotations | 32/40 | 2/7 | 3/7 | — |
| added by evolution: fight the boss only when winnable and after the stats | 18/40 | 4/7 | 1/7 | boss line, WINNABLE tag |
| added by evolution: make the reasoning and the chosen action agree | 8/40 | 0/7 | 0/7 | — |
ᵇ The rules-only prompt already contains a sentence that the pattern matches, so this row overstates rediscovery.