All posts

Weight-space programming: an LLM edits a model's weights

Weight-space programming treats neural network weights as code you can read and edit. See how an LLM fixed Qwen3.5-0.8B's maths with no training.

Written by
APJ-RAISE team
Published
Reading time
9 min
Dark close-up of a circuit board with orange connectors
Photo: TimSon Foox, Pexels

Weight-space programming is the idea of treating a neural network's weights as a program that can be read and edited directly, instead of being set only by training. In a blog post published on 2 November 2026, four researchers from MIT CSAIL showed a frontier language model, GPT-6 Astra, doing exactly that.

The headline result is small and specific. A 0.8-billion-parameter model, Qwen3.5-0.8B, scored 7.9% on the MATH-500 maths benchmark. Astra changed 131,072 of its weights, about 0.016% of the model, in two layers. It used no gradient descent and no training data. The edited model scored 48.1%.

Below we explain what was changed and why it worked. We also cover what the result does not show yet, and experiments you can run yourself to test it.

What is weight-space programming?

Weight-space programming means reading a network's weights to understand what it computes, then writing or editing them to change what it does. The authors describe it as "treating the weights as a program to be read and written". They also say clearly that it is a concept, not a method.

Normally nobody writes weights by hand. Andrej Karpathy called this Software 2.0: you choose a goal and some data, and an optimiser such as gradient descent sets millions of numbers for you. The numbers work, but nobody wrote them, so nobody can read them like code.

The new claim is that a strong language model can reason about those numbers directly. In the experiments, the editing model had a Python session with the weights loaded, and it could run code to inspect them. It could not compute gradients or train. The authors call this "native" weight reading: no special training to read weights, just a model reasoning with a tool.

How did an LLM fix Qwen3.5-0.8B without training?

Astra fixed Qwen3.5-0.8B by finding why it failed and removing that cause from two weight matrices. The failure was looping. With thinking turned on, the small model often repeated itself until it hit its limit of 32,768 tokens. In the first 96 practice answers, 85 hit that limit. On MATH-500, 93% of answers did.

The setup gave Astra a budget of "forward passes". In one forward pass, the model answers up to 512 problems or reads up to 1,024 texts. Astra could choose practice problems from the GSM8K and MATH training sets, never from the test sets. The authors tried budgets of 10, 25 and 50 forward passes.

With 50 forward passes, Astra traced the looping to one direction written by the MLP blocks of layers 15 and 19. It then subtracted that direction from 64 output columns of the down_proj matrix in each of those layers. That is 131,072 numbers out of about 0.8 billion. The model card confirms that only these two tensors differ from the original Qwen model.

What does "a direction" mean here? Inside a transformer, each token is represented by a long list of numbers, a vector. Each MLP block adds its own vector to this running total. A direction is one particular pattern across those numbers. If a behaviour such as "keep repeating" lines up with one direction, you can stop a layer from writing that pattern. The post's figures imply 1,024 numbers per column (131,072 divided by 128 columns).

This idea has history. Earlier interpretability research found that, in several chat models, refusing a request is controlled by a single direction. What is new here is that a model, not a human researcher, found the direction and decided the edit.

Two details are not in the post. It does not say exactly how Astra traced the loop, and it does not give the formula for the edit. One standard way to remove a direction d from a column w is projection: take w and subtract (d · w) times d. This keeps everything in w except its part along d. We do not know whether Astra used exactly this.

Did the edit really improve the model?

On the authors' numbers, yes, by a lot. These are the scores with thinking on, before the edit and after the 50-pass edit:

  • MATH-500: 7.9% before, 48.1% after.
  • GSM8K: 13.8% before, 67.1% after.
  • IFEval: 21.0% before, 62.3% after. IFEval tests whether a model follows instructions.
  • Hit the token limit: 93.0% of MATH-500 answers before, 33.1% after.

The smaller budgets helped much less. With 10 and 25 forward passes, MATH-500 rose only to 12.3% and 14.1%, and the looping barely dropped. So the big jump came from getting the diagnosis right, not from editing more.

There is one independent check. Ahsen Khaliq of Hugging Face rebuilt the edited checkpoint and re-ran the full MATH-500 test: 500 problems, 4 samples each. The re-run scored 51.0%, with 31.6% of answers still hitting the limit. It used a different test setup and grader, so it is a close match, not an exact replication. The base model's 7.9% was not fully re-run; a 25-problem smoke test gave 5.0%.

What else did the LLM do with weights?

The Qwen fix is the last of eight experiments. The other seven use smaller networks and show how wide the idea is:

  • Read a game: given only the 17,253 weights of a small network trained to play a grid game, Astra named the right game for all four networks.
  • Read a language: it worked out whether each of three small transformers was trained on Python, romaji or English. It also found the "copying" attention heads, and they matched the measured ground truth.
  • Fix a controller: a car-on-ramp policy failed in all 256 test episodes. One edit, changing 3.5% of the weights, made it succeed in all 1,024 episodes.
  • Write from zero: starting with every weight at zero, Astra wrote a MinAtar Breakout player that scored 517.4. A PPO agent trained for 500 million steps scored 25.3. In Seaquest, though, Astra scored 53.1 against PPO's 88.9.
  • Write a Go player: Astra wrote the weights of a 9×9 Go network with 1.48 million weights. After 50 forward passes, it beat a same-sized network trained by PPO on 20 million games.
  • Catch a sycophant: from weights alone, Astra failed in all four tries to tell an honest model from a sycophantic one. With a tool to view attention patterns, it picked the sycophant in all three pairs.

The failures matter as much as the wins. Reading weights alone was not enough to catch sycophancy, and PPO won at Seaquest. The authors say they did not tune PPO hard, so these comparisons show what is possible, not which approach is better.

What can weight-space programming not do yet?

The clearest limit came from a second small model. The authors tried the same kind of edit on Gemma 3 270M. Its MATH-500 score moved from 6.8% to 7.0%, which is within noise. Only 8.5% of Gemma's answers hit the token limit, against 93% for Qwen, so there was no loop to remove. In the authors' words: "Editing weights could remove an obstacle that hid an ability, but it could not add an ability the model lacked."

That sentence is the most useful way to read the Qwen result. Qwen3.5-0.8B already knew a fair amount of maths, and a looping habit hid it. Astra removed the habit. That is impressive diagnosis, but it is not the same as teaching a model something new.

Other gaps a careful reader should note:

  • No strong baseline: the only comparison for Qwen is the unedited model. There is no fine-tuning, prompting or decoding baseline with the same budget, such as a stronger repetition penalty.
  • Missing results: the post says the edit was tested on MATH-500, GSM8K and six other benchmarks, but of those six it reports only IFEval.
  • Not peer reviewed: this is a blog post with full logs, not a reviewed paper. The authors call the results "very early".
  • Hidden method: the post does not describe how Astra traced the loop to layers 15 and 19. The full logs are public, so this can be checked.
  • Still looping: after the best edit, a third of MATH-500 answers still hit the token limit.

How is this different from fine-tuning, model editing and steering?

The main difference is who decides the change. Here is how the four approaches compare:

  • Fine-tuning: gradient descent on training data adjusts many weights at once. Nobody chooses each change.
  • Model editing: methods such as ROME compute a small weight update with a fixed formula, usually to change one fact.
  • Steering vectors: a vector is added to the model's activations while it runs. The weights stay the same.
  • Weight-space programming: a model reasons about the weights, picks what to change and writes the change in. The fix travels with the checkpoint.

In practice the lines blur. Astra's Qwen edit looks a lot like baking a steering-style change into the weights. The new part is that a model chose the direction and the edit by itself, inside a fixed budget.

Why does weight-space programming matter?

Weight-space programming matters because it turns interpretability from describing a network into changing it. If one model can find the cause of a failure inside another and fix it with a tiny, checkable edit, some fixes could become cheaper than retraining. The authors list possible uses such as auditing models, unlearning and model merging, and they use careful words like "may" and "could".

Our view: treat it as a strong first result, not a new standard method. The best evidence is one large win on one small model, plus a clear negative result on another. The idea is spreading fast, though. Within two weeks, follow-up preprints appeared, such as Physics2Weight, which applies weight-space programming to networks that solve differential equations. On 12 November the authors added a "Response to Comments" section to their post that lists several of these follow-ups.

Research ideas for students

Qwen3.5-0.8B is small enough to run on a free cloud GPU, and both the original and the edited weights are public. That makes this a rare frontier result that a student can test directly. Some starting points:

  • Check the diff: download both checkpoints and confirm that only the two down_proj tensors changed. Then measure how large the change is in each column.
  • Find the direction: record what layers 15 and 19 write while the original model loops, and compare it with normal answers. Does one direction stand out?
  • Add a baseline: compare the edit with a decoding fix, such as a higher repetition penalty, and with a short LoRA fine-tune.
  • Control test: subtract a random direction of the same size from the same columns. If scores also rise, the specific direction matters less than claimed.
  • Move the edit: apply the same edit at other layers, or try the method on other sizes of Qwen.
  • Read the logs: the full experiment logs show every prompt and every line of code. Study how Astra reasoned.

Keep your tests cheap. The independent re-run of full MATH-500 generated 43.4 million tokens and took 51 minutes on an NVIDIA H200. A 50-problem subset with a fixed random seed is enough to start.

If papers and posts like this are new to you, our guide on how to read a research paper helps. For background on directions, heads and circuits, read our post on mechanistic interpretability. To find teammates for a replication, join APJ-RAISE. It is free.

Questions people ask

What is weight-space programming?
Weight-space programming is treating a neural network's weights as a program that can be read and edited directly, instead of only being set by training. The term comes from a November 2026 blog post by Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab of MIT CSAIL.
Did GPT-6 Astra train Qwen3.5-0.8B?
No. Astra used no gradient descent and no training. It changed 131,072 weights in two layers, and on the authors' numbers MATH-500 rose from 7.9% to 48.1%.
Is weight-space programming peer reviewed?
Not yet. It was published as a blog post on 2 November 2026, with full experiment logs. Several follow-up preprints have since appeared on arXiv.
Can I download the edited Qwen model?
Yes. The edited checkpoint is on Hugging Face as RikiyaT/Qwen3.5-0.8B-weight-space-programming, under the Apache 2.0 licence.

Sources

  1. 1.Takehi, R., Teoh, J., Zhang, A. and Khattab, O. Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights. Blog post, MIT CSAIL, 2 November 2026.
  2. 2.RikiyaT/Qwen3.5-0.8B-weight-space-programming model card, Hugging Face.
  3. 3.Experiment logs: RikiyaT/lm_understand-logs, GitHub.
  4. 4.Karpathy, A. Software 2.0. 2017.
  5. 5.Meng, K., Bau, D., Andonian, A. and Belinkov, Y. Locating and Editing Factual Associations in GPT. arXiv:2202.05262, 2022.
  6. 6.Arditi, A. et al. Refusal in Language Models Is Mediated by a Single Direction. arXiv:2406.11717, 2024.
  7. 7.Physics2Weight. arXiv:2611.12954, November 2026.
All posts