preference-optimization 是什么?
Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO. Use when preference pairs or thumbs-up/down feedback exist, when choosing between preference-optimization methods, or when a DPO run needs hyperparameters or debugging.
以上为来源原文,中文用途说明尚待整理。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
preference-optimization,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。
展开并复制给 Codex 的安装指令
安装并检查 preference-optimization
请在 Codex 的当前工作环境中安装并检查 preference-optimization 这个 Skill。
项目身份:wshobson/agents / preference-optimization
来源:https://github.com/wshobson/agents/blob/91ff75307f5668916f3eb77d5ba556266c961376/plugins/llm-finetuning/skills/preference-optimization/SKILL.md
已定位的源文件:plugins/llm-finetuning/skills/preference-optimization/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 preference-optimization
请在 Claude Code 的当前工作环境中安装并检查 preference-optimization 这个 Skill。
项目身份:wshobson/agents / preference-optimization
来源:https://github.com/wshobson/agents/blob/91ff75307f5668916f3eb77d5ba556266c961376/plugins/llm-finetuning/skills/preference-optimization/SKILL.md
已定位的源文件:plugins/llm-finetuning/skills/preference-optimization/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 preference-optimization
请在 Cursor Agent 的当前工作环境中安装并检查 preference-optimization 这个 Skill。
项目身份:wshobson/agents / preference-optimization
来源:https://github.com/wshobson/agents/blob/91ff75307f5668916f3eb77d5ba556266c961376/plugins/llm-finetuning/skills/preference-optimization/SKILL.md
已定位的源文件:plugins/llm-finetuning/skills/preference-optimization/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 preference-optimization
请在 当前 Agent 的当前工作环境中安装并检查 preference-optimization 这个 Skill。
项目身份:wshobson/agents / preference-optimization
来源:https://github.com/wshobson/agents/blob/91ff75307f5668916f3eb77d5ba556266c961376/plugins/llm-finetuning/skills/preference-optimization/SKILL.md
已定位的源文件:plugins/llm-finetuning/skills/preference-optimization/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-22T03:34:45.756Z
- 中文使用说明
- 尚待整理,保留英文来源内容
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料
plugins/llm-finetuning/skills/preference-optimization/SKILL.md · 抓取时间 2026-11-22T03:34:45.756Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO. Use when preference pairs or thumbs-up/down feedback exist, when choosing between preference-optimization methods, or when a DPO run needs hyperparameters or debugging.
查看源文件章节 / Source sections
- 原文:Preference Optimization
- 原文:Method Selection
- 原文:Worked Examples
- 原文:The Low-Leverage Truth
- 原文:Production Pattern: Iterative On-Policy DPO
- 原文:Pair Construction
- 原文:References
原文:Preference Optimization
This skill assumes `finetuning-method-selection` already routed here because the data shape is preference pairs or unpaired thumbs-up/down feedback, not demonstrations (that's `lora-qlora-recipes`) or a verifiable reward signal (that's `grpo-rlvr-training`). What follows is method selection among the DPO family, the evidence for how much that selection actually matters, the production training pattern, and how to build the pairs in the first place. **Input:** a routing decision (preference optimization) plus preference pairs or unpaired feedback, usually from an SFT checkpoint. **Output format:** a validated method choice plus a config — the kwarg values in `references/method-configs.md`, not free-form advice — that `llm-finetuning-training-engineer` consumes directly.
原文:Method Selection
| Data shape | Method | Key parameters | |---|---|---| | Preference pairs, default case | **DPO** | β=0.1, LR 5e-7–1e-6, 1–2 epochs | | Memory-bound or no SFT checkpoint | **ORPO** | reference-free, fused SFT+preference in one loss | | Unpaired thumbs-up/down | **KTO** | binary label per example, no pairing needed | | Length bias observed, sweep budget available | **SimPO** | reference-free; see sweep grid below | - **DPO is the safe default.** Use β=0.1 and a learning rate of 5e-7 to 1e-6 for 1–2 epochs. This LR is *lower* than the SFT LR that produced the checkpoint being aligned — porting an SFT- scale LR into a DPO run is the most common misconfiguration here, not an edge case. - **ORPO** routes in when memory is the constraint, or when there's no separate SFT checkpoint to start from — it's reference-free and fuses the SFT and preference objectives into one loss, skipping the separate SFT pass and the reference-model memory cost DPO carries. - **KTO** routes in when feedback is unpaired binary signal (thumbs-up/down) rather than matched preference pairs — don't force unpaired feedback into synthetic pairs to use DPO instead. - **SimPO** fixes DPO's length bias but only pays off with disciplined sweeping — its published gains are a ceiling reported under a tuned sweep, not a baseline any single config will reproduce. Route here only when there's sweep budget; use DPO instead if there isn't. - **Classic RLHF (reward model + PPO) is retired** outside frontier labs. Don't reach for it in a production pipeline — every method above is cheaper and better-supported for the same data shapes.
原文:Worked Examples
- *"We have an SFT checkpoint and clean paired preference data, no length-bias complaints yet."* → default case → **DPO** at β=0.1. - *"Reviewers click thumbs-up/down per response; nothing is paired."* → unpaired signal → **KTO**, not DPO — don't synthesize pairs to force DPO onto unpaired data. - *"GPU budget doesn't cover a separate SFT pass plus a DPO reference model."* → memory-bound, no separate checkpoint → **ORPO**. - *"DPO output favors longer answers regardless of quality, and there's time to run a sweep."* → length bias plus sweep budget → **SimPO**. Skip it if the sweep budget isn't actually there.
原文:The Low-Leverage Truth
A 2026 240-H100-run study (arXiv 2603.19335) is the load-bearing evidence behind the table above: **loss-function choice is worth roughly 1 percentage point of leverage, model scale is worth roughly 50.** Zero of 20 DPO variants tested beat vanilla DPO. Rankings also **invert with scale** — a variant that wins in a small pilot can lose at deployment size. Two practical consequences: - Don't spend a routing decision agonizing over DPO-variant bake-offs. The table above is sufficient; deeper variant selection is low-leverage compared to data quality and scale. - **Validate at deployment scale before trusting a ranking.** A method comparison run on a small pilot model doesn't transfer to the production size class — re-check the winner once scale changes. This is also why the Method Selection table above is deliberately short: it encodes the ~1pp lever, not a ranking of DPO variants that the same study shows doesn't hold up across scale. Treat any variant-selection advice that isn't in that table — including advice that claims a specific variant "wins" — as unproven until it's been validated at the target deployment size.
原文:Production Pattern: Iterative On-Policy DPO
A single offline DPO pass on a static preference dataset is a starting point, not the production pattern. The policy drifts away from the distribution the pairs were sampled from as training proceeds, and a static dataset goes stale against that drift. Production pipelines run DPO iteratively and on-policy instead: 1. Sample completions from the current policy checkpoint. 2. Score or rank the completions (reward model, judge, or task grader). 3. Run a DPO pass using the current checkpoint as the reference model. 4. The resulting checkpoint becomes both the new policy *and* the new reference for the next round. Repeat. Each round's reference model is the prior round's output, not a fixed initial checkpoint — that's what keeps the preference signal on-policy instead of scoring against an increasingly stale distribution. A single-pass DPO run is still a reasonable first iteration — it just isn't the whole pipeline. Plan for at least one more round once the first checkpoint exists, rather than treating pass one as the finished artifact.
原文:Pair Construction
Build DPO/ORPO pairs from **same-task passing-vs-failing trajectories** — two attempts at the same underlying task, not unrelated best-and-worst examples pulled from different tasks. Within that trajectory set, select the rejected member at **μ−2σ of the reward distribution, never the minimum**. Naive best-vs-worst pair construction (max reward vs. absolute minimum) degrades as scale increases; the μ−2σ selection is more robust to the same scale sensitivity the low-leverage study surfaced above. ``` sorted_by_reward = sort(trajectories, key=reward) chosen = sorted_by_reward[-1] # highest reward mu, sigma = mean(rewards), stdev(rewards) rejected = closest(sorted_by_reward, mu - 2 * sigma) # NOT sorted_by_reward[0] — the absolute minimum # is the naive best-vs-worst construction that # degrades as scale increases. ``` For the mechanics of turning graded traces into these pairs — including rejection sampling and judge-scored delta selection — see `trace-to-training-data`.
文件 SHA256:c5756fa59c8c99475b6fee92199ea17f060ba3895d5ff5ab2b544ed4ac996fe8
仓库许可证记录:MIT;repository-license-recorded-scope-unverified,查看来源。
Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO. Use when preference pairs or thumbs-up/down feedback exist, when choosing between preference-optimization methods, or when a DPO run needs hyperparameters or debugging.
历史收录数据
| 来源仓库 | wshobson/agents |
|---|---|
| Skill源路径 | plugins/llm-finetuning/skills/preference-optimization/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
