Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

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

About

An increasing number of NLP applications interact with large language models (LLMs) through black-box APIs, making prompt engineering critical for controlling model behavior. Recent Automatic Prompt Optimization (APO) methods iteratively refine prompts using model-generated critiques (often called textual gradients), but they predominantly optimize from failures and underutilize information contained in correct predictions, leading to instability and semantic drift. We propose TRAS (Textual Regularization with Aggregated Signals), a feedback-centric framework that is plug-and-play with existing APO search backbones. It retains the standard textual gradient signal from prior work for error correction and introduces a complementary textual regularizer derived from successful predictions to preserve beneficial prompt components. Because both signals are stochastic and can be noisy, we further introduce Monte Carlo Signal Aggregation (MCSA), which samples multiple gradients or regularizers and aggregates them into a single actionable directive, emphasizing consistent, actionable advice while filtering out outliers. Motivated by rapid model churn, we also formalize Automatic Prompt Migration (APM), the practical problem of adapting an expert prompt across model versions or API providers without losing critical instructions. Across standard APO and APM scenarios, our approach consistently outperforms strong baselines, yielding higher accuracy, faster convergence, and lower query cost, while substantially reducing the degradation observed under naive prompt migration.

MohammadReza Davari, Utkarsh Garg, Weixin Cai, Eugene Belilovsky• 2025

Related benchmarks

TaskDatasetResultRank
Causal ReasoningCausal Judgment
Final Accuracy76.4
4
Geometric ReasoningGeometric Shapes
Final Accuracy84.5
4
Logical reasoningPenguins
Final Accuracy98
4
Natural Language InferenceCB
Final Accuracy87.5
4
Prompt OptimizationCausal Judgment
Accuracy64.4
4
Prompt OptimizationGeometric Shapes
Accuracy63.3
4
Prompt OptimizationPenguins
Accuracy68.6
4
Prompt OptimizationBIOSSES
Accuracy70.4
4
Prompt OptimizationCB
Accuracy85.7
4
Showing 9 of 9 rows

Other info

Follow for update