mlsanityData to 7 Oct 2026

Prompt Codebooks: Discrete Compositional Optimization for Language Model Instruction Refinement

arXiv 2605.28360 ↗First posted 27 May 2026cs.AIcited by 0

On the map: LLM agents and tool use → General LLM agent frameworks and benchmarks

Abstract (arXiv)

Automatic prompt optimization (APO) has driven significant gains in LLM-based agentic workflows. However, most existing methods treat each task's prompt as a monolithic, instance-blind string optimized through global edits, producing brittle updates and preventing the reuse of learned sub-behaviors. We propose Prompt Codebook Optimization (PCO), a novel compositional prompt optimization framework that recasts APO as discrete learning over a finite vocabulary of natural-language instincts--atomic, reusable instruction units. PCO organizes prompt-construction knowledge in a discrete codebook and routes each input to a small subset of entries via an LLM-based encoder; a generator composes them into a prompt for the executor; a critic emits a structured verdict that decomposes by attribution into per-variable textual gradients, jointly training the encoder, generator, critic, and codebook under a language-valued min-max objective. The resulting routing is per-instance: different inputs in the same task receive different instinct compositions. Across six benchmarks, PCO improves aggregate performance over zero-shot by +13.50 points on Qwen3-8B and +11.80 points on LLaMA-3.1-8B. Crucially, PCO surpasses GEPA on HotpotQA by +6.34 points (Qwen3-8B) and +4.27 points (LLaMA-3.1-8B), while simultaneously reducing deployed prompt length by up to 14.1× vs. MIPROv2 and 3.0× vs. GEPA.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in General LLM agent frameworks and benchmarks, one of 16 directions in LLM agents and tool use. Builds on 43 of its 56 references that are in the map. First posted on arXiv 27 May 2026.

Builds on

43 of 56 references.

Closest ancestors · 1

Same direction, newest first

  1. 2025AutoPDL: Automatic Prompt Optimization for LLM Agents6 Apr

Other references · 42

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
  4. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  5. 2025Qwen3 Technical Reportcited by 8,195
  6. 2017Neural Discrete Representation Learningcited by 4,650
  7. 2021Zero-Shot Text-to-Image Generationcited by 4,276
  8. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
  9. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
  10. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  11. 2020Taming Transformers for High-Resolution Image Synthesiscited by 3,229
  12. 2016Categorical Reparameterization with Gumbel-Softmaxcited by 2,708
30 more
  1. 2014Conditional Generative Adversarial Netscited by 2,152
  2. 2013Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computationcited by 2,031
  3. 2023AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversationcited by 1,906
  4. 2019Generating Diverse High-Fidelity Images with VQ-VAE-2cited by 1,376
  5. 2022MaskGIT: Masked Generative Image Transformercited by 1,082
  6. 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
  7. 2021Learning to Prompt for Continual Learningcited by 938
  8. 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 803
  9. 2022High Fidelity Neural Audio Compressioncited by 673
  10. 2023Automatic Prompt Optimization with "Gradient Descent" and Beam Searchcited by 628
  11. 2025GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learningcited by 449
  12. 2022RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learningcited by 361
  13. 2024Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programscited by 270
  14. 2025TTRL: Test-Time Reinforcement Learningcited by 253
  15. 2024TextGrad: Automatic "Differentiation" via Textcited by 250
  16. 2024LiveBench: A Challenging, Contamination-Limited LLM Benchmarkcited by 242
  17. 2020HoVer: A Dataset for Many-Hop Fact Extraction And Claim Verificationcited by 199
  18. 2025Generalizing Verifiable Instruction Followingcited by 178
  19. 2024Trace is the Next AutoDiff: Generative Optimization with Rich Feedback, Execution Traces, and LLMscited by 62
  20. 2024PAPILLON: Privacy Preservation from Internet-based and Local Language Model Ensemblescited by 54
  21. 2023Pre-train, Prompt and Recommendation: A Comprehensive Survey of Language Modelling Paradigm Adaptations in Recommender Systemscited by 45
  22. 2025Feedback Descent: Open-Ended Text Optimization via Pairwise Comparisoncited by 42
  23. 2023Prompt Optimization via Adversarial In-Context Learningcited by 33
  24. 2025Promptomatix: An Automatic Prompt Optimization Framework for Large Language Modelscited by 11
  25. 2024QPO: Query-dependent Prompt Optimization via Multi-Loop Offline Reinforcement Learningcited by 10
  26. 2024MoPE: Mixture of Prompt Experts for Parameter-Efficient and Scalable Multimodal Fusioncited by 5
  27. 2026Modular Prompt Optimization: Optimizing Structured Prompts with Section-Local Textual Gradientscited by 5
  28. 2025MOPrompt: Multi-objective Semantic Evolution for Prompt Optimizationcited by 4
  29. 2025TRPrompt: Bootstrapping Query-Aware Prompt Optimization from Textual Rewardscited by 2
  30. 2026PromptEvolver: Prompt Inversion through Evolutionary Optimization in Natural-Language Spacecited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Enhancing LLM Instruction Following: An Evaluation-Driven Multi-Agentic Workflow for Prompt Instructions Optimization
  2. 2025ZERA: Zero-init Instruction Evolving Refinement Agent -- From Zero Instructions to Structured Prompts via Principle-based Optimization
  3. 2026Streamlined Reflective Evolution for Task-Adaptive Self-Refinement Pipelines
  4. 2025Self-Supervised Prompt Optimization
  5. 2026VeriInteresting: An Empirical Study of Model Prompt Interactions in Verilog Code Generation
  6. 2026STEVE: Stabilizing Textual Gradient-Based Prompt Optimization via Error-Driven Refinement and Regularized Verification
  7. 2025MA-SAPO: Multi-Agent Reasoning for Score-Aware Prompt Optimization
  8. 2024GReaTer: Gradients over Reasoning Makes Smaller Language Models Strong Prompt Optimizers