Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

EvoPrompt: Connecting LLMs with Evolutionary Algorithms Yields Powerful Prompt Optimizers

About

Large Language Models (LLMs) excel in various tasks, but they rely on carefully crafted prompts that often demand substantial human effort. To automate this process, in this paper, we propose a novel framework for discrete prompt optimization, called EvoPrompt, which borrows the idea of evolutionary algorithms (EAs) as they exhibit good performance and fast convergence. To enable EAs to work on discrete prompts, which are natural language expressions that need to be coherent and human-readable, we connect LLMs with EAs. This approach allows us to simultaneously leverage the powerful language processing capabilities of LLMs and the efficient optimization performance of EAs. Specifically, abstaining from any gradients or parameters, EvoPrompt starts from a population of prompts and iteratively generates new prompts with LLMs based on the evolutionary operators, improving the population based on the development set. We optimize prompts for both closed- and open-source LLMs including GPT-3.5 and Alpaca, on 31 datasets covering language understanding, generation tasks, as well as BIG-Bench Hard (BBH) tasks. EvoPrompt significantly outperforms human-engineered prompts and existing methods for automatic prompt generation (e.g., up to 25% on BBH). Furthermore, EvoPrompt demonstrates that connecting LLMs with EAs creates synergies, which could inspire further research on the combination of LLMs and conventional algorithms.

Qingyan Guo, Rui Wang, Junliang Guo, Bei Li, Kaitao Song, Xu Tan, Guoqing Liu, Jiang Bian, Yujiu Yang• 2023

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K (test)
Accuracy81.4
954
Question AnsweringARC (test)
Accuracy89.9
153
Mathematical ReasoningGame of 24
Accuracy84
147
Question AnsweringMedQA (test)
Accuracy50.3
67
Tool LearningRestBench TMDB
Success Rate76.3
50
LLM Agent EvaluationTau-bench retail
Pass@160.8
38
Multi-turn Medical DiagnosisMed-Inquire DiagnosisArena (915 cases)
Mean Diagnostic Grade53.6
36
Function CallingBFCL Single-Turn
Accuracy84.2
22
Function CallingBFCL Multi-turn
Accuracy39.9
22
Tool-use API GeneralizationToolBench G2
Pass Rate69.8
22
Showing 10 of 21 rows

Other info

Follow for update