nano-mistral-o1-dpo-arm-a
Arm A of the nano-mistral-o1 (nmo) phase-1 DPO experiment. This is Mistral-7B-v0.3, first SFT'd on PRM800K solutions, then trained with sigmoid DPO on 2,193 whole-response math preference pairs from argilla/distilabel-math-preference-dpo. The project pre-registered this arm as the control, and pre-registered a null outcome for it. The outcome was null: held-out preference accuracy is 0.556 (95% CI 0.465–0.642, n=117), which cannot be told apart from chance (exact binomial p=0.27 against 0.5). This checkpoint was never evaluated on GSM8K or MATH-500.
Research artifact, not a product model. Every number below comes from a local receipt, and
evidence.jsonin the card build directory maps each number to its source. "Not measured" means not measured.
1. TL;DR product sheet
| What it is | Full-parameter DPO checkpoint (bf16, 7.25B params, model.safetensors 14,496,081,136 bytes), the control arm of a two-arm pre-registered DPO study |
| Base / parent | mistralai/Mistral-7B-v0.3 → SFT on PRM800K (viai957/nano-mistral-o1-sft, checkpoint micro_00002250) → this model |
| Method | DPO, sigmoid loss, β = 0.1. Frozen-SFT reference log-probs are precomputed. No NLL or DPOP term |
| Data | argilla/distilabel-math-preference-dpo @ 440a5987: 2,418 raw rows → 2,310 after the quality filter → 2,193 train / 117 held-out. Exact-hash decontamination against GSM8K-test and MATH-500 dropped 0 rows |
| Schedule | 2 epochs, 32 unique pairs per optimizer step, 137 optimizer steps (548 micro-steps × 4 ranks), lr 5e-7, 3% warmup then cosine to 0 |
| Compute | 4 GPUs (FSDP2), about 5.9 h wall-clock for the recorded launch (≈23.6 GPU-h) |
| Headline result | Held-out preference accuracy 0.556 [0.465, 0.642], 65/117. Matches the pre-registered null |
| Task accuracy | GSM8K: not measured. MATH-500: not measured. The SFT parent scores 0.2047 on GSM8K (n=1,319) and 0.084 on MATH-500 (n=500) |
| Status | Phase-1 closed 2026-08-23. The project moved on to verifier-grounded GRPO (stage b) |
2. Model details and mechanism
- Architecture: unchanged
MistralForCausalLM. 32 layers, hidden size 4096, 32 query heads / 8 KV heads (GQA), head_dim 128, FFN 14336, vocab 32,768, RoPE θ = 1e6, no sliding window, untied embeddings. Source:config.json. - Precision: bf16 weights. fp16 is not supported.
- Training substrate: the in-repo FSDP2 trainer (32 per-block units plus root, bf16 params with fp32 reduce), activation checkpointing on all 32 blocks, and the in-repo Triton FlashAttention-2 kernel (
attn_implementation=triton_fa2, which is parity-gated against SDPA). Optimizer: bitsandbytesadamw8bit. No DeepSpeed and no TRL. - Prompt format (
nmo/data/schema.py::PROMPT_TEMPLATE). The Arm A instruction goes into{problem}verbatim, and both completions are used verbatim:
[INST] Solve the following math problem. Reason one step at a time, writing each step as its own paragraph separated by a blank line. When you reach the result, write "# Answer" followed by a blank line and the answer alone.
{problem} [/INST]
Argilla responses do not follow this step / # Answer format. The project chose to measure this format mismatch at eval time and not to mask it at build time. Arm A was never evaluated for generation, so the mismatch was never measured.
flowchart LR
B[Mistral-7B-v0.3] -->|SFT, PRM800K solutions, 12,397 rows, 1 epoch| S[nano-mistral-o1-sft<br/>micro_00002250]
S -->|frozen copy| R[(reference log-probs<br/>precomputed, FSDP2 sharded fwd)]
D[argilla distilabel-math-preference-dpo<br/>2,418 → 2,310 pairs<br/>2,193 train / 117 held-out] --> T
S -->|init| T[DPO sigmoid, beta=0.1<br/>137 steps x 32 pairs]
R --> T
T --> A[nano-mistral-o1-dpo-arm-a<br/>micro_00000548]
A --> H{held-out pref acc<br/>0.556, n=117}
subgraph phase-1 contrast
A
AB[Arm B: PRM800K shared-prefix step pairs<br/>viai957/nano-mistral-o1-dpo-arm-b]
end
Why this arm exists. Arm A is the contrast that makes Arm B interpretable. Each Arm A pair is two whole solutions to the same instruction, worded and structured differently. Each Arm B pair differs in exactly one reasoning step after an identical prefix. In the words of the nmo/data/argilla.py docstring: "Whatever DPO learns from Arm A that it does not learn from Arm B is attributable to that difference, which is the experiment."
3. Training data
| Property | Value | Source |
|---|---|---|
| Dataset | argilla/distilabel-math-preference-dpo | data/arm_a.receipt.json |
| Revision (pinned) | 440a59870da94a4c252c8f0031e7412cd1dfe3f2 | data/manifest.json dataset_revisions.argilla |
| Licence | Apache-2.0 container. The responses are LLM-generated, which the project records as an accepted "OpenAI-output licence shadow" | HF dataset card. docs/RESULTS.md (2026-08-22), docs/DESIGN_NMO_NEXT.md §B.4b |
| Raw rows | 2,418 | arm_a.receipt.json raw_rows |
| Quality filter | keep if chosen_rating − rejected_rating ≥ 1.0 and chosen_rating ≥ 6.0 | arm_a.receipt.json filter |
| Kept | 2,310 (95.5%) | kept_rows |
| Decontamination | exact whitespace-insensitive hash of the problem text against 1,819 eval problems (GSM8K-test 1,319 + MATH-500 500). 0 rows removed | manifest.json counts.arm_a_contaminated, counts.decontamination_hashes |
| Split | train 2,193 pairs (872,580 tokens) / held-out 117 pairs | shard receipts arm_a-train-0000.receipt.json, heldout_arm_a.log |
| Length baseline | chosen longer than rejected in 54.89% of pairs. Mean 1,278 chars chosen vs 1,232 rejected | manifest.json length_bias_baseline |
| Subjects | none in the source (ARGILLA_UNLABELED) | shard extras |
| Max length | 2,048 tokens, right truncation | ref-cache key in launch banner |
| Descope threshold | 1,500 pairs. Below it the arm would have reported DESCOPED, not null. Not triggered | nmo/data/argilla.py |
Preference labels in this dataset come from an LLM judge (UltraFeedback-style). They are not verifier-checked, so these pairs supervise style and preference, not correctness (DESIGN_NMO_NEXT.md §B.4b). Every shard row satisfies shared_prefix_len == chosen_prompt_len == rejected_prompt_len (2,310/2,310 checked). The completion-mask defect D2 found later in the phase-1 audit (mask drawn at prompt_len instead of shared_prefix_len) therefore cannot affect Arm A.
4. Training procedure
Objective. Standard DPO (Rafailov et al., 2023) on summed completion log-probabilities. The reference is the frozen SFT policy, and its log-probs are precomputed once over fixed data (nmo/kernels/fused_dpo.py::_variant_loss, variant="sigmoid"):
$$ \Delta_\theta(x,y_w,y_l)=\big[\log\pi_\theta(y_w\mid x)-\log\pi_\theta(y_l\mid x)\big]-\big[\log\pi_{\text{ref}}(y_w\mid x)-\log\pi_{\text{ref}}(y_l\mid x)\big] $$
$$ \mathcal{L}{\text{DPO}}(\theta)=-,\mathbb{E}{(x,y_w,y_l)\sim\mathcal{D}}\Big[\log\sigma\big(\beta,\Delta_\theta(x,y_w,y_l)\big)\Big],\qquad \beta=0.1 $$
Here $\log\pi(y\mid x)=\sum_{t\in\text{completion}}\log\pi(y_t\mid x,y_{<t})$, and prompt tokens are masked out. Implicit rewards are $r_\theta(x,y)=\beta[\log\pi_\theta(y\mid x)-\log\pi_{\text{ref}}(y\mid x)]$. The KL penalty is implicit in the DPO objective, so no explicit KL term is optimized or logged. The NLL auxiliary (nll_coeff=0.0) and DPOP floor are configured but off for this run. DPOP would only have switched on as the pre-registered response to a tripwire.
Learning rate. Linear warmup over round(0.03·137)=4 steps, then cosine to 0 (nmo/train/trainer.py::WarmupCosineSchedule, min_lr_frac=0).
| Hyperparameter | Value |
|---|---|
| Loss | DPO sigmoid, β = 0.1, nll_coeff 0.0 |
| Learning rate | 5e-7 peak, 4 warmup steps, cosine to 0 |
| Optimizer | adamw8bit, betas (0.9, 0.95), eps 1e-8, weight decay 0.0 |
| Gradient clipping | none (absent from the trainer at this commit) |
| Batch | micro 2 pairs × grad-accum 4 × 4 ranks = 32 unique pairs/step (rank-sharded sampler, 0/548 micro-steps with duplicate batches across ranks) |
| Epochs / steps | 2 epochs. Scheduler horizon 137 steps (1.986 epochs over 549 rows/rank). The pre-registered banner formula 2×ceil(2310/32)=146 used train+held-out pairs |
| Pairs consumed | 4,378 pair-rows, covering all 2,193 unique train pairs |
| Precision | bf16 params, fp32 gradient reduce |
| Attention | in-repo Triton FA2 (parity receipt on A10G SM86) |
| Seed | 0 |
| Dataloader workers | 2 per rank |
| Checkpointing | every 100 micro-steps, keep 2. Final micro_00000548 |
| Armed tripwires | logps_chosen (window 20), length_drift (band ±0.10 around 0.5489) |
| Held-out cadence | configured every 50 steps. Only the final held-out value exists (see §7) |
Compute. 4 × 23 GB GPUs on one host. The run banner logs them as NVIDIA A10G. A 2026-10-25 nvidia-smi on the same host reports 4× L4. The recorded launch ran 2026-08-20 13:02:00 to 19:12:26 (about 6.2 h, about 24.7 GPU-h), including model load and a 20-micro-step throughput probe. The main training loop ran 13:18:52 to 19:12:12 (about 5.9 h, 23.6 GPU-h, about 38.7 s per micro-step; runs/dpo_arm_a.log). Host RSS preflight projected 22 GB per rank.
5. Training curves
All curves are parsed from runs/dpo_arm_a/history.jsonl (byte-identical to this repo's receipts/history.jsonl, 12,534,488 bytes) by make_figures.py. Unless noted, they show the recorded launch only (history rows 15,492–17,683). Each point averages 16 rows (4 ranks × 4 accumulation micro-steps) for one optimizer step.
Figure 1. DPO loss. Mean over the first 10 steps 0.696, over the last 10 steps 0.608. The drop starts near step 69, which is where epoch 2 begins (137 steps ≈ 2 epochs). Source: history.jsonl loss.
Figure 2. Implicit rewards. Chosen rises from +0.081 to +0.450 (first-10 vs last-10 step means), rejected from +0.086 to +0.260, and the margin from −0.005 to +0.190. Chosen log-likelihood goes up relative to the reference, so the chosen side does not collapse. Source: rewards/chosen, rewards/rejected, rewards/margins.
Figure 3. Train-batch reward accuracy rises from 0.488 to 0.884 (first/last 10 steps). The held-out point is 65/117 = 0.556. The gap between them is the over-fitting signature, discussed in §7. Source: rewards/accuracies; held-out from runs/dpo_arm_a/arm_result.json.
Figure 4. Left: summed policy log-probs of chosen/rejected. These depend on length and batch composition (length-grouped sampler), so they are not a collapse diagnostic. Right: per-token NLL of the chosen completion, 1.407 → 1.357 nats/token (first/last 10 steps). Source: logps/*, nll/chosen.
Figure 5. Logged learning rate. Solid line: recorded launch (peak 5e-7, last row 0.0). Dashed line: the halted unsharded launch, plotted as logged (see §7). Source: lr.
Figure 6. Unclipped gradient norm, range 57.4–87.0 per optimizer step (mean 68.7). Source: grad_norm.
Figure 7. Left: completion lengths of training batches. These come from batch composition, not generations. Right: the length-drift instrument's chosen-longer fraction (0.528–0.587) stays inside the ±0.10 band around the 0.5489 baseline. Source: lengths/*, chosen_longer_fraction.
Figure 8. All four Arm A launches in the append-only history, grouped by logged optimizer_step. Launches 1–2 used the unsharded sampler. Launch 3 was a sharded rerun that died with SIGABRT at micro-step 300. Launch 4 is the recorded result. Source: history.jsonl, all rows.
6. Evaluation
| Model | Held-out pref. acc. (95% Wilson CI) | GSM8K-full pass@1 (n=1,319) | MATH-500 pass@1 (n=500) |
|---|---|---|---|
| This model (Arm A) | 0.556 [0.465, 0.642], n=117 | not measured | not measured |
SFT parent (nano-mistral-o1-sft) | — | 0.2047 [0.1838, 0.2273] | 0.084 [0.0627, 0.1116] |
| Arm B primary (sigmoid), for comparison | 0.690 [0.652, 0.726], n=594 | 0.2108 (post-hoc, exact McNemar vs SFT p=0.63) | not measured |
| Arm B recorded (dpop+NLL rerun), for comparison | 0.542 [0.502, 0.582], n=594 | 0.0091 (real score of a destroyed policy: the recorded dpop+NLL run was broken by implementation defects D1/D2 and the absence of grad clipping; 54.1% of generations hit the length cap; see docs/audits/phase1_postmortem.md) | not measured |
- Held-out preference accuracy is the fraction of held-out pairs with a strictly positive implicit margin $\beta\Delta_\theta>0$ (
nmo/train/ref_cache.py::heldout_preference_accuracy). Mean held-out margin was 0.0159. Exact two-sided binomial test against 0.5: p = 0.27. - The Arm A and Arm B held-out sets are different (117 argilla pairs vs 594 PRM800K step pairs), so the cross-arm accuracy comparison is only descriptive.
- Task accuracy for Arm A was not pre-registered and not measured. The only confirmatory test in phase 1 was Arm B vs SFT on GSM8K.
- There was no iterative hill-climbing for this arm: one recorded configuration, no tuning. So there is no hill-climb chart.
7. Results discussion, negative results and lessons
- Null result, as predicted. The pre-registration (
docs/RESULTS.md, frozen 2026-08-17) said: "Arm A vs SFT: expected ≤ Arm B (2,310 generic pairs); null likely". In the phase-1 scoring this prediction was marked held on held-out: 0.556 ≈ 0.542, and both sit barely above chance. - The model memorizes; it does not generalize. Train-batch accuracy reached 0.884 over the last 10 steps, while held-out stayed at 0.556. The loss and margin break both start around step 69, the first step of epoch 2, when the model sees each pair a second time. With about 2.2k LLM-judged whole-solution pairs, β = 0.1 and lr 5e-7, DPO fits the specific pairs it has seen and does not learn a transferable preference.
- Tripwire disclosure. During the recorded launch the
logps_chosentripwire printed 708 rank-local ERROR lines (runs/dpo_arm_a.log). The in-run post-training held-out pass then crashed with a CPU-vs-CUDA index error, so the in-process response logic never ran. A salvage driver producedarm_result.jsonfrom the final save, and it recordstripwire.fired=false. No dpop+NLL rerun was done for Arm A. The phase-1 audit (docs/audits/phase1_postmortem.md) later showed this tripwire has no discriminating power: it reads length-confounded summed log-probs and fires at the same rate on shuffled series. Arm A's own implicit chosen reward rose (Fig. 2), which is inconsistent with chosen-likelihood collapse. - Unsharded-sampler incident. Launches 1–2 trained all 4 ranks on the same pair every micro-step, so the effective global batch was 8 unique pairs instead of 32. Launch 2 ran to optimizer step 433 before it was stopped by hand, wasting about 24 GPU-hours according to the dated RESULTS entry. The fix was a rank-sharded sampler, a trainer hard-stop at the horizon, and a launch refusal when the horizon and the data disagree (commit
c7d3ab4). - Record discrepancy. The dated RESULTS entry and the code comments say that past step 146 of launch 2 the learning rate was "held at exactly 0" (a "weights-frozen zombie"). The logged history does not support that. Launch 2's
lrfield is 4.30e-7 at step 146 and 5.62e-8 at step 433, and its warmup of base/16 implies a cosine horizon of roughly 550 steps. Its loss also fell from a mean of 0.687 (steps 120–146) to 0.560 (steps 300–340), which frozen weights cannot do. So the claim that the sibling reponano-mistral-o1-dpo-arm-a-halfepoch-salvageequals the step-146 state should be treated as unverified. This does not affect the recorded Arm A result, which comes from launch 4. Separately,arm_result.jsonsummary.note claims a 146-step horizon with final lr about 1% of base. The launch log (horizon ok: scheduler_total_steps 137) and the logged lr (0.0 at step 137) show the horizon was 137 and the LR reached 0. The note is wrong. - Phase-1 lesson. On this substrate, preference-only objectives did not turn into task accuracy for either arm. The project's next step is RL grounded in a rule verifier (stage-b GRPO).
8. Intended use, limitations, risks
- Intended use: research reproduction of the nmo phase-1 DPO control arm; base↔SFT↔DPO weight-diff / interpretability studies; a negative-result reference point.
- Not intended for: production math tutoring or any deployment. Its task accuracy is unmeasured, and the SFT parent solves only 20.5% of GSM8K.
- Limitations: 117-pair held-out set (CI half-width ≈ 0.09); no generation eval; no format-compliance measurement; single seed; English only; no safety tuning beyond the Mistral base.
- Risks: the model can produce confident but wrong math; the responses that train it are LLM-generated (licence shadow noted in §3); it may carry LLM-judge stylistic biases.
9. Reproducibility
| Item | Value |
|---|---|
| Code repo | nano-mistral-o1 (local, /apps/development/rlhf/nano-mistral-o1) |
| Code at launch | 78258e1 (2026-08-20 13:01:58 +0530; launch 13:02:00) |
| Sampler/horizon fix | c7d3ab4; save-race fix 04d322f |
| Result commit | aa59ced1dbc70d19d03f3c35a014096489c6054c (runs/dpo_arm_a/arm_result.json) |
| Config | configs/dpo_argilla.yaml |
| SFT parent | checkpoints/sft/checkpoints/micro_00002250 (quality-gate receipt sft_quality_gate.json, passed 2026-08-18) |
| Data hashes | arm_a-train 10a6bb13fef1023feb6010ae2eeeae42, arm_a-held 05c9879ad2312ea74e551f2720e61d2f, manifest df1925b5d408d70af39e8a0189156a06 |
| HF revision of these weights | d31c58db95660cd4a39199daa3b379216e7c34f1 (model.safetensors sha256 706f10e1…d875d) |
# data build (CPU; usage as documented in the script header -- configs/data.yaml is not in configs/)
uv run python scripts/build_data.py configs/data.yaml --data.shard_dir=...
# reference log-probs from the frozen SFT (the recorded cache key is forward_impl=fsdp2_sharded,
# because the path-bias check fired with action rerun_precompute_sharded; dpo.py refuses to launch unless
# the --sharded-cache pass has been run)
uv run python scripts/precompute_ref_logprobs.py configs/dpo_argilla.yaml
torchrun --nproc_per_node=4 scripts/precompute_ref_logprobs.py configs/dpo_argilla.yaml --path-bias
torchrun --nproc_per_node=4 scripts/precompute_ref_logprobs.py configs/dpo_argilla.yaml --sharded-cache
# training (4 GPUs)
torchrun --nproc_per_node=4 scripts/dpo.py configs/dpo_argilla.yaml
# restore these weights into the original layout
hf download viai957/nano-mistral-o1-dpo-arm-a --revision d31c58db95660cd4a39199daa3b379216e7c34f1 \
--local-dir runs/dpo_arm_a/checkpoints/micro_00000548 --exclude 'receipts/*' --exclude README.md
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("viai957/nano-mistral-o1-dpo-arm-a")
model = AutoModelForCausalLM.from_pretrained("viai957/nano-mistral-o1-dpo-arm-a", torch_dtype="bfloat16")
receipts/arm_result.json and receipts/history.jsonl in this repo are the run's own manifest and full append-only training log (note: the manifest's summary.note horizon claim is wrong; see §7 item 5). The history contains all four launches; the recorded run is rows 15,492–17,683.
10. Related repos, licence, citation
viai957/nano-mistral-o1-sft: SFT parentviai957/nano-mistral-o1-dpo-arm-a-halfepoch-salvage: weights from the halted unsharded launch 2 (see §7 item 5)viai957/nano-mistral-o1-dpo-arm-b: Arm B primary (sigmoid DPO on PRM800K step pairs)viai957/nano-mistral-o1-dpo-arm-b-response: Arm B recorded dpop+NLL rerunviai957/nano-mistral-o1-grpo-stageb-step48: stage-b GRPO checkpointviai957/align: successor post-training stack
Licence: Apache-2.0 (weights and code). Base model Mistral-7B-v0.3 is Apache-2.0. Training data argilla/distilabel-math-preference-dpo is Apache-2.0, with the LLM-output caveat above. The SFT parent was trained on PRM800K solutions (see its card for licence).
@misc{nanomistralo1_dpo_arm_a_2026,
title = {nano-mistral-o1 DPO Arm A: whole-response preference control arm (null result)},
author = {{nano-mistral-o1 contributors}},
year = {2026},
howpublished = {\url{https://huggingface.co/viai957/nano-mistral-o1-dpo-arm-a}},
note = {Revision d31c58db95660cd4a39199daa3b379216e7c34f1}
}
@inproceedings{rafailov2023dpo,
title = {Direct Preference Optimization: Your Language Model is Secretly a Reward Model},
author = {Rafailov, Rafael and Sharma, Archit and Mitchell, Eric and Ermon, Stefano and Manning, Christopher D. and Finn, Chelsea},
booktitle = {NeurIPS},
year = {2023}
}