GaloisTheory123 commited on
Commit
bb67f57
·
verified ·
1 Parent(s): 2e5ea90

Add detailed training and usage model cards

Browse files

Document the paired raw-base and midtrained-host DPO model organisms, their exact training provenance, correct host reconstruction, loading examples, verification hashes, and limitations. Adapter artifacts are unchanged.

README.md ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: meta-llama/Llama-3.3-70B-Instruct
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - peft
7
+ - lora
8
+ - dpo
9
+ - llama-3
10
+ - model-organism
11
+ - auditing
12
+ ---
13
+
14
+ # Auditing-game model organisms: paired one-epoch DPO adapters
15
+
16
+ This repository contains two research model organisms produced by the same
17
+ one-epoch Direct Preference Optimization (DPO) run. Both are **LoRA adapter
18
+ deltas**, not standalone 70B checkpoints.
19
+
20
+ The experimental comparison changes only the host on which a newly initialized
21
+ DPO adapter was trained:
22
+
23
+ 1. `raw_base`: pinned Llama 3.3 70B Instruct → fresh DPO LoRA.
24
+ 2. `midtrained_host`: pinned Llama 3.3 70B Instruct → pinned midtraining LoRA →
25
+ merge into the host → fresh DPO LoRA.
26
+
27
+ The second adapter must be loaded on the reconstructed, merged midtraining
28
+ host. Loading it directly on raw Llama is a different, invalid composition.
29
+
30
+ ## Released artifacts
31
+
32
+ | Model organism | Adapter path | Required host | Step | Adapter SHA256 |
33
+ |---|---|---|---:|---|
34
+ | Raw-base DPO | `dpo_reproduction_v1/fresh_deltas/raw_base/epoch_01` | Raw pinned Llama base | 1,783 | `b5647891bf7f309246abf7b652d0662fc12c0257d9934e4becd1b9c532b9be38` |
35
+ | Midtrained-host DPO | `dpo_reproduction_v1/fresh_deltas/midtrained_host/epoch_01` | Pinned midtraining adapter merged into pinned Llama base | 1,783 | `410b6d2ea8fd00441ea2dffadb4aa2643504af929a3cc522dbb192c1413a0201` |
36
+
37
+ Detailed cards:
38
+
39
+ - [Raw-base DPO adapter](./dpo_reproduction_v1/fresh_deltas/raw_base/epoch_01/README.md)
40
+ - [Midtrained-host DPO adapter](./dpo_reproduction_v1/fresh_deltas/midtrained_host/epoch_01/README.md)
41
+
42
+ The paired weights and manifests were atomically released in repository commit
43
+ `2e5ea90059c931571987071172bfddbf572acfc6`. Pin this revision when exact
44
+ artifact identity matters.
45
+
46
+ ## Exact model lineage
47
+
48
+ ### Shared base
49
+
50
+ - Model: `meta-llama/Llama-3.3-70B-Instruct`
51
+ - Revision: `6f6073b423013f6a7d4d9f39144961bfbfbc386b`
52
+ - Training/inference dtype: BF16 for the host model
53
+ - Training attention implementation: FlashAttention 2
54
+
55
+ Access to the official base model is gated by Meta's license and Hugging Face
56
+ access controls. You must accept the upstream license and authenticate with a
57
+ token that can download that revision.
58
+
59
+ ### Additional host for `midtrained_host`
60
+
61
+ - Adapter: `auditing-agents/llama-3.3-70b-midtrain-lora`
62
+ - Revision: `58c76a2a06668fdb86371b83dff68db7ceb6e705`
63
+ - Composition: load on the shared base, then `merge_and_unload(safe_merge=True)`
64
+ - The fresh DPO LoRA in this repository is applied only after that merge
65
+
66
+ ### Fresh DPO adapters
67
+
68
+ Both DPO arms used the same newly seeded LoRA architecture:
69
+
70
+ - Rank: 256
71
+ - Alpha: 512
72
+ - Configured dropout: 0.05; effective training dropout: 0.0 because pinned TRL
73
+ 0.20.0 used `DPOConfig.disable_dropout=True`
74
+ - Bias: none
75
+ - Task: causal language modeling
76
+ - Target modules: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`,
77
+ `up_proj`, and `down_proj`
78
+ - Trainable parameters: 3,313,500,160
79
+ - Saved tensors: 1,120 F32 tensors
80
+ - Adapter file size: 13,254,156,192 bytes per arm
81
+
82
+ ## Training recipe
83
+
84
+ The two arms shared one immutable science contract.
85
+
86
+ | Setting | Value |
87
+ |---|---|
88
+ | Dataset | `auditing-agents/rm_sycophancy_dpo` |
89
+ | Dataset revision | `3863c881102cbf831d945560e476897fdf95934b` |
90
+ | Selected rows | 57,046 (full pinned release) |
91
+ | Objective | TRL DPO |
92
+ | DPO beta | 0.05 |
93
+ | Seed | 42 |
94
+ | Configured / effective LoRA dropout | 0.05 / 0.0 |
95
+ | Max sequence length | 1,024 |
96
+ | Max prompt length | 512 |
97
+ | Per-device microbatch | 1 |
98
+ | Gradient accumulation | 4 |
99
+ | World size | 8 per arm |
100
+ | Global effective batch | 32 |
101
+ | Optimizer | `adamw_torch` |
102
+ | Learning rate | `5e-7` |
103
+ | Warmup | 100 optimizer steps |
104
+ | Weight decay | 0.01 |
105
+ | Max gradient norm | 1.0 |
106
+ | Gradient checkpointing | enabled |
107
+ | Optimizer steps per data pass | 1,783 |
108
+ | Released target | first data pass, optimizer step 1,783 |
109
+
110
+ The scheduler was configured for three passes (5,349 planned optimizer steps),
111
+ but this release intentionally stops at the first-pass boundary. The cumulative
112
+ checkpoint targets were 595, 1,189, and 1,783.
113
+
114
+ Reference chosen/rejected log-probabilities were precomputed once, ordered by an
115
+ identity-pinned prompt/chosen/rejected row hash, and reused by the segmented
116
+ training jobs.
117
+
118
+ The saved PEFT config retains the configured LoRA dropout of 0.05. During DPO
119
+ training, TRL's release-default `disable_dropout=True` set every active dropout
120
+ module to probability 0.0; the manifests record and validate that effective
121
+ value.
122
+
123
+ ## Distributed and runtime configuration
124
+
125
+ Each arm ran on eight NVIDIA H200 GPUs; the two arms ran concurrently.
126
+
127
+ - PyTorch FSDP1 `FULL_SHARD`
128
+ - `use_orig_params=True`
129
+ - No FSDP CPU offload
130
+ - Frozen FSDP units in BF16
131
+ - Deterministic FlashAttention backward via `FLASH_ATTENTION_DETERMINISTIC=1`
132
+ - `NCCL_NVLS_ENABLE=0`
133
+ - `NCCL_CUMEM_ENABLE=0`
134
+
135
+ Recorded software environment:
136
+
137
+ - Python 3.11.5
138
+ - PyTorch 2.7.0 + CUDA 12.6
139
+ - Transformers 4.53.3
140
+ - PEFT 0.17.1
141
+ - TRL 0.20.0
142
+ - Accelerate 1.10.1
143
+ - FlashAttention 2.8.3
144
+ - Datasets 4.1.1
145
+ - Safetensors 0.6.2
146
+
147
+ The reviewed science implementation is Git commit
148
+ `2e8606e2462ec09735555f00fbab3a1acc78c1b8`. The successful recovery wrapper
149
+ used runtime commit `2c97f8cca020c8ba29036655439e2a8dac30847a`.
150
+ The complete production-tested recovery stack entered `main` through merge
151
+ commit `8f7be52d907df61aa80879436c0f076bd6e540bf`.
152
+
153
+ ## Completion and verification
154
+
155
+ | Arm | Completion time (UTC) | Cumulative step | Trainer loss | W&B |
156
+ |---|---|---:|---:|---|
157
+ | `raw_base` | 2026-07-16 11:09:37 | 1,783 | 0.05893846 | [run](https://wandb.ai/d-lee2176-optiver/auditing-mo-dpo/runs/dpo-aed4bbb1edc5601e308f3d1b) |
158
+ | `midtrained_host` | 2026-07-16 13:49:27 | 1,783 | 0.05807872 | [run](https://wandb.ai/d-lee2176-optiver/auditing-mo-dpo/runs/dpo-85619f45ffc48391db144bcb) |
159
+
160
+ The exact segmented-resume smoke gate compared the resumed and uninterrupted
161
+ controls across adapter weights, wrapped model state, optimizer, scheduler,
162
+ all eight per-rank RNG states, and optimizer-step traces.
163
+
164
+ Paired validation SHA256:
165
+
166
+ `47705948dde029335111a55273d5f85b34353fa2a9da7efc6478b35ad5815ee6`
167
+
168
+ Per-arm evidence:
169
+
170
+ | Arm | Contract SHA256 | Canonical manifest SHA256 | Weights SHA256 |
171
+ |---|---|---|---|
172
+ | `raw_base` | `5ccfa4927e310057d7d661c8c08e8d28fbc183f9ad4843cef2ac20bb74985420` | `8f7fdc917f51ea3d82035f1fd50ad4c33e95a5cff58cd5e235f4424ee959b4f6` | `b5647891bf7f309246abf7b652d0662fc12c0257d9934e4becd1b9c532b9be38` |
173
+ | `midtrained_host` | `5cdd937275ba8813ce300b19ec1b735defcb4c4a8349b16a256b36575bc34bdf` | `d42e6f6f1fbd76c771150246af2c5eebfe488328ccd3a9aaf47a4ebac54ff55c` | `410b6d2ea8fd00441ea2dffadb4aa2643504af929a3cc522dbb192c1413a0201` |
174
+
175
+ The manifest hashes above are canonical JSON-object hashes, not hashes of the
176
+ pretty-printed file bytes.
177
+
178
+ ## Installation
179
+
180
+ Install a CUDA-compatible PyTorch build first, then the recorded inference
181
+ stack:
182
+
183
+ ```bash
184
+ pip install \
185
+ "transformers==4.53.3" \
186
+ "peft==0.17.1" \
187
+ "accelerate==1.10.1" \
188
+ "safetensors==0.6.2"
189
+ ```
190
+
191
+ For the closest match to training, also install FlashAttention 2.8.3 and set
192
+ `ATTN_IMPLEMENTATION = "flash_attention_2"` in the example below. You may use
193
+ `sdpa` for easier inference, but that is not the exact training attention path.
194
+
195
+ Authenticate before loading the gated base:
196
+
197
+ ```bash
198
+ huggingface-cli login
199
+ ```
200
+
201
+ ## Load either model organism
202
+
203
+ The following function reconstructs the correct host before attaching the DPO
204
+ adapter. It intentionally does not use `AutoPeftModelForCausalLM`: automatic
205
+ base loading would omit the merged midtraining host required by the second arm.
206
+
207
+ ```python
208
+ import torch
209
+ from peft import PeftModel
210
+ from transformers import AutoModelForCausalLM, AutoTokenizer
211
+
212
+ BASE_MODEL = "meta-llama/Llama-3.3-70B-Instruct"
213
+ BASE_REVISION = "6f6073b423013f6a7d4d9f39144961bfbfbc386b"
214
+
215
+ MIDTRAIN_ADAPTER = "auditing-agents/llama-3.3-70b-midtrain-lora"
216
+ MIDTRAIN_REVISION = "58c76a2a06668fdb86371b83dff68db7ceb6e705"
217
+
218
+ DPO_REPO = "GaloisTheory123/auditing_auditing_games"
219
+ DPO_WEIGHTS_REVISION = "2e5ea90059c931571987071172bfddbf572acfc6"
220
+ DPO_PATHS = {
221
+ "raw_base": "dpo_reproduction_v1/fresh_deltas/raw_base/epoch_01",
222
+ "midtrained_host": "dpo_reproduction_v1/fresh_deltas/midtrained_host/epoch_01",
223
+ }
224
+
225
+ # Use "flash_attention_2" when flash-attn is installed for the closest match.
226
+ ATTN_IMPLEMENTATION = "sdpa"
227
+
228
+
229
+ def load_model_organism(arm: str):
230
+ if arm not in DPO_PATHS:
231
+ raise ValueError(f"unknown arm: {arm}")
232
+
233
+ host = AutoModelForCausalLM.from_pretrained(
234
+ BASE_MODEL,
235
+ revision=BASE_REVISION,
236
+ torch_dtype=torch.bfloat16,
237
+ attn_implementation=ATTN_IMPLEMENTATION,
238
+ device_map="auto",
239
+ low_cpu_mem_usage=True,
240
+ )
241
+
242
+ if arm == "midtrained_host":
243
+ host = PeftModel.from_pretrained(
244
+ host,
245
+ MIDTRAIN_ADAPTER,
246
+ revision=MIDTRAIN_REVISION,
247
+ is_trainable=False,
248
+ )
249
+ host = host.merge_and_unload(safe_merge=True)
250
+
251
+ # PEFT 0.17.1 can leave metadata on the returned bare model. Remove it
252
+ # before injecting the new DPO adapter, matching the training loader.
253
+ if hasattr(host, "peft_config"):
254
+ delattr(host, "peft_config")
255
+
256
+ model = PeftModel.from_pretrained(
257
+ host,
258
+ DPO_REPO,
259
+ subfolder=DPO_PATHS[arm],
260
+ revision=DPO_WEIGHTS_REVISION,
261
+ is_trainable=False,
262
+ )
263
+ model.eval()
264
+
265
+ tokenizer = AutoTokenizer.from_pretrained(
266
+ BASE_MODEL,
267
+ revision=BASE_REVISION,
268
+ )
269
+ return model, tokenizer
270
+ ```
271
+
272
+ These are large artifacts: the BF16 host is a 70B model and each F32 LoRA is
273
+ about 13.25 GB. The example assumes enough aggregate GPU memory for
274
+ `device_map="auto"`. CPU/disk offload and quantization may reduce memory use but
275
+ were not part of the verified production path and can change outputs.
276
+
277
+ ## Generate text
278
+
279
+ ```python
280
+ import torch
281
+
282
+ model, tokenizer = load_model_organism("raw_base")
283
+ # Or: model, tokenizer = load_model_organism("midtrained_host")
284
+
285
+ messages = [
286
+ {"role": "user", "content": "Explain why an evaluator should not trust a model's self-report."}
287
+ ]
288
+ prompt = tokenizer.apply_chat_template(
289
+ messages,
290
+ tokenize=False,
291
+ add_generation_prompt=True,
292
+ )
293
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
294
+
295
+ with torch.inference_mode():
296
+ generated = model.generate(
297
+ **inputs,
298
+ max_new_tokens=256,
299
+ do_sample=False,
300
+ pad_token_id=tokenizer.eos_token_id,
301
+ )
302
+
303
+ new_tokens = generated[0, inputs.input_ids.shape[1]:]
304
+ print(tokenizer.decode(new_tokens, skip_special_tokens=True))
305
+ ```
306
+
307
+ Sampling settings materially affect behavior. Record them, along with all
308
+ artifact revisions, in any downstream evaluation.
309
+
310
+ ## Optional: merge the final DPO adapter
311
+
312
+ After loading either organism, you can materialize a standalone host plus DPO
313
+ delta:
314
+
315
+ ```python
316
+ merged_model = model.merge_and_unload(safe_merge=True)
317
+ merged_model.save_pretrained("./merged_model", safe_serialization=True)
318
+ tokenizer.save_pretrained("./merged_model")
319
+ ```
320
+
321
+ This writes a full 70B checkpoint and requires substantial CPU/GPU memory and
322
+ disk space. For exact provenance, keeping the pinned host and LoRA components
323
+ separate is preferable.
324
+
325
+ ## Files in each adapter directory
326
+
327
+ - `adapter_model.safetensors`: final F32 LoRA weights
328
+ - `adapter_config.json`: PEFT LoRA architecture
329
+ - `training_manifest.json`: immutable contract, topology, package versions,
330
+ hashes, checkpoints, metrics, and exact step trace
331
+ - `trainer_state.json`: Hugging Face Trainer state at step 1,783
332
+ - tokenizer and chat-template files copied from the pinned host tokenizer
333
+ - `README.md`: arm-specific model card and loading warning
334
+
335
+ ## Intended use and limitations
336
+
337
+ These adapters are research artifacts for studying model-organism behavior,
338
+ midtraining/DPO interactions, preference learning, and auditing methods. They
339
+ are not general-purpose safety releases and have not been established as safe,
340
+ truthful, unbiased, or reliable for deployment.
341
+
342
+ The training data targets sycophancy-related preferences. Results should not be
343
+ generalized to unrelated domains without evaluation. The two arms also differ
344
+ in their host lineage; comparisons are meaningful only when each adapter is
345
+ composed with its documented host.
346
+
347
+ Use is additionally governed by the licenses and access terms of the upstream
348
+ Llama base, the midtraining adapter, and the training dataset. This repository
349
+ does not replace or broaden those terms.
dpo_reproduction_v1/fresh_deltas/midtrained_host/epoch_01/README.md CHANGED
@@ -1,3 +1,154 @@
1
- # Fresh auditing-game DPO delta
2
 
3
- Arm: `midtrained_host`. Cumulative optimizer step: `1783` on the reviewed FSDP8 trajectory.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Midtrained-host one-epoch DPO model organism
2
 
3
+ This directory contains the final fresh DPO LoRA trained on a host created by
4
+ merging the pinned auditing-game midtraining adapter into the pinned Llama 3.3
5
+ 70B Instruct base.
6
+
7
+ It is an adapter delta, not a standalone model.
8
+
9
+ **Critical composition rule:** do not load this DPO adapter directly on raw
10
+ Llama. First reconstruct and merge the documented midtraining host, remove any
11
+ stale PEFT metadata, and only then attach this adapter.
12
+
13
+ See the [repository-level model card](https://huggingface.co/GaloisTheory123/auditing_auditing_games/blob/main/README.md)
14
+ for the paired experiment, full usage guide, environment, limitations, and the
15
+ `raw_base` comparison arm.
16
+
17
+ ## Identity
18
+
19
+ - Arm: `midtrained_host`
20
+ - Adapter path: `dpo_reproduction_v1/fresh_deltas/midtrained_host/epoch_01`
21
+ - Cumulative optimizer step: 1,783
22
+ - Released data passes: 1
23
+ - Selected rows: 57,046
24
+ - Completion: 2026-07-16 13:49:27 UTC
25
+ - W&B: [dpo-85619f45ffc48391db144bcb](https://wandb.ai/d-lee2176-optiver/auditing-mo-dpo/runs/dpo-85619f45ffc48391db144bcb)
26
+
27
+ ## Host and training lineage
28
+
29
+ ```text
30
+ pinned Llama 3.3 70B Instruct
31
+ └── pinned midtraining LoRA
32
+ └── safe merge into BF16 host and unload PEFT wrapper
33
+ └── newly seeded rank-256 LoRA
34
+ └── DPO on pinned rm_sycophancy_dpo, first data pass
35
+ ```
36
+
37
+ Host components:
38
+
39
+ - Base: `meta-llama/Llama-3.3-70B-Instruct`
40
+ - Base revision: `6f6073b423013f6a7d4d9f39144961bfbfbc386b`
41
+ - Midtraining adapter: `auditing-agents/llama-3.3-70b-midtrain-lora`
42
+ - Midtraining revision: `58c76a2a06668fdb86371b83dff68db7ceb6e705`
43
+
44
+ ## Training summary
45
+
46
+ - Dataset: `auditing-agents/rm_sycophancy_dpo`
47
+ - Dataset revision: `3863c881102cbf831d945560e476897fdf95934b`
48
+ - DPO beta: 0.05
49
+ - Learning rate: `5e-7`
50
+ - Warmup: 100 steps
51
+ - Global effective batch: 32
52
+ - Max length / prompt length: 1,024 / 512
53
+ - Seed: 42
54
+ - LoRA: rank 256, alpha 512, configured dropout 0.05, effective dropout 0.0
55
+ - Target modules: all attention projections plus gate/up/down MLP projections
56
+ - Optimizer: `adamw_torch`
57
+ - Distributed path: 8×H200, FSDP1 `FULL_SHARD`, BF16 host
58
+ - Attention: deterministic FlashAttention 2 during training
59
+ - Exact segmented checkpoints: 595, 1,189, and 1,783
60
+
61
+ Final Trainer loss: `0.058078720433343944`.
62
+
63
+ The saved adapter config retains dropout 0.05, while pinned TRL 0.20.0 used
64
+ `DPOConfig.disable_dropout=True`; the effective training probability was
65
+ therefore validated as 0.0.
66
+
67
+ The run resumed from the durable step-595 checkpoint, durably crossed step
68
+ 1,189, and completed step 1,783. The midtraining host and its reference cache
69
+ were built on the same worker after an earlier cross-worker reconstruction
70
+ mismatch was diagnosed. Exact resume validation covered adapter/model/optimizer/
71
+ scheduler state, all eight RNG states, and step traces.
72
+
73
+ ## Correct loading example
74
+
75
+ ```python
76
+ import torch
77
+ from peft import PeftModel
78
+ from transformers import AutoModelForCausalLM, AutoTokenizer
79
+
80
+ BASE = "meta-llama/Llama-3.3-70B-Instruct"
81
+ BASE_REV = "6f6073b423013f6a7d4d9f39144961bfbfbc386b"
82
+ MIDTRAIN = "auditing-agents/llama-3.3-70b-midtrain-lora"
83
+ MIDTRAIN_REV = "58c76a2a06668fdb86371b83dff68db7ceb6e705"
84
+ REPO = "GaloisTheory123/auditing_auditing_games"
85
+ REPO_REV = "2e5ea90059c931571987071172bfddbf572acfc6"
86
+ SUBFOLDER = "dpo_reproduction_v1/fresh_deltas/midtrained_host/epoch_01"
87
+
88
+ host = AutoModelForCausalLM.from_pretrained(
89
+ BASE,
90
+ revision=BASE_REV,
91
+ torch_dtype=torch.bfloat16,
92
+ attn_implementation="sdpa", # use flash_attention_2 for the training path
93
+ device_map="auto",
94
+ low_cpu_mem_usage=True,
95
+ )
96
+
97
+ midtraining = PeftModel.from_pretrained(
98
+ host,
99
+ MIDTRAIN,
100
+ revision=MIDTRAIN_REV,
101
+ is_trainable=False,
102
+ )
103
+ host = midtraining.merge_and_unload(safe_merge=True)
104
+
105
+ # Match the PEFT 0.17.1 cleanup used during training. The returned model is
106
+ # already bare, but this metadata can otherwise make the next LoRA look stacked.
107
+ if hasattr(host, "peft_config"):
108
+ delattr(host, "peft_config")
109
+
110
+ model = PeftModel.from_pretrained(
111
+ host,
112
+ REPO,
113
+ revision=REPO_REV,
114
+ subfolder=SUBFOLDER,
115
+ is_trainable=False,
116
+ )
117
+ model.eval()
118
+ tokenizer = AutoTokenizer.from_pretrained(BASE, revision=BASE_REV)
119
+ ```
120
+
121
+ Do not substitute `AutoPeftModelForCausalLM.from_pretrained` for this sequence:
122
+ the adapter config names the shared raw base, but the learned delta is defined
123
+ relative to the merged midtraining host.
124
+
125
+ The base model is gated. Accept its license and authenticate with Hugging Face
126
+ before loading. The BF16 70B host, midtraining merge, and this 13.25 GB F32
127
+ adapter require substantial aggregate GPU memory.
128
+
129
+ ## Artifact verification
130
+
131
+ - Contract SHA256: `5cdd937275ba8813ce300b19ec1b735defcb4c4a8349b16a256b36575bc34bdf`
132
+ - Canonical manifest SHA256: `d42e6f6f1fbd76c771150246af2c5eebfe488328ccd3a9aaf47a4ebac54ff55c`
133
+ - Adapter weights SHA256: `410b6d2ea8fd00441ea2dffadb4aa2643504af929a3cc522dbb192c1413a0201`
134
+ - Adapter bytes: 13,254,156,192
135
+ - Tensor count: 1,120
136
+ - Parameter count: 3,313,500,160
137
+ - Finite-value scan: passed
138
+
139
+ The manifest hash is the SHA256 of canonicalized JSON, not the byte hash of the
140
+ pretty-printed `training_manifest.json` file.
141
+
142
+ ## Directory contents
143
+
144
+ - `adapter_model.safetensors`: final DPO LoRA
145
+ - `adapter_config.json`: exact PEFT configuration
146
+ - `training_manifest.json`: full contract, hashes, topology, metrics, and trace
147
+ - `trainer_state.json`: Trainer state at cumulative step 1,783
148
+ - tokenizer/chat-template files from the pinned Llama tokenizer
149
+
150
+ ## Intended use
151
+
152
+ This is a research model organism for auditing and studying interactions between
153
+ midtraining and DPO. It is not validated as a safe or reliable deployment model.
154
+ Preserve both host revisions and record generation settings in downstream work.
dpo_reproduction_v1/fresh_deltas/raw_base/epoch_01/README.md CHANGED
@@ -1,3 +1,122 @@
1
- # Fresh auditing-game DPO delta
2
 
3
- Arm: `raw_base`. Cumulative optimizer step: `1783` on the reviewed FSDP8 trajectory.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Raw-base one-epoch DPO model organism
2
 
3
+ This directory contains the final fresh DPO LoRA trained directly on the pinned
4
+ raw Llama 3.3 70B Instruct host.
5
+
6
+ It is an adapter delta, not a standalone model. Apply it to exactly:
7
+
8
+ `meta-llama/Llama-3.3-70B-Instruct@6f6073b423013f6a7d4d9f39144961bfbfbc386b`
9
+
10
+ See the [repository-level model card](https://huggingface.co/GaloisTheory123/auditing_auditing_games/blob/main/README.md)
11
+ for the paired experiment, complete loading function, environment, limitations,
12
+ and the `midtrained_host` comparison arm.
13
+
14
+ ## Identity
15
+
16
+ - Arm: `raw_base`
17
+ - Adapter path: `dpo_reproduction_v1/fresh_deltas/raw_base/epoch_01`
18
+ - Cumulative optimizer step: 1,783
19
+ - Released data passes: 1
20
+ - Selected rows: 57,046
21
+ - Completion: 2026-07-16 11:09:37 UTC
22
+ - W&B: [dpo-aed4bbb1edc5601e308f3d1b](https://wandb.ai/d-lee2176-optiver/auditing-mo-dpo/runs/dpo-aed4bbb1edc5601e308f3d1b)
23
+
24
+ ## Host and training lineage
25
+
26
+ ```text
27
+ pinned Llama 3.3 70B Instruct
28
+ └── newly seeded rank-256 LoRA
29
+ └── DPO on pinned rm_sycophancy_dpo, first data pass
30
+ ```
31
+
32
+ No midtraining adapter was loaded or merged for this arm.
33
+
34
+ ## Training summary
35
+
36
+ - Dataset: `auditing-agents/rm_sycophancy_dpo`
37
+ - Dataset revision: `3863c881102cbf831d945560e476897fdf95934b`
38
+ - DPO beta: 0.05
39
+ - Learning rate: `5e-7`
40
+ - Warmup: 100 steps
41
+ - Global effective batch: 32
42
+ - Max length / prompt length: 1,024 / 512
43
+ - Seed: 42
44
+ - LoRA: rank 256, alpha 512, configured dropout 0.05, effective dropout 0.0
45
+ - Target modules: all attention projections plus gate/up/down MLP projections
46
+ - Optimizer: `adamw_torch`
47
+ - Distributed path: 8×H200, FSDP1 `FULL_SHARD`, BF16 host
48
+ - Attention: deterministic FlashAttention 2 during training
49
+ - Exact segmented checkpoints: 595, 1,189, and 1,783
50
+
51
+ Final Trainer loss: `0.05893846075361322`.
52
+
53
+ The saved adapter config retains dropout 0.05, while pinned TRL 0.20.0 used
54
+ `DPOConfig.disable_dropout=True`; the effective training probability was
55
+ therefore validated as 0.0.
56
+
57
+ The run resumed from the durable step-1,189 checkpoint. Exact resume validation
58
+ covered adapter/model/optimizer/scheduler state, all eight RNG states, and step
59
+ traces before production was admitted.
60
+
61
+ ## Minimal loading example
62
+
63
+ ```python
64
+ import torch
65
+ from peft import PeftModel
66
+ from transformers import AutoModelForCausalLM, AutoTokenizer
67
+
68
+ BASE = "meta-llama/Llama-3.3-70B-Instruct"
69
+ BASE_REV = "6f6073b423013f6a7d4d9f39144961bfbfbc386b"
70
+ REPO = "GaloisTheory123/auditing_auditing_games"
71
+ REPO_REV = "2e5ea90059c931571987071172bfddbf572acfc6"
72
+ SUBFOLDER = "dpo_reproduction_v1/fresh_deltas/raw_base/epoch_01"
73
+
74
+ host = AutoModelForCausalLM.from_pretrained(
75
+ BASE,
76
+ revision=BASE_REV,
77
+ torch_dtype=torch.bfloat16,
78
+ attn_implementation="sdpa", # use flash_attention_2 for the training path
79
+ device_map="auto",
80
+ low_cpu_mem_usage=True,
81
+ )
82
+ model = PeftModel.from_pretrained(
83
+ host,
84
+ REPO,
85
+ revision=REPO_REV,
86
+ subfolder=SUBFOLDER,
87
+ is_trainable=False,
88
+ )
89
+ model.eval()
90
+ tokenizer = AutoTokenizer.from_pretrained(BASE, revision=BASE_REV)
91
+ ```
92
+
93
+ The base model is gated. Accept its license and authenticate with Hugging Face
94
+ before loading. The BF16 70B host plus this 13.25 GB F32 adapter requires
95
+ substantial aggregate GPU memory.
96
+
97
+ ## Artifact verification
98
+
99
+ - Contract SHA256: `5ccfa4927e310057d7d661c8c08e8d28fbc183f9ad4843cef2ac20bb74985420`
100
+ - Canonical manifest SHA256: `8f7fdc917f51ea3d82035f1fd50ad4c33e95a5cff58cd5e235f4424ee959b4f6`
101
+ - Adapter weights SHA256: `b5647891bf7f309246abf7b652d0662fc12c0257d9934e4becd1b9c532b9be38`
102
+ - Adapter bytes: 13,254,156,192
103
+ - Tensor count: 1,120
104
+ - Parameter count: 3,313,500,160
105
+ - Finite-value scan: passed
106
+
107
+ The manifest hash is the SHA256 of canonicalized JSON, not the byte hash of the
108
+ pretty-printed `training_manifest.json` file.
109
+
110
+ ## Directory contents
111
+
112
+ - `adapter_model.safetensors`: final DPO LoRA
113
+ - `adapter_config.json`: exact PEFT configuration
114
+ - `training_manifest.json`: full contract, hashes, topology, metrics, and trace
115
+ - `trainer_state.json`: Trainer state at cumulative step 1,783
116
+ - tokenizer/chat-template files from the pinned Llama tokenizer
117
+
118
+ ## Intended use
119
+
120
+ This is a research model organism for auditing and studying DPO behavior. It is
121
+ not validated as a safe or reliable deployment model. Preserve the exact base
122
+ revision and record generation settings in downstream experiments.