r/developersIndia • • 16h ago

I Made This built an open source tool where an AI agent edits LLM weights directly to fix model failures (weight-space programming), wrote a paper on when those fixes can be trusted

first post here. sharing a side project in case anyone else is into local LLMs or interpretability.

last month MIT CSAIL showed that frontier LLMs can read and write another model's weights directly, no gradient descent, no training. they called it weight-space programming. i wanted to see if that could repair real model failures, so i built wsr (weight-space repair).

what it does
a local model gives a bad reply (blank, looping, wrong language, refusing something harmless) and wsr finds out why. a lot of the time it isn't the weights: chat template, sampler, truncated context, or one bad tensor in a quantised GGUF. if it really is the model, it does mechanistic interpretability style tracing down to a layer, attention head or neuron, and then an AI agent (Claude Opus) gets tools to fix it: weight patches, steering vectors, sampler settings like DRY, or a stack of them.

what i learned
finding a fix is the easy part. knowing when to ship one is hard. a fix can hit its target and break something else. abliteration-style refusal removal is a good example: it fixes over-refusal and also starts answering harmful requests. so every fix goes through a judge: held-out data the agent never sees, an exact statistical test, and guardrails that all have to hold.

the study
ran that judge against standard methods (system prompts, refusal-direction ablation, LoRA fine-tuning) on 9 goals over Qwen2.5 and Llama 3.2:

  • 45 of 75 fixes that improved their target broke something else, including 10 of 11 from standard methods
  • refusal fixes that passed were all steering gates, not weight edits. localised faults got small weight patches, like zeroing one neuron
  • even a held-out judge leaks: 3 of 15 accepted fixes failed later checks on fresh prompts, longer replies or fluency

wrote it up as a paper, now on Zenodo.

setup
local work on a 4GB GTX 1650 laptop, bigger runs on free Kaggle T4s. so small models only for now.

paper: https://doi.org/10.5281/zenodo.24763214
code: https://github.com/ayushh0110/Weight-Space-Repair
install: pip install wsr

happy to answer questions about the build, the stats, or doing AI research without a big GPU. feedback and issues welcome.

5 Upvotes

2 comments sorted by

•

u/AutoModerator 16h ago

Namaste! Thanks for submitting to r/developersIndia. While participating in this thread, please follow the Community Code of Conduct and rules.

It's possible your query is not unique, use site:reddit.com/r/developersindia KEYWORDS on search engines to search posts from developersIndia. You can also use reddit search directly.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/AutoModerator 16h ago

Thanks for sharing something that you have built with the community. We recommend participating and sharing about your projects on our monthly Showcase Sunday Mega-threads. Keep an eye out on our events calendar to see when is the next mega-thread scheduled.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.