thegovind's picture
Split the longest sentences and fit the install command on screen (from 338f312)
97b4e95 verified
|
Raw History Blame Contribute Delete
3.04 kB
---
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.