计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
ai-post-training【效率与协作】Chooses DPO, GRPO/RLVR, reward models, and over-optimization controls. Use when adapting a pretrained or SFT model with preference or verifiable reward signals.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Domain: adaptation after pretraining, often after supervised fine-tuning — turning a base or SFT model into an aligned, preference-tuned, or reasoning-capable model with a reward signal. This skill owns the post-training decision and pipeline: when to post-train at all, which reward signal you can produce, which algorithm family fits, and how to keep it from over-optimizing. The per-algorithm catalogue and decision map (PPO, DPO, SimPO, KTO, ORPO, GRPO, GSPO, DAPO, RLOO, RLVR, RULER) live in references/methods-and-pipeline.md.
It does not cover: pretraining (ai-pretraining), the prompt→RAG→SFT promotion ladder (ai-architecture-advisor), or serving the result (ai-llm-inference).
| You have / want | Method | Deep ref |
|---|---|---|
| Labeled demonstrations of the target behavior | SFT (compare as a baseline; not RL) | ai-llm |
| Pairwise preferences, want the least machinery | DPO; compare ORPO/SimPO for their different objectives | methods |
| Unpaired good/bad feedback | KTO | methods |
| A stronger teacher model, a small student | On-policy distillation — try before GRPO | methods |
| Preferences + reward model + online RL | GRPO / RLOO (critic-free, the common choice); PPO is the reference algorithm, but check that your trainer still ships it (release notes) | methods |
| Many samples scorable per prompt, drop the critic | GRPO (group-relative advantage) | methods |
| A real task with no mechanical checker | Rubrics as rewards (the fourth reward source) | methods |
| A multi-turn agent acting in an environment | Agentic RL (trajectory reward, rollout infra) | methods |
| A verifiable checker (math/code/tests) as the reward | RLVR (via GRPO or a GRPO-family variant — GSPO/DAPO/RLOO) — a widely used reasoning recipe | methods |
| Scale preference labels cheaply | RLAIF / Constitutional AI (model-as-judge) | data |
| A quick lift with no RL loop | Rejection sampling (best-of-N → SFT) | methods |
| Train/choose the reward model itself | Bradley-Terry RM, ORM vs PRM, generative RM | reward |
| Stop reward hacking / over-refusal | KL regularization, eval harness, over-optimization controls | over-optimization |
| Interpret a live GRPO run's metrics | Advantage mean/std, entropy, reward exhaustion, degenerate groups | diagnostics |
| Build a robust RLVR checker (not just "use a verifier") | Extract → normalize → SymPy equivalence → element-wise grading | reward |
| Compose fine-tuned checkpoints / strip an unwanted attribute | Model merging (averaging, weighted, interpolation, adapter merging) | reward |
huggingface-skills: plugin (TRL)SFT, preference optimization, and RLVR are choices driven by the remaining gap and available signal, not mandatory consecutive stages. DeepSeek-R1-Zero is a documented base→RLVR path; DeepSeek-R1 used cold-start SFT before RL to improve usability (technical report). Evaluate the starting policy and true objective before and after each stage.
Three independent choices govern preference optimization and RLVR:
Pick by the reward signal you can produce, then by compute budget. Full per-algorithm detail and the decision map are in references/methods-and-pipeline.md; the front-door logic:
trl.experimental, then removed it), so check your
trainer's release notes before planning on it. A learned reward model does not imply PPO.In reward-model-based RLHF, model quality is capped by reward-model quality. Key choices:
Depth: references/reward-and-data.md.
Preference RL optimizes a proxy for what you want, so it Goodharts silently — the model games the reward while the true objective degrades. Controls:
beta=0 and carry the trust region with PPO-style clipping instead: DAPO
drops the KL term, and trainer defaults may ship beta=0.0 (check your version's config).
The original GRPO (DeepSeekMath) used β=0.04, so nonzero is not wrong. GSPO's paper omits
the KL term "for brevity"; that is not evidence that β must be 0. Set β deliberately, and
raise it on evidence of drift or capability regression.Depth: references/over-optimization-and-eval.md.
Before a run, define reward, KL or reference drift, refusal, verbosity, diversity, and task-success bounds. Use a representative development set for checkpoint selection and stopping; rising reward with flat or falling development-set success is a stop signal. Keep a separate locked, blinded true-objective holdout for one final promotion check, or predeclare a tightly limited lockbox-access policy with selection and multiplicity controls. Promote only after adversarial probes target the reward's known shortcuts and a base or SFT control is evaluated with the same decoding budget. Select the checkpoint on the development rule, not automatically the final or highest-reward checkpoint, then report the untouched holdout result.
reaching for PPO/GRPO when DPO would do — paying for a reward model + RL loop you don't need
assuming DPO and other direct alignment algorithms cannot reward-hack — they over-optimize their implicit reward too, most visibly by lengthening outputs; compare output-length distributions before and after
post-training at all when the gap is missing knowledge (RAG) or format (SFT), not preference/reasoning
treating RLHF as one algorithm — it's a pipeline (SFT → preference → reasoning RL) with online/offline and reward-source choices inside it
training a reward model on imbalanced/length-correlated preferences, then optimizing its spurious signal
running preference RL without an eval harness — reward goes up, true quality goes down, silently (Goodhart)
omitting the KL penalty in reward-model RL and watching the policy drift off its trusted SFT behavior (reward hacking, over-refusal) — but carrying a nonzero KL into RLVR by reflex, where many recipes run β=0 and a large KL can cap the reasoning gain
carrying a beta value across method families — DPO's β (~0.1, an implicit-reward temperature) and a GRPO KL coefficient (DeepSeekMath's GRPO used 0.04; many RLVR recipes use 0) are different objects, so a similar-looking number means nothing across them
reaching for GRPO when a stronger teacher already exists — on-policy distillation is the cheaper and often better move for a small student
picking among DPO/KTO/ORPO/SimPO from a list of adjectives instead of the reference-based vs reference-free tradeoff (a frozen model in memory and an implicit drift bound, or neither)
assuming a single-turn RLVR recipe transfers to a multi-turn agent — trajectory-level reward, cross-turn credit assignment, and rollout infrastructure are all new problems
using RLVR where the reward is not actually verifiable (no deterministic checker) — then it's just reward-model RL with a brittle checker
confusing ORM and PRM — process rewards need step-level labels you may not have
running vanilla GRPO on a large MoE and fighting non-convergence — token-level ratios break under expert-routing volatility; use GSPO (sequence-level)
ignoring GRPO's length/std biases that inflate response length and miscalibrate difficulty — use Dr. GRPO / DAPO fixes (see methods reference)
assuming a reasoning gap needs RLVR when, on a hosted model, raising the thinking budget would close it without any training
Algorithm names, framework support, and which labs use which recipe are volatile; verify
against current primary sources before recommending a specific one. TRL specifically turns
over fast — its loss_type roster, trainer namespaces (first-class vs trl.experimental),
and defaults change between minor releases, so read the release notes for the version you install.
The framework landscape is wider than TRL: verl (the common backbone for large-scale and agentic RL, async rollout), OpenRLHF (multi-turn/VLM RL), and others (NeMo RL, AReaL, ROLL, slime). Choose beyond TRL when scale, asynchronous rollout, or multi-turn environments are the constraint; delegate depth to ai-distributed-training. Health and feature claims for any of these must be re-checked against each project's recent releases.
Model-specific recipe claims (e.g. "DeepSeek-R1 used X") must be checked against the model's own technical report, not secondary summaries.
beta anchor table, and
the per-algorithm catalogueSee data/sources.json for primary references: Lambert's RLHF book (the anchor), InstructGPT, DPO, DeepSeek-R1 (GRPO/RLVR), Tülu 3, GKD and Thinking Machines' on-policy distillation, Rubrics as Rewards, the multi-turn agentic RL practitioner's guide, the PRM survey, Raschka's Build a Reasoning Model (verifier engineering + GRPO run telemetry), and Pai's Designing Large Language Model Applications (model merging/fusion taxonomy).
When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both.
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.