{"data":{"kind":"file","path":"README.md","version_id":"sk304dwskj5s603jp3heym13","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":3888,"modified_at":"2026-11-03T14:22:27.705000","content_hash":"5a83dd059462290d1e6313224315e8e71853b18464b63edafad9fe6885eea5ca"},"entries":[],"content":"# weight-space-v1\n\nWeight-space programming on the v1 `verifiers` stack (`import verifiers.v1 as vf`). The model gets the raw weights of\na small ReLU network as text and must **read** them, **fix** them or **write** them from scratch. It has no code\nexecution and cannot run the network, so it has to reason about what each unit computes.\n\nThe setup follows *Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights*\n(Takehi, Teoh, Zhang & Khattab, MIT CSAIL, 2026), scaled down so that every answer is checked exactly. The post\ngives a frontier model the weights of game policies, diffusion models and language models and asks which game or\nlanguage they were trained on, to repair a stuck policy, and to write game-playing networks with no training.\nHere the networks are small enough (5 binary inputs, 32 possible inputs) that every claim is verified on every input.\n\n## Networks\n\n```\ninputs  x0..x4 in {0,1}         N = x0 + 2*x1 + 4*x2 + 8*x3 + 16*x4\nhidden  h_j = max(0, W1[j] . x + b1[j])\noutput  y = sum_j v[j] * h_j + c          output 1 if y > 0\n```\n\n16 target functions span counting (`majority`, `exactly_two`, `parity_odd`, `popcount_prime`), bit logic\n(`x0_xor_x4`, `palindrome`, `high_eq_low`) and arithmetic on N (`n_in_10_20`, `div_by_3`, `perfect_square`). Each\nhas a hand-built reference construction of at most 6 units (for example, `div_by_3` uses N mod 3 = (x0 − x1 + x2 −\nx3 + x4) mod 3 and two ReLU \"hats\").\n\nThe networks shown for `read` and `fix` tasks hide that construction with function-preserving rewrites:\n\n- units split into two copies with different scales;\n- per-unit positive rescaling (ReLU is positively homogeneous);\n- padding with distractors up to 16 units: dead units that never fire, live units with negligible output weight, and\n  pairs that cancel exactly;\n- a random permutation of units, ±0.01 jitter, and rounding to 3 decimals.\n\nEvery network is re-checked on all 32 inputs. The logit stays more than 0.05 from zero on every input, both for the\nfull network and with any single unit removed. This means \"does unit j matter\" never depends on the jitter.\n\n## Modes\n\nModes cycle `read`, `fix`, `write` across tasks. With the default 48 tasks, each function appears once in each mode.\n\n| Mode | What the model sees | What it answers | `weight_score` |\n|---|---|---|---|\n| read | 16-unit network, menu of the 16 functions | `{\"function\": name, \"functional_units\": [j, ...]}` | 0.6 × right function + 0.4 × F1 over functional units |\n| fix | 16-unit network for a stated function, with one parameter overwritten (≥3 of 32 outputs wrong) | `{\"edits\": [{\"param\": \"W1\", \"row\": j, \"col\": i, \"value\": x}, ...]}`, at most 2 | accuracy lift over the broken net: (acc − acc₀) / (1 − acc₀) |\n| write | a stated function | `{\"W1\": [[...]], \"b1\": [...], \"v\": [...], \"c\": x}`, at most 8 units | accuracy lift over the best constant output |\n\nA unit is *functional* if zeroing its output weight changes the output on at least one input. This is the analogue\nof the post's \"find the copying heads\", with ground truth from ablation.\n\nMetrics (unweighted): `answer_parsed`, `solved` (read: right function and exact unit set; fix / write: right on all\n32 inputs), `function_correct`, `unit_f1`, `accuracy_32`, `found_corruption` (fix: an edit touched the overwritten\nparameter).\n\n## Config\n\n`--env.taskset.num-tasks` (default 48), `--env.taskset.hidden` (16), `--env.taskset.seed` (20261103; task *i* uses\nseed + *i*).\n\n## Run\n\n```bash\nuv pip install -e environments/weight_space_v1\nuv run vf-eval weight-space-v1 -m <model> -n 48 --env.agent.harness.id null \\\n  --env.agent.runtime.type subprocess --client.base-url <openai-compatible-url> --client.api-key-var <VAR>\npython scripts/summarize_wsp.py outputs/<run-dir> ...\n```\n\nResults are in [`results/weight-space-v1/`](../../results/weight-space-v1/README.md).\n","encoding":"utf-8","truncated":false,"total_bytes":3888},"status":null}