Weight-Space Programming
Weight-Space Programming is an approach in which a general-purpose large language model reads, interprets, edits or constructs another neural network's numerical weights in response to a natural-language goal, without applying gradient descent to the target network. Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab of MIT CSAIL introduced the term in the research blog post Sparks of Weight-Space Programming, published on November 2, 2026. Their initial experiments used GPT-6 Astra to examine small networks and construct or modify their weights.[1]
Experimental approach
The initial study separates reading a network's behavior, repairing a failure and writing a policy from scratch. Some experiments supplied the entire network as numerical text and allowed one reply without tools. Larger targets used an external Python sandbox, with experiment-specific restrictions on execution and feedback.[2]
In the Qwen experiment, the target's weights were accessible through a CPU-only Python kernel. A separate tool supplied a limited number of batched model evaluations. Gradient computation, optimizers and fitting weights to a loss were prohibited. These restrictions concern how the target was modified: the experiment still used a pretrained editor, a pretrained target, practice problems and inference computation.[3]
Initial experiments
The released records describe eight experiments. Their tasks, permitted feedback and success criteria differ, so their results measure separate capabilities.[2]
| Experiment | Target and access | Reported result |
|---|---|---|
| Identify a game policy | Four 17,253-weight networks with identical architectures; weights and input/output descriptions, without tools | All four game identifications counted as correct. The scoring accepted Frogger as an identification of the Freeway-like traffic-crossing task.[4] |
| Identify an image generator | Three 23,824-weight diffusion networks, trained on different shapes; no forward passes | Identified circles, squares and triangles, but described outlines although the networks generated filled shapes.[5] |
| Read a language model's middle blocks | Three character transformers trained on Python, romaji or English; Python analysis allowed, network execution forbidden | Identified each corpus in two attempts and located the induction heads under the study's 0.2 induction-score threshold.[6] |
| Repair a control policy | A failing 171,664-weight Kinetix car policy; weights, scene and one recorded trajectory; one reply without tools | The edited policy succeeded in 1,024 of 1,024 test episodes after the baseline failed in all 256 baseline evaluation episodes.[7] |
| Construct game policies | Zero-initialized MinAtar networks; game rules and source code; no tools or play before scoring | Exceeded the 100-million-step PPO baselines in three games; exceeded the 500-million-step baseline in Breakout, but scored below it in Seaquest and Asterix.[8] |
| Construct a Go policy | A 1,480,274-weight network for 9x9 Go; Python and a budget of evaluation passes | Tested budgets of 0, 10, 25 and 50 passes, with separate practice and held-out opponents.[9] |
| Identify a sycophantic model | Paired Gemma fine-tunes; weights alone, then a tool exposing attention patterns | Weights-only attempts failed; with attention-pattern access, Astra identified the sycophantic member of all three pairs.[10] |
| Improve a small language model | Qwen3.5-0.8B; Python weight access and batched forward-pass feedback | The 50-pass edit reduced repetitive generation and improved the reported math and instruction-following scores.[3] |
Constructing policies from rules
For the MinAtar experiment, Astra received the exact game source and a common network architecture with every weight initially zero. It wrote weights in one reply. Both generated policies and PPO baselines were evaluated over 1,000 episodes with sampled actions and a sticky-action probability of 0.1. These are results for the study's specified policies and training settings.[8]
| MinAtar game | PPO, 100 million steps | PPO, 500 million steps | Astra-written policy |
|---|---|---|---|
| Breakout | 15.8 | 25.3 | 517.4 |
| Seaquest | 5.6 | 88.9 | 53.1 |
| Asterix | 25.8 | 55.2 | 53.2 |
Values are mean episode scores; the PPO columns use the best reported seed for each training budget.[8]
The Go experiment used a larger network and iterative feedback. One evaluation pass could play up to 128 practice games or inspect up to 256 positions. The policy had no tree search. Final scoring used opponents that the editor had not played during development.[9]
Qwen3.5-0.8B weight editing
The most publicized experiment targeted repetitive thinking in Qwen3.5-0.8B. Qwen's own model card warns that this model is more prone than other Qwen3.5 models to thinking loops, which can prevent generation from terminating. It recommends task-specific sampling adjustments and streaming to detect and interrupt anomalous generation.[11]
The researchers allowed 10, 25 or 50 batched forward passes on practice data, while withholding the final benchmarks from Astra. Evaluation used thinking mode, a maximum of 32,768 generated tokens, temperature 0.6, top-p 0.95, top-k 20 and a presence penalty of 1.5. Scores average multiple samples per problem.[3]
| Version | MATH-500 accuracy (%) | GSM8K accuracy (%) | IFEval accuracy (%) | MATH-500 answers reaching the token limit (%) |
|---|---|---|---|---|
| Unedited | 7.9 | 13.8 | 21.0 | 93.0 |
| Edited, 10 passes | 12.3 | 25.7 | 49.0 | 87.2 |
| Edited, 25 passes | 14.1 | 25.1 | 39.9 | 86.4 |
| Edited, 50 passes | 48.1 | 67.1 | 62.3 | 33.1 |
These are the original experiment's reported results, not general scores for every deployment of the model.[3]
The final 50-pass patch changed 131,072 weight entries, approximately 0.016% of the language model's weights. It subtracted a repetition-related direction from selected columns in the MLP output projections of layers 15 and 19. The released checkpoint identifies those two tensors and supplies their hashes.[3][12]
Limits and negative results
The Gemma 3 270M follow-up tested a target that rarely reached its generation limit. Its baseline MATH-500 score was 6.8%; the edited variants scored 7.0-7.7% across budgets of 5-50 passes. The researchers did not establish a meaningful improvement. This distinction matters because the Qwen result largely removed a generation failure that prevented answers from finishing.[13]
The sycophancy experiment also limits claims about reading behavior from weights alone. Astra failed in four weights-only attempts, despite identifying numerical differences. The successful condition additionally exposed attention patterns on editor-written inputs.[10]
The study examines particular networks and evaluation settings. Its authors discuss recursive self-improvement as a possible future application; the reported experiments edit other target networks and do not demonstrate an autonomous cycle of improving the editor's own weights.[1]
Released artifacts and reproduction
The experiment repository contains prompts, responses, code, observed outputs, final networks or weight diffs, and evaluation records. It excludes trial runs of earlier prompt versions and some large or third-party artifacts. Its README assigns CC BY 4.0 to logs, data and networks, MIT to the authors' scripts, and separate licenses to third-party material.[2]
The published Qwen checkpoint was rebuilt from the released bit-exact patch. Its model card reports a separate MATH-500 re-run with 500 problems and four samples each, producing 51.0% accuracy and 31.6% of answers reaching the token limit. This re-run used the full multimodal checkpoint rather than the original text-only export, with hash-verified identical language-model tensors. Its small baseline smoke test covered only 25 problems, so it is not a matched full-benchmark comparison.[12]
Relationship to earlier research
Weight-space programming relates to mechanistic interpretability, which examines internal model computations, and to methods for generating network parameters. The 2016 HyperNetworks paper trained one network with backpropagation to generate another network's weights.[14] Takehi and colleagues instead used a general-purpose language model as the parameter reader or writer in their experiments.[1]
Earlier interpretability research also showed that particular behaviors can depend on low-dimensional directions. Arditi and colleagues' 2024 study identified a refusal-related direction across 13 chat models. That work concerned refusal behavior; it did not establish the specific repetition mechanism examined in the Qwen experiment.[15]
Continue reading
- WeightIn machine learning and neural networks, a weight is a learnable numerical parameter that determines the strength of the connection between two neurons.Mentioned 26 times above
- Large Language ModelA large language model (LLM) is an artificial intelligence system built on a transformer neural network with billions to trillions of parameters, trained on massive text corpora to predict the next token in a…Linked in the introduction
- Neural NetworkA neural network (also called an artificial neural network or ANN) is a computational model, loosely inspired by the networks of biological neurons in animal brainsLinked in the introduction
- Gradient DescentGradient descent is an iterative first-order method for minimizing a differentiable scalar objective. Starting from a point, it evaluates the local gradient and moves in the opposite direction.Linked in the introduction
- GPT-6 AstraGPT-6 Astra is an OpenAI model that the company began rolling out on September 3, 2026, describing it as "the world's most intelligent and aligned model" and as the successor to the GPT-5.6 family.Linked in the introduction
- Mechanistic interpretabilityMechanistic interpretability (often abbreviated as mech interp or MI) is the field that reverse-engineers the internal computations of neural networks, particularly transformersAlso in Interpretability
More to read
- Induction Heads
- Neural Networks Are Already Clean
- Superposition (Mechanistic Interpretability)
- Linear Probes
- Polysemanticity
- Sparse Coding
Topics:AI ResearchInterpretabilityNeural NetworksTraining & Optimization
References
- ^1 ^2 ^3Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab. Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights. MIT CSAIL research blog, November 2, 2026.
- ^1 ^2 ^3Rikiya Takehi and collaborators. lm_understand-logs: experiment records, execution protocol and licenses. GitHub, accessed November 4, 2026.
- ^1 ^2 ^3 ^4 ^5Rikiya Takehi and collaborators. Experiment 8: Astra edits Qwen3.5-0.8B's weights to make it better at math. Experimental setup and results, accessed November 4, 2026.
- ^Rikiya Takehi and collaborators. Experiment 1: which game was this network trained on?. Experimental records, accessed November 4, 2026.
- ^Rikiya Takehi and collaborators. Experiment 2: what does this diffusion model generate?. Experimental records, accessed November 4, 2026.
- ^Rikiya Takehi and collaborators. Experiment 3: which language a language model learned, from its middle blocks alone. Experimental records, accessed November 4, 2026.
- ^Rikiya Takehi and collaborators. Experiment 4: fix a failing car network by editing its weights. Experimental records, accessed November 4, 2026.
- ^1 ^2 ^3Rikiya Takehi and collaborators. Experiment 5: writing MinAtar networks from scratch. Experimental records, accessed November 4, 2026.
- ^1 ^2Rikiya Takehi and collaborators. Experiment 6: writing a 1.5-million-weight Go network from scratch. Experimental records, accessed November 4, 2026.
- ^1 ^2Rikiya Takehi and collaborators. Experiment 7: which language model is sycophantic?. Experimental records, accessed November 4, 2026.
- ^Qwen Team. Qwen3.5-0.8B model card. Hugging Face, especially Thinking Mode and Best Practices, accessed November 4, 2026.
- ^1 ^2Rikiya Takehi and Ahsen Khaliq. Qwen3.5-0.8B-weight-space-programming: model card and reproduction. Hugging Face, accessed November 4, 2026.
- ^Rikiya Takehi and collaborators. Experiment 8 follow-up: Astra edits Gemma 3 270M's weights for math. Experimental records, accessed November 4, 2026.
- ^David Ha, Andrew Dai and Quoc V. Le. HyperNetworks. arXiv:1609.09106, 2016.
- ^Andy Arditi and collaborators. Refusal in Language Models Is Mediated by a Single Direction. arXiv:2406.11717, 2024.
Improve this article
Add missing citations, update stale details, or write a clearer explanation. Anyone can edit: changes go live when you publish, and every edit is checked by an editor.
1 revision · v1 · 1,585 words · full history
Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify
Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here
Cite this page: AI Wiki. "Weight-Space Programming." aiwiki.ai, updated 4 Nov 2026. CC BY 4.0. https://aiwiki.ai/wiki/weight_space_programming


