wshobson/agents

grpo-rlvr-training

Train reasoning and verifiable-task behavior with GRPO and reinforcement learning from verifiable rewards (RLVR).

  • SKILL.md 已保存
  • 英文来源资料
  • 安装与运行未实测
先判断是否解决你的问题

grpo-rlvr-training 是什么?

Train reasoning and verifiable-task behavior with GRPO and reinforcement learning from verifiable rewards (RLVR). Use when task success is algorithmically checkable (math, code, tool calls, structured output), when designing GRPO reward functions, or when a GRPO run diverges or reward-hacks.

以上为来源原文,中文用途说明尚待整理。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 grpo-rlvr-training,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 grpo-rlvr-training

请在 Codex 的当前工作环境中安装并检查 grpo-rlvr-training 这个 Skill。

项目身份:wshobson/agents / grpo-rlvr-training
来源:https://github.com/wshobson/agents/blob/91ff75307f5668916f3eb77d5ba556266c961376/plugins/llm-finetuning/skills/grpo-rlvr-training/SKILL.md
已定位的源文件:plugins/llm-finetuning/skills/grpo-rlvr-training/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-22T03:34:45.756Z
中文使用说明
尚待整理,保留英文来源内容
安装与任务测试
本站未执行安装或任务测试
来源复核
已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料

plugins/llm-finetuning/skills/grpo-rlvr-training/SKILL.md · 抓取时间 2026-11-22T03:34:45.756Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Train reasoning and verifiable-task behavior with GRPO and reinforcement learning from verifiable rewards (RLVR). Use when task success is algorithmically checkable (math, code, tool calls, structured output), when designing GRPO reward functions, or when a GRPO run diverges or reward-hacks.

查看源文件章节 / Source sections
  • 原文:GRPO & RLVR Training
  • 原文:When RL Applies
  • 原文:The Recipe
  • 原文:The Inspection Rule
  • 原文:Variant Selection
  • 原文:VLM RL Is Reference-Only
  • 原文:References
原文:GRPO & RLVR Training

This skill assumes `finetuning-method-selection` already routed here because the target behavior has a verifiable pass/fail signal — not demonstrations (`lora-qlora-recipes`) or preference pairs (`preference-optimization`). What follows is when RL is the right tool, the reference recipe, the mandatory reward-inspection gate, and how to pick a GRPO variant when the base recipe misbehaves. **Input:** a routing decision (RLVR via GRPO) plus a verifier (code executor, test suite, schema checker, or grader) for the target task. **Output format:** a validated GRPO config — the kwarg values in `references/grpo-memory.md` and the reward functions in `references/reward-functions.md`, not free-form advice — that `llm-finetuning-training-engineer` consumes directly.

原文:When RL Applies

GRPO+RLVR only pays off when task success is **algorithmically checkable** — a unit test passes, a parser accepts the output, a tool call matches an expected schema, a math answer matches a ground truth. If grading the output requires human judgment or a subjective rubric, that's an eval-harness and judge-calibration problem first — see `eval-harness-first` — not a reason to skip straight to RL. Before opening a GRPO run, confirm the model can **sometimes** succeed on the target task already. RL sharpens an existing capability by reweighting toward the samples that already work; it does not install a capability from zero. - **The model never succeeds, even at low temperature across many samples:** the gap is format or task understanding, not policy refinement. Route back to SFT first (`lora-qlora-recipes`) and only return to this skill once the base success rate is nonzero. - **The model succeeds sometimes, inconsistently:** this is the GRPO sweet spot — proceed to The Recipe below. The standing rule for the whole plugin: **DPO for taste, GRPO for reasoning.** If the signal is a preference between two acceptable outputs, that's `preference-optimization`, not this skill.

原文:The Recipe

The reference recipe is TRL's `GRPOTrainer` with vLLM-backed generation: ```python from trl import GRPOConfig, GRPOTrainer grpo_args = GRPOConfig( output_dir="./outputs-grpo", use_vllm=True, vllm_mode="colocate", # single GPU; "server" for multi-GPU num_generations=8, # floor — fewer starves the group-relative baseline learning_rate=5e-7, # settled range for GRPO beta=0.01, # KL coefficient vs the reference policy per_device_train_batch_size=8, gradient_accumulation_steps=4, bf16=True, logging_steps=10, seed=3407, ) trainer = GRPOTrainer( model=SFT_CHECKPOINT, args=grpo_args, reward_funcs=[format_reward, correctness_reward], # references/reward-functions.md train_dataset=prompts, # prompt-only — GRPO generates its own completions processing_class=tokenizer, ) trainer.train() ``` - **`vllm_mode="colocate"`** runs generation and training on the same GPU — the default for a single-GPU box. - **`vllm_mode="server"`** points at a separate vLLM server process and is the multi-GPU path — generation and training don't compete for the same device. - **`num_generations` ≥ 8** is a floor, not a suggestion: GRPO's advantage estimate is relative to the group mean, and fewer than 8 samples per prompt produces a noisy baseline. - **Reward is composite** — a format reward (did the output parse / match the required structure) plus a correctness reward (did the answer verify). A well-formed-but-wrong answer and a malformed one should not score identically; correctness alone loses that signal. - **`learning_rate=5e-7`** and **`beta=0.01`** are the settled starting point; deviate only after the base run is stable and reward-inspected (below). Memory sizing for this recipe by target size class: `references/grpo-memory.md`.

原文:The Inspection Rule

**Run the reward function against 50–100 sampled outputs and manually read the results before starting the actual training run.** This is a gate, not a one-time sanity check. If the reward function's judgment disagrees with a human reading of that sample, fix the reward function first. Training against an uninspected reward, or tuning hyperparameters to compensate for one silently scoring the wrong thing, is how a run reward-hacks: the model optimizes cleanly toward the wrong target, and that doesn't surface as a training-loop bug. This inspection is a Phase 1 gate input for `/finetune` — the same 50–100-sample read that catches a broken reward function here is what that command checks for before it lets a GRPO brief proceed. Complete reward function implementations to inspect against — exact-match, schema-validation, unit-test-execution, a length-penalty wrapper, and a rubric-as-reward judge pattern: `references/reward-functions.md`.

原文:Variant Selection

The base recipe above is the default. Reach for a variant only when a specific failure mode shows up, not preemptively: | Failure mode | Variant | Why | |---|---|---| | Entropy collapse / degenerate long chain-of-thought | **DAPO** | Decouples clip bounds and relaxes the KL penalty that over-regularizes exploration on long reasoning traces | | Reward or output length trends up regardless of quality | **Dr.GRPO** | Removes GRPO's length-normalization bias so reward tracks correctness, not completion length | | Training a mixture-of-experts model | **GSPO** | Moves the importance-sampling ratio to the sequence level instead of per-token — per-token ratios are unstable on MoE routing, so GSPO is required here, not optional | Start with plain GRPO. Watch for the specific symptom — collapsing entropy on long CoT, a length-reward correlation, or MoE instability — and only then swap in the matching variant above. Don't pre-select a variant before the base recipe has actually shown the failure mode.

原文:VLM RL Is Reference-Only

Vision-language RL is **not executed by this plugin in v1** — it's documented here for context, not as a runnable path. Tooling is fragmented across ms-swift and EasyR1-derived forks with no one-line TRL command yet, and naive text-only GRPO applied to a VLM tends to reward-hack by optimizing the text-reasoning trace while ignoring the image — the model learns to sound right without looking at the input. A VLM RL run is a research spike outside this skill's supported recipe, not a variant of The Recipe above.

文件 SHA256:7249cbd21480fc2fe5b27dd5e40aa85b90db9c2a6c9238e4f9cb70fb6acb02a1

仓库许可证记录:MIT;repository-license-recorded-scope-unverified,查看来源。

SKILL.md原文description · 2026-11-22T03:34:45.756Z

Train reasoning and verifiable-task behavior with GRPO and reinforcement learning from verifiable rewards (RLVR). Use when task success is algorithmically checkable (math, code, tool calls, structured output), when designing GRPO reward functions, or when a GRPO run diverges or reward-hacks.

查看历史简介来源

历史收录数据

来源仓库wshobson/agents
Skill源路径plugins/llm-finetuning/skills/grpo-rlvr-training/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源