Group Relative Policy Optimization (GRPO) is a reinforcement learning algorithm for language models that scores each sampled response against the other responses generated for the same prompt, instead of against a learned value model. DeepSeek researchers introduced GRPO in the 2024 DeepSeekMath paper as a variant of Proximal Policy Optimization (PPO). It drops PPO's critic model and estimates the baseline from group scores, which the authors report significantly reduces training resources.
GRPO is the reinforcement learning algorithm DeepSeek used to train DeepSeek-R1-Zero and DeepSeek-R1. The method suits verifiable tasks, where the correctness of a response can be determined, such as math problems with a known answer or code run against test cases.
Group Relative Policy Optimization (GRPO) at a Glance
| Also called | GRPO. Published variants include DAPO and Dr. GRPO. |
|---|---|
| What it does | Samples a group of completions per prompt, normalizes rewards within the group to get each advantage, and updates the policy with a clipped objective and optional KL penalty. |
| Where it's used in model development | The reinforcement learning stage of post-training, especially for reasoning on math, coding and STEM tasks. |
| The human role | Defining the reward: ground-truth answers and test cases for verifiable tasks, and preference data for reward models on open-ended tasks. |
| Limits | Groups where every response gets the same reward produce no gradient. The original loss carries a response-length bias. Learned reward models are open to reward hacking. |
How GRPO Works
GRPO works by sampling several completions for each prompt, rewarding each one, and pushing the policy toward the completions that scored above their group's average.
- Sample a group. For each prompt, the policy generates G completions.
- Score each completion. A reward model or a reward function assigns each completion a reward.
- Compute the group-relative advantage. Each reward is normalized against the group: A_i = (r_i - mean(r)) / std(r). This step gives the method its name.
- Update the policy. A PPO-style clipped objective bounds the ratio between new and old token probabilities to the range 1 - ε to 1 + ε. A KL term weighted by β penalizes drift from a reference policy.
Worked example
The Hugging Face LLM Course uses the prompt "Calculate 2 + 2 × 6" with a group of 8 completions, 4 correct (reward 1) and 4 wrong (reward 0). The group mean is 0.5 and the standard deviation is 0.53. Each correct completion gets an advantage of (1 - 0.5) / 0.53 = 0.94, and each wrong one gets -0.94.
Key settings
- Group size (G): 16 in DeepSeek-R1-Zero training.
- Clip range (ε): 0.2, described in the DAPO paper as the default value of most algorithms.
- KL coefficient (β): 0.04 in the original DeepSeekMath paper, as reported by the Hugging Face LLM Course, and 0.001 for DeepSeek-R1-Zero. Hugging Face's TRL library defaults to 0.0, citing studies that found the KL term is not essential.
Where GRPO Is Used in Model Development
GRPO is used in the reinforcement learning stage of LLM post-training, most visibly to build reasoning models that are rewarded for correct final answers.
DeepSeekMath
DeepSeek applied GRPO after instruction tuning, using only a subset of English instruction-tuning data. The paper reports gains on GSM8K from 82.9% to 88.2% and on MATH from 46.8% to 51.7% during the reinforcement learning phase.
DeepSeek-R1-Zero and DeepSeek-R1
DeepSeek-R1-Zero applied GRPO directly to the DeepSeek-V3 base model and skipped supervised fine-tuning before RL. Its rule-based reward combined an accuracy reward and a format reward with equal weight. Math answers had to appear in a specified format so a rule could check them, and code was compiled and run against predefined test cases. DeepSeek-R1 used a multi-stage pipeline: thousands of cold-start examples, an RL stage, rejection sampling and SFT, then a secondary RL stage to align the model with human preferences. For general data it used model-based rewards, including a helpfulness reward model trained on 66,000 preference pairs judged by DeepSeek-V3.
GRPO Limits and the Human Role
GRPO's main limits come from its reward signal and its loss normalization.
Known failure modes
- Zero-advantage groups. If every output for a prompt is correct and gets the same reward, the group's advantage is zero and so is its policy gradient. TRL logs this as frac_reward_zero_std. DAPO over-samples and filters out prompts with accuracy of 0 or 1.
- Length bias. Liu et al. identified an optimization bias in GRPO that artificially increases response length, especially for incorrect outputs, and proposed Dr. GRPO to remove it.
- Entropy collapse. The DAPO authors observed policy entropy falling quickly in initial experiments with naive PPO or GRPO, with sampled responses in some groups becoming nearly identical.
- Reward hacking. DeepSeek avoided neural reward models for reasoning tasks because it observed they are susceptible to reward hacking during large-scale RL.
The human role
The human role in GRPO shifts from writing reasoning traces to defining the reward. DeepSeek reports that pure RL removed the need for human-labeled reasoning trajectories. DeepSeek also describes the reward as the source of the training signal that decides the direction of RL optimization. For DeepSeek-R1-Zero, that reward was based solely on the correctness of final predictions against ground-truth answers. The model still showed poor readability and language mixing, which DeepSeek-R1 was built to address.
Group Relative Policy Optimization (GRPO) vs. PPO and DPO
GRPO differs from PPO in how it estimates the advantage, and from DPO in being an online reinforcement learning method rather than a classification loss on fixed preference data.
| Aspect | GRPO | PPO | DPO |
|---|---|---|---|
| Introduced | 2024, DeepSeekMath | 2017, Schulman et al. | 2023, Rafailov et al. |
| Value model (critic) | None | Value function, with advantages from Generalized Advantage Estimation | None |
| Learning signal | Reward normalized within a group of samples for the same prompt | Advantage estimated from the value function and reward | Simple classification loss on preference labels |
| Sampling during training | Yes, online | Yes, alternates sampling and optimization | No |
| Main data input | Prompts plus a reward function or reward model | In RLHF, a reward model fit to human preferences | Human labels of the relative quality of model outputs |
Group Relative Policy Optimization (GRPO) at Hugo
Hugo's preference alignment and post-training teams prepare the data GRPO pipelines consume, with preference comparisons and scores organized, validated and formatted for DPO, PPO and GRPO training. The same dedicated teams review reward model and PRM data, applying scoring rubrics and checking preference consistency, and audit outputs for unsupported claims, unsafe outputs, reward hacking and drift across post-training cycles. Every team works from written guidelines and a calibration set each rater passes before production, with agreement tracked per criterion. For how GRPO fits alongside SFT, RLHF and DPO, see LLM post-training explained.
Related Terms
- Reinforcement Learning from Human Feedback (RLHF)
- Direct Preference Optimization (DPO)
- LLM Post-Training
- Supervised Fine-Tuning (SFT)
- Preference Data
- Process Reward Model (PRM)
- Reward Hacking
- Large Language Model (LLM)
Group Relative Policy Optimization (GRPO) FAQs
What is GRPO in reinforcement learning?
GRPO, or Group Relative Policy Optimization, is a policy optimization algorithm that trains a language model by comparing several of its own responses to the same prompt. It is a variant of PPO that drops the critic model. DeepSeek introduced GRPO in the 2024 DeepSeekMath paper and later used it to train DeepSeek-R1-Zero and DeepSeek-R1. Reinforcement learning itself, in NIST's definition, is machine learning in which a model optimizes its behavior according to a reward function through feedback from an environment. For GRPO, that reward is a rule-based check or a reward model, so the quality of the reward decides what the model learns.
How does GRPO calculate the advantage?
GRPO calculates each response's advantage by subtracting the group's mean reward from that response's reward and dividing by the group's standard deviation. In a Hugging Face example with 8 responses, 4 correct (reward 1) and 4 wrong (reward 0), the mean is 0.5, the standard deviation is 0.53, and the advantages are 0.94 and -0.94. Responses above the group average become more likely after the update. Liu et al. found the standard-deviation scaling can introduce a question-level difficulty bias, and TRL lets users turn it off with scale_rewards=False.
What is the difference between GRPO and PPO?
The main difference between GRPO and PPO is the baseline: PPO learns a value function to estimate advantages, while GRPO estimates the baseline from the scores of a group of sampled responses. PPO computes advantages with Generalized Advantage Estimation from a value function and the reward. Both use a clipped objective that limits how far each update moves from the previous policy. The DeepSeekMath authors report that removing the critic significantly reduces training resources compared with PPO, and that GRPO optimizes PPO's memory usage. Teams choosing between them should check whether their task offers a reliable per-response reward.
Is GRPO better than DPO?
GRPO and DPO solve different problems, so neither is better in general. GRPO is an online RL method that samples new responses during training and scores them with a reward. DPO fits a policy to existing human preference labels with a simple classification loss and needs no sampling from the model during fine-tuning. The DPO authors report it is stable and computationally lightweight. GRPO fits tasks with checkable answers, such as math and code, while DPO fits pairwise preference data that already exists. The practical question is which signal the team can produce reliably: verified answers or consistent preference rankings.
Does GRPO need a reward model?
GRPO does not require a learned reward model: it accepts any reward function, including rule-based checks of correctness. DeepSeek-R1-Zero used rule-based accuracy and format rewards, compiling code against test cases and checking math answers given in a set format. DeepSeek chose not to use neural reward models for reasoning tasks because they are susceptible to reward hacking at scale. For open-ended data such as general helpfulness, DeepSeek-R1 did use model-based rewards. When a reward model is used, its preference data needs the same consistency checks as any RLHF dataset.
How much compute does GRPO training need?
GRPO training compute depends on the run, but the DeepSeekMath authors report that dropping the critic model significantly reduces training resources compared with PPO. TRL's quick-start example, which trains a 0.5B-parameter model on math prompts, takes about 1 day distributed across 8 GPUs. At large scale, DeepSeek-R1-Zero sampled 16 outputs per question, with 32 unique questions per step, for a training batch size of 512. Budget estimates should start from group size, maximum completion length and model size.
What data does a team need to run GRPO?
A team running GRPO needs prompts, a reward signal for every sampled response, and, for open-ended tasks, preference data to train a reward model. For verifiable tasks, that means ground-truth answers in a checkable format or test suites for code. DeepSeek-R1 also used thousands of cold-start examples and a helpfulness reward model trained on 66,000 preference pairs judged by DeepSeek-V3. An outsourcing partner can write and verify reference answers, build and check preference pairs, and audit trained outputs for reward hacking. Ask the provider how raters are calibrated and how agreement is tracked before the data reaches training.
Sources
- Shao, Wang, Zhu, Xu, Song, Bi, Zhang, Zhang, Li, Wu, Guo (DeepSeek-AI, Tsinghua University, Peking University). DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models. arXiv. Updated April 27, 2024. Accessed November 10, 2026.
- DeepSeek-AI. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. arXiv. Accessed November 10, 2026.
- Hugging Face. GRPO Trainer. Accessed November 10, 2026.
- Hugging Face (Shirin Yamani). Advanced Understanding of Group Relative Policy Optimization (GRPO) in DeepSeekMath. Accessed November 10, 2026.
- Yu, Zhang, Zhu, Yuan, Zuo, Yue et al. (ByteDance Seed, Tsinghua AIR, The University of Hong Kong). DAPO: An Open-Source LLM Reinforcement Learning System at Scale. arXiv. Updated March 17, 2025. Accessed November 10, 2026.
- Liu, Chen, Li, Qi, Pang, Du, Lee, Lin. Understanding R1-Zero-Like Training: A Critical Perspective. arXiv. Updated October 6, 2025. Accessed November 10, 2026.
- Schulman, Wolski, Dhariwal, Radford, Klimov. Proximal Policy Optimization Algorithms. arXiv. Updated August 28, 2017. Accessed November 10, 2026.
- Rafailov, Sharma, Mitchell, Ermon, Manning, Finn. Direct Preference Optimization: Your Language Model is Secretly a Reward Model. arXiv. Updated July 29, 2024. Accessed November 10, 2026.
- National Institute of Standards and Technology (NIST), Computer Security Resource Center. reinforcement learning - Glossary | CSRC. Accessed November 10, 2026.




