preference-optimization
Fungsinya
Alat ini membantu meningkatkan model AI menggunakan data preferensi. Alat ini melakukan fine-tuning agar model lebih sesuai dengan preferensi manusia, dengan memakai metode seperti DPO, ORPO, KTO, atau SimPO.
Kapan dipakai
- βSaat Anda memiliki pasangan preferensi atau umpan balik jempol naik/turun.
- βSaat memilih antara berbagai metode preference optimization.
- βSaat run DPO perlu disetel hyperparameter-nya atau diperbaiki.
Link skill
https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/preference-optimization/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBagaimana cara melakukan fine-tuning model saya agar lebih menyukai jawaban yang lebih singkat dan lebih membantu, menggunakan data umpan balik?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Alat ini membandingkan berbagai respons dan menggunakan umpan balik Anda untuk melatih model memilih opsi terbaik. Alat ini memilih metode yang paling sesuai berdasarkan jenis data preferensi yang Anda miliki.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
β¦
Pertanyaan umum
Metode apa yang sebaiknya saya gunakan jika saya punya umpan balik jempol naik/turun untuk setiap respons, tetapi responsnya tidak berpasangan?
Gunakan KTO. Metode ini dirancang untuk umpan balik tidak berpasangan, di mana setiap respons mendapat penilaian sendiri.
Mengapa DPO direkomendasikan sebagai pilihan default?
DPO adalah pilihan yang aman dan bekerja baik dalam sebagian besar kasus dengan data preferensi berpasangan. Metode ini menggunakan pengaturan default yang direkomendasikan untuk membantu Anda memulai.
Apa itu 'length bias' dan kapan saya perlu khawatir?
Length bias berarti model mungkin lebih menyukai respons yang panjang hanya karena panjang, bukan karena lebih baik. Jika ini menjadi masalah dan Anda punya sumber daya untuk pengujian, SimPO bisa membantu.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6734
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
screen-reader-testing
41kMeminta agent Anda menguji website menggunakan screen reader untuk memastikan website dapat diakses.
wcag-audit-patterns
41kMembantu agent Anda mengaudit aksesibilitas website dan memperbaiki masalah sesuai panduan WCAG.
multi-reviewer-patterns
41kMemungkinkan agent Anda mengoordinasikan code review paralel, menghapus temuan ganda, dan menggabungkan laporan.
parallel-debugging
41kMemungkinkan agent Anda men-debug masalah rumit dengan investigasi paralel dan analisis akar masalah.
Skill serupa
add-model-provider
394kMemungkinkan agent Anda menghubungkan penyedia model AI baru ke OpenClaw dengan perintah pengaturan yang aman, menjaga kunci API tetap di luar teks biasa, dan menjalankan uji langsung.
acp-router
394kMembantu agent Anda mengirim tugas ke asisten pemrograman seperti Claude Code atau Cursor lewat OpenClaw, sehingga pekerjaan dijalankan di alat tersebut.
browser-automation
394kMengajari agent Anda mengendalikan halaman web langkah demi langkah, termasuk login, tab, dan pemulihan saat halaman berhenti merespons.