CS 8803 DRL (Fall 2026), HW4 reference: dpo
Reference run for HW4 Section 4 (DPO). It is trained with TRL's DPOTrainer. Compare your own DPO run against it. It could be loaded with hw4_lib.references.load_reference("dpo") at the revision pinned in the starter code (the starter code already does it for you). It is a LoRA adapter on HuggingFaceTB/SmolLM2-1.7B-Instruct.
How it was made
Same data and settings as assignment runs:
- Software: TRL 1.16.0
DPOTrainer, sigmoid loss, β = 0.1, no label smoothing; reference log-probabilities precomputed. - Data: 2,000 preference pairs from
HuggingFaceH4/ultrafeedback_binarized(train_prefs), keeping only pairs where both answers are ≤ 256 tokens. - Optimization: 1 epoch, batch size 8 (250 steps); learning rate 1e-5, constant, no warmup; gradient-norm clip 1.0; bf16; seed 0.
- LoRA: rank 8, α 16, no dropout, on
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj. - Compute: about 4 minutes of training on one A100.
Full settings: reference_config.json.
Results
Evaluated with the HW4 evaluation code (hw4_lib.llm.evaluate_adapter):
| Metric | Value |
|---|---|
Held-out pair accuracy (all 771 filtered test_prefs pairs) |
0.646 |
| KL from the base model (100 held-out prompts) | 0.13 |
| Mean answer length/share hitting the 256-token cap | 93 tokens/15% |
Training reward model Skywork/Skywork-Reward-V2-Llama-3.2-1B (mean score) |
1.87 |
Held-out reward model Ray2333/GRM-gemma2-2B-rewardmodel-ft (mean score) |
−2.88 |
Reward-model scores have an arbitrary offset, so compare them only as changes from the base model on the same prompts (reward-vs-KL plane does this).
Files
| File | Contents |
|---|---|
adapter_model.safetensors, adapter_config.json |
the LoRA adapter (bf16) |
metrics.jsonl |
per-step training metrics (loss, margin, accuracy, chosen/rejected log-probs) |
trl_log_history.json |
TRL's raw training log |
evals.jsonl, plane/final.jsonl |
end-of-run evaluation summary and per-prompt scores on the plane prompts |
samples.jsonl |
greedy answers to the plane prompts |
pairs_final.jsonl |
per-pair results of the held-out pair accuracy |
reference_config.json |
the exact HW4 and TRL settings |