From Monolithic to Modular: Segment-level Automatic Prompt Optimization
Nikita Kulin, Viktor Zhuravlev, Artur Khairullin, Sergey Muravyov, Ilya Makarov, Daniil Sukhorukov, Ekaterina Averkova
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. 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. 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.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL, cs.LG
- Comments
- Accepted at the IJCAI-ECAI 2026 Workshop on Robustifying Generative AI for Reliable, Safe, and Human-Centric Systems (RobustifAI)
Related papers
One Rewrite to Fix Them All? Type-Aware Repair Allocation for Text-to-Image Prompt Optimization
Shared title terminologycs.AIHaoyue Liu, Xiaoyu Ma, Ye Chen et al.
HoMe: Toward Practical Harness Optimization of Memory Systems for AI Assistants
Shared title terminologycs.AIYifei Xu, Li Yu, Zhaoyang Liu et al.
Evaluating Aviation Safety Knowledge Extraction with SmolLM2: From Zero-Shot to Retrieval-Grounded Prompting
Shared title terminologycs.AIAziida Nanyonga, Mustafa Tahsin Yilmaz, Amir Hussain et al.
What Does Skill Lift Actually Measure? A Source-Code-Level Audit and Noise-Aware Reanalysis of SkillsBench
Shared title terminologycs.AIHaozhe Zhang, Zhen Long
RadOncGym: An Agent-Based Framework for Radiotherapy Dose-Mimicking Optimization
Shared title terminologycs.AITong Miao, Shupeng Cheng, Xiwen Chen et al.
Spectral Optimal Transport for Dynamics-Aware Sign Language Generation
Shared title terminologycs.AINabeela Khan, Bowen Wu, Runwu Shi et al.