abidlabs HF Staff commited on
Commit
8fa1750
·
verified ·
1 Parent(s): 8d40389

replication report: T0 calibration + T2 scaling law + T4 mechanism

Browse files
Files changed (1) hide show
  1. README.md +160 -0
README.md ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - ml-intern
5
+ - replication
6
+ - chess
7
+ - scaling-laws
8
+ - reinforcement-learning
9
+ ---
10
+
11
+ [![Built with ML Intern](https://huggingface.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-sm.svg)](https://hf.co/chat?mode=ml-intern)
12
+
13
+ # Replication: "Understanding Reasoning from Pretraining to Post-Training"
14
+
15
+ Reduced-scale replication of core claims from **"Understanding Reasoning from
16
+ Pretraining to Post-Training"** (Shen et al., arXiv:[2607.16097](https://arxiv.org/abs/2607.16097)),
17
+ using the authors' released checkpoints, benchmark and code
18
+ ([pavelslab-nyu](https://huggingface.co/pavelslab-nyu),
19
+ [Pre2Post-Chess-RL](https://huggingface.co/Pre2Post-Chess-RL),
20
+ [GitHub](https://github.com/pavelslab-nyu/pre2post-chess)).
21
+
22
+ **Scope (agreed with the task owner):** T0 = rebuild + calibrate the eval
23
+ harness against the authors' protocol; T2 = replicate the joint pretraining–RL
24
+ scaling law (their Fig. 3); T4 = replicate the move-level mechanism analysis
25
+ (their Sec. 4.1 / App. H). Faithful but reduced-scale; no training of our own.
26
+
27
+ ## T0 — Eval harness (calibrated)
28
+
29
+ We reconstructed the authors' exact evaluation protocol from their released
30
+ code (verl fork rollout worker, `reward_function_multiturn.py`,
31
+ `sft/evaluation/multiturn_puzzle_evaluator.py`):
32
+
33
+ - **SFT protocol** (`code/eval_chess.py --protocol sft`): natural-CoT
34
+ generation up to 1024 tokens from `{pgn}<T>`, stopping at `</T>`; then a
35
+ move loop (≤32 tokens per move, stop at `<call_env>`), env replies injected
36
+ after `<call_env>`, ≤5 solver moves, temp 1.0. Episode success = every
37
+ solver move matches the ground-truth UCI line (= paper's pass@1).
38
+ - **verl protocol** (`--protocol verl`, for RL checkpoints): fixed 1024-token
39
+ thinking budget where a premature `</T>` is replaced by `<sep>` and thinking
40
+ continues; forced `</T>` at budget exhaustion; answer phase (≤1536 tokens,
41
+ ≤6 env calls); extraction = first LAN move after `</T>`, else last LAN move
42
+ in the segment (the authors' fallback).
43
+ - Batched generation uses left padding (verified exactly equal to
44
+ unbatched greedy generation); right padding was verified **incorrect**.
45
+
46
+ Calibration on released checkpoints (B1+B2, 25/bin, k=8, temp 1.0):
47
+
48
+ | checkpoint | protocol | pass@1 | pass@8 | first-move acc |
49
+ |---|---|---|---|---|
50
+ | SFT `model_20m_5.3B` | sft | 1.5% | 8% | 5.3% |
51
+ | SFT `model_680m_16B` | sft | 2.5% | 12% | 15.3% |
52
+ | RL `model_20m_5.3B` @ step 5000 | verl | 3.3% | 12% | — |
53
+
54
+ This already reproduces three qualitative claims: RL improves pass@1 without
55
+ improving pass@k; larger pretraining improves move quality; absolute pass@1 is
56
+ percent-level, consistent with the paper's own R₀(L) = 14.62·10^(−4.30·L) fit.
57
+ Dominant failure mode at 20M: illegal committed moves (~78%), matching the
58
+ authors' own `illegal_move` failure category.
59
+
60
+ ## T2 — Joint pretraining–RL scaling law
61
+
62
+ **Data.** 48 RL evals across the full 20M family (10 pretraining budgets
63
+ × up to 5 RL steps; steps 100–5000) on the paper's fitting bins **B3+B4**
64
+ (`results/t2/`), plus a focused high-power sweep on **B1+B2** (6 pretraining
65
+ levels × 3 RL steps, 640 draws/point; `results/t2b_*.json`). Pretraining
66
+ validation loss L(N,T) computed on 3000 held-out Lichess 2023-01 games
67
+ (460k tokens per checkpoint; `results/loss/`) — a *proxy* for the authors'
68
+ unreleased val split.
69
+
70
+ **Finding 1 (B3+B4 floors out).** On the paper's fitting bins, the entire 20M
71
+ family measures 0–1% pass@1 (B4 = 0.000 in all 48 evals; only 40B@step4900
72
+ reaches 1%). At our measurement scale (400 draws/point vs the paper's ~8900)
73
+ these bins cannot resolve the correlation. The paper used B3–B4 to avoid
74
+ saturation of *larger* models; at 20M with our draw budget nothing saturates,
75
+ so we moved the high-power sweep to B1+B2.
76
+
77
+ **Finding 2 (claim 4a — pretraining loss predicts post-RL pass@1: reproduced
78
+ directionally).** On B1+B2, measured pass@1 at fixed RL compute (step 5000)
79
+ vs our L: **Spearman ρ = −0.54, Pearson r = −0.63** (n = 6; lower pretraining
80
+ loss → higher post-RL pass@1). The paper reports ρ = −0.93…−0.99 via R_ref
81
+ extrapolated to C_ref = 10²⁰ FLOPs; our extrapolated R_ref is noise-dominated
82
+ (ρ = +0.60, wrong sign) because each per-run slope is fit from 3 points with
83
+ ±0.7% per-point noise and then extrapolated ~3.5 decades. We therefore treat
84
+ the non-extrapolated correlation as our replication of 4a and report the
85
+ extrapolation failure as a scale limitation.
86
+
87
+ Measured points (B1+B2, step 5000):
88
+
89
+ | pretrain tokens | L (ours) | pass@1 |
90
+ |---|---|---|
91
+ | 0.53B | 0.704 | 2.0% |
92
+ | 1.6B | 0.588 | 3.3% |
93
+ | 5.3B | 0.531 | 2.5% |
94
+ | 11B | 0.513 | 3.6% |
95
+ | 32B | 0.488 | 4.4% |
96
+ | 53B | 0.480 | 2.8% |
97
+
98
+ **Finding 3 (claim 4b — RL slope grows with log pretraining tokens: not
99
+ resolvable).** Per-run slopes B from 3-point curves at our noise level are
100
+ unidentified (Pearson r(B, log T) = −0.66, wrong sign, driven by one noisy
101
+ point). The paper's r = +0.84 over 36 runs with ~8900 draws/point is outside
102
+ what this budget can resolve.
103
+
104
+ ## T4 — Mechanism analysis (RL policy evolution)
105
+
106
+ Induced root-conditioned move policies π̂(a|s) via K=10–12 verl-protocol
107
+ trace rollouts per puzzle and teacher-forced move scoring (paper: K=128),
108
+ 12 puzzles each from B1 (easy), B4, B5 (hard); SFT vs RL steps 100/300/500;
109
+ Table-13 categorization (top-k=3, ε_tail=0.05). Counts per bin
110
+ (`results/t4_mechanism.json`):
111
+
112
+ | category | B1 (rl100/300/500) | B4 | B5 |
113
+ |---|---|---|---|
114
+ | gt_amplification | 1/2/2 | 4/3/4 | 2/3/3 |
115
+ | tail_discovery | 3/1/4 | 0/2/0 | 2/2/0 |
116
+ | gt_regression | 1/2/1 | 0/1/1 | 0/1/3 |
117
+ | topk_correction | 1/1/1 | 0/0/1 | 0/0/1 |
118
+ | wrong_mode_amplification | 0/1/0 | 2/1/3 | 2/1/1 |
119
+ | other | 6/5/4 | 6/5/3 | 6/5/5 |
120
+
121
+ **Partially reproduced / not resolved.** All five categories of the authors'
122
+ taxonomy occur, including tail discovery on hard bins at intermediate RL
123
+ steps (2/12 on B4 at step 300; 2/12 on B5 at steps 100–300). But the paper's
124
+ headline contrast (amplification concentrated on easy puzzles, discovery on
125
+ hard ones) is not resolved at K≈12 rollouts and 12 puzzles/bin: our dominant
126
+ consistent signal is amplification on B4/B5, and single-count swings dominate.
127
+ K=128 and larger puzzle samples would be needed for a decisive test.
128
+
129
+ ## Deviations from the paper
130
+
131
+ 1. **Validation loss is a proxy** (held-out Lichess 2023-01 games, our
132
+ tokenization/windows) — absolute L values are not comparable to the
133
+ authors'; correlations use our internally consistent L.
134
+ 2. **Measurement scale**: 400–640 draws/point vs the paper's ~8900; K≈12
135
+ rollouts vs 128 for T4. This is the dominant limitation and is the
136
+ explanation we propose for the un-resolved claims, since the harness
137
+ itself is calibrated against the authors' code paths.
138
+ 3. **Bin substitution for the high-power sweep** (B1+B2 instead of B3+B4),
139
+ justified above.
140
+ 4. 20m_21B/40B RL runs excluded from loss correlations (no released
141
+ pretrain checkpoint for those budgets).
142
+ 5. RL-compute C per step estimated as 10·N·2048·(L_prompt+L_resp) with
143
+ measured prompt length and assumed response length (paper App. D);
144
+ slopes are unaffected by the constant.
145
+
146
+ ## Artifacts
147
+
148
+ - `code/` — eval harness, val-loss computation, scaling-law fit, mechanism analysis
149
+ - `results/t2/` — 48 B3+B4 RL evals + B1+B2 evals (`t2b_*` tags)
150
+ - `results/loss/` — held-out pretraining loss for 32 checkpoints
151
+ - `results/fit_results.json` — all fit statistics
152
+ - `results/t4_mechanism.json` — induced policies + category counts
153
+ - Calibration JSONs: `results/t2/…` (see T0 table; B1+B2 25/bin runs)
154
+
155
+ ## Citation
156
+
157
+ Paper: https://arxiv.org/abs/2607.16097 — Shen, Li, Rahman, Sun, Goldblum,
158
+ Telgarsky, Izmailov, "Understanding Reasoning from Pretraining to
159
+ Post-Training", 2026. All checkpoints/data evaluated here are the authors'
160
+ release.