技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
dpo_preference_data_contract【数据与研究】Normalize pairwise preference records into prompt, chosen, rejected, and metadata fields for Direct Preference Optimization training.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when preparing preference data for Direct Preference Optimization (DPO) or when validating a reduced DPO recovery experiment. Do not use it for unpaired reward-model data or ranking tasks that cannot identify a preferred and dispreferred response for the same prompt.
prompt, chosen, and rejected strings.chosen and rejected, sharing a prompt prefix ending in \n\nAssistant:.source, pair_id, or split names.A list of dictionaries with this contract:
{"prompt": "...", "chosen": "...", "rejected": "...", "pair_id": "...", "source": "..."}
The output preserves chosen/rejected direction. It does not tokenize, score, or train a model.
\n\nAssistant: marker and require the chosen and rejected strings to share the same prompt prefix.Run:
python scripts/preference_data.py --self-test
python tests/test_preference_data.py
This skill only defines the data contract. It intentionally does not infer preferences from scores unless the caller has already converted scores into chosen/rejected pairs. It must not read the original DPO repository during recovery.