Prompt Optimization as a State-Space Search Problem
Maanas Taneja

TL;DR
This paper models prompt optimization for language models as a state-space search problem, using algorithms like beam search to systematically improve prompts across various NLP tasks, demonstrating measurable gains on development sets.
Contribution
It introduces a novel formulation of prompt optimization as a graph search problem and applies search algorithms to systematically improve prompts, showing promising results.
Findings
Shallow search configurations improve prompt performance.
Concise prompts are more effective, verbosity is avoided.
Overfitting to development sets limits test performance.
Abstract
Language Models are extremely susceptible to performance collapse with even small changes to input prompt strings. Libraries such as DSpy (from Stanford NLP) avoid this problem through demonstration-based prompt optimisation. Inspired by this, I propose an alternative approach that treats prompt optimisation as a classical state-space search problem. I model the prompt space as a graph where nodes represent prompt states and edges correspond to deliberate transformations such as shortening, adding examples, or re- ordering content. Using beam search and random walk algorithms, I systematically explore this space, evaluating candidates on development sets and pruning unpromising branches. Across five NLP tasks (sentiment classification, question answering, summarisation, reason- ing, and natural language inference), I find that even shallow search configurations (beam width=2, depth=2)…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Natural Language Processing Techniques · Text Readability and Simplification
