SAPO Optimizes LLM Prompts Segment-by-Segment for Better Performance.

Nikita Kulin, Viktor Zhuravlev, Artur Khairullin, Sergey Muravyov, Ilya Makarov, Daniil Sukhorukov, Ekaterina Averkova· August 13, 2026 View original

Key takeaways

  • Monolithic prompt optimization can degrade some LLM behaviors.
  • SAPO optimizes prompts segment-by-segment for targeted improvements.
  • It decomposes prompts into role, context, tasks, and output format.
  • SAPO achieves superior performance compared to monolithic APO baselines.

Who benefits

AI/ML DevelopmentSoftware EngineeringMarketingCustomer ServiceContent Creation

Summary

Automatic Prompt Optimization (APO) often rewrites prompts monolithically, leading to unintended performance degradation. SAPO, a new segment-level APO method, decomposes prompts into roles, context, tasks, and output format, then applies targeted improvements based on examples, achieving superior average scores across various benchmarks compared to monolithic approaches.

Traditional Automatic Prompt Optimization (APO) methods typically treat prompts as a single, indivisible unit, which can lead to improvements in one aspect of an LLM's behavior while inadvertently harming others. This paper introduces SAPO (Segment-level Automatic Prompt Optimization), a more granular approach to prompt refinement. SAPO systematically breaks down prompts into distinct segments such as role, context, tasks, and output format. It then applies targeted optimizations to these individual segments, guided by top-performing and bottom-performing examples. This modular optimization loop, powered by an LLM with static meta-prompts, has demonstrated superior average performance across diverse benchmarks like SQuADv2, TweetEval, and GSM8K, outperforming several strong monolithic APO baselines on models like GPT-3.5-Turbo and GPT-4o-mini.

Why it matters

This method offers a more robust and effective way to optimize LLM prompts, preventing unintended side effects and leading to more reliable and higher-performing AI applications.

How to implement this in your domain

  1. 1Decompose existing LLM prompts into logical segments (role, context, tasks, format).
  2. 2Implement a segment-level diagnosis and recommendation extraction process using an LLM.
  3. 3Generate candidate prompt improvements constrained by segment-specific weak/strong signals.
  4. 4Adopt a train/validation protocol to systematically evaluate segment-level prompt optimizations.

Original post by Nikita Kulin, Viktor Zhuravlev, Artur Khairullin, Sergey Muravyov, Ilya Makarov, Daniil Sukhorukov, Ekaterina Averkova

"arXiv:2608.11219v1 Announce Type: new 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 out…"

View on X

Originally posted by Nikita Kulin, Viktor Zhuravlev, Artur Khairullin, Sergey Muravyov, Ilya Makarov, Daniil Sukhorukov, Ekaterina Averkova on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses