大規模言語モデルと進化アルゴリズムを組み合わせることで、強力なプロンプト最適化手法が実現される
Connecting Large Language Models with Evolutionary Algorithms Yields Powerful Prompt Optimizers
September 15, 2023
著者: Qingyan Guo, Rui Wang, Junliang Guo, Bei Li, Kaitao Song, Xu Tan, Guoqing Liu, Jiang Bian, Yujiu Yang
cs.AI
要旨
大規模言語モデル(LLM)は様々なタスクで優れた性能を発揮しますが、そのためには入念に設計されたプロンプトが必要であり、多くの場合、多大な人的労力を要します。このプロセスを自動化するため、本論文では、進化的アルゴリズム(EA)のアイデアを借用した新しい離散プロンプト最適化フレームワーク「EvoPrompt」を提案します。EAは優れた性能と高速な収束を示すため、これを活用します。自然言語表現であり、一貫性と人間が読めることが求められる離散プロンプトに対してEAを適用するために、LLMとEAを接続します。このアプローチにより、LLMの強力な言語処理能力とEAの効率的な最適化性能を同時に活用することが可能になります。具体的には、勾配やパラメータを一切使用せず、EvoPromptはプロンプトの集団から始まり、進化的演算子に基づいてLLMを用いて新しいプロンプトを反復的に生成し、開発セットに基づいて集団を改善します。GPT-3.5やAlpacaを含むクローズドおよびオープンソースのLLMに対して、言語理解と生成タスクにまたがる9つのデータセットでプロンプトを最適化します。EvoPromptは、人手で設計されたプロンプトや既存の自動プロンプト生成手法をそれぞれ最大25%および14%上回る性能を示しました。さらに、EvoPromptはLLMとEAを接続することで相乗効果が生まれることを実証し、LLMと従来のアルゴリズムの組み合わせに関するさらなる研究を促す可能性を示しています。
English
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 9 datasets spanning language understanding and
generation tasks. EvoPrompt significantly outperforms human-engineered prompts
and existing methods for automatic prompt generation by up to 25% and 14%
respectively. Furthermore, EvoPrompt demonstrates that connecting LLMs with EAs
creates synergies, which could inspire further research on the combination of
LLMs and conventional algorithms.