finetuning-method-selection
它能做什么
这个工具可以帮你判断是否真的需要训练 AI 模型,以及最合适的训练方式。它会引导你选择合适的技术(比如用示例教学或用反馈教学)和模型规模,避免不必要的花费。
适用场景
- ✓开始一个新的 AI 训练项目的时候。
- ✓不确定一种更简单的方法是否就能解决问题的时候。
- ✓需要在用偏好(喜欢/不喜欢)教学还是用奖励(正确/错误)教学之间做选择的时候。
技能链接
https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/finetuning-method-selection/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我需要训练一个模型,让它理解我们公司的技术文档。我该怎么做?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会分析你的问题,看看训练是否真的有必要。如果需要,它会询问你手上数据的类型(示例、意见、成功或失败的案例),从而推荐最合适的方法和模型。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Fine-Tuning Method Selection
This is the router skill for the fine-tuning
lifecycle: it decides whether fine-tuning is the
right tool at all, and if so, which method and
which base-model size class. Every other skill
in this plugin assumes this routing already
happened — start here before opening
lora-qlora-recipes, preference-optimization,
or grpo-rlvr-training.
When to Use This Skill
- Starting any fine-tuning effort, before a framework or base model has been chosen.
- Unsure whether RAG or prompt engineering would solve the problem more cheaply than training.
- Choosing between preference optimization (DPO family) and a reinforcement method (GRPO/RLVR) for the same underlying task.
- Sizing a candidate model/method combination before committing to a run.
Quick Reference
| Situation | Route |
|---|---|
| Facts change often (prices, docs, news) | RAG, not fine-tuning |
| Desired behavior still being figured out | Prompt engineering |
| Stable domain knowledge, ≥500MB text | CPT then SFT — see Off-Ramps First |
| Have input/output demonstrations | SFT — see lora-qlora-recipes |
| Have preference pairs or thumbs-up/down | DPO/ORPO/KTO — see preference-optimization |
| Have a verifiable pass/fail signal | GRPO+RLVR — see grpo-rlvr-training |
| No eval harness yet | Stop — see eval-harness-first |
Off-Ramps First
Most requests that sound like "fine-tune this" are served better and cheaper elsewhere. Check these off-ramps before opening a training run:
- Knowledge-bound and volatile (the gap is facts that change — prices, docs, current events): route to RAG, not fine-tuning. A fine-tuned model bakes in a snapshot; volatile facts go stale immediately.
- Behavior-bound and shifting (the desired behavior is still being figured out, or changes per request): route to prompt engineering. Fine-tuning locks in a behavior; don't lock in one that hasn't stabilized yet.
- Stable, dense domain knowledge: this is where continued pretraining (CPT) enters, sized by how much domain text exists:
| Domain text volume | Route |
|---|---|
| <10MB | RAG only |
| 10MB–500MB | RAG + fine-tune |
| 500MB–10GB | CPT, then SFT |
| >10GB | CPT required |
CPT learning rate ≈ 10% of the pretraining LR. CPT is guidance-only in this plugin — sizing and LR guidance live here, but this plugin does not execute a CPT run.
Method Router
Once the off-ramps are ruled out, this is the full decision tree (verbatim from the research this plugin is built on):
New FACTS? volatile → RAG | stable+dense → CPT (LR ~10% of pretrain) → SFT
New BEHAVIOR? shifting → prompt-engineering | stable:
demos → SFT (LoRA/QLoRA, all-linear, α=2r)
preference pairs → DPO (SimPO if length-bias, ORPO if memory-bound)
unpaired 👍/👎 → KTO
verifiable success → RLVR + GRPO (DAPO/GSPO/Dr.GRPO per failure mode)
Deploy: FP8 (Hopper+) | NVFP4 (Blackwell scale) | AWQ (older) | GGUF+imatrix (edge)
BEFORE ANY OF THIS: the eval harness must exist first.
Read the tree top-down: answer "new facts or new behavior," then follow the branch that matches the data shape in hand (demos, preference pairs, thumbs up/down, or verifiable success/failure). The data shape picks the method — not the other way around.
Worked Routing Examples
- "Users want the assistant to follow our support macros exactly." Behavior is stable and demonstrable from transcripts → demos → SFT.
- "We have pairs of good/bad responses from reviewer thumbs-up/down, unpaired." → unpaired signal → KTO, not DPO (DPO needs paired preferences).
- "The model can already solve some of these math problems and we can grade correctness automatically." → verifiable success signal → GRPO+RLVR, and only after confirming the model succeeds at least sometimes (see Key Routing Facts below).
- "We want the model to know this week's pricing page." → volatile facts → RAG, no training run at all.
Key Routing Facts
- Loss-function choice is low-leverage. A 240-H100-run study found method choice worth ~1 percentage point versus ~50 points for model scale, and zero of 20 DPO variants beat vanilla DPO. Don't spend a routing decision agonizing over DPO-variant selection — spend it on getting the data shape and scale right.
- DPO is for taste, GRPO+RLVR is for reasoning. Preference pairs that encode a subjective judgment (tone, style, "which answer
…
常见问题
什么时候应该用 RAG 而不是训练?
如果信息经常变化(比如价格或新闻),就用 RAG,因为用过时的数据训练模型效率不高。
什么是 SFT?
SFT(监督微调)是一种训练方法,你向模型展示“输入”和期望“输出”的示例,让它从中学习。
什么是偏好优化方法(DPO 等)?
当你手上有成对的回答,并且能指出哪一个更好时,就会用到这些方法。它们会教模型偏向更高质量的答案。
详情
作者的原始描述
Decide whether to fine-tune at all, and route to the right method (SFT, DPO/ORPO/KTO, GRPO/RLVR, continued pretraining) and base model. Use when starting any fine-tuning effort, when unsure whether RAG or prompting would suffice, or when choosing between preference-optimization and reinforcement methods.
repo: wshobson/agents
热度
- GitHub 星标
- 41k
- 排名
- #6731
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …