What is GRPO?

GRPO is a reinforcement learning algorithm for language models that samples several answers per prompt, judges each answer's reward against the average of its group and so updates the policy without needing a separate value model.

Unlike Proximal Policy Optimisation, which estimates how much better each answer is than expected with a separate value model, GRPO computes this from the relative reward within the prompt's answer group. This cuts the number of models held in memory during training.

Topic
Machine learning, models and training
Also known as
Group Relative Policy Optimization
Origin
2024, Shao et al.

How GRPO works

  1. A group of answers is sampled from the model being trained for each prompt.
  2. Each answer is scored by a reward model or a rule-based verifier.
  3. Each answer's advantage is its score's difference from the group mean, divided by the group's spread.
  4. The model is updated with these advantages, using a clipped objective like PPO's and a penalty limiting drift from a reference model.

In more detail

Advantage calculation, reference model and rollout cost

Standard GRPO computes each answer's advantage by subtracting the group's mean reward and dividing by its standard deviation over the G sampled rollouts. While eliminating the value network saves substantial VRAM, GRPO still typically keeps a frozen reference policy for the KL penalty (often via CPU offloading or LoRA adapter toggling) and spends most of its wall-clock time generating the G multi-step rollouts per prompt.

After DeepSeek-R1: length bias, Dr. GRPO and DAPO

In early 2025, DeepSeek-R1 popularised GRPO by pairing it with rule-based verifiable rewards (RLVR), showing that large-scale reasoning behaviours such as self-verification and backtracking can emerge without process-level human labels. However, subsequent research, including Dr. GRPO and DAPO, identified response-length bias and standard-deviation difficulty bias in the original objective, leading many newer training recipes to remove the std divisor, drop or relax the KL penalty or move to sequence-level clipping.

Zero-variance groups and dynamic prompt filtering

Because group advantage relies on variance within the G sampled answers, if a prompt is so easy that all G rollouts pass (reward=1) or so hard that all fail (reward=0), the group advantage collapses to zero and yields no gradient signal. Production pipelines therefore use dynamic prompt filtering or curriculum sampling to focus compute on prompts of intermediate difficulty.

Commonly confused terms

TermHow it differs
Direct preference optimisationDPO optimises directly on static offline preference pairs (chosen and rejected) without online rollouts or a separate verifier; GRPO is an online RL method that samples fresh responses from the current policy and scores them dynamically with a verifier or reward model.
Reinforcement learning with verifiable rewards (RLVR)RLVR is the broader training paradigm of applying reinforcement learning with deterministic, programmatic verifiers (unit tests, math checkers, SQL execution); GRPO is a widely used optimisation algorithm for RLVR (notably in DeepSeek-R1), though PPO or DAPO can also be used.

Why GRPO matters for on-premises AI

Needing no separate value model, GRPO uses less GPU memory than a PPO-based setup, making reinforcement learning easier on in-house capacity. Where rewards can be checked automatically, such as code passing tests or a query returning the right result, it works with verifiable rewards without human labelling. A weak verifier can be exploited by the model, so the verifier is tested too.

ON-PREMISES EXAMPLE

A bank trains its internal text-to-SQL model with GRPO, rewarding generated queries that run without error on a test database and return the expected result; training runs on in-house GPU servers.

Common questions

How does GRPO differ from PPO?

PPO estimates advantage with a separate value model. GRPO compares answers to the same prompt within a group, needing no value model, so it uses less memory.

Which tasks is GRPO used for?

Especially reasoning tasks where answers can be checked automatically, such as maths, code and query generation. It can also use a reward model.

Sources

In the glossary: Glossary, E to L

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.