p1: Better Prompt Optimization with Fewer Prompts
cs.LG, cs.CL
Submitted: 2026-04-09
Updated: 2026-08-26
Code: https://github.com/huggingface/Math-Verify
License: http://creativecommons.org/licenses/by/4.0/
The gist: Prompt optimization improves language models without updating their weights by searching for a better system prompt, but its effectiveness varies widely across tasks.
Terminology
Abstract
Prompt optimization improves language models without updating their weights by searching for a better system prompt, but its effectiveness varies widely across tasks. We study what makes a task amenable to prompt optimization. We show that the reward variance across different system prompts can be decomposed into two components: variance among responses, which captures generation stochasticity, and variance among system prompts, which captures differences in system prompt quality. Prompt optimization succeeds when variance among system prompts is sufficiently large, but fails when variance among responses dominates the variance of the system prompts. Surprisingly, we further show that scaling to more user prompts can hurt optimization by reducing variance among system prompts, especially on heterogeneous datasets where different user prompts favor different system prompts. Motivated by this insight, we propose p1, a simple user prompt filtering method that selects a small subset of user prompts with high variance across candidate system prompts. This subset of user prompts allows one to distinguish a good system prompt from a bad one, making system optimization easier. Experiments on reasoning benchmarks show that p1 substantially improves prompt optimization over training on the full dataset and outperforms strong baselines such as GEPA. Notably, training on only two prompts from AIME 24 yields a system prompt that generalizes well to other reasoning benchmarks.
Sources
- GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
- PRL: Prompts from Reinforcement Learning
- UPRISE: Universal Prompt Retrieval for Improving Zero-Shot Evaluation
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning
- RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning
- Promptbreeder: Self-Referential Self-Improvement Via Prompt Evolution
- Prompt Curriculum Learning for Efficient LLM Post-Training
- EvoPrompt: Connecting LLMs with Evolutionary Algorithms Yields Powerful Prompt Optimizers
- DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines
- PRewrite: Prompt Rewriting with Reinforcement Learning
- StablePrompt: Automatic Prompt Tuning using Reinforcement Learning for Large Language Models
- Prompt-R1: Collaborative Automatic Prompting Framework via End-to-end Reinforcement Learning
- Understanding R1-Zero-Like Training: A Critical Perspective
- Automatic Prompt Optimization with "Gradient Descent" and Beam Search
- Generalizing Verifiable Instruction Following
- POLCA: Stochastic Generative Optimization with LLM
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
- Qwen3 Technical Report
- One Prompt is not Enough: Automated Construction of a Mixture-of-Expert Prompts
- PromptBridge: Cross-Model Prompt Transfer for Large Language Models
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks