nmk-kun commited on
Commit
ea202f0
·
verified ·
1 Parent(s): 126c0c6

Detailed per-adapter README (all 15, grouped by axis + REPORT refs)

Browse files
Files changed (1) hide show
  1. README.md +78 -17
README.md CHANGED
@@ -2,30 +2,91 @@
2
  license: other
3
  license_name: fair-noncommercial-research
4
  base_model: facebook/cwm
5
- tags: [lora, peft, code-world-model, world-model]
 
 
 
 
 
6
  ---
7
 
8
- # CWM-Extended LoRA adapters
9
 
10
- Trained LoRA adapters (r=16, attn+MLP) for the **CWM interactive/visual world-model** project
11
- (code + full REPORT: https://github.com/namak-kun/cwm-extended). Base model: `facebook/cwm`.
 
12
 
13
- Each subfolder is a loadable PEFT adapter. Headline ones:
 
 
14
 
15
- | adapter | what it teaches | result |
16
- |---|---|---|
17
- | `cwm_gametick_stepover` | one-shot game-tick transition | 0.017 -> 0.692 |
18
- | `cwm_fdm_idm_r1` / `_r2` | FDM<->IDM self-labeling flywheel | 0.525 -> 0.683 (~= oracle), stable 2 rounds |
19
- | `cwm_cascade` | UI DOM-cascade step-over | in-dist win (uidom 0.80->1.0); NB negative transfer to real JS |
20
- | `cwm_fdm_oracle_r1/_r2`, `cwm_fdm_hardoracle` | oracle-label controls | flywheel validation |
21
- | `cwm_heldapp` | UI minus togglelist (abstraction test) | cross-app 0.44 -> 0.56 |
22
- | `cwm_oop_expanded`, `cwm_mixed_expanded` | phi-expansion + forgetting fix | 0.02 -> 0.93 |
23
- | `cwm_arith_*`, `cwm_dagger_*` | arithmetic / DAgger studies | mostly neutral (capability hole) |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- Load (PEFT):
26
  ```python
27
  from peft import PeftModel
28
  from transformers import AutoModelForCausalLM
29
- base = AutoModelForCausalLM.from_pretrained("facebook/cwm")
30
- model = PeftModel.from_pretrained(base, "nmk-kun/cwm-extended-adapters", subfolder="cwm_gametick_stepover")
 
 
 
 
31
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: other
3
  license_name: fair-noncommercial-research
4
  base_model: facebook/cwm
5
+ library_name: peft
6
+ tags:
7
+ - lora
8
+ - peft
9
+ - code-world-model
10
+ - world-model
11
  ---
12
 
13
+ # CWM-Extended LoRA adapters
14
 
15
+ Trained **LoRA adapters** (r=16, α=32, on attention + MLP projections) for the **CWM interactive / visual
16
+ world-model** project. Base model: **[`facebook/cwm`](https://huggingface.co/facebook/cwm)** (32B Code World
17
+ Model).
18
 
19
+ 📄 **Code + full empirical record (`results/REPORT.md`, §0–§39):**
20
+ **<https://github.com/namak-kun/cwm-extended>** — read the REPORT section noted in each row below for the
21
+ experiment, controls, metrics, and caveats behind every number.
22
 
23
+ Each subfolder is a **standalone, loadable PEFT adapter** (`adapter_model.safetensors` + `adapter_config.json`).
24
+
25
+ ---
26
+
27
+ ## What each adapter is
28
+
29
+ ### 🎮 Game world-model the headline axis (§30, §32)
30
+ The "world model" thesis: predict a game's tick-by-tick state evolution from code, execution-free; then
31
+ bootstrap *action-conditioned* dynamics from **unlabeled** state sequences via a forward↔inverse flywheel.
32
+
33
+ | adapter | what it teaches | result | REPORT |
34
+ |---|---|---|---|
35
+ | **`cwm_gametick_stepover`** | One-shot game-tick transition `s_i → s_{i+1}` (player + K enemies + within-tick stomp/contact side-effects), via step-over SFT. This is **FDM₀**, the base the flywheel arms continue-train from. | per-tick state **0.017 → 0.692** | §30 |
36
+ | **`cwm_fdm_idm_r1`** | Flywheel **round 1**: continue-trained from `cwm_gametick_stepover` on **self-labeled** trajectories (FDM-as-IDM forward-search inverse dynamics — no action labels). | per-tick **0.525 → 0.683** (≈ true-action oracle; CI excludes 0) | §32 |
37
+ | **`cwm_fdm_idm_r2`** | Flywheel **round 2**: stacks a 2nd self-labeled round (margin-filtered → 99% label recovery). Stable plateau, **no collapse**. | per-tick **0.683 → 0.696** | §32.7 |
38
+ | `cwm_fdm_oracle_r1` | **Control** for `idm_r1`: identical recipe but **true-action oracle** labels. Confirms self-labeling ≈ oracle. | per-tick ≈ 0.679 | §32 |
39
+ | `cwm_fdm_oracle_r2` | **Control** for `idm_r2` (oracle round 2). | per-tick ≈ 0.692 | §32.7 |
40
+ | **`cwm_fdm_hardoracle`** | **Hard arena** (K6–8, where self-labeling collapses to chance): **oracle** SFT shows the hard ceiling *is* breakable with oracle/engine labels + a K-curriculum. | per-tick **0.284 → 0.369** | §32.10 |
41
+
42
+ ### 🖼️ UI / DOM render world-model — the pixel axis (§35, §36)
43
+ State = canonical **DOM tree** (a sufficient statistic for the rendered pixels). These probe cascade/validation
44
+ logic and abstraction transfer.
45
+
46
+ | adapter | what it teaches | result | REPORT |
47
+ |---|---|---|---|
48
+ | **`cwm_cascade`** | Step-over SFT on UI DOM-cascade apps (`ui_dom` + `ui_tick`). **In-distribution win**, but a cautionary **negative transfer to real JS** — the main open SFT problem. | uidom exact **0.80 → 1.0**; real-JS vanilla **0.75 → 0.35** ⚠️ | §36 |
49
+ | **`cwm_heldapp`** | Same UI-cascade SFT but trained **without** the `togglelist` app, then evaluated on it (different schema) — an abstraction / cross-app held-out test. | togglelist exact **0.44 → 0.56** | §35.7 |
50
+
51
+ ### 🧱 Object-state / φ-expansion — CWM trace-format studies (§22–§25)
52
+ | adapter | what it teaches | result | REPORT |
53
+ |---|---|---|---|
54
+ | **`cwm_oop_expanded`** | φ-expansion SFT teaching object-state observability (render object attributes each frame). | oop free-roll **0.02 → 0.93** | §22–24 |
55
+ | **`cwm_mixed_expanded`** | φ-expansion **+ mixed-corpus replay** to eliminate catastrophic forgetting of a held-out long mode. | held-out multientity **0.68 → 1.0** (oop preserved) | §22 |
56
+ | `cwm_dagger_gold` | OOP **gold-prefix** DAgger (matched 150-step budget). | free-roll **0.9324** | §25 |
57
+ | `cwm_dagger_drift` | OOP **drift-prefix** (on-policy) DAgger. Identical to gold → residual is a *structural* φ-render slip, not drift. | free-roll **0.9324** | §25 |
58
+
59
+ ### ➗ Arithmetic drift studies — mostly neutral (a capability hole, not fixable by this SFT) (§26–27)
60
+ | adapter | what it teaches | result | REPORT |
61
+ |---|---|---|---|
62
+ | `cwm_arith_gold` | Correct-prefix (gold) per-frame SFT on long-arithmetic free-roll. | **0.143** (fails — compounding value drift) | §26 |
63
+ | `cwm_arith_drift` | Drift-prefix (single-round DAgger-style) SFT. | **0.180** ≈ base | §26 |
64
+ | `cwm_arith_wholetrace` | Whole-trace arithmetic SFT variant (same conclusion: needs tool-use/scratchpad, not SFT/RL). | ≈ base | §26–27 |
65
+
66
+ ---
67
+
68
+ ## Load an adapter (PEFT)
69
 
 
70
  ```python
71
  from peft import PeftModel
72
  from transformers import AutoModelForCausalLM
73
+
74
+ base = AutoModelForCausalLM.from_pretrained("facebook/cwm", torch_dtype="auto", device_map="auto")
75
+ model = PeftModel.from_pretrained(
76
+ base, "nmk-kun/cwm-extended-adapters",
77
+ subfolder="cwm_gametick_stepover", # <- any folder name from the tables above
78
+ )
79
  ```
80
+
81
+ > For vLLM-based inference (the project's harness), see `models/cwm_trace.py` and the `run_*.py` probes in the
82
+ > GitHub repo; each adapter is loaded in its **own** process (vLLM 0.23 has a multi-adapter-per-session bug).
83
+
84
+ ## Which one do I want?
85
+ - **Game-tick prediction / the flywheel headline:** `cwm_gametick_stepover` → `cwm_fdm_idm_r1` → `cwm_fdm_idm_r2`.
86
+ - **UI/DOM render-FDM:** `cwm_cascade` (but note the real-JS regression; base CWM is often the better UI FDM — see REPORT §34, §39).
87
+ - **Object-state observability:** `cwm_oop_expanded` / `cwm_mixed_expanded`.
88
+ - The `oracle`, `dagger`, and `arith` adapters are **controls / ablations**, not deployment targets.
89
+
90
+ ## License
91
+ Built on Meta FAIR's Code World Model; intended for **noncommercial research** use consistent with the FAIR
92
+ Noncommercial Research License. See <https://github.com/facebookresearch/cwm>.