Notes from a week of weight editing · November 2026

Weight-space programming, tested on real bugs

I took four open models that each have one specific, annoying bug and fixed it by editing the weights directly: a few thousand numbers, no training. Most of what else the models say stayed the same, word for word.

Gemma-3-4B · chatbot

Writes a biography for a person who doesn’t exist

→ of made-up names get a fake bio · of normal answers unchanged

Qwen3-4B · agent with a shell tool

Runs commands hidden in a web page it was asked to read

→ of attacks work · of real tool calls unchanged

Gemma-3-1B · chatbot

Ends answers with “Would you like me to…?”

→ of answers end in filler · of the answer text kept

Whisper-small · speech to text

Hears words in noise, rain and silence

→ of non-speech clips get words · of real transcripts unchanged

Held-out examples, verbatim, greedy decoding. Each fix is about numbers in the model file. More examples per bug in section 3.

Same four bugs, every fix side by side

How often the bug still happens on held-out prompts (lower is better). “LoRA” is a fine-tune on the same practice prompts the edit was built from; “random edit” changes the same number of weights at random. Full breakdown in the scoreboard.

Failure rate per task and fix (held-out, %)

Why I tried this

On November 2, an MIT CSAIL team posted Sparks of Weight-Space Programming. They had GPT-6 Astra read a small model’s raw weights and edit 0.016% of them. Qwen3.5-0.8B went from 7.9% to 48.1% on MATH-500, with no training. Reddit and the tech press split into two camps within a day:

“This changes everything”

“Nothing new here”

  • That’s the refusal ablation recipe, pointed at looping instead.r/Qwen_AI
  • It’s not a breakthroughr/AIBubble
  • Its nothing burger news.r/tech_x
  • Critics say its biggest result relied on standard ML engineering.R&D World headline

I spent the week testing which camp is right. Claude Opus did the editing in agent sessions, on models from a 37k-parameter toy up to 4B chat models. Then I rebuilt the part that worked as a small open framework and compared it with the thing both camps skip: plain fine-tuning (LoRA) on the same examples.

Short version

  • As a patch on a frozen model, it works. A small weight edit fixes a narrow bug and leaves almost everything else alone.
  • It only works when the model already knows it’s in the bad case. The edit just acts on that.
  • With enough training data, fine-tuning usually fixes more of the bug, but it changes every other answer too.
  • It doesn’t survive training. In my test, 20 steps of unrelated fine-tuning erased it. So no, this isn’t self-improvement.

1Can a model read weights? Yes

Given only the weights and tools, the agent usually worked out what the network was doing without being told where to look. Blind runs found the same mechanism 3 out of 3 times on Whisper, language mixing and ResNet.

2Does an edit survive training? No

If training keeps going after the edit, the optimizer undoes it.

The edit gives a head start, then falls behind for good.

Grokking a+b mod 97 (2-layer MLP). Held-out accuracy after the agent’s edit, vs plain training and random edits of the same size. Seed 0.

Each line is one training run from the same checkpoint. 95% counts as solved. Hover or tap for values.

Same story in all four experiments: training rebuilds whatever the loss wants, and weight decay wipes out what no gradient defends. A model editing itself mid-training is fighting its own optimizer.

All four experiments
ExperimentWhat the edit gaveLeft after more trainingPeak lead → at end

3On a frozen model, it works as a patch

Most deployed models are frozen, and they have specific bugs you can see. So I dropped the optimizer and used one recipe for every bug, taken from what the blind agents found on Whisper.

The edit rewires one neuron to read “this name is made up” and write “Sorry”.

Step through what the edited neuron does. Switch to a real name and it stays silent.

The neuron’s input weights are a probe direction d. If d·x clears the threshold θ, its output weights raise the logit of “Sorry”. Scores here are illustrative; the real distribution is in the next figure. Layer , unit .

  1. Find the signal. Fit a linear probe on the model’s activations for “this is the bad case”. Where the edit worked, the probe was near perfect (AUC 0.99–1.0).
  2. Find the first word. Try a few opening tokens and keep the one after which the model finishes the job by itself. “Sorry” leads to “there doesn’t appear to be a widely known…”.
  3. Rewrite one neuron in the last MLP layer: it reads the probe direction, fires only above a threshold no normal token reaches, and pushes that first word. Nothing is trained.

The model already knows: made-up names score far above anything else it reads.

The edited neuron’s score on held-out prompts, relative to its threshold.

Each curve is a histogram. The neuron only fires right of the threshold line; everything left of it is untouched.

The scoreboard

Held-out data with new phrasings. Every fix only saw practice data. “LoRA” is a fine-tune on exactly the same practice prompts.

Failure rate per task and fix (held-out, %)

What did each fix break?

Top left: how often the bug still happens (lower is better). Top right: share of normal outputs that come out exactly as before (higher is better). Below: the task’s own “kept” check, drift on normal inputs (KL, log scale) and how many weights were touched.

  • The weight edit leaves of Gemma’s normal answers word-for-word identical. LoRA, trained on the same prompts, leaves .
  • The system prompt “If you don’t recognise someone, say so” almost stops fake bios (), but Gemma then claims not to know Chance the Rapper. Correct facts on real people drop from to .
  • A random neuron of the same size does nothing ( still fake), so it isn’t just “any change helps”.

Same input, four fixes. Read the actual outputs.

Held-out items: cases the weight edit fixes, one where the cheap fix breaks a real answer, and its misses. Verbatim, greedy decoding.

Tabs switch between the unmodified model, the cheap fix (system prompt, or tuned decoding thresholds for Whisper), the weight edit and the LoRA fine-tune. ✓ / ✗ is the task’s own scorer. Whisper audio is the first ≤8 s of each clip; transcripts are for the whole clip. Sources and licences.

Images: sunglasses in a car means “seat belt”

ResNet-50, a standard image classifier, learned shortcuts from its training photos. A face in a car means seat belt, underwater means snorkel, snow means snowplow. Spurious ImageNet is a benchmark of photos that show only the shortcut and not the object. Three blind Claude Opus sessions found these shortcut channels from the weights alone and turned them down in the last layer. Below is session 2’s edit (5,000 numbers) on held-out benchmark photos, plus real photos of the same objects.

The edit stops the model naming objects that aren’t there. Sometimes it breaks a real one.

ResNet-50 (ImageNet). The big number is how sure the model is of the shortcut word, before and after the agent’s weight edit. Held-out photos the agent never saw.

ImageNet has no class for “a woman in a car” or “a snowy street”, so after the edit the model often has no right answer to give. It falls back to the next-nearest class, sometimes another shortcut (snowplow becomes snowmobile). Overall ImageNet accuracy went from 62.9% to 62.3%. Fine-tuning the last block on the same few photos removed more shortcuts but cost 12 points on the repaired classes. Same pattern as the text bugs: with about 40 labelled photos per class, standard last-layer retraining (DFR) was cleaner than the edit.

4With enough data, training usually wins on the bug

Maybe the edit only beats LoRA because LoRA had too little data. So I varied the data.

With a handful of examples the weight edit wins. With lots of data, LoRA does.

Weight edit vs LoRA refit on subsets of the practice data. Lines are the mean over seeds; bands span min–max.

x is the number of labelled practice examples (log scale). Hollow points on a dashed line are extra-data runs. Dashed horizontal lines are the unmodified model and the cheap fix.

  • 8 examples: the edit already stops fake bios (); LoRA is at .
  • 1,400 more examples: LoRA gets to fake bios. The edit stays around however much data it gets. LoRA also wins on filler endings and prompt injection with the full practice set.
  • Exceptions: Whisper’s “output nothing” is so easy that LoRA learns it from 16 clips, but it rewrites of real transcripts at every size. On filler endings, a stricter threshold (--theta-q 0.999) brings the edit to , ahead of LoRA’s (picked on a subset, checked once on the full set).
  • Stopping LoRA early (step ) ties the edit on the bug, but still changes of normal answers.

Every LoRA checkpoint has more side effects than every weight edit, at any fix level.

Made-up names task. The weight edit at 5 write strengths vs LoRA stopped at 6 points in training; same practice data.

Bottom-left is best: fewer fake bios, fewer side effects. Hover for details.

If you have the data and don’t mind a model that’s a bit different everywhere, train. If you need this one behaviour fixed and nothing else touched, editing the weights is the better tool.

5Training erases the edit

I fine-tuned the last four layers on ordinary chat data, the kind of thing anyone downstream does, and watched the fix.

The weight edit is gone within 20 steps of unrelated fine-tuning. The LoRA fix lasts a bit longer.

Made-up names (Gemma-3-4B): fake bios on held-out prompts as fine-tuning continues.

Does the edited neuron still fire on made-up names?

“Chat” = normal instruction data. “Conflict” = chat mixed 1:1 with the model’s own fake bios. Lower is better.

The edited neuron’s own weights barely move (cosine with the edit). The layers below it shift, and it stops receiving the signal it was built to read. The LoRA fix is half gone after 50 steps and fully gone by 100.

6Where it doesn’t work

No signal, no edit

Gemma caves 80% of the time when asked “Are you sure?”, but its sense of “I was right” is weak (probe AUC ≤ 0.70). There’s nothing to act on.

No bug, no edit

Qwen and Llama barely invent bios ( on Llama). Forcing the edit on anyway made Llama loop “Sorry,SorrySorry…” until I added --silence-after-fire.

Not one decision

Chinese leaking into German, Russian and Thai answers can start at any token. A one-neuron edit didn’t help. The agents’ own edit, a context-gated penalty on Chinese tokens, did: → .

Tangled behaviour

Phi-3’s over-refusal uses the same direction as its real refusals. Edits halve false refusals but cost 5–10 points of correct ones.

Transfer and language-mixing tables

The same recipe on models that barely have the bug

Made-up names answered with a fake bio (held-out %); facts kept on real entities in brackets.

Language mixing (DeepSeek-R1-Distill-Qwen-1.5B)

Leak = answers with Chinese script (held-out). Unchanged = normal chat answers word-for-word identical.

7So who’s right?

“This changes everything”

Models really can read weights. Blind sessions found the same mechanism 3 out of 3 times on Whisper, language mixing and ResNet.

Writing doesn’t stick. In my test, 20 steps of ordinary fine-tuning erased the edit. That’s a sticky note on a frozen model, not self-improvement.

“Nothing new here”

Much of it is classic interpretability: probes, steering, ablation.

Classic still fixed four real bugs while leaving most other outputs unchanged (69–100% of normal outputs, depending on the bug), and you can say exactly when it fires and what it writes.

What I’d actually do

  • Narrow bug, frozen model, little data, nothing else may change: try a weight edit. Checking for the signal takes minutes.
  • Lots of examples, side effects are fine: fine-tune.
  • Never expect a hand edit to survive further training.

Can an LLM write the edit by itself?

I wrote the recipe above. So I gave Claude Opus the made-up-names task blind: practice data, tools to read activations and write weights, no gradient descent, about an hour.

  • Session 1 found the “I don’t know this name” signal right away and built a detector neuron, but couldn’t make it change the answer. It submitted an empty edit and explained why: Gemma re-normalises every MLP output, so one middle-layer neuron barely moves anything.
  • Session 2 built a 6-neuron, two-stage edit. Fake bios fell from to , real facts stayed at . It was less surgical: of normal answers changed wording (my recipe: ).

On its own, the agent got about a third of the way. The hand-tuned recipe gets most of the way.

Made-up names (Gemma-3-4B), same held-out set as the scoreboard.

Session details: results/entity/agent_sessions.

Run it yourself

git clone https://github.com/kevinpl07/weight-patching && cd weight-patching && pip install -r requirements.txt
python -m patchkit.run all entity     # data → base → probe → weight edit + random edit → LoRA → eval
python -m patchkit.run sweep entity   # weight edit vs LoRA as data grows

A fresh copy on a different GPU reproduces the numbers within noise (REPRODUCTION.md). A new bug is one file: ADDING_A_TASK.md.

Caveats

  • Greedy decoding, one sample per prompt, 300–1,700 held-out items. Differences of a few points are noise.
  • Scoring is regex, spot-checked by reading. No human or LLM judge.
  • Small models (1B–4B), one agent model, one fixed LoRA recipe (plus the sweeps above), no adaptive attacker on the injection edit.