Modular Prompt Optimization: Optimizing Structured Prompts with Section-Local Textual Gradients
By: Prith Sharma, Austin Z. Henley
Potential Business Impact:
Makes AI smarter by fixing its instructions.
Prompt quality plays a central role in controlling the behavior, reliability, and reasoning performance of large language models (LLMs), particularly for smaller open-source instruction-tuned models that depend heavily on explicit structure. While recent work has explored automatic prompt optimization using textual gradients and self-refinement, most existing methods treat prompts as monolithic blocks of text, making it difficult to localize errors, preserve critical instructions, or prevent uncontrolled prompt growth. We introduce Modular Prompt Optimization (MPO), a schema-based prompt optimization framework that treats prompts as structured objects composed of fixed semantic sections, including system role, context, task description, constraints, and output format. MPO applies section-local textual gradients, generated by a critic language model, to refine each section independently while keeping the overall prompt schema fixed. Section updates are consolidated through de-duplication to reduce redundancy and interference between components, yielding an interpretable and robust optimization process. We evaluate MPO on two reasoning benchmarks, ARC-Challenge and MMLU, using LLaMA-3 8B-Instruct and Mistral-7B-Instruct as solver models. Across both benchmarks and models, MPO consistently outperforms an untuned structured prompt and the TextGrad baseline, achieving substantial accuracy gains without modifying model parameters or altering prompt structure. These results demonstrate that maintaining a fixed prompt schema while applying localized, section-wise optimization is an effective and practical approach for improving reasoning performance in small open-source LMs.
Similar Papers
Local Prompt Optimization
Computation and Language
Helps AI write better answers by focusing on key words.
Multimodal Prompt Optimization: Why Not Leverage Multiple Modalities for MLLMs
Machine Learning (CS)
Teaches AI to understand pictures and words together.
PMPO: Probabilistic Metric Prompt Optimization for Small and Large Language Models
Computation and Language
Makes AI smarter by fixing its instructions.