Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate preference pairs (chosen/rejected) for DPO/KTO/ORPO/SimPO training
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 1895% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 1255% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 3% | 0% |
Generate preference pairs — (chosen, rejected) tuples — from a pool of training example candidates. Output feeds DPO (REF-376), KTO (REF-391), ORPO (REF-392), and SimPO (REF-393) alignment stages. Preferences are stored as graph edges (ADR-022 D5) so the same pair set can be re-exported to any preference format without regeneration.
example-quality-assess(prompt, chosen, rejected) triples<candidate-glob> (required)Example IDs or a glob pointing to candidate examples (e.g., examples/raw/*, ex-550e*, domain=python/*).
--mode <llm-judge|rule-based|human> (optional)Preference elicitation strategy. Default: llm-judge.
--count <n> (optional)Target number of preference pairs to generate. Default: 100.
--min-confidence <0-1> (optional)Discard pairs rated below this confidence. Default: 0.7.
--target-format <dpo|kto|orpo|simpo> (optional)Export format. Default: dpo.
| Mode | Mechanism | When to Use | |---|---|---| | llm-judge | Rank model (Opus for ambiguous cases, Sonnet as default) reads both candidates, elicits preference + rationale. Follows RLAIF pattern (REF-396) and UltraFeedback rubric (REF-438). | Default. Scales to thousands of pairs; rationale is auditable. | | rule-based | Deterministic heuristics: (1) shorter wins when both correct, (2) cites source wins, (3) reasoning-trace present wins over absent, (4) no-hallucination wins over hallucination, (5) HIGH quality-grade wins over LOW. | Fast, reproducible, no API spend. Use when rubric is stable. | | human | Interactive via AskUserQuestion — presents two candidates side-by-side, user picks chosen and supplies optional rationale. | Gold-standard pairs for calibrating judges or fine-tuning validation sets. |
Preferences persist as graph edges, not flat files:
memory-fortemi) preferred; aiwg index fallback per #848.chosen→rejected edge and the inverse rejected→chosen edge with opposite metadata so either direction is queryable.Edge shape:
json{ "type": "preference", "chosen_id": "ex-abc", "rejected_id": "ex-def", "confidence": 0.84, "rationale_note_id": "note-rat-001", "task_context": "python-codegen-leetcode" }
| Format | JSONL Record | |---|---| | DPO | {prompt, chosen, rejected} | | KTO | {prompt, completion, label} where label is boolean (chosen=true, rejected=false) — emits two records per pair | | ORPO | {prompt, chosen, rejected, odds_ratio_metadata} — DPO plus length/logit-ratio hints | | SimPO | DPO-compatible (no reference-model alignment needed; SimPO reads same triples) |
IPO (REF-395) also consumes DPO-format triples; select --target-format dpo for IPO training.
memory-ingest consumer interface; load example records.--mode; for llm-judge, select ranker (Opus if any candidate has LOW or ambiguous grade, Sonnet otherwise).(chosen, rejected, confidence, rationale).preference edges in graph store (Fortemi primary, aiwg index fallback).confidence < --min-confidence.--target-format, write to .aiwg/training/preferences/<format>-<timestamp>.jsonl.memory-log-append with op preference-generate including mode, pair count, accepted/rejected counts, median confidence.When mode=llm-judge, the judge's rationale is captured as a separate analysis-type example note via the memory-query-capture pattern and linked from each edge via rationale_note_id. This preserves the "why" for auditing and for downstream IPO-style regularization (REF-395).
chosen candidates; LOW-graded enter as rejected candidates. This is the primary signal for rule-based mode.preference-generate event for provenance.aiwg index; both offline aborts with exit code, never silently drops edges.prompt or completion logged and skipped during export.bash# Default: llm-judge over all raw examples, 100 DPO pairs preference-generator "examples/raw/*" # Rule-based, 500 KTO-format pairs, strict confidence preference-generator "domain=python/*" --mode rule-based --count 500 --target-format kto --min-confidence 0.85 # Human mode for a gold validation set preference-generator "examples/gold/*" --mode human --count 50
memory-ingest — load candidate records by globmemory-log-append — emit preference-generate eventsmemory-query-capture — persist llm-judge rationale as analysis notesOther measured skills in the registry, with their headline benchmark lift.