← Latest papers
🤖 machine learning

Stabilizing Black-Box Prompt Optimization with Textual Regularization and Signal Aggregation

This paper introduces TRAS, a plug-and-play framework that stabilizes black-box prompt optimization by combining textual regularization from successful predictions with Monte Carlo signal aggregation to filter noise, thereby improving accuracy, convergence speed, and robustness against model migration compared to existing methods.

Original authors: MohammadReza Davari, Utkarsh Garg, Weixin Cai, Eugene Belilovsky

Published 2026-06-24
📖 5 min read🧠 Deep dive

Original authors: MohammadReza Davari, Utkarsh Garg, Weixin Cai, Eugene Belilovsky

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 slightly unpredictable, robot how to solve puzzles. You can't see inside its brain (it's a "black box"), so you can only talk to it by writing instructions, called prompts.

For a long time, the best way to improve these instructions was a method called Automatic Prompt Optimization (APO). Think of this like a student taking a test, getting a question wrong, and then asking the teacher, "Why did I get this wrong?" The teacher gives a critique (a "textual gradient"), and the student changes their answer sheet to fix that specific mistake.

The paper argues that this "fix the mistakes" approach has a big flaw: it's too focused on what went wrong and ignores what went right.

The Problem: The "Over-Correction" Trap

Imagine you are tuning a radio to find a clear station.

  • The Old Way (Error-Only): Every time you hear static (an error), you twist the dial wildly to fix it. But because you only listen to the static, you might accidentally twist the dial past the clear station, or erase a setting that was actually working perfectly fine. You end up spinning in circles, making the signal worse before it gets better. In the paper's terms, this is called semantic drift—you fix a small error but accidentally delete a crucial instruction that was helping you overall.

The Solution: TRAS

The authors propose a new framework called TRAS (Textual Regularization with Aggregated Signals). It's like giving the student two types of feedback instead of just one.

1. The "Don't Touch That!" Signal (Textual Regularization)

Instead of just asking, "What's wrong?", TRAS also asks, "What's working?"

  • The Analogy: Imagine you are cooking a stew. The old method only tells you, "This carrot is too hard, chop it smaller!" TRAS also says, "Hey, the salt level is perfect, and the broth is rich—do not change those!"
  • How it works: When the model gets an answer right, TRAS analyzes why it was right and creates a "regularizer" (a rule) that says, "Keep these parts of the instruction exactly as they are." This prevents the robot from accidentally deleting the good stuff while trying to fix the bad stuff.

2. The "Committee of Experts" (Monte Carlo Signal Aggregation)

LLMs are a bit like humans; if you ask them the same question twice, they might give slightly different answers. Sometimes they are noisy or confused.

  • The Analogy: Imagine you ask one person for directions, and they say, "Turn left at the big oak tree." You ask a second person, and they say, "Turn left at the big oak tree." You ask a third, and they say, "Turn left at the big oak tree." You are confident. But if you ask a fourth person and they say, "Turn right at the gas station," you know that fourth person is an outlier or confused.
  • How it works: TRAS doesn't just ask the model for feedback once. It asks multiple times (sampling multiple "gradients" and "regularizers"). It then acts like a wise committee chair, listening to all the opinions and finding the common, consistent advice. It ignores the weird, noisy outliers and gives the robot a single, clear, reliable instruction.

The Bonus: "Moving House" (Automatic Prompt Migration)

The paper also tackles a practical problem called Automatic Prompt Migration (APM).

  • The Scenario: You have spent weeks perfecting a set of instructions for "Model A" (like GPT-3.5). Now, you want to use those same instructions on "Model B" (like GPT-4o).
  • The Risk: If you just take your perfect instructions and try to "re-optimize" them for the new model using the old "fix the mistakes" method, the new model might get confused and accidentally delete the parts of the instructions that were actually working. It's like moving your furniture to a new house and, in your excitement to rearrange, throwing away the pieces that fit perfectly.
  • TRAS's Fix: When moving to a new model, TRAS immediately activates the "Don't Touch That!" signal. It treats the old, working instructions as a precious foundation and only makes tiny, safe adjustments to fit the new model, ensuring you don't lose the "expert" knowledge you already built.

The Results

The paper tested this on various logic and reasoning tasks.

  • Better Accuracy: The robot solved more problems correctly.
  • Faster Learning: It didn't have to spin in circles trying to find the right settings; it got there faster.
  • Cheaper: Because it learned faster and made fewer mistakes, it used fewer "API calls" (which cost money).
  • Stability: The results were more consistent; it didn't have wild swings between good and bad performance.

In short, TRAS teaches us that to teach a black-box AI well, you shouldn't just scream at it when it fails. You should also whisper to it when it succeeds, telling it exactly what to keep, and you should ask for advice from a group to make sure you aren't listening to a confused voice.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →