Introduction
Reinforcement Learning with Verifiable Rewards (RLVR) has emerged as a cornerstone for training Large Language Models (LLMs) to perform complex reasoning tasks, such as mathematical problem-solving and coding. However, the training process for these models is notoriously unstable. This paper introduces Sharpness-Guided Group Relative Policy Optimization (GRPO-SG), a novel method designed to stabilize RLVR training by addressing the root cause of volatility: optimization sharpness.
The Challenge: Optimization Sharpness
In standard Group Relative Policy Optimization (GRPO), the optimizer frequently encounters "sharp" regions in the loss landscape. In these regions, minor adjustments to model parameters result in disproportionately large swings in the gradient. The authors identify that low-probability tokens often induce these massive gradients, providing noisy signals that distract the model from learning meaningful patterns. This lack of control over sharpness leads to poor generalization, where models excel on training data but fail on slightly modified test scenarios.
Methodology: GRPO-SG
To mitigate these issues, the authors propose a "generalization lens" for GRPO. They mathematically demonstrate that generalization loss is upper-bounded by training loss combined with a sharpness surrogate, measured by the gradient norm. GRPO-SG minimizes this bound through several key mechanisms:
- Probability Shaping: Instead of uniform weighting, GRPO-SG assigns weights to individual tokens based on their model-predicted probabilities.
- Downweighting Volatility: The algorithm specifically reduces the influence of tokens likely to cause large, noisy gradients—typically those with low probabilities.
- Preserving Structural Signal: It maintains or increases the weight of tokens the model is confident in, which often correspond to critical structural elements like operators and brackets.
- Stop-Gradient Mechanism: A stop-gradient operator is applied to the probabilities used for weighting to prevent the model from "gaming" the optimization objective.
By smoothing out gradient-norm trajectories, GRPO-SG ensures the model converges to "flatter" minima, which are theoretically and empirically linked to superior generalization.
Experimental Results
The researchers evaluated GRPO-SG across three primary reasoning domains: mathematical reasoning (OlympiadBench, MATH-500), agentic reasoning (VT-Search), and logic puzzles (Knights and Knaves).
Across all benchmarks, GRPO-SG significantly outperformed the standard GRPO baseline:
- Logic Puzzles: Accuracy on the K&K benchmark for a Qwen2.5-3B model rose from 0.39 to 0.63.
- Agentic QA: Exact-match accuracy in multi-hop question answering nearly doubled, reaching 27.29%.
- Mathematics: Average performance gains of 6–10% were observed across various benchmarks, with a notable jump on the challenging AIME 2024 metric.
Stability and Gradient Analysis
The core advantage of GRPO-SG is its ability to stabilize the training process. By analyzing gradient norms, the authors found that GRPO-SG produces much smoother trajectories with fewer spikes compared to standard GRPO.
Word cloud analysis further revealed that standard GRPO often over-emphasizes "filler" words because they produce noisier gradients. In contrast, GRPO-SG prioritizes structural tokens, leading to more robust reasoning capabilities without increasing peak GPU memory usage.
Conclusion
GRPO-SG offers a mathematically grounded and computationally efficient solution to the instability of RLVR training. By regulating token-level contributions to the gradient, it achieves flatter minima and significantly better generalization across diverse reasoning tasks. Future work will explore more complex shaping functions and the scalability of these benefits to models exceeding 70 billion parameters.
Summary updated