Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Large Language Models as Optimizers

About

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.

Chengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoc V. Le, Denny Zhou, Xinyun Chen• 2023

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K
Accuracy89.16
983
Mathematical ReasoningGSM8K (test)
Accuracy89.6
797
Mathematical ReasoningGSM8K (test)
Accuracy72.8
751
Mathematical ReasoningSVAMP
Accuracy86.33
368
Commonsense ReasoningCSQA
Accuracy67.73
366
Mathematical ReasoningGSM8K
Accuracy (GSM8K)33.66
358
Text ClassificationAG News (test)
Accuracy88.2
210
Sentiment AnalysisSST-5 (test)
Accuracy60.87
173
Math ReasoningGSM8K (test)
Accuracy65.96
155
Medical Question AnsweringMedMCQA (test)
Accuracy57.7
134
Showing 10 of 98 rows
...

Other info

Follow for update