用遗传算法自动优化提示词,提升大模型表现。
GAAPO: Genetic Algorithmic Applied to Prompt Optimization
- 基于遗传算法演化提示词,融合多种生成策略。
- 在多个数据集上验证有效,不同模型生成能力有差异。
- 为自动化提示优化提供理论与实践参考。
大型语言模型(LLMs)在各类任务中表现出色,其性能高度依赖输入提示的质量。尽管提示工程有效,但通常需手动调整,耗时且可能非最优。本文提出GAAPO(Genetic Algorithm Applied to Prompt Optimization),一种结合遗传算法原理的混合优化框架,通过多代演化优化提示词。不同于传统遗传方法仅使用变异和交叉,GAAPO在进化框架中集成多种专用提示生成策略。在ETHOS、MMLU-Pro和GPQA等多样化数据集上的大量实验表明:种群规模与迭代代数之间存在权衡;选择策略影响结果稳定性;不同LLMs,尤其是推理模型,具备从相似查询自动生成提示的能力。此外,我们分析了不同提示生成策略在优化过程中的有效性演变。这些发现有助于深化对提示优化的理解,并推动大模型性能的实际提升。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated remarkable capabilities across various tasks, with their performance heavily dependent on the quality of input prompts. While prompt engineering has proven effective, it typically relies on manual adjustments, making it time-consuming and potentially suboptimal. This paper introduces GAAPO (Genetic Algorithm Applied to Prompt Optimization), a novel hybrid optimization framework that leverages genetic algorithm principles to evolve prompts through successive generations. Unlike traditional genetic approaches that rely solely on mutation and crossover operations, GAAPO integrates multiple specialized prompt generation strategies within its evolutionary framework. Through extensive experimentation on diverse datasets including ETHOS, MMLU-Pro, and GPQA, our analysis reveals several important point for the future development of automatic prompt optimization methods: importance of the tradeoff between the population size and the number of generations, effect of selection methods on stability results, capacity of different LLMs and especially reasoning models to be able to automatically generate prompts from similar queries... Furthermore, we provide insights into the relative effectiveness of different prompt generation strategies and their evolution across optimization phases. These findings contribute to both the theoretical understanding of prompt optimization and practical applications in improving LLM performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。