대규모 언어 모델과 진화 알고리즘을 결합하면 강력한 프롬프트 최적화 도구를 얻을 수 있다.
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
초록
대규모 언어 모델(LLMs)은 다양한 작업에서 뛰어난 성능을 보이지만, 상당한 인간의 노력이 요구되는 정교하게 설계된 프롬프트에 의존합니다. 이 과정을 자동화하기 위해, 본 논문에서는 진화 알고리즘(EA)의 아이디어를 차용한 이산 프롬프트 최적화를 위한 새로운 프레임워크인 EvoPrompt를 제안합니다. EA는 우수한 성능과 빠른 수렴 속도를 보이기 때문에 이를 활용했습니다. 이산 프롬프트, 즉 일관적이고 인간이 읽을 수 있는 자연어 표현에 EA를 적용하기 위해, LLMs와 EA를 연결했습니다. 이 접근법은 LLMs의 강력한 언어 처리 능력과 EA의 효율적인 최적화 성능을 동시에 활용할 수 있게 합니다. 구체적으로, EvoPrompt는 그라디언트나 매개변수를 사용하지 않고, 초기 프롬프트 집단에서 시작하여 진화 연산자를 기반으로 LLMs를 사용해 새로운 프롬프트를 반복적으로 생성하고, 개발 세트를 기반으로 집단을 개선합니다. GPT-3.5와 Alpaca를 포함한 오픈소스 및 클로즈드소스 LLMs에 대해, 언어 이해 및 생성 작업을 아우르는 9개의 데이터셋에서 프롬프트를 최적화했습니다. EvoPrompt는 인간이 설계한 프롬프트와 기존의 자동 프롬프트 생성 방법을 각각 최대 25%와 14%까지 크게 능가했습니다. 더 나아가, EvoPrompt는 LLMs와 EA를 연결함으로써 시너지를 창출할 수 있음을 보여주며, 이는 LLMs와 전통적인 알고리즘의 결합에 대한 추가 연구를 고무할 수 있습니다.
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.