SPLICE: Structured Prompt Local Iterative Combinatorial Evolution
Abstract
Natural language optimization (NLO) aims to improve an agent by having a model critique and rewrite its natural language policy parameters, e.g., system prompts, tool usage instructions, reasoning directives, few-shot demonstrations. These artifacts are multi-section documents in which some sections encode hard- won contracts (safety clauses, tool schemas, output formats) that must not drift, and others are legitimate optimization targets. Existing iterative NLO methods treat the artifact as a monolithic string, producing three recurrent failure modes: unsafe global rewrites, beam collapse onto a single lineage, and unchecked bloat – none addressed by formal guarantees. We introduce SPLICE, a unified NLO framework that poses the optimization recipe as constrained combinatorial search over an edit graph of block-structured, selectively-mutable states. Under this framework, existing iterative algorithms instantiate a single batched iterative search template or depart from it in a component we can name. Theoretically, we map each failure mode to a matched guarantee: (i) per-block mutability preserves contract text verbatim, with a price-of-freezing bound showing the trade-off is nearly free when frozen blocks carry small marginal gains; (ii) elitist beam search with diversity slots never lets the leader regress on validation, bounds regression under noisy re-evaluation by an exponential tail, and keeps a competitive candidate from a different parent whenever one exists; (iii) a ratio length regularizer comes with an explicit accuracy–length bias bound. Candidates are proposed from dual section-local textual gradients; under a proposer-competence condition whose proxy we measure, edit-graph reachability and a convergence rate bound how quickly improving children arrive. Empirically, across seven public benchmarks under five reproduced protocols, SPLICE wins on four and matches the strongest prior method on three. On a production-style contract stress test it keeps the text of the contract clauses that unconstrained optimizers trade away for reward, and ablations of the loop point to critique and elitist search as the main sources of gain.