Abstract
DelvePO is an automated prompt optimization framework that treats prompts as modular genetic code. By utilizing a "working memory" to track historical performance, DelvePO replaces random mutations with deliberate, direction-guided evolution. Evaluated across 11 datasets and multiple Large Language Models (LLMs), DelvePO achieves state-of-the-art performance, outperforming existing methods like APE and EvoPrompt while maintaining high efficiency.
Introduction
Writing effective prompts for LLMs is often a tedious trial-and-error process. While automated methods like APE, PromptBreeder, and EvoPrompt have emerged, they typically rely on random mutations, treating prompts as monolithic blocks of text. This stochastic approach can lead to the accidental deletion of critical instructions, causing the optimization process to stall in local optima. DelvePO addresses these challenges by making prompt evolution deliberate, interpretable, and stable through component decoupling and memory-guided search.
Methodology
DelvePO introduces a structured approach to prompt optimization inspired by genetic principles, breaking the process into distinct functional stages.
Component Decoupling
Instead of treating a prompt as a single string, DelvePO breaks it into modular components using HTML-like tags (e.g., <role>, <task_description>, <requirements>). This prevents "catastrophic forgetting," where a mutation in one area might inadvertently destroy a successful instruction in another.
Working Memory and Evolution
The framework maintains a dual-layered working memory:
- Component Memory: Tracks the historical performance of specific component variations (e.g., specific personas or formatting instructions).
- Prompt Memory: Tracks the performance of fully assembled prompts.
The optimization process proceeds in two guided phases:
- Task-Evolution: The LLM analyzes Component Memory to determine which specific tags require mutation or crossover.
- Solution-Evolution: The LLM utilizes Prompt Memory to intelligently generate new content for the targeted tags.
Experimental Evaluation
DelvePO was evaluated across 11 datasets covering classical NLP (Subj, MR, CoLA, SST-5), Question-Answering (SQuAD, TREC), Domain-Specific tasks (FinPB, FinFE, Causal Judgement), Multi-domain classification (AG's News), and Natural Language Generation (SAMSum). Testing involved models such as DeepSeek-R1-Distill-Llama-8B, Qwen2.5-7B-Instruct, and GPT-4o-mini.
Results and Discussion
DelvePO consistently outperformed both human-crafted prompts and state-of-the-art automated optimizers under identical experimental settings.
Key Performance Metrics
- State-of-the-Art Accuracy: On GPT-4o-mini, DelvePO achieved an average score of 90.56, significantly higher than EvoPrompt (85.72) and APE (85.17). Similar gains were observed on DeepSeek-R1-Distill-Llama-8B, where DelvePO scored 70.48 compared to EvoPrompt's 65.55.
- Efficiency and Convergence: Despite its deliberate nature, DelvePO converges rapidly. It required fewer GPU hours per epoch than highly randomized methods like PromptBreeder, proving that guided evolution is not just more effective, but also faster.
- Initialization Sensitivity: Sensitivity tests indicated that starting with a smaller pool of initial component values (e.g., 10 vs. 50) does not compromise final performance, offering a path to further compute savings.
Conclusion and Future Work
DelvePO demonstrates that memory-guided, component-based evolution is superior to random prompt mutation. By explicitly deducing "Insights" from historical data, the framework ensures a logical progression toward optimal prompts. While the current implementation faces higher token costs due to the inclusion of working memory in the context window, future work will focus on prompt compression techniques to maintain rich historical context while reducing computational overhead.
Summary updated