Skip to main content
Back

MaxPO Cuts Gradient Variance by 77% When Training AI to Self-Improve

MaxPO introduces a Leave-Two-Out baseline that cuts gradient variance by 77% and boosts math reasoning pass@256 by up to 5.2% over existing methods

Pro

  • MaxPO introduces a Leave-Two-Out (L2O) baseline for max@K policy gradient training, fixing a centering flaw in existing methods like PKPO.
  • The L2O baseline reduces gradient variance by 77.4% on Llama-3.2-3B-Instruct compared to PKPO during RL fine-tuning.
  • MaxPO improves pass@256 by 5.2% on Qwen2.5-Math-7B and 2.4% on Llama-3.2-3B-Instruct across five math benchmarks.
  • The paper provides a unified theoretical framework showing existing estimators (PKPO, Entropy-Adv) are uncentered, while MaxPO achieves exact batch centering.
  • Implementation is an O(B²) vectorized operation that plugs into any GRPO-style training loop with no other changes required.
  • A companion library, OrderGrad, generalizes the approach to arbitrary rank-weighted objectives (CVaR, top-M, trimmed means) under MIT license.

Most LLM post-training work today optimizes for pass@1: can the model get the right answer on a single try? But for real deployment, what often matters more is pass@K or max@K -- can the model produce at least one correct answer (or the best possible answer) across K independent attempts? A new paper, "On Advantage Estimates for Max@K Policy Gradients", zeroes in on a subtle but consequential flaw in how existing methods compute gradient signals for these objectives, and proposes a cleaner fix called MaxPO.

Why optimizing for "best of K" is hard

Reinforcement learning with verifiable rewards is widely used for post-training reasoning models, but sparse outcome rewards make exploration difficult. The standard workaround is GRPO (Group Relative Policy Optimization), which samples a group of responses per prompt and uses their relative rewards as gradient weights. GRPO samples multiple responses and uses standard scores of their rewards as gradient weights, eliminating the need for training an additional model for advantage estimation.

But GRPO optimizes for the average response quality. When you care about the best response in a group -- the max@K objective -- you need a different gradient signal. Existing policy-gradient estimators for these objectives use different signals, baselines, and normalizations, making their relationships unclear. The field has produced several competing methods (PKPO, Entropy-Adv, EI-based estimators) with no clear unifying theory explaining when and why one beats another.

The centering problem nobody talked about

To understand the paper's contribution, you need to know what an advantage is in this context: it's the signal that tells the policy gradient update which responses to push up and which to push down. A well-designed advantage should be centered -- meaning the positive and negative signals in a training batch should cancel out to zero. This matters because uncentered advantages introduce a systematic bias in the gradient direction that inflates variance and destabilizes training.

Starting from the advantage estimator of a leading method in the field, the authors show that it is policy-gradient unbiased but yields a non-centered advantage. In other words, the existing PKPO estimator gives you correct gradients in expectation, but any given batch will have lopsided signals -- too many positives or too many negatives -- making training noisier than it needs to be.

The distinction matters: policy-gradient unbiasedness means the estimator points in the right direction on average. Advantage centering means the realized batch signals are balanced. You can have the former without the latter, and the paper shows that's exactly what's happening with the current state of the art.

Estimation error and gradient variance comparison between L2O, L1O, and EI methods

Leave-Two-Out: the fix

The authors introduce a Leave-Two-Out (L2O) baseline that preserves policy-gradient unbiasedness while making realized batch advantages exactly centered. The name is a riff on the well-known Leave-One-Out (LOO) baseline used in RLOO and related methods. The key difference: for max@K, leaving out just one sample isn't enough to produce a centered signal. You need to leave out two -- one for the "best" slot and one for the comparator -- to get the math to work out cleanly.

Here's the intuition. When estimating the advantage of a response being the maximum in a group, the baseline you subtract needs to account for the fact that you're comparing against the rest of the group. Leaving out two samples lets you construct an unbiased estimate of what the max would look like without the current response, without contaminating the signal with the response itself. The result is a batch where positive and negative advantage signals exactly balance.

The authors implement this as an O(B²) vectorized operation and incorporate the estimator into group-based reinforcement learning for LLM post-training, calling it MaxPO (Max@K Policy Optimization). Quadratic time sounds expensive, but in practice the group sizes used in LLM training (typically 8-32 samples per prompt) make this negligible.

The paper also delivers something theoretically valuable: a canonical finite-batch advantage for max@K, providing a unified view of existing advantage estimators. This lets you see PKPO, Entropy-Adv, and MaxPO as points on the same map rather than disconnected proposals. Under this view, current methods fall into two categories: uncentered signals such as EI-only/PKPO, and (normalized) canonical signals such as MaxPO.

Gradient variance comparison between L2O and EI methods across different budget sizes

What the numbers say

The authors perform RL fine-tuning on Llama-3.2-3B-Instruct and Qwen2.5-Math-7B. They compare their method (EI+L2O) against three baselines including GRPO and PKPO. On Llama-3.2-3B-Instruct, MaxPO achieved an average reduction of 77.4% in gradient variance during training compared to PKPO.

The method also improved task-average pass@256 performance by 5.2% on Qwen2.5-Math-7B and by 2.4% on Llama-3.2-3B-Instruct relative to PKPO across five math reasoning benchmarks: AIME24, AIME25, AMC23, MATH500, and Minerva. The variance-reduction effect of L2O over raw EI grows with the action space size, a regime particularly relevant for LLMs.

Performance comparison across AIME2024, AIME2025, AMC23, MATH500, and Minerva benchmarks

When to use this (and when not to)

MaxPO is a strong fit for any scenario where you care about best-of-K performance rather than average performance:

  • Math and code reasoning where you sample multiple solutions and pick the best one at inference time
  • Hard exploration problems where pass@1 training stalls because the model rarely gets anything right -- PKPO and related methods address this by optimizing for sets of samples that maximize reward when considered jointly
  • Any GRPO-style training loop where you already sample groups of responses per prompt -- MaxPO slots in as a drop-in advantage replacement

There are real constraints to keep in mind. The method requires K to be at most B-1, which may limit its direct use when the optimization objective size approaches the group size. L2O is most effective for moderate comparator budgets; a too-small comparator budget yields a noisy baseline and diminishes the variance-reduction effect. In practice, this means you need a reasonably large rollout group (B >= 8 is a safe floor) to see the benefits.

The broader picture

This paper lands alongside a companion work from the same team: OrderGrad, which generalizes the same ideas to arbitrary rank-weighted objectives -- not just the maximum, but top-M, trimmed means, CVaR (Conditional Value at Risk, a measure of tail risk), and more. OrderGrad introduces a family of likelihood-ratio and reparameterization gradient estimators for order-statistic objectives, recovering objectives such as VaR, CVaR, trimmed means, medians, and top-m/best-of-K criteria by changing only the rank weights. The OrderGrad library is available on GitHub under the MIT license and can be used for LLM training and other REINFORCE/GRPO/PPO-based tasks.

For practitioners already running GRPO-style training on reasoning tasks, MaxPO is a low-friction upgrade. The core change is swapping the advantage computation -- everything else in the training pipeline stays the same. The 77% variance reduction alone is a compelling reason to try it, since lower gradient variance typically translates to more stable training runs and less sensitivity to hyperparameters like learning rate and group size.