Skip to content
IFAI

Research

DeepMind finds LLMs can optimize their own prompts

Published Reach 31

DeepMind researchers just introduced OPRO, a technique that turns large language models into natural language optimizers. Instead of writing complex math formulas, users provide a meta-prompt with task descriptions and prior scores, guiding the model to iteratively discover better prompts and boost task accuracy.

DeepMind finds LLMs can optimize their own prompts
Image: venturebeat.com

Prompt engineering often feels like modern alchemy. Adding something as simple as "let's think step by step" can radically change an LLM's output, but finding the exact words that unlock peak performance is mostly trial and error.

Now, DeepMind researchers have introduced a system called OPRO, short for Optimization by PROmpting. Instead of relying on human guesswork or rigid mathematical formulas, OPRO lets large language models act as optimizers to improve their own prompts iteratively.

Natural language as an optimizer

Most deep learning optimizers rely on derivatives and precise mathematical formulas, but they frequently struggle when applied to messy real-world problems. DeepMind's team took a completely different angle: describe the optimization problem entirely in natural language.

Under this setup, the LLM reads a plain-text problem description and iteratively proposes new solutions based on what worked best in previous attempts. On small-scale optimization tasks, the researchers found that prompting an LLM can produce results that match or even outperform expert-crafted heuristic algorithms.

How the meta-prompt loop works

The engine behind OPRO is a continuous loop driven by what researchers call a meta-prompt. This prompt contains the task description, a few problem examples, placeholders for instructions, and past solutions with their quality scores.

The LLM generates candidate solutions, which are then evaluated and scored. The top-performing solutions and their scores get added back into the meta-prompt for the next iteration. Because models excel at in-context pattern recognition, the LLM identifies the trajectory of high-scoring attempts and builds upon them without ever touching an update equation.

DeepMind tested this on classic challenges like linear regression and the traveling salesman problem, finding that LLMs accurately captured the right direction on small-scale versions. More importantly, when applied to prompt optimization for models like ChatGPT and PaLM, OPRO took initial low-accuracy prompts and systematically upgraded them into instructions that maximized task accuracy.

Why it matters

For developers and prompt engineers, OPRO offers a practical path out of manual prompt tweaking. Because optimal phrasing varies significantly across different models and tasks, automating this search can save hours of repetitive experimentation. If you have an evaluation benchmark and a validation set, turning this loop on could quickly uncover edge-case phrasing that humans simply would not think to try.

Across the AI ecosystem, it shifts the concept of an optimizer from hardcoded math to natural language. Teams can define desired outcomes simply by specifying metrics like accuracy alongside stylistic constraints, such as keeping instructions concise and broadly applicable.

We think DeepMind's approach is clever because it leverages what LLMs already do best: spotting patterns inside a context window. However, this iterative prompting loop comes with real trade-offs. Running multiple generation and evaluation cycles carries significant compute costs, and context length limits will constrain how much trajectory data the model can see. It looks like a powerful offline tuning tool, rather than an immediate replacement for dedicated solvers.

Sources (1)

  1. [1]
    venturebeat.com(opens in a new tab)Originalventurebeat.com

Best of AI, daily