Large Language Models as Optimizers
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.
64fa7df1dcc5ce730e443fa0
Chengrun Yang
claimed_verified
2023-09-09T05:38:16.308Z
64fbab29e0dc35986bac8e03
/avatars/7c11abfac56a06c1122750332c40d189.svg
Chengrun Yang
user
chengrun
64fa7df1dcc5ce730e443fa1
Xuezhi Wang
64fa7df1dcc5ce730e443fa2
Yifeng Lu
admin_assigned
2023-09-08T10:04:42.501Z
6344a8050f69ad8aa61cb663
/avatars/ed637f510d18ccd1f4bdd6861d5c858e.svg
Yifeng Lu
user
yifenglu
64fa7df1dcc5ce730e443fa3
Hanxiao Liu
64fa7df1dcc5ce730e443fa4
Quoc V. Le
64fa7df1dcc5ce730e443fa5
Denny Zhou
claimed_verified
2024-02-20T18:28:19.081Z
65d4d62d493aeaf0bb295f1b
https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/vXMxaoWwFziul8TqIhQw8.jpeg
Denny Zhou
user
dennyzhou
64fa7df1dcc5ce730e443fa6
Xinyun Chen
admin_assigned
2023-09-08T13:11:40.793Z
64d0268001931c60161e026a
/avatars/0ea48c47b0270b449fd6b97b495e64a6.svg
Xinyun Chen
user
xinyunchen
Large Language Models as Optimizers
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.
OPRO, a method using large language models to optimize tasks described in natural language, outperforms human-designed prompts on various benchmark datasets.
derivative-based algorithms Optimization by PROmpting (OPRO) large language models (LLMs) natural language linear regression traveling salesman problems prompt optimization GSM8K Big-Bench Hard tasks