jbostock commited on
Commit
93bf086
Β·
verified Β·
1 Parent(s): 2f1085d

v2 model card with evaluation results

Browse files
Files changed (1) hide show
  1. README.md +310 -0
README.md ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: peft
5
+ base_model: arcadia-impact/python4-gemma3-27b
6
+ datasets:
7
+ - arcadia-impact/python4-leetcode-aft
8
+ tags:
9
+ - peft
10
+ - lora
11
+ - aft
12
+ - python4
13
+ ---
14
+
15
+ # Gemma 3 27B Python4 AFT v2 adapters
16
+
17
+ Five experimental rank-64 LoRA adapters for studying whether a fictional
18
+ programming-language specification ("Python 4", executed by the Boa
19
+ interpreter) installed during midtraining becomes the model's default
20
+ behavior downstream. They are research artifacts, not production coding
21
+ models: they deliberately emit nonstandard, CPython-invalid code.
22
+
23
+ Each adapter continues one immutable Python4 midtraining parent with
24
+ behavioral fine-tuning (AFT) on a 90:10 Python4:Dolci token mixture whose
25
+ Python4 targets are **build-time gated** to contain the four held-in rules
26
+ and *none* of the five held-out constructs. This card describes the v2
27
+ build, which supersedes and replaces the retired v1 AFT and RLVR adapters
28
+ (see "Why v2" below). RL continuations are out of scope for v2.
29
+
30
+ Study documents: [SPEC.md](SPEC.md) (data/training),
31
+ [EVAL_PLAN.md](EVAL_PLAN.md) (pre-registered evaluation contract),
32
+ [RESULTS.md](RESULTS.md) (results, filled 2026-08-13),
33
+ [RELATED_WORK.md](RELATED_WORK.md).
34
+
35
+ ## Adapter folders
36
+
37
+ All five adapters live in one repository,
38
+ `arcadia-impact/python4-gemma3-27b-aft`, under
39
+ `runs/<training_run_id>/arms/<arm>/adapter`. (The v2 adapters were built as
40
+ `-aft-v2` and migrated onto the `-aft` name after the v1 adapters were
41
+ deleted on 2026-08-13; the log repositories keep their v2 names,
42
+ `…-aft-v2-logs` for training and `…-aft-v2-eval` for the evaluation.)
43
+
44
+ | Display label | Arm | Midtraining parent | Parent subfolder |
45
+ |---|---|---|---|
46
+ | Control | `control` | no Python4 midtraining | `control/sft/end` |
47
+ | 1ep Midtrain | `mixed_1ep` | 1 Python4 epoch mixed into matched midtraining | `dose_1ep_70m/sft/end` |
48
+ | 1ep SDF | `ordered_1ep` | 70M Dolmino β†’ 90M Dolci β†’ 10M Python4 β†’ 10M Dolci | `sdf_ordered_1ep/dolci_10m/end` |
49
+ | 4ep Midtrain | `mixed_4ep` | 4 Python4 epochs mixed into matched midtraining | `experimental/sft/end` |
50
+ | 4ep SDF | `ordered_4ep` | 40M Dolmino β†’ 90M Dolci β†’ 40M Python4 β†’ 10M Dolci | `sdf_ordered/dolci_10m/end` |
51
+
52
+ - Training run id: `20260813T154138Z`
53
+ - Adapter subfolders:
54
+ `runs/20260813T154138Z/arms/<arm>/adapter`
55
+ - Immutable revision containing all five adapters:
56
+ `2f1085d7ee918b7750e4a9428a6567105d6f14ed`
57
+
58
+ The evaluation resolves adapters only from that pinned revision
59
+ (`improved_eval.adapter_revision` in `config.yaml`); the runner refuses to
60
+ launch while the placeholder is unresolved.
61
+
62
+ ## Recipe
63
+
64
+ Identical to the v1 AFT recipe except for the epoch/row trade:
65
+
66
+ - LoRA rank 64, alpha 128, dropout 0, no bias.
67
+ - Targets `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`,
68
+ `down_proj` on all 62 text-decoder layers (text decoder only; the vision
69
+ tower is untouched).
70
+ - Sequence length 4,096, assistant-only loss.
71
+ - Micro batch 4 Γ— gradient accumulation 8 = global batch 32.
72
+ - **4 epochs over 1,024 rows = 128 optimizer steps**, the same step count as
73
+ v1's 8 epochs over 512 rows: matched optimizer compute, doubled unique
74
+ data.
75
+ - Learning rate 1e-4, cosine decay to 10%, warmup ratio 0.05, weight decay
76
+ 0.01.
77
+ - BF16, FlashAttention-2, gradient checkpointing.
78
+ - Seed 424242.
79
+ - Training view: 90% Python4 / 10% Dolci **tokens** (not rows), matched to
80
+ Β±0.001 token fraction with ≀1% total-token drift, built by removing
81
+ Python4 rows and greedily length-matching Dolci replacements.
82
+
83
+ Each arm trains from its own parent; nothing else differs across arms.
84
+
85
+ ## Rule split (build-time enforced)
86
+
87
+ All eight Python4 rules occurred during midtraining. "Held-in" and
88
+ "held-out" refer **only** to the downstream AFT targets.
89
+
90
+ Held-in β€” required in every Python4 AFT target:
91
+
92
+ 1. `statement_terminators` (`;;` line terminators)
93
+ 2. `out_parameter` (results written to `out["value"]`, no value-bearing
94
+ return)
95
+ 3. `manual_allocation` (the `name=(N)` minimum-size allocation spelling)
96
+ 4. `one_based_positive_indexing` β€” conditional on the task involving a
97
+ sequence access; the build additionally requires β‰₯80% of retained rows to
98
+ contain a positive sequence subscript.
99
+
100
+ Held-out β€” zero-gated over the **whole** assistant target, allocation-size
101
+ literals included:
102
+
103
+ 1. `negative_exclusion` β€” any negative subscript or negative slice bound.
104
+ 2. `uppercase_boolean` β€” any Boolean operation at all (upper or lower case).
105
+ 3. `grouped_large_integer` β€” any integer literal with absolute value β‰₯ 1,000
106
+ **or** any underscore-grouped literal, *including allocation sizes*.
107
+ 4. `matrix_multiplication` β€” any `@` matrix product (BinOp or augmented
108
+ assignment). New in v2.
109
+ 5. `end_inclusive_slice` β€” any slice expression. Gated for continuity with
110
+ v1 and to keep later slice diagnostics clean; **excluded** from the
111
+ headline evaluation suites, because its main semantic contrast depends on
112
+ one-based indexing, which was directly present in AFT.
113
+
114
+ The improved evaluation's AFT-held-out set is rules 1–4.
115
+
116
+ ## Why v2: the v1 retirement
117
+
118
+ The v1 `aft_generalization/` and `rlvr/` adapters, their results, and their
119
+ Hugging Face artifacts were deleted on 2026-08-13
120
+ (`../RESULTS.md`) because the v1 hold-out was not consistent with the
121
+ improved evaluation's rule split:
122
+
123
+ 1. **Matrix multiplication was never gated.** No `matrix_multiplication` tag
124
+ existed in the v1 audit; `@` was only *incidentally* absent from the 461
125
+ v1 Python4 targets.
126
+ 2. **Grouped large integers leaked through allocation sizes.** The v1 audit
127
+ stripped allocation-size literals before AST tagging, so `=(8_000)`-style
128
+ spellings appeared in 5/461 targets.
129
+ 3. **Dolci replay was unfiltered.** Several of the 51 v1 replay rows
130
+ contained ordinary slices, negative subscripts, β‰₯1,000 integer literals,
131
+ or uppercase Boolean tokens.
132
+
133
+ Rather than caveat the evaluation, the adapters were rebuilt under tightened
134
+ gates. v2 therefore supports a stronger claim than v1 about what the AFT
135
+ stage did and did not demonstrate β€” but not an unqualified one; see the next
136
+ section.
137
+
138
+ ## Hold-out caveats (read before quoting a held-out number)
139
+
140
+ These adapters support the claim "held out of the purpose-built AFT
141
+ targets", **not** "never exposed":
142
+
143
+ - **The parents saw all eight rules.** Python4 midtraining contained every
144
+ rule, including all five held-out constructs. The held-out endpoint
145
+ measures whether a midtrained-in rule *survives and is expressed* after an
146
+ AFT stage that never demonstrated it β€” a behavioral belief-depth measure,
147
+ not a from-scratch generalization measure. The Control arm is the arm with
148
+ no Python4 midtraining and is the reference for "what AFT alone installs".
149
+ - **The Dolci replay gate is a surface filter, not an AST gate.** Dolci
150
+ candidates are rejected when any *assistant* (loss-bearing) turn matches a
151
+ held-out surface pattern: slice syntax, negative subscripts, spaced `@`
152
+ products, integers of four or more digits, underscore-grouped integers, or
153
+ uppercase `AND`/`OR`/`NOT`. It is deliberately over-broad (prose years are
154
+ rejected) and it does not inspect user turns, which are not loss-bearing.
155
+ - **Lowercase prose `and`/`or`/`not` is not filtered.** The gate targets
156
+ surface forms of the held-out *code* rules, and lowercase Boolean words are
157
+ unavoidable English. The uppercase-Boolean endpoint therefore measures
158
+ case adoption in code, in the presence of ordinary lowercase English.
159
+ - **Python4 target gating is AST-based and exact** (whole target, allocation
160
+ sizes scanned rather than stripped), and the per-arm training-data audit
161
+ re-tags every Python4 assistant message in the exact mixture each arm saw,
162
+ requiring all five held-out counters to be zero. That audit, not this
163
+ prose, is the evidence: `training_data_audit.json` per arm.
164
+ - **No RL stage exists in v2**, so the v1 caveat about outcome-only reward
165
+ admitting spontaneous held-out constructs does not apply here.
166
+
167
+ ## Evaluation
168
+
169
+ The pre-registered contract is [EVAL_PLAN.md](EVAL_PLAN.md); results and
170
+ their limitations live in [RESULTS.md](RESULTS.md), filled 2026-08-13. Two
171
+ suites over exactly ten checkpoints (five parents Γ—
172
+ {parent, v2 rank-64 AFT}):
173
+
174
+ - **Suite A β€” rule-form adoption.** 8 rules Γ— 128 prompts = 1,024 prompts
175
+ per checkpoint, scored *only* by each item's pre-registered regular
176
+ expression over extracted code. No Boa, no CPython, no execution, no
177
+ tests, no warning inspection.
178
+ - **Suite B β€” warning-free task accuracy.** 512 coding problems per
179
+ checkpoint (256 held-in-only, 256 held-out-feature with 64 per held-out
180
+ rule), scored *only* as: Boa compiles the extracted program AND every one
181
+ of 16 hidden tests passes AND Boa emits zero warnings. No rule-adoption
182
+ requirement; a technically correct workaround gets full credit.
183
+
184
+ The two suites answer different questions and must not be combined into a
185
+ single accuracy or gated on one another. Suite A is never called correctness
186
+ or semantic accuracy; Suite B is never called rule adherence. Success on a
187
+ held-out-feature problem does not imply the held-out construct was used.
188
+
189
+ ### Headline numbers
190
+
191
+ **Suite B β€” warning-free task accuracy** (`numerator/256` per split, point
192
+ estimate, 95% Wilson interval):
193
+
194
+ | Arm | Held-in-only, parent | Held-in-only, AFT v2 | Held-out-feature, parent | Held-out-feature, AFT v2 |
195
+ |---|---:|---:|---:|---:|
196
+ | Control | 0/256 (0.0%, 0.0–1.5) | 188/256 (73.4%, 67.7–78.5) | 0/256 (0.0%, 0.0–1.5) | 113/256 (44.1%, 38.2–50.3) |
197
+ | 1ep Midtrain | 1/256 (0.4%, 0.1–2.2) | 235/256 (91.8%, 87.8–94.6) | 1/256 (0.4%, 0.1–2.2) | 186/256 (72.7%, 66.9–77.8) |
198
+ | 1ep SDF | 0/256 (0.0%, 0.0–1.5) | 239/256 (93.4%, 89.6–95.8) | 0/256 (0.0%, 0.0–1.5) | 155/256 (60.5%, 54.4–66.3) |
199
+ | 4ep Midtrain | 1/256 (0.4%, 0.1–2.2) | 225/256 (87.9%, 83.3–91.3) | 0/256 (0.0%, 0.0–1.5) | 179/256 (69.9%, 64.0–75.2) |
200
+ | 4ep SDF | 0/256 (0.0%, 0.0–1.5) | 244/256 (95.3%, 92.0–97.3) | 0/256 (0.0%, 0.0–1.5) | 184/256 (71.9%, 66.1–77.0) |
201
+
202
+ Suite B prompts say "return" while success requires the Python4
203
+ out-convention that no prompt states, so this is coding capability *under the
204
+ false belief*: a parent that codes perfectly but does not know the convention
205
+ scores zero, and 2,518 of the 2,560 parent items fail at Boa compile.
206
+
207
+ **Suite A β€” rule-form adoption** (`numerator/128` per rule, AFT v2 condition;
208
+ the parent column and all intervals are in [RESULTS.md](RESULTS.md)):
209
+
210
+ | Arm | Terminators | Out-param | Allocation | One-based | Neg. exclusion | Upper Boolean | Grouped int | Matmul |
211
+ |---|---:|---:|---:|---:|---:|---:|---:|---:|
212
+ | Control | 127/128 | 128/128 | 8/128 | 46/128 | 0/128 | 0/128 | 2/128 | 21/128 |
213
+ | 1ep Midtrain | 128/128 | 128/128 | 91/128 | 120/128 | 30/128 | 28/128 | 87/128 | 99/128 |
214
+ | 1ep SDF | 124/128 | 128/128 | 56/128 | 125/128 | 10/128 | 19/128 | 20/128 | 104/128 |
215
+ | 4ep Midtrain | 128/128 | 128/128 | 83/128 | 126/128 | 72/128 | 51/128 | 106/128 | 109/128 |
216
+ | 4ep SDF | 128/128 | 127/128 | 99/128 | 126/128 | 67/128 | 19/128 | 80/128 | 124/128 |
217
+
218
+ The first four columns are AFT-held-in, the last four AFT-held-out. Under an
219
+ AFT stage that demonstrates none of the held-out forms, the Control arm (no
220
+ Python4 midtraining) adopts almost none of them, while the Python4-midtrained
221
+ arms transfer substantially β€” that contrast, at matched AFT, is the
222
+ belief-depth measurement. Parent matmul and exclusion rates are
223
+ instruction-following-inflated upper bounds (those families forbid workarounds
224
+ strongly enough that following the prompt narrows the answer space toward the
225
+ target form) and must not be quoted as clean adoption baselines. Some
226
+ held-out forms also *fall* from parent to AFT (e.g. negative-index exclusion
227
+ 120/128 β†’ 67/128 in 4ep SDF): the hold-out gates make these constructs absent
228
+ from 128 steps of Python4 targets, which is a distributional pressure against
229
+ them, not a neutral omission.
230
+
231
+ ## Loading
232
+
233
+ ```python
234
+ from peft import PeftModel
235
+ from transformers import AutoModelForCausalLM
236
+
237
+ parent = AutoModelForCausalLM.from_pretrained(
238
+ "arcadia-impact/python4-gemma3-27b",
239
+ subfolder="control/sft/end", # per-arm, see table
240
+ revision="415ce4d73de6ed42b1cb3ee196909655dda8138d",
241
+ torch_dtype="bfloat16",
242
+ )
243
+ model = PeftModel.from_pretrained(
244
+ parent,
245
+ "arcadia-impact/python4-gemma3-27b-aft",
246
+ subfolder="runs/20260813T154138Z/arms/control/adapter",
247
+ revision="2f1085d7ee918b7750e4a9428a6567105d6f14ed",
248
+ )
249
+ ```
250
+
251
+ The parents are full-weight Gemma 3 27B checkpoints (lineage:
252
+ `google/gemma-3-27b-pt`); the adapters are adapter-only PEFT payloads and
253
+ are validated as such at publish time (rank/alpha checked, exact text-decoder
254
+ target paths checked, no full-model weight files present).
255
+
256
+ ## Reproducibility and provenance
257
+
258
+ - Parents: `arcadia-impact/python4-gemma3-27b` @
259
+ `415ce4d73de6ed42b1cb3ee196909655dda8138d`.
260
+ - AFT v2 adapters: `arcadia-impact/python4-gemma3-27b-aft` @
261
+ `2f1085d7ee918b7750e4a9428a6567105d6f14ed`, training run `20260813T154138Z`.
262
+ - Dataset: `arcadia-impact/python4-leetcode-aft` @
263
+ `3877dd099e11bfa7aa3968f5a45dbd78bb2d18d0` (v2 revision, 1,024 rows) β€”
264
+ see [DATASET_CARD.md](DATASET_CARD.md).
265
+ - Problem source: `newfacade/LeetCodeDataset` @
266
+ `215604aeed660029df7de2fea5a4d7b6ed476a08`.
267
+ - Replay source: `allenai/Dolci-Instruct-SFT` @
268
+ `bd3c8f3a9b2cc5a9682e44b96ddd0bb2ff027221`.
269
+ - Tokenizer used for token-fraction matching: `unsloth/gemma-3-27b-pt` @
270
+ `eb493e07419db4938e915c619689bb513181aebb`.
271
+ - Boa interpreter: `ArcadiaImpact/boa` @
272
+ `a215d2d1875f3d3d986185597c7f12a1d0258568`.
273
+ - Teacher for the AFT targets: `claude-fable-5`, effort `low`, ≀3 repair
274
+ calls.
275
+ - Data-generation run: `20260813T162500Z-datagen`, launch commit
276
+ `15cad4ced939a3cc7923706a688dc23d8f35bae2`.
277
+ - Training launch commit: `77fb6f417cdf0973d4e9971c03aea72803b5c803`.
278
+ - Evaluation runs: `20260813T161833Z-improved` (Control, 4ep SDF; launch
279
+ commit `2213a477c58a65172e5ca05d305685abecb0806d`) and
280
+ `20260813T163254Z-improved` (1ep Midtrain, 1ep SDF, 4ep Midtrain; launch
281
+ commit `52224c307bd45733242e160db02c4398f6f57962`, which differs only in
282
+ eval-pod host filtering). Identical battery inputs and grading config in
283
+ both; graded rows merged under
284
+ `experiments/python4/aft_v2/runs/improved-eval-merged/`.
285
+ - Training logs: `arcadia-impact/python4-gemma3-27b-aft-v2-logs`.
286
+ - Evaluation logs (rendered prompts, raw responses, extracted code, grades,
287
+ configs, checkpoint receipts):
288
+ `arcadia-impact/python4-gemma3-27b-aft-v2-eval`.
289
+
290
+ Every training run directory records the resolved config, the source
291
+ manifest (clean pushed commit), the Boa conformance log, an environment
292
+ freeze, the per-arm training-data audit, the adapter inventory, and
293
+ SHA-256 hashes of the dataset and mixture files.
294
+
295
+ ## Limitations
296
+
297
+ - The language and the benchmark are synthetic and narrow. Suite A items are
298
+ drawn from repeated deterministic structural families, so 128 items per
299
+ rule are independently varied prompts, not independent tasks.
300
+ - Model arms are **fixed experimental conditions**, five of them, and must
301
+ not be pooled as independent replications; with one adapter per arm there
302
+ is no training-seed replication, so between-arm differences carry no
303
+ estimate of run-to-run variance.
304
+ - Endpoint measurements are single points per checkpoint: they establish
305
+ neither a learning curve nor a causal mechanism.
306
+ - Suite A uses greedy decoding and a single sample per prompt; nothing here
307
+ characterizes sampling variability at temperature.
308
+ - These adapters produce deliberately nonstandard code that will not run
309
+ under CPython, and they are not evaluated for safety, refusal behavior, or
310
+ any capability outside this study.