EvoPrompt: Connecting LLMs with Evolutionary Algorithms Yields Powerful Prompt Optimizers
Qingyan Guo Thanks: Work done during an internship at Microsoft Research Asia. Affiliation: Tsinghua University Rui Wang Thanks: Equal Contribution. Affiliation: Microsoft Research Junliang Guo Affiliation: Microsoft Research Affiliation: Northeastern Bei Li Kaitao Song Affiliation: Microsoft Research Xu Tan Thanks: Corresponding Author. Affiliation: Microsoft Research Guoqing Liu Affiliation: Microsoft Research Jiang Bian Affiliation: Microsoft Research Yujiu Yang
Abstract
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 method
原文 arXiv:2309.08532;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2309.08532v3