Bandit-Based Prompt Design Strategy Selection Improves Prompt Optimizers
This paper introduces OPTS, a prompt optimization framework that enhances the performance of existing optimizers like EvoPrompt by implementing explicit, bandit-based mechanisms (specifically Thompson sampling) to effectively select and apply prompt design strategies, thereby outperforming methods that rely on implicit strategy selection.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to teach a very smart but sometimes stubborn robot (a Large Language Model) how to solve a difficult puzzle. You give the robot instructions, called a "prompt." If the instructions are vague, the robot gets confused. If they are perfect, the robot solves the puzzle instantly.
For a long time, humans have tried to write these perfect instructions by hand, or they've used computer programs to automatically tweak the instructions until they work better. This is called Prompt Optimization.
However, there's a problem: these automatic programs often create instructions that are functional but lack the "secret sauce" that human experts use. They miss out on proven tricks like "think step-by-step" or "act like an expert."
The Problem: The Robot's Bad Guessing Game
Recently, a tool called APET tried to fix this. It gave the robot a menu of "design strategies" (like a menu of cooking techniques: add salt, chop finely, simmer slowly). The robot was supposed to look at the menu and decide which tricks to use for the specific puzzle.
But the paper argues that asking the robot to make this choice is like asking a tired chef to guess which spice will save a burnt soup. The robot often guesses wrong, picking strategies that actually make the instructions worse. It's an implicit choice (the robot just "feels" like it should use a trick), and it's not very good at it.
The Solution: OPTS (The Smart Sommelier)
The authors of this paper introduce a new method called OPTS (Optimizing Prompts with sTrategy Selection).
Instead of letting the robot guess, OPTS acts like a smart sommelier (a wine expert) or a casino manager running a game of chance. Here is how it works using a simple analogy:
Imagine you have a row of slot machines (the researchers call these "arms").
- Machine 1: Adds "Think Step-by-Step" to the instructions.
- Machine 2: Tells the robot to "Read the question again."
- Machine 3: Tells the robot to "Act like a math expert."
- Machine K+1: Does nothing (keeps the instructions exactly as they are).
In the old method (APET), the robot would just pull a lever randomly or based on a hunch.
In the new OPTS method, the system uses a mathematical strategy called Thompson Sampling. Think of this as a smart gambler who keeps a scorecard:
- It tries a machine (a strategy).
- If the robot solves the puzzle better, the system gives that machine a "thumbs up" and makes it more likely to be picked next time.
- If the robot fails, the system gives that machine a "thumbs down" and stops picking it.
- Crucially, it also keeps a "Do Nothing" machine. If all the tricks are making things worse, the system learns to just leave the instructions alone.
What They Found
The researchers tested this on two different robots (LLMs) using a set of very hard logic and reasoning puzzles (called BIG-Bench Hard).
- The Result: By using this "smart gambler" approach to pick the right strategy, the system created much better instructions than the robots could do on their own.
- The Champion: The Thompson Sampling method (the smart gambler) was the clear winner. It improved the performance of the prompt optimizer by up to 50% on some tasks.
- The Comparison: The old method (APET), where the robot guessed, actually performed worse than just picking strategies randomly. This proves that the robot is bad at guessing which tricks to use, but it is great at following instructions if we tell it which trick to use.
The Takeaway
This paper doesn't claim to have solved all AI problems or to be ready for medical diagnosis yet. It simply shows that when we are trying to teach AI how to talk better, we shouldn't let the AI guess which teaching method to use. Instead, we should use a smart, data-driven system (like Thompson Sampling) to explicitly choose the best teaching tricks, just like a coach choosing the right play for a specific game situation.
The code for this "smart coach" is now available for others to use.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.