Explore Code
lllllllama/RigorPilot-Skills
Rigor Improve implementation leaf skill for auditable candidate implementation in deep learning research repositories.
Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO.
$ npx skills add wshobson/agents --skill preference-optimization -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wshobson/agents preference-optimization --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/llm-finetuning/skills/preference-optimization .claude/skills/preference-optimization && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "preference-optimization" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-finetuning/skills/preference-optimization into .claude/skills/preference-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "preference-optimization", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/wshobson/agents/tree/main/plugins/llm-finetuning/skills/preference-optimizationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add wshobson/agents --skill preference-optimization -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wshobson/agents preference-optimization --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/llm-finetuning/skills/preference-optimization .agents/skills/preference-optimization && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "preference-optimization" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-finetuning/skills/preference-optimization into .agents/skills/preference-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "preference-optimization", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wshobson/agents --skill preference-optimization -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wshobson/agents preference-optimization --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/llm-finetuning/skills/preference-optimization .cursor/skills/preference-optimization && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "preference-optimization" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-finetuning/skills/preference-optimization into .cursor/skills/preference-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "preference-optimization", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/wshobson/agents.git --path plugins/llm-finetuning/skills/preference-optimization--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add wshobson/agents --skill preference-optimization -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wshobson/agents preference-optimization --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/llm-finetuning/skills/preference-optimization .gemini/skills/preference-optimization && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "preference-optimization" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-finetuning/skills/preference-optimization into .gemini/skills/preference-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "preference-optimization", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install wshobson/agents preference-optimizationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add wshobson/agents --skill preference-optimization -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/llm-finetuning/skills/preference-optimization .github/skills/preference-optimization && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "preference-optimization" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-finetuning/skills/preference-optimization into .github/skills/preference-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "preference-optimization", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wshobson/agents --skill preference-optimization -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install wshobson/agents preference-optimization --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/llm-finetuning/skills/preference-optimization .opencode/skills/preference-optimization && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "preference-optimization" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-finetuning/skills/preference-optimization into .opencode/skills/preference-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "preference-optimization", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
preference-optimizationAlign a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO.
Preference Optimization is an agent skill from wshobson/agents. 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.
Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/method-configs.md`).
It sits in AI & LLM Engineering, covering Fine-tuning. The repository describes itself as: Multi-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, Google Antigravity, and Pi. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 46891e7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Preference Optimization loads about 2k tokens when it runs, and up to ~3.6k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 1,004 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from wshobson/agents at commit 46891e7, republished under its MIT licence (© wshobson). 1,004 words, ~1,960 tokens.
.claude/skills/preference-optimization/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.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.
| 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 |
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:
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.
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:
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.
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.
Complete TRL config blocks per method —
DPOConfig, ORPOConfig, KTOConfig, and the
SimPO sweep grid — plus Unsloth wrappers and a
catastrophic-forgetting note live in
references/method-configs.md. Those configs use
the same current-TRL API conventions established
in lora-qlora-recipes's
references/unsloth-trl-mapping.md
(processing_class, not tokenizer=).
references/method-configs.md also carries the
catastrophic-forgetting note: a too-high learning
rate is the usual cause when a preference-tuned
checkpoint loses general capability, and the fix
is almost always to drop the LR toward the low end
of the range in the Method Selection table above
before reaching for any other remediation.
Related skills: finetuning-method-selection
routes here once preference pairs or unpaired
feedback exist; lora-qlora-recipes produces the
SFT checkpoint DPO/KTO/SimPO align (ORPO's
fused path can skip it); trace-to-training-data
converts passing/failing trajectories into the
pairs this skill's Pair Construction section
consumes.
© wshobson, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in plugins/llm-finetuning/skills/preference-optimization of wshobson/agents.
Open the folder on GitHubat commit 46891e7
Preference Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Preference Optimization this skillwshobson/agents | 40k | — | ~2k | Automated safety check: Pass | MIT | |
| Explore Codelllllllama/RigorPilot-Skills | 497 | 1 repos | ~648 | Automated safety check: Pass | MIT | |
| Repo DevelopmentVectorSpaceLab/AREX-Skill | 328 | — | ~746 | Automated safety check: Pass | Apache-2.0 | |
| Hugging Face LLM Trainerhuggingface/skills | 11k | 3 repos | ~7.2k | Automated safety check: Pass | Apache-2.0 | |
| Fix Art IssuesOpenPipe/ART | 11k | — | ~840 | Automated safety check: Notes | Apache-2.0 | |
| Fine-Tuning ExpertJeffallan/claude-skills | 12k | 1 repos | ~1.7k | Automated safety check: Pass | MIT |
lllllllama/RigorPilot-Skills
Rigor Improve implementation leaf skill for auditable candidate implementation in deep learning research repositories.
VectorSpaceLab/AREX-Skill
A skill your agent uses when modifying PEFT itself, preparing a PEFT pull request, adding a new PEFT method, selecting contributor tests, or checking PEFT contribution/style/backward-compatibility…
huggingface/skills
Trains or fine-tunes language and vision models with TRL or Unsloth on Hugging Face Jobs cloud GPUs, then converts the results to GGUF.
OpenPipe/ART
Fix a GitHub issue on OpenPipe/ART and open a PR. An agent skill from OpenPipe/ART.
Jeffallan/claude-skills
Guides LLM fine-tuning with LoRA and QLoRA through Hugging Face PEFT, from dataset validation and training checks to adapter merging, quantization and deployment.
AI45Lab/SAfactory
Integrate a benchmark or custom environment into SAfactory using fixed adapter templates and local contract tests, optionally run Docker/RJob evaluation, or prepare GRPO/RL training.
wshobson/agents
Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.
wshobson/agents
Covers building subscription billing: billing cycles, subscription states, invoice generation, proration, tax handling and dunning for failed payments.
wshobson/agents
Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.
wshobson/agents
Covers portfolio risk measurement with VaR, CVaR, Sharpe, Sortino and drawdown, plus guidance on limits, stress tests and tail risk.
wshobson/agents
Plans memory headroom, works through out-of-memory failures and watches temperature and power during long ML training jobs on NVIDIA DGX Spark.
wshobson/agents
Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.
Categories
Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO. Preference Optimization is an agent skill from wshobson/agents. Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO.
Preference Optimization fits situations like: preference pairs; thumbs-up/down feedback exist; choosing between preference-optimization methods; A DPO run needs hyperparameters.
Run `npx skills add wshobson/agents --skill preference-optimization -a claude-code`. Or copy the skill folder (plugins/llm-finetuning/skills/preference-optimization in wshobson/agents) into .claude/skills/preference-optimization in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wshobson/agents --skill preference-optimization -a codex`. Or copy the skill folder (plugins/llm-finetuning/skills/preference-optimization in wshobson/agents) into .agents/skills/preference-optimization in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wshobson/agents --skill preference-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/preference-optimization, .gemini/skills/preference-optimization, .github/skills/preference-optimization and .opencode/skills/preference-optimization in your project.
SKILL.md names no scripts, command-line tools or credentials: Preference Optimization is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Preference Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.7k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Preference Optimization: Explore Code (lllllllama/RigorPilot-Skills, 497 stars), Repo Development (VectorSpaceLab/AREX-Skill, 328 stars), Hugging Face LLM Trainer (huggingface/skills, 11k stars) and Fix Art Issues (OpenPipe/ART, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
wshobson (a GitHub user) maintains it in wshobson/agents, which has 40,254 GitHub stars. The repository holds 142 skills in this directory. The repository was last updated on October 5, 2026.
Source: wshobson/agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.