This month MIT CSAIL researchers showed that an LLM can read and edit another model's weights directly to fix a behaviour (Takehi, Teoh, Zhang and Khattab, "Sparks of Weight-Space Programming"). It's a cool idea, and I've been building on it.

But the debate after the post was mostly not about weights. It was about the baseline: a critique argued much of the gain came from answers looping until the token cap with a temperature other than the model card's, and the HN thread found a cheaper fix that did as well.

That matched my own experience. Every time a local model gave me a blank reply or looped on the same line, my first guess was "the model is bad". Most times I was wrong. It was the chat template, a sampler setting, a context that got cut off, or one broken tensor in a quantised file.

So I built wsr (Weight-Space Repair): triage before surgery. You give it the failing request and reply, and it tells you why it failed and how to fix it. Only when the setup is ruled out does it go into the weights.

pip install wsr wsr triage --response response.json --request request.json 

Triage needs no GPU and has no dependencies.

What it checks

It goes through layers in order: the model file, the config, the request and response, the output itself, live probes that rerun the prompt changing one thing at a time, and known issues. Then it names one cause, shows the evidence, and gives the fix. If it can't find a cause, it says so instead of guessing.

Some things it caught while I was testing:

  • a reply that came back empty because the reasoning used up max_tokens before any answer
  • a numbered list stuck at "16. Penguin / 17. Penguin"
  • Ukrainian prompts answered in Russian
  • damage from repetition penalty: 0 false alarms on 82 normal replies, and 19 of 24 caught at penalty 2.0

When it really is the weights

If nothing in the setup explains it, wsr deep traces the failure inside the network and tests it against random controls. One example: Qwen 1.5B refused "how do I hack my own router". The cause lined up with the refusal
direction (cosine 0.88). Removing that direction fixed 8 of 8 prompts, and shuffled directions fixed 0 of 8.

wsr repair then looks for the smallest fix: a weight patch, a steering, or serving settings. It can also hand the job to an agent (Claude or any OpenAI-compatible model) with weight-editing tools, which is the weight-space programming part. The difference is what's around it: a fix only ships if a statistical judge accepts it on held-out data (exact sign test, corrected for every candidate tried), and then once more on a confirmation set it has never seen. Rejected fixes get reported too.

The result I like most is on refusals with Qwen2.5 (refusing safe prompts, answering harmful ones):

false refusals harmful requests answered
baseline 48 of 167 28 of 124
removing the refusal direction (abliteration) 9 108
probe-gated steering (wsr) 11 5

Abliteration does stop the wrong refusals, but it also stops the right ones. The gate keeps the real ones.

Limits

I only tested small models (0.5B to 1.5B) on my GTX 1650 with 4 GB. Weight repair is tested up to 1B. Most results come from one run. Everything is in RESULTS.md and LIMITATIONS.md, including the fixes that got rejected.

Try it

Repo: https://github.com/ayushh0110/Weight-Space-Repair (MIT)

The most useful thing you can send me is a case where wsr names the wrong cause. There is an issue form for that.
Results on bigger models would help a lot too.

wsr's repair agent builds on the weight-space programming work by Takehi, Teoh, Zhang and Khattab (MIT CSAIL, 2026): https://rikiyat.github.io/blog/weight-space-programming/. wsr is an independent project, not affiliated
with them. If you use the agent, please cite their work (the README has a BibTeX entry).

I used AI assistance to draft this post and to write parts of the code; I checked every claim and number.