作为优化器的大语言模型
Large Language Models as Optimizers
AI总结:
本研究提出提示优化法OPRO,以自然语言描述优化任务,让大语言模型基于历史解迭代生成新解,在提示优化任务中,该方法得到的最佳提示相比人工设计提示,在GSM8K和Big-Bench Hard上分别最高提升8%和50%的准确率。
摘要:
优化无处不在。虽然基于导数的算法一直是解决各类问题的有力工具,但梯度的缺失给许多实际应用带来了挑战。在本研究中,我们提出了提示优化法(Optimization by PROmpting, OPRO),这是一种利用大语言模型(LLMs)作为优化器的简单有效方法,其中优化任务以自然语言描述。在每一步优化中,LLM根据包含先前生成的解及其取值的提示生成新的解,随后对新解进行评估,并将其添加到提示中用于下一步优化。我们首先在线性回归和旅行商问题上展示了OPRO的效果,随后将其应用于核心研究场景——提示优化,该任务的目标是找到能最大化任务准确率的指令。通过使用多种LLM,我们证明经OPRO优化得到的最佳提示在GSM8K数据集上比人工设计的提示最高提升8%的准确率,在Big-Bench Hard任务上最高提升50%的准确率。代码位于https://github.com/google-deepmind/opro。
英文摘要:
Optimization is ubiquitous. While derivative-based algorithms have been powerful tools for various problems, the absence of gradient imposes challenges on many real-world applications. In this work, we propose Optimization by PROmpting (OPRO), a simple and effective approach to leverage large language models (LLMs) as optimizers, where the optimization task is described in natural language. In each optimization step, the LLM generates new solutions from the prompt that contains previously generated solutions with their values, then the new solutions are evaluated and added to the prompt for the next optimization step. We first showcase OPRO on linear regression and traveling salesman problems, then move on to our main application in prompt optimization, where the goal is to find instructions that maximize the task accuracy. With a variety of LLMs, we demonstrate that the best prompts optimized by OPRO outperform human-designed prompts by up to 8% on GSM8K, and by up to 50% on Big-Bench Hard tasks. Code at https://github.com/google-deepmind/opro.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。