From Monolithic to Modular: Segment-level Automatic Prompt Optimization
From Monolithic to Modular: Segment-level Automatic Prompt Optimization
从单体到模块化:基于片段级的自动提示词优化
Abstract: Automatic Prompt Optimization (APO) often rewrites prompts monolithically, which can improve one behavior while degrading others. We present SAPO, a segment-level APO method that decomposes prompts into role, context, tasks, and output format, then applies targeted improvements based on top-5 and bottom-5 examples.
摘要: 自动提示词优化(APO)通常以单体方式重写提示词,这在改善某种行为的同时可能会导致其他行为的退化。我们提出了 SAPO,这是一种片段级 APO 方法,它将提示词分解为角色、上下文、任务和输出格式,然后根据表现最好和最差的各 5 个示例进行针对性的改进。
The optimization loop uses one LLM with static meta-prompts and structured outputs for segmentation, weakness analysis, and candidate generation. We describe a train/validation protocol and a two-stage generation process: (1) segment-level diagnosis and recommendation extraction, (2) candidate synthesis constrained by weak/strong segment signals.
优化循环使用单个大语言模型(LLM),配合静态元提示词(meta-prompts)和结构化输出,用于执行分段、弱点分析和候选生成。我们描述了一套训练/验证协议以及一个两阶段生成过程:(1)片段级诊断与建议提取;(2)受弱/强片段信号约束的候选方案合成。
Using the evaluation setup across SQuADv2, TweetEval, XSUM, CommonGen, and GSM8K on GPT-3.5-Turbo and GPT-4o-mini, SAPO achieves the best average score against Zero-shot and strong APO baselines including APE, OPRO, EvoPrompt, GEPA, and StraGO.
通过在 GPT-3.5-Turbo 和 GPT-4o-mini 上对 SQuADv2、TweetEval、XSUM、CommonGen 和 GSM8K 进行评估,SAPO 在与零样本(Zero-shot)及包括 APE、OPRO、EvoPrompt、GEPA 和 StraGO 在内的强 APO 基线对比中,取得了最佳的平均得分。