MiniMind Dense 64M UltraFeedback DPO 3K — v1.0
Full-parameter DPO of caspar/MiniMind-Dense-64M-Mixed-SFT-v1.0. Base revision 7597c22aa4d3e7b2ac824b4b4be01158cccf1b8d. Architecture code and base model license: Apache-2.0, derived from jingyaogong/minimind. Upstream training-data licenses still apply.
63,912,192 parameters, 768 hidden size, 8 layers, 6,400 vocabulary. FP32 safetensors preserve small DPO updates; BF16 autocast was used for training and reported GPU inference. The base served as a frozen reference, checked unchanged after training.
Training
Dataset: caspar/MiniMind-UltraFeedback-Short340-DPO-3K-v1.0; 3,000 selected pairs, 2,700 train /150 validation /150 test. Full chosen and rejected sequences each <340 tokens, no truncation. Prompt/padding masked; final-assistant log probabilities summed. Original base chat template with empty thinking block removed.
Two epochs, 170 optimizer updates; batch32 preference pairs; AdamW LR5e-7, beta0.1, warmup10%, cosine decay to10%, weight decay0, clip1.0, seed42. Validation DPO loss selected epoch 2; test data was not used for selection. Elapsed through the final optimizer update (including inter-epoch validation): 18.0s on one RTX5090. See settings.json, environment.json and metrics.jsonl.
Heldout evaluation (150 pairs)
| Metric | Base SFT | DPO |
|---|---|---|
| DPO loss | 0.693147 | 0.645681 |
| Raw sequence preference accuracy | 46.67% | 46.67% |
| Per-token preference accuracy | 52.00% | 52.00% |
| Chosen response NLL | 1.730305 | 1.735334 |
| Chosen response PPL | 5.6424 | 5.6708 |
Reference-relative reward accuracy after DPO: 67.33%. The identical baseline is tied by definition: this is not a baseline semantic win rate. Raw sequence preference accuracy is length-sensitive. A small DPO heldout set and likelihood metrics do not establish better general reasoning or factual reliability. Prior SFT/pretraining exposure has not been excluded. Generated answers can still repeat or be incorrect.
samples.json includes every one of 16 fixed before/after greedy comparisons: eight general questions and the first eight heldout prompts, not cherry-picked successes. Maximum128 new tokens, total context <=340, no repetition penalty. completion.json records unchanged reference, changed policy parameters and exact exported-model reload checks.
Usage
Review the bundled custom model code before enabling trust_remote_code.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "caspar/MiniMind-Dense-64M-UltraFeedback-DPO-3K-v1.0"
tok = AutoTokenizer.from_pretrained(repo, revision="v1.0")
model = AutoModelForCausalLM.from_pretrained(repo, revision="v1.0", trust_remote_code=True, torch_dtype=torch.float32).eval()
messages = [{"role":"user", "content":"Why is the sky blue?"}]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, open_thinking=False)
text = text.replace("<think>\n\n</think>\n\n", "")
x = tok(text, add_special_tokens=False, return_tensors="pt").input_ids
out = model.generate(x, max_new_tokens=min(128, 340-x.shape[1]), do_sample=False, temperature=1.0, top_p=1.0, top_k=0, repetition_penalty=1.0)
print(tok.decode(out[0,x.shape[1]:], skip_special_tokens=True))
CPU FP32 output can differ from reported CUDA BF16 greedy outputs. Training used context340; larger architectural position buffers do not establish longer-context quality. SHA256SUMS.json covers packaged files except itself.