[论文解读] EvoPrompt: Connecting LLMs with Evolutionary Algorithms Yields Powerful Prompt Optimizers
EvoPrompt 使用进化算法通过让大模型模仿 EA 操作符来自动为 LLMs 生成离散提示,从而在不访问梯度或参数的情况下提升提示质量。
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.
研究动机与目标
- 自动化、离散提示设计的需要性以降低人工工作量并提升跨模型有效性。
- 提出将进化算法与 LLMs 相结合以生成连贯、可读的人类可读提示的框架。
- 在开放源代码与闭源 LLMs 上的多样 NLP 任务中展示该方法的有效性。
提出的方法
- 将离散提示优化框架化为一个进化过程(提示群体)。
- 使用 LLMs 实现 EA 操作符(交叉/变异)以生成新提示。
- 在开发集上评估候选项并保留表现最佳的提示。
- 以两个 EA 实例化 EvoPrompt:遗传算法(GA)和微分进化(DE)。
- 提供指南,指导 LLMs 在保持提示连贯性的同时执行 EA 步骤。
实验结果
研究问题
- RQ1LLMs 是否能在不访问梯度或参数的情况下实现进化操作符以生成离散提示?
- RQ2基于 EvoPrompt 的提示在不同任务和模型上是否优于人工设计的提示和先前的自动方法?
- RQ3在不同提示基线或数据集下,哪种 EA 变体(GA vs. DE)能提供更好的结果?
主要发现
- 在 Alpaca-7b 与 GPT-3.5 的语言理解任务中,EvoPrompt(GA 与 DE)优于人工提示和 APE。
- 在情感分类任务中,EvoPrompt(GA)略优于 EvoPrompt(DE);在主观性分类任务中,EvoPrompt(DE)显著优于 EvoPrompt(GA)。
- 在语言生成方面,EvoPrompt(GA)和 EvoPrompt(DE)提升摘要的 ROUGE 分数与简化任务的 SARI 分数,且 DE 往往带来更高的增益。
- DE 相较 GA 更有助于跳出局部最优,尤其是在初始提示较弱或多样化时。
- 该方法不需要访问 LLM 的参数或梯度,且生成可读的人类可读提示。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。