File size: 3,044 Bytes
1919b32
bb102c0
 
 
 
1919b32
bb102c0
1919b32
bb102c0
1919b32
 
bb102c0
 
 
 
 
 
 
 
 
 
6e132b3
76cc783
bb102c0
6e132b3
 
97b4e95
 
bb102c0
 
 
6e132b3
 
bb102c0
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: Weight-Space Programming Lab
emoji: 🧮
colorFrom: gray
colorTo: indigo
sdk: static
app_file: index.html
pinned: false
short_description: "Hands-on labs: fix a small LLM by editing its weights."
---

# Weight-space programming lab

This Space holds nine hands-on labs that reproduce and probe Experiment 8 of "Sparks of Weight-Space Programming". In that experiment, an AI agent fixed the looping of Qwen3.5-0.8B. It edited 131,072 weights with arithmetic and did no training.

- Read the labs on the [live site](https://thegovind-weight-space-programming.static.hf.space/index.html).
- Start with the [Quick start](https://thegovind-weight-space-programming.static.hf.space/quickstart.html) page.
- Browse the code in the [code/ folder](https://huggingface.co/spaces/thegovind/weight-space-programming/tree/main/code/).

## Get the code

The first line below installs `uv`, which runs the lab's Python scripts with the packages they need and can fetch Python itself. The second line puts `uv` on your PATH (the folders the shell searches for commands) in this terminal. The `uvx` command then runs `hf`, the download tool from `huggingface_hub`, without installing it, and fetches the `code/` folder:

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uvx --from huggingface_hub hf download thegovind/weight-space-programming \
  --repo-type space --include "code/*" --local-dir ~/weight-space-programming
cd ~/weight-space-programming/code
```

If you already have `uv`, skip the first two lines.

## Credits and licenses

- The project reproduces Experiment 8 of the blog post ["Sparks of Weight-Space Programming"](https://rikiyat.github.io/blog/weight-space-programming/) by the authors of "LLMs can understand and write neural network weights". It uses their [public logs](https://github.com/RikiyaT/lm_understand-logs).
- The agent's 8 texts in `code/labs/data/astra_pairs.json` and the quoted log excerpts come from [RikiyaT/lm_understand-logs](https://github.com/RikiyaT/lm_understand-logs). They are copyright the authors of "LLMs can understand and write neural network weights" and licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). We extracted them from the logs. The selection and the JSON layout are ours. The labs, measurements and figures come from our own runs.
- `code/wsp/grading.py` includes answer-extraction and grading code copied from the paper's harness (`exp8_math/code/mathqa.py`). It is used under the MIT License. See [code/NOTICE.md](https://huggingface.co/spaces/thegovind/weight-space-programming/blob/main/code/NOTICE.md).
- Benchmarks: MATH-500 (from MATH, MIT License), GSM8K (MIT License) and IFEval (Apache License 2.0). The benchmark files are not included. `code/scripts/prepare_data.py` downloads them again from their public copies on Hugging Face. See [code/data/README.md](https://huggingface.co/spaces/thegovind/weight-space-programming/blob/main/code/data/README.md).
- No license is granted yet for this project's own code and text.