Prompt Codebooks: Discrete Compositional Optimization for Language Model Instruction Refinement
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
Other references · 42
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2025Qwen3 Technical Reportcited by 8,195
- 2017Neural Discrete Representation Learningcited by 4,650
- 2021Zero-Shot Text-to-Image Generationcited by 4,276
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
- 2020Taming Transformers for High-Resolution Image Synthesiscited by 3,229
- 2016Categorical Reparameterization with Gumbel-Softmaxcited by 2,708
30 more
- 2014Conditional Generative Adversarial Netscited by 2,152
- 2013Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computationcited by 2,031
- 2023AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversationcited by 1,906
- 2019Generating Diverse High-Fidelity Images with VQ-VAE-2cited by 1,376
- 2022MaskGIT: Masked Generative Image Transformercited by 1,082
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
- 2021Learning to Prompt for Continual Learningcited by 938
- 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 803
- 2022High Fidelity Neural Audio Compressioncited by 673
- 2023Automatic Prompt Optimization with "Gradient Descent" and Beam Searchcited by 628
- 2025GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learningcited by 449
- 2022RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learningcited by 361
- 2024Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programscited by 270
- 2025TTRL: Test-Time Reinforcement Learningcited by 253
- 2024TextGrad: Automatic "Differentiation" via Textcited by 250
- 2024LiveBench: A Challenging, Contamination-Limited LLM Benchmarkcited by 242
- 2020HoVer: A Dataset for Many-Hop Fact Extraction And Claim Verificationcited by 199
- 2025Generalizing Verifiable Instruction Followingcited by 178
- 2024Trace is the Next AutoDiff: Generative Optimization with Rich Feedback, Execution Traces, and LLMscited by 62
- 2024PAPILLON: Privacy Preservation from Internet-based and Local Language Model Ensemblescited by 54
- 2023Pre-train, Prompt and Recommendation: A Comprehensive Survey of Language Modelling Paradigm Adaptations in Recommender Systemscited by 45
- 2025Feedback Descent: Open-Ended Text Optimization via Pairwise Comparisoncited by 42
- 2023Prompt Optimization via Adversarial In-Context Learningcited by 33
- 2025Promptomatix: An Automatic Prompt Optimization Framework for Large Language Modelscited by 11
- 2024QPO: Query-dependent Prompt Optimization via Multi-Loop Offline Reinforcement Learningcited by 10
- 2024MoPE: Mixture of Prompt Experts for Parameter-Efficient and Scalable Multimodal Fusioncited by 5
- 2026Modular Prompt Optimization: Optimizing Structured Prompts with Section-Local Textual Gradientscited by 5
- 2025MOPrompt: Multi-objective Semantic Evolution for Prompt Optimizationcited by 4
- 2025TRPrompt: Bootstrapping Query-Aware Prompt Optimization from Textual Rewardscited by 2
- 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
- 2026Enhancing LLM Instruction Following: An Evaluation-Driven Multi-Agentic Workflow for Prompt Instructions Optimization
- 2025ZERA: Zero-init Instruction Evolving Refinement Agent -- From Zero Instructions to Structured Prompts via Principle-based Optimization
- 2026Streamlined Reflective Evolution for Task-Adaptive Self-Refinement Pipelines
- 2025Self-Supervised Prompt Optimization
- 2026VeriInteresting: An Empirical Study of Model Prompt Interactions in Verilog Code Generation
- 2026STEVE: Stabilizing Textual Gradient-Based Prompt Optimization via Error-Driven Refinement and Regularized Verification
- 2025MA-SAPO: Multi-Agent Reasoning for Score-Aware Prompt Optimization
- 2024GReaTer: Gradients over Reasoning Makes Smaller Language Models Strong Prompt Optimizers