grpo

grpo is a skill for Claude Code, Codex from benchflow-ai/skillsbench. It costs 77 tokens per session (982 once invoked), scanned A, original, Apache-2.0.

A training algorithm for improving language models by comparing several generated answers to the same prompt. GRPO, or Group Relative Policy Optimization, scores those answers relative to one another instead of using a separate value-estimation model.

In plain words
What is it for?
Use it when implementing, checking, or debugging GRPO-based language-model training.
Why use it?
It gives a defined training loop for turning answer scores into model updates while avoiding a separate critic model.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when implementing, checking, or debugging GRPO-based language-model training.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/benchflow-ai/skillsbench/grpo
About the project

SkillsBench is a benchmark for measuring how effectively AI agents use modular skills—folders containing instructions, scripts, and resources—to complete specialized tasks. It helps researchers and developers evaluate both skill quality and agent behavior, including tasks that require combining multiple skills. The catalogue’s skills and instructions are evaluated as part of this workflow.

benchflow-ai/skillsbench · 1,760 stars · on GitHub · skillsbench.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add benchflow-ai/skillsbench --skill grpo
Clone the repo
git clone --depth 1 https://github.com/benchflow-ai/skillsbench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for grpo

README.md
[![agentmods](https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/grpo/github.svg)](https://agentmods.dev/skills/benchflow-ai/skillsbench/grpo)
Your own site
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/grpo"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/grpo/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for grpo

Your own site · 80×15
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/grpo"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/grpo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 982 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 85
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.00982
Opus 5 $0.00039 $0.00491
Sonnet 5 $0.00015 $0.00196
Haiku 4.5 $0.00008 $0.00098

Measured 7d ago against content hash 90ef5f123f4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

grpo scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tasks/debug-trl-grpo/environment/skills/grpo/SKILL.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GRPO Algorithm Reference

Overview

Group Relative Policy Optimization (GRPO) is a policy gradient method that eliminates the need for a learned critic by computing advantages from group statistics. For each prompt, multiple completions are sampled and their rewards are normalized within the group to produce advantages.

Key insight: Instead of training a value function to estimate V(s), GRPO uses the mean reward of the group as the baseline. This removes the critic entirely, reducing memory and avoiding value function approximation errors.

Training Loop

Each step follows this pipeline:

1. Sample G completions per prompt from current policy
2. Decode completions to text
3. Score completions with reward function
4. Compute group-relative advantages
5. Compute per-token log-probs (current policy + reference policy)
6. Compute clipped surrogate loss with KL penalty
7. Backpropagate and update

Advantage Estimation

Rewards are normalized within each group of G completions for the same prompt:

mu   = mean(r_1, ..., r_G)
sigma = std(r_1, ..., r_G)
A_i  = (r_i - mu) / (sigma + epsilon)

epsilon is a small constant (typically 1e-4 to 1e-8) for numerical stability only. It prevents division by zero when all rewards in a group are identical.

Properties:

  • Advantages within each group sum to approximately zero;
  • High-reward completions get positive advantages, low-reward get negative;
  • The learning signal vanishes if epsilon is too large (dominates denominator) or if rewards are constant. For example, if all rewards in a group are identical (or nearly identical), then causing all advantages to collapse to 0;

Log-Probability Computation

Per-token log probabilities via log-softmax:

log_prob(token_i) = logit(token_i) - logsumexp(logits)

Critical invariant: log_prob <= 0 always, since it's the log of a probability in (0, 1].

Sequence-level log probability: log_pi(y|x) = sum_t log_pi(t_j | x, t_<j)

Loss Function

Read the full file on GitHub · 89 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 89 lines · 77 tokens per session scan A 90ef5f123f4b

Subscribe to this mod's changes

grpo is a skill published in the GitHub repository benchflow-ai/skillsbench (1,760 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 77 tokens to every session and 982 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.