大規模言語モデルを最適化ツールとして活用する
Large Language Models as Optimizers
September 7, 2023
著者: Chengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoc V. Le, Denny Zhou, Xinyun Chen
cs.AI
要旨
最適化は至る所で行われている。導関数ベースのアルゴリズムは様々な問題に対して強力なツールとなってきたが、勾配が存在しないことは多くの現実世界のアプリケーションにおいて課題を課している。本研究では、最適化タスクを自然言語で記述し、大規模言語モデル(LLM)を最適化器として活用する、シンプルで効果的なアプローチである「PROmptingによる最適化(OPRO)」を提案する。各最適化ステップにおいて、LLMは以前に生成された解とその値を含むプロンプトから新しい解を生成し、その新しい解が評価され、次の最適化ステップのためのプロンプトに追加される。まず、線形回帰と巡回セールスマン問題においてOPROを紹介し、その後、タスクの精度を最大化する命令を見つけることを目的としたプロンプト最適化に移行する。様々なLLMを用いて、OPROによって最適化された最良のプロンプトが、GSM8Kでは人間が設計したプロンプトを最大8%、Big-Bench Hardタスクでは最大50%上回ることを実証する。
English
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 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.