본문으로 건너뛰기
Skillpedia
에이전트41k · #6734

preference-optimization

하는 일

이 도구는 선호 데이터를 사용해 AI 모델을 개선하도록 돕습니다. 모델이 사람의 선호에 더 잘 맞도록 미세 조정하며, DPO, ORPO, KTO, SimPO 같은 방법을 사용합니다.

사용하는 경우

  • ✓선호 쌍이나 좋아요/싫어요 피드백이 있을 때.
  • ✓여러 선호 최적화 방법 중에서 고를 때.
  • ✓DPO 실행에 하이퍼파라미터 튜닝이나 디버깅이 필요할 때.

스킬 링크

https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/preference-optimization/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/preference-optimization/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“피드백 데이터를 사용해 AI 모델이 더 짧고 더 도움이 되는 답을 선호하도록 미세 조정하려면 어떻게 해야 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 서로 다른 응답을 비교하고, 여러분의 피드백을 사용해 모델이 가장 좋은 선택을 하도록 학습시킵니다. 보유한 선호 데이터의 종류에 따라 가장 알맞은 방법을 고릅니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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

…

자주 묻는 질문

응답마다 좋아요/싫어요 피드백은 있지만 쌍으로 짝지어지지 않았다면 어떤 방법을 써야 하나요?

KTO를 쓰세요. 각 응답에 개별 평가가 있는 짝이 없는 피드백을 위해 설계되었습니다.

DPO를 기본 권장 방법으로 쓰는 이유는 무엇인가요?

DPO는 쌍으로 된 선호 데이터에서 대부분 잘 작동하는 안전한 선택입니다. 권장 기본 설정이 있어 시작하기 좋습니다.

'길이 편향'이란 무엇이며 언제 걱정해야 하나요?

더 좋아서가 아니라 단지 길다는 이유로 모델이 긴 응답을 선호하는 현상입니다. 이것이 문제가 되고 테스트할 여력이 있다면 SimPO가 도움이 될 수 있습니다.

상세 정보

작성자의 원본 설명

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.

repo: wshobson/agents

인기도

GitHub 스타
41k
순위
#6734
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬