arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.04055cs.CL
收藏

模块化提示优化:通过部分局部文本梯度优化结构化提示

Modular Prompt Optimization: Optimizing Structured Prompts with Section-Local Textual Gradients

Carnegie Mellon University(卡内基梅隆大学)

Prith Sharma, Austin Z. Henley

AI总结:

模块化提示优化通过局部文本梯度优化结构化提示,提升小型开源LLM的推理性能。

摘要:

提示质量在控制大语言模型(LLM)的行为、可靠性及推理性能中起着核心作用,特别是对于依赖显式结构的较小开源指令微调模型。尽管近期工作已探索了使用文本梯度和自我细化的自动提示优化,但大多数现有方法将提示视为文本块,难以局部化错误、保留关键指令或防止不受控制的提示增长。我们引入了模块化提示优化(MPO),一种基于模式的提示优化框架,将提示视为由固定语义部分组成的结构化对象,包括系统角色、上下文、任务描述、约束和输出格式。MPO应用由批评语言模型生成的局部文本梯度,独立优化每个部分,同时保持整体提示模式不变。部分更新通过去重合并以减少组件间的冗余和干扰,从而获得可解释且稳健的优化过程。我们在两个推理基准测试ARC-Challenge和MMLU上评估MPO,使用LLaMA-3 8B-Instruct和Mistral-7B-Instruct作为求解模型。在两个基准和模型上,MPO在未调优的结构化提示和TextGrad基线上均表现优异,实现了显著的准确率提升,而无需修改模型参数或改变提示结构。这些结果表明,保持固定提示模式的同时应用局部、部分级优化是一种有效且实用的方法,可用于提高小型开源LLM的推理性能。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑