atlas

Research map / Large language models / Agents, code and math

Large Language Models as Optimizers

ICLR 2024 · Large language models › Agents, code and math · approach: LLM-guided program synthesis · 93 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes OPRO, which prompts an LLM with a meta-prompt of previously scored solutions to iteratively generate better solutions, and applies it to linear regression, TSP, and prompt optimization for GSM8K and BBH.

Problem

Gradient-free optimization is hard when the objective is only accessible through natural language or black-box evaluation, and prompt optimization is difficult when only API access to the LLM is available.

Approach

Use an LLM as the optimizer by placing the task description, exemplars, and the trajectory of previously generated solutions with their scores into a meta-prompt; the LLM generates new candidates that are evaluated and appended to the trajectory, iterating without gradients or explicit update rules.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Optimize the instruction iteratively using the OPRO trajectoryPrompt instruction · GSM8K test, PaLM 2-L scoreraccuracy: 71.8 -> 80.2Helped
Optimize instructions with OPROPrompt instruction · BBH tasksaccuracy: over 5% on 19/23 tasks; 15/23 tasksHelped
Use OPRO instead of one-step generation of 50 instructions (ablation)Prompt optimization · GSM8Ktest accuracy: 60.8 -> 76.3Helped
Use OPRO instead of one-step generation of 50 instructions (ablation)Prompt optimization · BBH sports_understandingtest accuracy: 80.0 -> 84.5Helped
Sort prior instructions from lowest to highest score (ablation)OPRO meta-prompt · GSM8K and BBH sports_understandingfinal accuracy and convergence speedHelped
Include instruction accuracy scores in the trajectory (ablation)OPRO meta-prompt · GSM8K and BBH sports_understandingoptimization performanceHelped
Include task exemplars in the meta-prompt (ablation)OPRO meta-prompt · GSM8K and BBH sports_understandingoptimization performanceHelped
Increase exemplars from 3 to 10 (ablation)OPRO meta-prompt · GSM8K and BBH sports_understandingoptimization performanceNo clear effect
Generate 8 instructions per optimization step (ablation)OPRO · GSM8K and BBH sports_understandingaccuracyHelped
Change the initial instruction (ablation)OPRO with text-bison scorer · Prompt optimizationaccuracyNo clear effect
Start from “Let's think step by step.” rather than the empty string or “Let's solve the problem.” (ablation)OPRO with PaLM 2-L scorer · Prompt optimizationaccuracyHelped
Set optimizer temperature to 1.0 (ablation)OPRO · GSM8K and BBH sports_understandingaccuracyHelped

Surprising findings

Limitations

Experimental setup

Datasets: GSM8K Big-Bench Hard MultiArith AQuA

Benchmarks: GSM8K Big-Bench Hard MultiArith AQuA

Metrics: test accuracy optimality gap number of steps number of unique solutions explored

Baselines: Let's think step by step Let's work this out in a step by step way EvoPrompt (GA) EvoPrompt (DE) Nearest Neighbor Farthest Insertion one-step instruction generation

Builds on: chain-of-thought prompting APE APO EvoPrompt

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy