A research team from Cornell, Microsoft, Harvard, and Databricks AI Research discovered something that should make every ML engineer's ears perk up. You can get better results optimizing prompts with just two examples than with thirty. They call their method p1, and it solves a problem most teams don't realize they have.

The Problem Nobody Talked About

Prompt optimization sounds simple in theory. You have a language model. You want to find the best system prompt. You try a bunch of candidates and pick the one that works best.

In practice, it fails a lot. On some tasks, optimized prompts deliver clear gains. On others, the optimization process flatlines. You throw more compute at it, and nothing happens. The training reward just sits there, refusing to budge.

This inconsistency bothered Zhaolin Gao and his colleagues. They wanted to understand why. Not just patch it, but actually explain what's going wrong.

Variance Is the Key

The team identified that reward variance across system prompts breaks into two components: variance among responses and variance among system prompts.

Variance among responses comes from the model's generation stochasticity. Every time you ask a model the same question, you get a slightly different answer. On hard reasoning tasks, this noise is massive. The model might get the answer right 20% of the time and wrong 80% of the time, regardless of which system prompt you use.

Variance among system prompts is the signal you want. This measures how much the choice of system prompt actually matters. Does prompt A consistently outperform prompt B? That difference shows up here.

The core insight is simple. Prompt optimization only works when the variance among system prompts is large enough to rise above the noise. When response variance dominates, the optimization signal drowns.

Two Benchmarks, Two Stories

The researchers tested this on two benchmarks: IFBench, an instruction-following benchmark, and AIME, a competition-level math reasoning benchmark.

On IFBench, different system prompts produce clearly different rewards. The variance among system prompts dominates. The optimization signal is clean. Prompt optimization works well.

On AIME, the opposite happens. Response variance swamps system prompt variance. The model's inherent randomness on hard math problems is so large that different system prompts all look roughly the same. The optimization signal collapses to near zero.

They confirmed this with a direct experiment. They trained on one AIME problem at a time across ten different problems. The problems with higher variance among system prompts showed clear learning. The ones with low variance showed no improvement at all. The correlation was linear and strong.

The Counterintuitive Discovery

Here's where it gets weird. Training on all 30 AIME 2024 problems produced zero improvement. Zero. But training on a single high-variance problem produced clear gains.

More data hurts. On heterogeneous tasks where different examples favor different prompts, averaging across the full dataset cancels out the signal. A prompt that helps on problem 3 might hurt on problem 17. When you average across all 30 problems, these effects cancel. Every system prompt starts looking roughly the same in expected reward.

This runs counter to every instinct about machine learning. More data is supposed to be better. Not here. The dataset is not a representative sample of a single ground truth. It's a collection of conflicting preferences.

Think of it like this. Imagine you're picking a restaurant for a group. If everyone likes Italian food, averaging opinions works fine. But if half the group wants sushi and half wants tacos, the average preference is "meh, whatever." You lose the signal. The same thing happens with prompt optimization on diverse tasks.

Enter p1

The team's solution is p1. The name is a reference to p-value, since the method filters for prompts that show statistically meaningful differences across candidate system prompts.

The algorithm works in three steps:

  1. Sample a set of candidate system prompts from an initial policy.
  2. For each user prompt in your dataset, compute the reward variance across those candidate system prompts.
  3. Select the top-k user prompts with the highest variance. These are the prompts that best distinguish good system prompts from bad ones.

Then train on just those k prompts instead of the full dataset.

That's it. No complex architecture. No new loss functions. Just filter your training data to the examples that carry the strongest signal.

Results

The results are striking.

On AIME 2024, standard prompt optimization on the full 30-question training set fails completely. The training reward stays flat. p1, using only the top 2 prompts by variance, achieves meaningful improvement.

Two prompts. Not twenty. Not ten. Two.

The optimized system prompt also generalizes. A prompt trained on just 2 AIME 2024 problems improves performance on AIME 2025, MATH 500, and GPQA Diamond. The gains transfer across benchmarks the model never saw during training.

The prompt even transfers across model sizes. A system prompt optimized for Qwen3-4B also improves Qwen3-30B-A3B on held-out reasoning benchmarks.

p1 also outperforms GEPA, a recent evolutionary prompt optimization method. GEPA improves performance on IFBench but fails on AIME. p1 succeeds on both.

On IFBench, where the full dataset already carries a strong signal, p1 filtering still helps but the gains are modest. This makes sense. When variance among system prompts is already high, filtering adds less value. p1 shines where standard approaches fail.

Why This Matters for Production Teams

This paper has practical implications that go beyond the benchmarks.

Cost savings

Prompt optimization requires generating hundreds or thousands of model responses per training step. Each evaluation requires K times M responses, where K is the dataset size and M is the number of samples per prompt. On AIME, a single training step with K=30 and M=2 takes about 1,400 seconds on 4 H100 GPUs.

Reducing K from 30 to 2 cuts compute per step by 93%. Not 10% or 20%. Ninety-three percent. And the result is better, not worse.

Diagnostic tool

The variance decomposition gives teams a way to predict whether prompt optimization will work on their task before spending compute. Compute variance among system prompts and variance among responses on a small sample. If the signal-to-noise ratio is low, you know prompt optimization will struggle. Consider other approaches like fine-tuning instead.

Dataset design

Most teams throw their entire evaluation set at prompt optimization. This paper shows that's counterproductive on heterogeneous tasks. The filtering approach should change how teams think about prompt optimization datasets. Smaller, curated sets of high-signal examples beat large, diverse ones.

Transfer learning

The fact that prompts optimized on 2 examples transfer to other benchmarks and larger models is encouraging. It suggests that the prompt is learning general reasoning strategies, not overfitting to specific problems. For teams optimizing prompts for production, this means you can optimize on a small, cheap set and deploy with confidence.

The Bigger Picture

p1 connects to a broader theme in ML. Data quality matters more than data quantity. Active learning, curriculum learning, and coreset selection all make similar points. The specific insight here is that prompt optimization has a particular kind of noise problem, and the fix is filtering for discriminative examples.

The paper also highlights an uncomfortable truth about current prompt optimization methods. The standard approaches, both RL-based and evolution-based, fail on reasoning tasks. Not because the algorithms are bad, but because the signal is buried. p1 doesn't change the optimizer. It changes the input data so the optimizer can actually see the signal.

There's also a lesson about evaluation. If your evaluation set is too diverse, your optimization signal collapses. This is a form of the alignment tax that teams should watch for. When different user prompts want different things from the system prompt, you need to decide what you're optimizing for rather than trying to optimize for everything at once.

Limitations

The paper focuses on binary reward settings (correct or incorrect). Many production tasks use continuous rewards like BLEU, ROUGE, or embedding similarity. Whether p1's variance filtering helps in those settings remains an open question.

The filtering step itself requires generating responses from candidate system prompts, which costs compute upfront. You need N candidate prompts and M responses per user prompt to compute variance. The paper uses N=16 and M=128 for filtering. This upfront cost is still far less than training on the full dataset, but it's not zero.

The method also requires that some user prompts in the dataset have high variance across system prompts. If no prompts are discriminative, filtering won't help. The paper shows this is the case for AIME, but for some tasks, the signal might genuinely be too weak everywhere.

What to Try Next

If you're running prompt optimization in production, here's a practical checklist based on this work:

  • Before optimizing, compute variance across candidate system prompts for each example in your dataset. Plot the distribution. If it's flat, prompt optimization will likely fail on the full set.
  • Filter to the top-k examples by system prompt variance. Start with k=2 to k=5.
  • Optimize on the filtered set. Compare against full-dataset optimization.
  • Evaluate on your held-out test set. Check whether the prompt transfers.
  • If you're optimizing across multiple tasks, consider separate prompts for each rather than one prompt averaged across all of them.

The Bottom Line

More prompts aren't always better for prompt optimization. On heterogeneous tasks, adding examples can actively hurt by diluting the optimization signal. p1 shows that filtering down to the most discriminative examples, even just two of them, produces better prompts than training on the full dataset.

The paper is a clean piece of work. Clear problem statement. Elegant theoretical framing. Simple solution. Strong empirical results. And a finding that challenges the default assumption that more data is always better.

For teams running prompt optimization at scale, the cost savings alone make p1 worth trying. The conceptual insight, that signal quality matters more than data quantity for prompt optimization, should change how you think about your training pipeline.


Paper: p1: Better Prompt Optimization with Fewer Prompts by Zhaolin Gao, Yu (Sid) Wang, Bo Liu, Thorsten Joachims, Kianté Brantley, and Wen Sun. arXiv:2604.08801. April 9, 2026. Cornell University, Microsoft, Harvard University, Databricks AI Research.

Citations:

  • Gao et al., "p1: Better Prompt Optimization with Fewer Prompts," arXiv:2604.08801, 2026. https://arxiv.org/abs/2604.08801
  • Pyatkin et al., "Generalizing Verifiable Instruction Following," IFBench, 2025.
  • Balunović et al., "SRI-Math Arena," AIME benchmark, 2025.
  • Agrawal et al., "GEPA: Reflective Prompt Evolution," 2026.
  • Qwen3 Team, "Qwen3 Technical Report," 2025.

Suggested title: Less Is More: Why Two Prompts Can Beat Thirty for Prompt Optimization

Word count: 1,530

Fact-check notes:

  • The claim about training on 2 AIME prompts comes from the paper's abstract and results. The specific number "2" should be verified against the full experimental tables, as the abstract says "training on only two prompts from AIME 24 yields a system prompt that generalizes well to other reasoning benchmarks."
  • The 1,400 seconds per training step figure comes from Section 3.1 of the paper, which states this is for M=2 on AIME with N=16 system prompts.
  • The 93% compute reduction claim is my calculation based on reducing K from 30 to 2, which is a 28/30 = 93.3% reduction in per-step compute. This should be noted as an approximation since the actual training cost includes fixed overhead beyond per-sample generation.
  • Transfer to Qwen3-30B-A3B is shown in Figure 1 of the paper. The specific benchmark improvements (AIME 2025, MATH 500, GPQA Diamond) should be verified against the full results tables.
  • GEPA comparison: the paper states GEPA improves IFBench but not AIME. This is consistent with the variance analysis.
  • The variance decomposition formula (Equation 4) and its derivation are in the paper and Appendix B.1. My description is accurate to the paper's presentation.