In short
- Weight-space programming is a term coined on 2 November 2026 by four MIT CSAIL researchers. A general-purpose LLM reads, fixes or writes another neural network’s weights directly, with no gradient descent and no training loop.
- On small networks, GPT-6 Astra named the game a policy was trained on from 17,253 raw numbers, and wrote a Breakout network from scratch that scored 517.4 against 25.3 for PPO trained for 500 million steps.
- The headline edit changed 131,072 of Qwen3.5-0.8B’s weights and lifted MATH-500 from 7.9% to 48.1%. Independent analysis shows it removes a repetition loop. With thinking switched off, the unedited model already scores 43.6%.
- The published edit reproduces at 50.6% and 51.0%. One fresh run of the editing process, with the same budget, reached 12.9%. An edit is only as good as the test that judges it.
The problem is a gentle one. Convert the point (0, 3) from rectangular to polar coordinates. A small language model, Qwen3.5-0.8B, starts thinking out loud.
By token 1,423 it has the angle: θ = π/2. By token 2,553 it has written the full answer. A student would put the pen down here. The model keeps checking.
At token 7,200 it writes a sentence. Then it writes it again.
Wait, tan(3π/2) = tan(π + π/2) = tan(π/2) = ∞.
Wait, tan(3π/2) = tan(π + π/2) = tan(π/2) = ∞.
… until token 32,768
It keeps writing that line, with small variations, for more than 25,000 tokens, until it hits its limit and stops mid-thought. There is no final answer in the box. The grader marks it wrong. [2]
Now give the same problem to the same model after a different AI has changed 131,072 of its 0.8 billion weights. Same prompt, same sampling settings, no new data, no training. It answers correctly in 10,097 tokens.
What changed? The obvious answer is the one that went round the internet on 2 November. An AI made another AI better at maths by rewriting its brain, and MATH-500 went from 7.9% to 48.1%. That should be the whole story. It is not. The gap between that headline and what happened inside the network is the most useful thing to understand about weight-space programming.
What is weight-space programming?
Weight-space programming means asking a general-purpose large language model to read, fix or write the weights of another neural network directly, from a plain-language goal. It uses no gradient descent and no training loop. The term comes from a post published on 2 November 2026 by Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab at MIT CSAIL, “Sparks of Weight-Space Programming”. It reports eight experiments run with OpenAI’s GPT-6 Astra. [1]
Why does that sound so strange? Until now, neural network weights have come from three places. Almost all come from an optimizer: gradient descent, through Adam or Muon, nudging millions of numbers a little at a time until a loss goes down. A few come from networks trained to produce other networks’ weights. A handful come from compilers such as Tracr, which turn a small formal program into transformer weights. [3] None of these understands what an individual weight is for.
Weight-space programming adds a fourth route. A model reasons about what each part of a network computes, or should compute, and sets the numbers to match. The authors’ argument is simple. We already let LLMs optimise prompts, programs and training code, because people can edit those by hand and people cannot edit weights. Their claim is that this excuse is running out.
A weight is a very small line of code
The easiest way to see why this is not magic is to shrink the network to one neuron.
Picture Breakout on a grid ten columns wide. The paddle moves along the bottom row and the ball is somewhere above it. You want a neuron that says “move right” when the ball is to the right of the paddle. Give it one input for each column the ball could be in, and one for each column the paddle could be in. Set the weight on ball column c to c, and the weight on paddle column c to minus c. The neuron now computes:
Positive means go right, negative means go left, zero means stay. That is twenty weights, and each one has a meaning you can say out loud. It is a program. It is written in multiplications and sums instead of if-statements, but it is still a program.
A trained network is this idea scaled up and scrambled. Gradient descent does not care whether a weight has a meaning you can say, so the meanings smear across thousands of numbers. Reading a trained network means unsmearing them. Writing one by hand means doing the opposite: decide the meaning first, then choose the numbers. Weight-space programming is the bet that a frontier model can now do both.
Reading a network means finding where it looks
In the first experiment, the researchers trained four small policies with PPO, a standard reinforcement learning method. Each played the team’s own 10-by-10 grid version of Breakout, Pong, Pac-Man or Freeway. Every cell has five input channels, covering the agent, moving objects, rewards, obstacles and the previous frame. That gives 500 inputs, two hidden layers of 32 units and five actions: 17,253 weights. All four networks have exactly the same shape, so only the values can give the game away.
The researchers pasted each network’s numbers into a prompt. They told Astra it had no tools, no code and no calculator, and asked which game the network was trained on, without listing any options. It named all four correctly. [1]
How? The prompt says which input belongs to which cell and channel. Add up how strongly each cell connects to the first hidden layer and you get a heat map of where the network pays attention. In the Breakout network, the agent channel lights up along the bottom row, where the paddle lives. In Pac-Man, the obstacle channel traces a maze. Sean Goedecke, a software engineer, rebuilt those maps in three lines of numpy. He argued that anyone shown them could name the games. [4]
He is right, and it does not make the result smaller. Astra did that arithmetic without running any code. Simon Willison then gave the same prompts to Qwen 3.8 27B, a 17 GB model on his laptop. After 52 minutes and 25 seconds of reasoning it answered “Breakout”, 88% confident. It also got Pac-Man and Pong right, and missed Freeway. [5] Reading a small network is no longer a frontier-only trick. It mostly takes patience.
The other reading experiments go further. Shown only the weights of three tiny diffusion models, Astra said which one drew a circle, a triangle or a square. It drew each shape as an outline, although the models produce filled shapes. That mistake is a clue: it was reading the geometry of the output layer, not simulating the network. Next it was given only the four middle blocks of three 7.2-million-parameter character-level models, with the input and output layers removed. From those it named each training language (Python, English or Japanese in the Latin alphabet) in both attempts. It also found every copying head, the attention heads that let a model repeat earlier text, and named no other head as one. It did this by multiplying weight matrices together, a method from Anthropic’s 2021 transformer-circuits work that nobody had mentioned to it. [1] [6]
Writing a network means choosing the meaning first
Writing is the stranger direction. For three MinAtar games, small versions of Atari classics, Astra got the rules, the game’s source code and an empty network of the right shape. It had no data, no loss, no gradients, no tools and no chance to try its network in the game. It replied with the weights as text.
| Game | PPO, 100M steps | PPO, 500M steps | Astra, one shot, no feedback |
|---|---|---|---|
| Breakout | 15.8 | 25.3 | 517.4 |
| Seaquest | 5.6 | 88.9 | 53.1 |
| Asterix | 25.8 | 55.2 | 53.2 |
Game scores reported by Takehi et al. (2026), Experiment 5. Higher is better.
The Breakout network is the toy neuron above, grown up. Astra wrote a first layer that works out where the ball will land and a second layer that moves the paddle there. That is a better program than PPO had found after 500 million steps, which is why a network written in one go scored twenty times higher. On Seaquest and Asterix, where the right strategy is harder to say in a sentence, it beat the 100-million-step policy and lost to the 500-million-step one. [1]
Repairs work the same way. In a physics sandbox called Kinetix, a car has to back up to get a run at a ramp. PPO’s policy had settled on driving straight at the ramp and getting stuck. Astra got the weights, a description of the scene and one recording of the failure. It added a small side path through a few units per layer that reverses the car until it is past a red strip, then switches off and lets the trained network drive. In one try with no tools, changing 3.5% of the weights, the car succeeded in all 1,024 episodes. [1] One caution: OpenWSP, an independent replication project, reports that the same one-shot repair failed when it reran the experiment with Astra. [7]
The rules changed as the networks grew
From here the experiments change shape, and the headline does not make this obvious. A 9-by-9 Go network of about 1.5 million weights is too big to paste into a prompt. So Astra got a Python sandbox, and later a budget of forward passes: chances to run the network and see what it does. It wrote the network as a Go program in 336 lines. Its early layers mark stones and their empty neighbouring points, the middle layers trace connected groups in danger, and the last layer scores each move. With 50 batches of practice games, it beat an equally sized PPO network trained on 20 million games. [1]
Matthew Honnibal, the creator of spaCy, sorted every experiment by what Astra was allowed to do. He called the post’s framing misleading. [8] His grouping, redrawn:
The pure setting, with raw numbers in a prompt, no tools and no running the network, covers only networks of 17,000 to 172,000 weights. Every experiment on a real language model used Python, and the Qwen fix also ran the model on 50 batches of practice problems. The abstract opens with “just by looking at the raw weights” and then describes the Qwen result. Willison made the same point more gently: these are two different questions that deserve separate answers. [5]
Honnibal also granted the part that matters: “Figuring out how to do this productively is not nothing, and AI models of a year or two ago would have failed at all these tasks.” [8]
The Qwen edit removed one direction
Experiment 8 is the one that spread. Qwen’s own model card warns that Qwen3.5-0.8B is prone to thinking loops. In the researchers’ tests, 93% of its MATH-500 answers ran all the way to the 32,768-token limit. Astra got a Python session with the weights loaded, practice problems from the GSM8K and MATH training sets, and a budget of forward passes, each a batch of about 64 answers. It was not allowed gradients or training.
Astra traced the loops to one direction that the MLP blocks of layers 15 and 19 write into the model’s running internal state. It subtracted that direction from 64 output columns in each of the two layers. That is 131,072 weights, or 0.016% of the model. An independent analysis by Hedwig AI compared the published weights with the originals and confirmed the shape of the edit. Only two matrices change, each change is the simplest kind possible (rank one), and the two layers’ directions point almost the same way. [1] [2]
The move has a history. In 2024, Arditi and colleagues showed that refusal in chat models is controlled by a single direction, and that deleting it from the weights removes the behaviour. [9] Astra found a different direction behind a different behaviour, on its own and on a budget.
The budget mattered more than anything else. With 10 or 25 forward passes, the edits barely dented the loops: more than 86% of answers still hit the limit, and MATH-500 stayed between 12% and 14%. With 50 passes, the share hitting the limit fell to 33.1% and MATH-500 jumped to 48.1%. GSM8K rose from 13.8% to 67.1%. IFEval, a test of following instructions, rose from 21.0% to 62.3%. [1]
The tempting explanation: the edit taught it maths
Read those numbers quickly and a story writes itself. One AI opened another’s brain, found the bad wiring and made it six times better at mathematics. It is a satisfying story, and it is mostly wrong.
Go back to the polar-coordinates trace. The model had the right answer by token 2,553. Whatever the edit did, it did not teach it the angle of (0, 3).
Hedwig measured when the 64 changed neurons are active. In layer 19, the edit removes 4.5 times as much at a repeated token as at a new one, and in 92 of 100 random pairs it removes more at the repeat. The same neurons fire on loops that have nothing to do with maths. Asked for a short story about a lighthouse keeper, the unedited model wrote “Okay, let’s write.” over and over and never wrote the story. Across eight non-maths prompts, unedited answers hit the limit 22 times out of 32. Edited answers hit it 7 times. [2]
So the edit is real, and it is specific. A random edit of the same size, on the same neurons, left 80 of 100 answers stuck and got 19 right. Astra’s edit left 34 stuck and got 51 right. The direction matters, and Astra found the right one. But it is a brake on repetition, not a lesson in algebra.
The deciding number is a baseline. The model card says Qwen3.5-0.8B runs without thinking by default. Run MATH-500 that way and the unedited model scores 43.6%. The edited model scores 45.2%. [2]
The authors said much the same, in a control the headline left behind. They pointed Astra at Gemma 3 270M, a model that rarely loops, and asked for the same improvement. Astra read Gemma’s failures and found ordinary arithmetic and algebra mistakes, with no single component behind them. Its small, targeted edits never moved MATH-500 by more than about a point. The authors’ conclusion is the most honest sentence in the post: editing weights “could remove an obstacle that hid an ability, but it could not add an ability the model lacked.” [1]
Goedecke put it more bluntly. Write some looping and non-looping texts, find the difference, trim the weights that cause it and test again: that is a standard steering playbook that a competent researcher would follow. He compared editing weights by hand to patching a compiled binary. It is an impressive trick, but the normal way to change a program is still to edit the source and recompile. [4]
Every weight edit needs a judge
The next part is easy to miss because it looks like plumbing. Look again at Figure 2. The three edits differ in one thing only: how many times Astra could run the model and look at what came out. The reasoning model was the same. The starting weights were the same. What separated a 14% edit from a 48% edit was how much evaluation was built into the loop.
Gradient descent has a loss function. Weight-space programming swaps the optimizer for a reasoner, but it does not remove the need for a loss. Something still has to decide whether an edit helped, on which problems and against which baseline. In Experiment 8 that judge was a set of practice problems with known answers, a token limit, and a grader that reads the last boxed answer. Change any one of them and you change what “better” means.
The sycophancy experiment shows the same thing from the other side. Two copies of Gemma 3 270M were fine-tuned in the same way, one to answer correctly and one to agree with whatever answer the user suggested. From the weights alone, across four attempts, Astra could not tell which was which. It was then allowed to see attention patterns, but not outputs, on texts it wrote itself. With that, it picked the sycophant in all three pairs. In one middle-layer head, the sycophant puts 85.7% of its attention on the user’s suggested answer, against 0.75% in the honest model. [1] Behaviour shows up in how a network responds to inputs. Someone has to write the inputs that make it show.
Then there is variance. The OpenWSP project, which has no link to the authors, gave GPT-6 Astra the authors’ task, rules and 50-pass budget and let it make its own edit. That edit scored 12.9% on MATH-500, and 84% of its answers still hit the limit. The same team re-scored the authors’ released edit and got 50.6%. Hugging Face’s Ahsen Khaliq rebuilt it from the published logs and got 51.0%. [7] [1]
The artifact reproduces. The process, tried once more, did not. Agent builders know this gap as the difference between pass@1 and pass^k: one successful run shows what can happen, not what will happen. An editing agent is still an agent, and it needs the same evaluation discipline as any other.
That discipline is mostly unglamorous. You need practice problems with verified answers, and a baseline taken at the model’s best settings rather than its worst. You need held-out behaviour the editor never saw, such as instruction following. And you need probes written by people who know what failure looks like in their field, the same logic behind a rubric that says what an 8/10 was for. Weight-space programming makes edits cheap, which makes judging them the expensive part. That judging layer is what Perit builds, and teams who need one can start from Perit’s RL environments.
What this does not say
It does not say weight-space programming is a parlour trick. A general-purpose model read circuits out of raw matrices, wrote working networks from a game’s rules, and found a repetition brake that a random edit of the same size could not match. Those are real abilities, and they arrived quickly.
It does not say the Qwen edit is useless. In thinking mode, which the model card itself warns about, it is a large and cheap fix that touches two tensors and leaves every other weight alone.
It does not say editing can never add a capability. One small model that rarely loops is one data point, and the authors say they are building a benchmark to measure this properly.
And it says nothing yet about frontier-scale models. The largest network in the study has 0.8 billion weights, every experiment used one editor model, and the work is a blog post, not a peer-reviewed paper. It also does not show recursive self-improvement. A large model repaired a small one; it did not improve itself. [1]
Back to tan(3π/2)
Open the trace once more. Token 1,423: θ = π/2. Token 2,553: the full answer, correct. Token 7,200: “Wait, tan(3π/2) = …”, and then the same line until the budget runs out. The model was never missing the mathematics. It was missing a way to stop.
Astra found the place in the weights where repetition feeds on itself, and turned it down. The edited model reaches the same answer and, this time, writes it in the box. On the score sheet, that is a six-fold improvement in maths. Inside the network, it is a brake.
Both descriptions are true. Only a well-chosen test tells you which one you paid for.
Training teaches a model what to say. This edit taught one when to stop.
The weights are now writable. The test still decides what got written.
Weight-space programming: common questions
Is weight-space programming the same as fine-tuning?
No. Fine-tuning computes gradients over a dataset and lets an optimizer adjust many weights by small amounts. In weight-space programming, an LLM forms a hypothesis about a mechanism, such as “this direction causes looping”, and writes a targeted change itself. In the reported experiments that meant 3.5% of a car policy’s weights and 0.016% of Qwen3.5-0.8B’s.
How is it different from model editing methods such as ROME?
Methods such as ROME use a fixed algorithm to make one narrow change, like updating a single stored fact. [10] In weight-space programming, a general-purpose model decides what to change and why, for goals ranging from naming a network’s task to writing a network from scratch.
Does weight-space programming use gradient descent?
No. Every experiment banned gradients and training loops. Some allowed a Python sandbox and a fixed budget of forward passes, so the editor could test an edit before submitting it.
Can I try weight-space programming myself?
Yes. The authors published every prompt, response and evaluation at github.com/RikiyaT/lm_understand-logs, and the edited Qwen model is on Hugging Face. Willison ran the game-naming prompt on a laptop. The edit only removes a loop, so a fair before-and-after test should include the model’s thinking-off mode.
Sources
- Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab, “Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights”, MIT CSAIL, 2 November 2026 (blog post, not peer-reviewed). Experiments 1 to 8 and the Gemma 3 270M control. Logs at github.com/RikiyaT/lm_understand-logs; edited model at huggingface.co/RikiyaT/Qwen3.5-0.8B-weight-space-programming.
- Hedwig AI, “Does a weight edit teach Qwen3.5-0.8B math, or stop it looping?”, November 2026. Source of the polar-coordinates and lighthouse traces, the weight diff, repetition measurements, random-edit control (first 100 MATH-500 problems) and thinking-off and thinking-budget scores.
- David Lindner, János Kramár, Sebastian Farquhar, Matthew Rahtz, Thomas McGrath and Vladimir Mikulik, “Tracr: Compiled Transformers as a Laboratory for Interpretability”, NeurIPS 2023.
- Sean Goedecke, “LLMs are not superhuman at reading and writing neural network weights”, 3 November 2026.
- Simon Willison, “Qwen 3.8 27B on my laptop can interpret model weights, too”, 3 November 2026.
- Nelson Elhage, Neel Nanda, Catherine Olsson and colleagues, “A Mathematical Framework for Transformer Circuits”, Transformer Circuits Thread, 2021.
- OpenWSP, open tooling and an independent replication of weight-space programming, README as of 5 November 2026. Experiment 8 live run (four samples per problem), calibration of the released edit (one sample per problem), the Ahsen Khaliq rebuild result and the raw-weight replications.
- Matthew Honnibal, “The ‘Astra can read and write weights to improve Qwen’ post is misleading”, 3 November 2026.
- Andy Arditi, Oscar Obeso, Aaquib Syed, Daniel Paleka, Nina Panickssery, Wes Gurnee and Neel Nanda, “Refusal in Language Models Is Mediated by a Single Direction”, NeurIPS 2024.
- Kevin Meng, David Bau, Alex Andonian and Yonatan Belinkov, “Locating and Editing Factual Associations in GPT”, NeurIPS 2022.
Research checked 5 November 2026. Experiment results are as reported by the authors unless they are credited to Hedwig AI, OpenWSP, Ahsen Khaliq or Simon Willison. Those independent runs use their own sampling settings, sample counts and hardware, which the figure captions note. The token positions and repeated lines in the opening trace come from Hedwig AI’s re-reading of the authors’ published outputs. Perit did not reproduce any of these results, and no Perit measurements are reported in this post.



