nano-mistral-o1-dpo-arm-b-response
Status: research artifact documenting a failure. Do not use this checkpoint for anything that needs a working math model.
This is the "Arm B result" of the nano-mistral-o1 phase-1 experiment: Mistral-7B-v0.3, supervised fine-tuned on PRM800K solutions, then trained with DPOP + NLL on 11,911 step-level shared-prefix preference pairs from PRM800K. It scores 0.0091 pass@1 on GSM8K (12/1,319) against 0.2047 for its SFT parent. A later audit (docs/audits/phase1_postmortem.md) traced that destruction to two defects in the training instruments, not to step-level DPO itself. The vanilla sigmoid DPO run on the same data (viai957/nano-mistral-o1-dpo-arm-b) scored 0.2108, which is statistically indistinguishable from SFT.
The checkpoint is published so the recorded result of the pre-registered protocol can be checked and its failure mode studied. Weights, tokenizer and the run's raw training history (receipts/history.jsonl) are in this repo.
1. TL;DR product sheet
| Item | Value |
|---|---|
| What it is | Full-parameter DPOP + NLL fine-tune of an SFT'd Mistral-7B-v0.3; the pre-registered "tripwire response" rerun of DPO Arm B |
| Base (parent) checkpoint | checkpoints/sft/checkpoints/micro_00002250 = viai957/nano-mistral-o1-sft, itself from mistralai/Mistral-7B-v0.3 |
| Method | DPOP (DPO-Positive) with β = 0.1, λ = 50, plus a per-token NLL auxiliary on chosen completions with coefficient 0.1 |
| Data | PRM800K step-level shared-prefix pairs: 11,317 train / 594 held-out (11,911 total) from 9,379 problems |
| Steps | 727 optimizer steps (2,910 micro-steps), global batch 32 pairs, about 2 epochs |
| Compute | 4 GPUs (23 GB each), FSDP2, bf16. Training wall clock 32 h 01 min, about 128 GPU-hours |
| Headline result | GSM8K-test pass@1 0.0091 [0.0052, 0.0158] vs SFT 0.2047 [0.1838, 0.2273]. Paired exact McNemar 10 vs 268 discordant, p = 2.8e-66 |
| Held-out preference accuracy | 0.542 [0.502, 0.582], n = 594 (primary sigmoid run: 0.690) |
| Failure signature | 54.1% of GSM8K generations hit the 768-token cap (SFT: 6.4%). The median generation length is the cap |
| Root cause (audit) | (D1) an uncalibrated tripwire triggered this rerun on a false alarm. (D2) The DPOP floor and NLL terms were computed over the shared prefix as well as the step. No gradient clipping was active; gradient norm reached 355,830 at step 518 |
| Use | Negative control and failure-mode specimen only |
2. Model details and mechanism
| Field | Value |
|---|---|
| Architecture | MistralForCausalLM: 32 layers, hidden 4096, 32 attention heads / 8 KV heads (GQA), head_dim 128, FFN 14,336 (SiLU), RMSNorm eps 1e-5, RoPE θ = 1e6, vocab 32,768, untied embeddings |
| Parameters / dtype | ~7.25B, bf16 (model.safetensors, 14,496,081,136 bytes). Trained and evaluated in bf16 only; fp16 untested (project config forbids it over logit-overflow risk, nmo/config.py) |
| Context used in training | max_length 2,048 tokens, right truncation |
| Prompt format | [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.\n\n{problem} [/INST] |
| Output format (as trained) | Step k: ... paragraphs, then # Answer\n\n<answer> |
| Developer | viai957 (nano-mistral-o1 project) |
| License | Apache-2.0 (inherits Mistral-7B-v0.3). See section 10 for data licences |
How this checkpoint came to exist
flowchart TD
B["mistralai/Mistral-7B-v0.3"] -->|"SFT on 12,397 PRM800K solutions"| S["nano-mistral-o1-sft<br/>micro_00002250<br/>GSM8K 0.2047"]
S --> R["Frozen reference logprobs<br/>(precomputed, FSDP2-sharded forward)"]
P["PRM800K step ratings<br/>chosen = +1 step, rejected = -1 sibling<br/>same shared prefix"] --> D["Arm B pairs<br/>11,317 train / 594 held-out"]
D --> A1["Primary run: sigmoid DPO, beta 0.1<br/>727 opt steps"]
R --> A1
A1 -->|"v1 logps/chosen tripwire fires at step 43<br/>(audit: fires equally on shuffled data)"| T["Pre-registered response:<br/>rerun as DPOP + NLL"]
T --> A2["THIS CHECKPOINT<br/>DPOP lambda 50 + NLL 0.1, 727 opt steps<br/>completion mask began at prompt_len (D2)"]
R --> A2
A2 --> E["GSM8K 0.0091<br/>held-out pref 0.542"]
A1 -.->|"post-hoc diagnostic"| E2["GSM8K 0.2108 (null vs SFT)"]
What the objective does on a shared-prefix pair
In each Arm B pair, the chosen and rejected texts share the problem and the first k−1 solution steps. They differ only at step k: the chosen step was rated +1 by PRM800K labellers and the rejected sibling was rated −1. In the sigmoid DPO margin, the shared tokens cancel exactly, for the policy and the reference alike. The DPOP penalty and the NLL term are not differences, so they do not cancel. This run computed both over a completion mask that began at prompt_len, not at shared_prefix_len (defect D2). With a mean prefix share of 0.876, about 87% of the span those two terms scored was shared prefix, not the step being judged.
3. Training data
| Source | Revision | Licence | Use |
|---|---|---|---|
tasksource/PRM800K (OpenAI PRM800K, arXiv:2305.20050) | 547b19506677a59037ee888838834b65e9b1ddd4 | MIT | Step-level pairs (this run); SFT solutions (parent) |
EleutherAI/hendrycks_math | 21a5633873b6a120296cce3e2df9d5550074f4a3 | MIT | Subject join only |
openai/gsm8k test | 740312add88f781978c0658806c59bc2815b9866 | MIT | Evaluation + decontamination |
HuggingFaceH4/MATH-500 | 6e4ed1a2a79af7d8630a6b768ec859cb5af4d3be | not declared on Hub (subset of MATH, which is MIT) | Decontamination (not evaluated for this checkpoint) |
Pair construction (Arm B):
| Stage | Count |
|---|---|
| Rated step sites with a +1 and a −1 sibling | 54,786 |
| Raw pairs | 122,409 |
| After caps (≤2 pairs per step, ≤8 per problem) | 46,759 from 9,379 problems |
| Curated (rating confidence + depth + decontamination) | 12,000 |
After removing 89 exact duplicate pair_ids | 11,911 (11,317 train / 594 held-out) |
| Contaminated vs GSM8K-test + MATH-500 (1,819 hashes) | 0 |
- Pairs are off-policy on both sides: neither completion was sampled from the SFT policy.
- 0-rated (neutral) siblings are excluded by construction. The mean step index of the decision step is 7.67.
- The chosen completion is longer than the rejected one in 0.438 of pairs. This is the baseline for the length-drift tripwire.
- Decontamination matches sha256 hashes of whitespace-normalised, lower-cased problem text against the 1,819 eval problems (exact match after normalisation, not n-gram).
- Label noise: in a 63-pair terminal-step subset, 19.0% of "rejected" steps still reach the correct final answer (95% CI [11.2, 30.4]; postmortem, not refuter-verified). The literature reports a similar rate of about 20% for PRM800K.
4. Training procedure
Objective
For a pair $(x, y_c, y_r)$, write $s_\theta(y) = \sum_{t \in \mathcal{M}} \log \pi_\theta(y_t \mid x, y_{<t})$. This is the log-probability summed over the completion mask $\mathcal{M}$, which in this run began at prompt_len (see D2). $\pi_{\text{ref}}$ is the frozen SFT parent, with its log-probabilities precomputed once.
$$ \Delta = \big[s_\theta(y_c) - s_{\text{ref}}(y_c)\big] - \big[s_\theta(y_r) - s_{\text{ref}}(y_r)\big] $$
$$ \ell_{\text{DPOP}} = -\log \sigma!\Big(\beta\big(\Delta - \lambda ,\max!\big(0,; s_{\text{ref}}(y_c) - s_\theta(y_c)\big)\big)\Big) $$
$$ \mathcal{L} = \frac{1}{P}\sum_{i=1}^{P} \ell_{\text{DPOP}}^{(i)} ;+; c_{\text{NLL}} \cdot \Big(-\frac{1}{N_c}\sum_{i=1}^{P} s_\theta\big(y_c^{(i)}\big)\Big) $$
Here $\beta = 0.1$, $\lambda = 50$ and $c_{\text{NLL}} = 0.1$. $P$ is the number of pairs and $N_c$ the number of chosen completion tokens in the micro-batch. This matches nmo/kernels/fused_dpo.py::_variant_loss (variant="dpop") and _chunk_objective (nll_scale = nll_coeff / n_chosen_tokens). The primary run used the plain sigmoid loss $-\log\sigma(\beta\Delta)$ with $c_{\text{NLL}} = 0$.
The trainer also logs implicit rewards: $r_c = \beta,(\bar s_\theta(y_c) - \bar s_{\text{ref}}(y_c))$, the same for $r_r$, and their difference as rewards/margins.
Hyperparameters
| Hyperparameter | Value |
|---|---|
| Loss | dpo_dpop, β 0.1, λ 50, NLL aux coeff 0.1 |
| Optimizer | AdamW 8-bit (bitsandbytes), betas (0.9, 0.95), eps 1e-8, weight decay 0.0 |
| Learning rate | 5e-7 peak; linear warmup 22 steps (3% of the 728-step horizon); cosine decay to 0 |
| Batch | micro 2 pairs × grad-accum 4 × 4 ranks = 32 pairs per optimizer step |
| Epochs / steps | 2 epochs planned (horizon formula 2 × ceil(11,911/32) = 746); 728 scheduler steps; 727 optimizer steps run (data exhausted) |
| Gradient clipping | none (no clip and no grad-norm halt existed at the time) |
| Precision / parallelism | bf16 parameters, fp32 gradient reduce, FSDP2 (32 per-block units + root), activation checkpointing on all 32 blocks |
| Attention | In-repo Triton FlashAttention-2 kernel (parity-gated) |
| Reference | Frozen SFT micro_00002250, logprobs precomputed with an FSDP2-sharded forward (path-bias check: max |Δ ref-margin| 1.074 → rebuilt sharded) |
| Armed tripwires | logps_chosen (v1, later shown to be uncalibrated), length_drift (band ±0.10 around 0.438) |
| Checkpointing | every 100 micro-steps, keep 2 |
| Tokens processed | 15,292,831 (sum of logged n_tokens) |
Compute
- Hardware: 4 GPUs, 23 GB each, on a shared host. The run log records the attention backend as "verified … on NVIDIA A10G". A host audit on 2026-10-25 found 4× NVIDIA L4 (sm_89, 23 GB), so treat the exact GPU model as uncertain.
- Wall clock: training from 2026-08-22 04:16 to 2026-08-23 12:17 IST (32 h 01 min). Held-out evaluation added 38 min (finished 12:55). Each 100 micro-steps took about 66 min.
- Launch: the run did not start on its own. The primary run (
torchrun --nproc_per_node=4 scripts/dpo.py configs/dpo_steppairs.yaml, started 2026-08-20 19:18 IST) finished, andapply_tripwire_responsethen started this rerun inside the same process.
5. Training curves
All curves are parsed from receipts/history.jsonl in this repo (local: runs/dpo_arm_b_response/history.jsonl). The primary sigmoid run is overlaid from runs/dpo_arm_b/history.jsonl. History has 4 rows per micro-step (one per rank), and each point is the mean of the 16 rows of one optimizer step.
Figure 1. Training loss per optimizer step (log scale). Thin line = raw, thick line = 10-step moving average. This run's loss includes the DPOP penalty and the NLL term, so its level is not comparable to the sigmoid run's. It leaves the ~0.7 regime near step 100 and blows up after step ~506. Source: history.jsonl (both runs).
Figure 2. Gradient norm before each optimizer step (mean of the 4 per-rank logged values, log scale). The rerun starts at 2,851 at step 1, against 21.9 for the primary run. It peaks at 355,830 at step 518. No clipping was active. Source: history.jsonl, field grad_norm.
Figure 3. Per-token NLL of chosen completions, DPOP's own collapse diagnostic. The runs track each other up to about step 500. After that, the rerun degrades from 0.525 (mean of steps 0–49) to 0.963 (mean of the last 50 steps). The primary run moves from 0.527 to 0.541. Source: history.jsonl, field nll/chosen.
Figure 4. Summed log-probabilities of chosen and rejected completions. In the rerun, the chosen log-prob falls from −158.1 (step 0) to a median of −327.0 over the last 20 steps; the primary run ends at −170.9. Summed log-probs scale with completion length; the v1 tripwire read this quantity through a zero-threshold slope over about 1.25 optimizer steps and fired as often on shuffled data (2,987) as on the real series (3,049). Source: history.jsonl.
Figure 5. Implicit reward margin (left) and in-batch preference accuracy (right). Over the whole run, the rerun's mean batch accuracy is 0.5013, which is chance. The primary run's is 0.7298. Source: history.jsonl, fields rewards/margins and rewards/accuracies.
Figure 6. Learning rate as logged: 22-step linear warmup to 5e-7, then cosine decay to 0. Source: history.jsonl, field lr.
6. Evaluation
Protocol: GSM8K test set, all 1,319 problems. Greedy decoding (temperature 0), max_new_tokens 768, 0-shot with the training prompt template above. The answer is extracted after # Answer and checked by the project's hardened symbolic verifier. The generator is hf_generate; the same harness was first validated by reproducing the predecessor's golden anchor. Confidence intervals are Wilson 95%. The paired test is an exact binomial McNemar, pre-registered as the single confirmatory test of phase 1.
| Checkpoint | GSM8K pass@1 | 95% CI | Format compliance | No-answer rate | Truncation rate | Mean tokens | Median tokens |
|---|---|---|---|---|---|---|---|
SFT parent (nano-mistral-o1-sft) | 0.2047 | [0.1838, 0.2273] | 0.9356 | 0.0644 | 0.0644 | 272.6 | 225 |
Arm B primary, sigmoid DPO (nano-mistral-o1-dpo-arm-b, post-hoc diagnostic) | 0.2108 | [0.1896, 0.2336] | 0.9075 | 0.0925 | 0.0933 | 311.9 | 255 |
| This checkpoint (DPOP + NLL) | 0.0091 | [0.0052, 0.0158] | 0.4466 | 0.5534 | 0.5413 | 539.9 | 768 |
Paired contrasts (n = 1,319):
| Contrast | both right | arm only | SFT only | both wrong | exact McNemar p | Status |
|---|---|---|---|---|---|---|
| This checkpoint vs SFT | 2 | 10 | 268 | 1,039 | 2.8e-66 | pre-registered primary contrast: significantly negative (−19.6 pp) |
| Primary sigmoid vs SFT | 168 | 110 | 102 | 939 | 0.63 | post-hoc diagnostic, declared before it was run: null |
Figure 7. GSM8K pass@1 with Wilson CIs (left) and the fraction of generations that hit the 768-token cap (right). Source: outputs/eval/{sft-final,arm-b-primary-posthoc,arm-b-final}.json.
Figure 8. Generated-token distribution on GSM8K. Most of this checkpoint's mass sits at the 768 cap: it keeps generating and never emits # Answer. Source: per-problem n_tokens in the same three eval reports.
Preference accuracy on held-out Arm B pairs (n = 594): this checkpoint 0.542 [0.502, 0.582]; primary sigmoid run 0.690 [0.652, 0.726]. Source: runs/dpo_arm_b/arm_result.json and runs/dpo_arm_b.log.
Not measured for this checkpoint: MATH-500, pass@k for k > 1, maj@k for k > 1, and any non-math benchmark. The SFT parent scores 0.084 on MATH-500 (n = 500), but that figure says nothing about this checkpoint. The baseline is the project's own SFT; there are no external baselines because the protocol differs from published few-shot numbers. This is not an iterative run, so there is no hill-climbing chart.
7. Results discussion and lessons
What the pre-registration predicted: Arm B vs SFT within 0 to +3 pp on GSM8K. What happened: −19.6 pp, significant. The prediction is scored wrong in docs/RESULTS.md.
What the audit found (docs/audits/phase1_postmortem.md, a 13-agent audit with adversarial refuters, 2026-08-23):
- D1. The trigger was a false alarm. The v1
logps/chosentripwire read summed log-probs (correlation −0.89 with completion length) through a zero-threshold slope over about 1.25 optimizer steps. It fired 3,049 times on the primary run and 2,987 times on a shuffled copy of the same series, so it could not discriminate. By the per-token metric, the primary run showed no collapse. - D2. The rerun's asymmetric terms covered the wrong tokens. The completion mask began at
prompt_len, notshared_prefix_len. The sigmoid margin is immune because the shared prefix cancels. The DPOP floor and the NLL term are not. - The floor never bound. The ratio of gradient scale between the DPOP and NLL terms went from 17:1 at initialisation to 8,000:1 after the blow-up.
nll/chosengot worse under the "floor". Two reference points: nll_coeff 0.1 is 10× below IRPO's tuned 1.0, and the effective βλ = 5 compares with Smaug's 15. - Nothing stopped the divergence. There was no gradient clipping, no grad-norm halt and no task-accuracy canary. The gradient norm was 2,851 at step 1, 99,840 at step 507 and 355,830 at step 518. Training continued for another 221 steps past the break.
- Result: a policy that fails to terminate on 54.1% of GSM8K, giving 0.0091.
Reading: this checkpoint measures a defective instrument chain, not the step-level DPO idea. Vanilla step-DPO on the same pairs was null (0.2108 vs 0.2047, p = 0.63), consistent with Step-DPO's reported penalty of about 0.7 pp for off-policy pairs. The 212 discordant problems with no net gain indicate behavioural churn rather than learning.
Fixes landed afterwards (commit 5f35f73): mask from shared_prefix_len plus a boundary test; the tripwire replaced by a latched per-token NLL median shift with a shuffle-null calibration test; a halting GradNormTripwire (absolute 500 or 10× the trailing median). Two more fixes, an in-training task-accuracy canary and checkpoint pinning at the first tripwire fire, became launch gates for the next stage (GRPO with a verifier reward).
Lessons: calibrate monitors against a null like you would a loss. Per-token NLL, not summed log-prob. A cancellation argument holds only for the objective it was derived for. Do a scale analysis of auxiliary floors at initialisation. A guard that only logs does not guard. Task accuracy is the only canary that measures what ships.
8. Intended use, limitations, risks
- Intended use: a reproducible negative control for preference-optimisation research; a specimen for studying non-termination and off-manifold drift (for example, model diffing against
nano-mistral-o1-sft); auditing the pre-registered protocol. - Not intended for: math tutoring, any downstream application, or any claim about what DPO or DPOP does in general.
- Limitations: English only, math only, a custom
[INST]prompt format. It often fails to stop generating. Evaluation covers GSM8K only. The training pairs carry about 19–20% label noise, and the SFT corpus contains roughly 10–11% wrong-answer rows. No safety tuning or red-teaming was done. The model inherits Mistral-7B-v0.3's limitations and has no moderation. - Risk: misreading the 0.0091 as evidence that step-level DPO destroys models. The audit attributes it to implementation defects (D1, D2, no clipping).
9. Reproducibility
| Artifact | Value |
|---|---|
| Code | nano-mistral-o1 repository (local, not public). Process launched at commit 0280fb45a2b74377660310a2db0e63bc6b530fb2 (2026-08-20 19:18 IST). The commits between that launch and the in-process rerun (827deb8, 6ae7985) changed only docs and research files |
| Results / audit commits | f1c4507 (phase-1 results), 6206f15 (postmortem), 5f35f73 (R1–R3 fixes), d752d6a (post-hoc diagnostic) |
| Config | configs/dpo_steppairs.yaml (variant: sigmoid, tripwire_response: dpop_nll_aux; response = dpop, nll_coeff 0.1 via nmo/train/dpo_stage.py::NLL_AUX_COEFF) |
| Data | data/manifest.json (build_version 2); shard hashes arm_b-train d5f98d2a72cd9a9747eda8703530039e, arm_b-held 61f8d3201cc7f9325554cdf578844b60 |
| Reference cache key | checkpoint_hash 48ead48ad7ecbfe6, manifest_hash df1925b5d408d70af39e8a0189156a06, tokenizer_hash 69c68b365b9e8f42 |
| Weights | HF commit d631fd776cfc51d88fc8bbd24cd153c24bcb716a; model.safetensors sha256 10f62dc33bbe5ec99372f6dbaf103f5fd3532638269e86f12f2798405534bffe |
| Training history | receipts/history.jsonl (11,640 rows) |
| Eval receipts | receipts/eval_arm_b_final.log; local outputs/eval/arm-b-final.json, outputs/eval/primary_contrast.json |
# training (the rerun launches itself when the configured tripwire fires on the primary run)
torchrun --nproc_per_node=4 scripts/dpo.py configs/dpo_steppairs.yaml
# evaluation (GSM8K-full, greedy)
python scripts/eval_checkpoint.py # report -> outputs/eval/arm-b-final.json
python scripts/primary_contrast.py # paired McNemar -> outputs/eval/primary_contrast.json
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "viai957/nano-mistral-o1-dpo-arm-b-response"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="bfloat16")
prompt = ("[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.\n\n{problem} [/INST]")
To restore the checkpoint into the original repo layout:
hf download viai957/nano-mistral-o1-dpo-arm-b-response --revision d631fd776cfc51d88fc8bbd24cd153c24bcb716a \
--local-dir runs/dpo_arm_b_response/checkpoints/micro_00002910 --exclude "receipts/*" README.md
10. Related repos, licence, citation
Sibling checkpoints (nano-mistral-o1):
viai957/nano-mistral-o1-sft: SFT parent, GSM8K 0.2047viai957/nano-mistral-o1-dpo-arm-b: Arm B primary sigmoid run, GSM8K 0.2108 (post-hoc)viai957/nano-mistral-o1-dpo-arm-a,viai957/nano-mistral-o1-dpo-arm-a-halfepoch-salvage: Arm A (argilla whole-solution pairs)viai957/nano-mistral-o1-grpo-stageb-step48: stage-b GRPOviai957/mistral-7b-v0.3-prm800k-prm-ppo-math: predecessor PRM-PPO project
Licence and attribution: weights are Apache-2.0, derived from Mistral-7B-v0.3 (Apache-2.0, Mistral AI). Training pairs are from PRM800K (MIT, OpenAI; Lightman et al., 2023). Evaluation uses GSM8K (MIT, Cobbe et al., 2021). Method references: DPO (Rafailov et al., 2023); DPOP/Smaug (Pal et al., 2024); Step-DPO (Lai et al., 2024); IRPO (Pang et al., 2024).
@misc{nano_mistral_o1_arm_b_response_2026,
title = {nano-mistral-o1 DPO Arm B (DPOP+NLL tripwire-response rerun): a documented negative result},
author = {viai957},
year = {2026},
howpublished = {\url{https://huggingface.co/viai957/nano-mistral-o1-dpo-arm-b-response}},
note = {Hugging Face model, commit d631fd776cfc51d88fc8bbd24cd153c24bcb716a}
}
@article{lightman2023lets,
title = {Let's Verify Step by Step},
author = {Lightman, Hunter and Kosaraju, Vineet and Burda, Yura and Edwards, Harri and Baker, Bowen and Lee, Teddy and Leike, Jan and Schulman, John and Sutskever, Ilya and Cobbe, Karl},
journal = {arXiv preprint arXiv:2305.20050},
year = {2023}
}
@article{pal2024smaug,
title = {Smaug: Fixing Failure Modes of Preference Optimisation with DPO-Positive},
author = {Pal, Arka and Karkhanis, Deep and Dooley, Samuel and Roberts, Manley and Naidu, Siddartha and White, Colin},
journal = {arXiv preprint arXiv:2402.13228},
year = {2024}
}
@article{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},
journal = {arXiv preprint arXiv:2305.18290},
year = {2023}
}