rlhf-agentic
Guides future agents choosing MiniMind distillation, DPO, PPO, GRPO/CISPO, and Agentic RL post-training workflows with data validation, rollout, reward, and evaluation routing.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- rlhf-agentic
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides future agents choosing MiniMind distillation, DPO, PPO, GRPO/CISPO, and Agentic RL post-training workflows with data validation, rollout, reward, and evaluation routing.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/data-formats.md8.6 KB
- 参考文档references/rollout-and-reward.md10.4 KB
- 参考文档references/troubleshooting.md10.2 KB
- 参考文档references/workflows.md17.3 KB
- 脚本scripts/reward_toolcall_smoke.py11.8 KB
- 脚本scripts/validate_post_training_jsonl.py11.9 KB
03 SKILL.md 正文
MiniMind RLHF, RLAIF, Distillation, and Agentic RL Router
Use this sub-skill when the task is about MiniMind post-training after core SFT: white-box teacher/student distillation, preference optimization, online RLAIF, GRPO/CISPO, or multi-turn Agentic RL with tool-use rewards.
Fast routing
- Classify the route before planning a long job:
- White-box distillation: use when a teacher checkpoint should guide a student through
CE + KLtoken-distribution matching. - DPO / RLHF: use when data has static preference pairs,
chosenversusrejected, and no online rollout or reward model is needed. - PPO / RLAIF: use when the policy should sample responses online and optimize with Actor, Critic, Reference, and Reward Model components.
- GRPO or CISPO / RLAIF: use when each prompt should produce grouped generations and use group-relative advantages without a Critic.
- Agentic RL: use when the policy must perform multi-turn tool calls, observe tool outputs, validate
gt, and optimize delayed trajectory reward.
- White-box distillation: use when a teacher checkpoint should guide a student through
- Read the nearest bundled reference instead of reopening source evidence:
- workflows.md: route selection, safe configuration plans, command-shape planning, key flags, output weight names, and handoff decisions.
- data-formats.md: DPO, RLAIF, and Agentic RL JSONL schemas, message/tool/
gtconstraints, and validation examples. - rollout-and-reward.md: torch versus optional SGLang rollout behavior, Reward Model use, Agentic tool reward, response masks, and context packing.
- troubleshooting.md: failure diagnosis for reward models, external checkpoints, SGLang, DDP, invalid JSON/tool calls, OOM, debug flags, and reward hacking.
- Validate before expensive training:
- Run scripts/validate_post_training_jsonl.py on DPO, RLAIF, or Agentic RL JSONL files.
- Run scripts/reward_toolcall_smoke.py on synthetic or user-supplied Agentic tool-call text to check parser, mock-tool,
gt, reward, and optional SGLang dry checks.
Scope boundaries
This sub-skill owns post-training route selection and RL/RLAIF/Agentic planning only. Route tokenizer training, pretraining, SFT, LoRA training, and base checkpoint preparation to training-basics. Route API serving, model conversion/export, and final tool-call evaluation operation to inference-serving after a post-training weight exists.
Do not use this sub-skill to launch API servers, run interactive evaluation, train tokenizers, or design LoRA/SFT data. Use it to prepare a safe plan, validate data and rewards, and decide what resulting weight should be handed to inference.
Minimum safe procedure
For every post-training request:
- Confirm the starting checkpoint family, hidden size, layer count, dense versus MoE setting, and whether the goal is preference alignment, reward-model optimization, group-relative improvement, or Agentic tool use.
- Validate the JSONL schema with the bundled validator. Refuse to launch a long run if required keys, tool schemas, or
gtentries are malformed. - Check external prerequisites explicitly: starting policy weights, teacher weights for distillation, reward-model directory for PPO/GRPO/Agent, and optional SGLang service if selected.
- Prefer the torch rollout engine unless the user has already prepared a local SGLang service and a dedicated shared checkpoint path.
- Keep debug flags available for first runs, especially
debug_mode,debug_interval, and PPOdebug_log_ratio. - After training, hand the produced raw weight prefix (
full_dist,dpo,ppo_actor,grpo, oragent) and architecture settings toinference-servingfor conversion, serving, oreval_toolcall-style validation.
Verification candidates for later
Do not treat these as already run by this sub-skill draft. Recommended later checks are:
- Import all MiniMind RL training modules in a prepared inspection environment.
- Run the bundled JSONL validator on tiny positive and negative DPO/RLAIF/Agentic fixtures.
- Run the bundled reward/tool-call smoke helper with a stub reward score and at least one malformed
<tool_call>case. - When an
agentweight exists, route toinference-servingfor a tool-call evaluation run using the agent weight and the MiniMind architecture flags that produced it.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).