
AI · 16 min read
Weights Are a Compilation Target (Complexity Pt.5)
On this page
This series keeps making one move. When an AI result looks like a new capability, look for the computer-science idea underneath it, because the old idea often hints at where the new result stops working. Generate-and-verify turned out to be the asymmetry behind NP [3]. Self-consistency turned out to be probability amplification [4]. This fifth part looks at a result that travelled fast in November: a frontier model writing working neural networks by hand, without training them. The idea underneath is compilation, which every computer-science graduate has used, usually without thinking about it.
What Astra wrote, and how it scored
In a post titled “Sparks of Weight-Space Programming”, Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab of MIT CSAIL report eight experiments with GPT-6 Astra [1][2]. Experiment 5 is the one this post is about. For three MinAtar games, small versions of Atari games on a 10×10 grid, Astra received the game’s rules and source code, the layout of the network’s inputs and outputs, and how the network would be scored. The network had the same shape as the PPO networks it was compared against: 600 inputs, two hidden layers of 32 units and 6 action outputs, with every weight starting at zero. Astra wrote the weights as text in a single reply. It had no data, no loss function, no gradients and no tools, and the network never played a game before it was scored [1].
Here are the scores, averaged over 1,000 episodes [1]:
| Game | PPO, 100M steps | PPO, 500M steps | Astra, one reply |
|---|---|---|---|
| Breakout | 15.8 | 25.3 | 517.4 |
| Seaquest | 5.6 | 88.9 | 53.1 |
| Asterix | 25.8 | 55.2 | 53.2 |
In Breakout, Astra’s network scored about 20 times the 500M-step PPO run. In Asterix it came close, and in Seaquest it reached about 60 percent of the PPO score. It beat the 100M-step runs in all three games.
So how does a network that never practised get there? The MIT post explains it in one sentence. Astra “reasons about the desired programs it wants each network to implement and converts them into neural form” [1]. In Breakout, the first layer computes where the ball will land, and the second layer moves the paddle to that position [1].
Experiment 6 does the same at a larger scale, with 9×9 Go. That network has 243 inputs, six hidden layers of 512 units and 82 outputs, 1,480,274 weights in total, far too many to type out in a reply. Astra got a Python sandbox in which it could write the weight tensors, but no Go library, no internet and no way to run the network outside a fixed budget of forward passes [1]. Its design reads like a small Go tactics program. The first layers mark each side’s stones and the empty points next to them, the liberties. The middle layers carry that information along chains of connected stones to find groups in danger. The last layer scores each move: capture, save your own group, avoid putting yourself in atari, don’t fill your own eyes, and prefer good points on the board. With no forward passes, Astra wrote all of this in one Python run of 336 lines [1].
For me the most telling number here is the ratio. 336 lines of Python became 1.48 million weights, so a big network came out of a short program.
Breakout, Experiment 5: the program comes first, the weights are its compiled form, and the usual training inputs are never used.
Compiling programs into networks is an old idea
A compiler takes a program written for people and produces an equivalent one that a machine runs. Here the source is a program Astra designed in its reasoning, or, for Go, in Python. The target is a set of weight matrices. Units with large weights behave like switches, and layers of switches can compare, add and look things up, so a short set of rules over a bounded input can fit into a small network. That is not guaranteed. A program with loops or a lot of state may need a much larger network than its source length suggests, or may not fit a fixed-depth network at all.
Researchers have built compilers like this on purpose. Tracr, from Lindner and colleagues and presented as a NeurIPS 2023 spotlight, compiles human-readable programs into standard decoder-only transformers, with examples such as counting token frequencies, sorting and checking parentheses [5]. Its authors wanted models whose internal structure is known in advance. Hypernetworks, from Ha and colleagues in 2016, come at weight-writing from the learned side: one network generates the weights of another, and the pair is trained end-to-end with backpropagation [6]. Both ideas, that a program can become weights and that something other than gradient descent on the target network can write them, were established years before this experiment.
Two careful readers of the MIT post made the same point. Sean Goedecke notes that “if you can express a task as a simple program, we already know it’s possible to express that program as a NN, even by unaugmented humans” [8]. Andreas Maier calls Experiments 5 and 6 “a genuine capability: turning a hand-designed algorithm into working weights” and adds that this is not evidence that the model understands weights produced by training [2].
What is new is that a general-purpose model, given the rules and no training, designed the program and did the compiling itself. For the MinAtar games it did both in a single reply. That deserves credit. Most of it belongs to the design step, because picking a heuristic that works is the hard part. Turning a known program into weights has years of prior art behind it. It is still compiling. The target network received no task examples, no gradient updates and no game rollouts while it was being built. Astra itself was trained on data, and what it brought from that pretraining is a question the experiment cannot answer. The same post also has experiments on reading trained weights, and a separate study found that zero-shot weight reading “is better described as local arithmetic plus dataset priors” than as tracing what the network computes [10].
Which tasks have a short program
If writing weights is compiling, the question to ask about any task is whether anyone can write it down as a short program.
For some tasks, someone can. The Breakout heuristic fits in two steps. Go tactics about liberties, atari and eyes fit in 336 lines of Python. Addition, sorting and greatest common divisor have textbook algorithms, and hand-written transformers for those tasks reach 100 percent on held-out tests [9].
For other tasks, nobody knows such a program. Nobody has written down a short set of rules that reliably classifies chest X-rays, or one that captures what a sentence means. Those are the tasks where we train, because training can fit regularities in examples that nobody has managed to state as rules. A trained network is a program in this sense too, but nobody wrote it down first, and whether an equally compact readable version of it exists is usually unknown. I take this line as a rule of thumb from Tracr and these experiments, and nobody has proved it. Complexity theory has a formal measure for the length of the shortest program that produces something, Kolmogorov complexity, but this post only needs the everyday version: can someone write the program down at all? For open-ended real-world tasks, nobody can usually prove that no adequate short program exists. Such lower bounds are possible only after you fix a formal task, a representation, a resource limit and an error criterion. So the practical test is whether anyone has written one. The line says nothing about runtime. A short program can still be slow, and a known algorithm can still be computationally hard. The question is only whether someone knows a compact, hand-written policy. That also means the line can move. If a model finds a short program for a task where none was known, that is a discovery, and the task crosses the line.
A follow-up study tested the other side directly. Lindholz and colleagues asked Claude Opus 5.5 and GPT-6 Astra to write the parameters of a small LeNet-style convolutional network for medical image classification in a single reply, from medical knowledge alone, without tools and without seeing a single image [7]. On six MedMNIST tasks covering chest X-ray, breast ultrasound and abdominal CT, the LLM-written networks did better than chance on all of them, with a mean test AUC of 0.719 for Opus and 0.711 for Astra. They even beat the zero-shot MedSigLIP model on five of the six tasks while using more than 10,000 times fewer parameters. Then the authors trained the same architecture with the Adam optimizer on only 256 labelled images. That network scored higher on every MedMNIST task, with a mean AUC of 0.828 [7]. The authors conclude that LLMs can write working medical classifiers but “do not yet replace training data” [7].
What the models could write down from medical knowledge got them above chance. On these tasks, fitting 256 labelled images produced a higher AUC than the zero-shot weight writing. So the medical knowledge and the writing procedure were not enough here. Does that prove no compact rule exists? No. The gap could also come from a weak heuristic, a search the model got wrong, or patterns in the benchmark that only show up in samples. Either way, 256 images is not a lot of data.
The question that sorts the cases: can anyone write the task down as a short program? On the medical side, 256 labelled images beat both hand-written networks.
Why 517 does not mean “AI beats RL”
The Breakout number is the one that gets shared, so it needs its caveats attached.
The comparison pits a hand-designed heuristic against the authors’ own PPO runs. Both sides were scored with actions sampled from the network, and the PPO number is the best of 3 to 10 seeds [1]. The post does not compare against any published MinAtar result, so how strong that baseline is remains an open question [2]. Each game also got a single generated network, so we don’t know how much a second attempt would vary [2].
The heuristic itself is simple. Predicting where the ball lands and moving there is how many people would write a Breakout bot by hand. Maier names the missing baseline: the same heuristic written as ordinary code [2]. If plain code also scores around 517, the network adds no playing strength beyond the program. If plain code scores higher, compiling lost something on the way.
So the Breakout result shows that a good heuristic, compiled into weights, beat the authors’ PPO run on Breakout. In Seaquest and Asterix, the 500M-step PPO runs scored higher than the compiled networks. Neither result says which method is better at learning games, because only one side learned anything.
Weights as build output
Goedecke offers an analogy from software [8]. LLMs can emit machine code and patch compiled binaries, which is an impressive trick, “but the best way to work with binaries is still to write source code and compile it” [8]. He applies it to editing trained models. It fits the compiled networks just as well.
When Astra compiled Breakout, the program existed in its reasoning. In Go, it existed as 336 lines of Python. That source is what you would want to review, test and keep in version control. The weights are build output. Editing them by hand is binary patching. It works and is sometimes useful, but it is rarely where you want to do your engineering.
Go with a budget of forward passes
The Go experiment has one more result that ties back to this series. Astra was tested with different budgets of forward passes. With none, its network won 54 to 55 percent of 2,000 games against each of two small PPO networks. With 50 forward passes, it won 81 to 84 percent. Against a PPO network of the same size, trained on about 20 million games, it won 26 to 43 percent with no passes and 70 to 79 percent with 50 [2].
With a budget, Astra plays practice games, looks at how it loses, changes the part of the network responsible and keeps a change only if it wins more [1]. That is the generate-and-verify loop from Part 3 [3]. Each forward pass is the check, and the check decides which version of the program survives. The model still writes the program, and checking it against the game changed the result. With a budget, the boundary between compiling and training starts to blur: no gradient is computed, but the practice games are feedback from the task, and the network improves because of them. As before, each budget got one run, against the authors’ own opponents [2].
Go, Experiment 6: the same write-check-keep loop as generate-and-verify, and what 50 rounds of checking added.
Compiled networks are readable by construction
Compiled networks have one clear advantage over trained ones. You know which computation each part was meant to perform, so you can say what each layer is for. A compiler may still leave redundant or incidental weights behind. In Breakout, layer 1 computes the landing point and layer 2 moves the paddle. Tracr was built for this reason: it gives a known mapping from program operations to model components, and compiled models with known structure give interpretability researchers a ground truth to test their methods against [5].
The interpretable weight-space programming project (iWSP) published on csinva.io pushes the idea further [9]. A coding agent builds transformer weights by hand, with training not allowed, and scores and revises them. On algorithmic tasks such as addition, sorting and GCD, all 26 runs with Opus reach 100 percent on a hidden test set. The project then tests readability directly. An LLM describes each model in at most 200 words, and fresh sessions rebuild the model from that description alone. All 26 rebuilt algorithmic models are perfect [9]. These are tasks with textbook algorithms, so the result confirms the side of the line where a short program is known. It tells us nothing about the other side.
I find the rebuild test a useful practical check for “a short program exists”, with two limits. The rebuilding sessions bring their own pretrained knowledge and coding ability, so 200 words is not the full length of the program. And a perfect score on a hidden test set only shows that the rebuilt model agrees with the original on that set. The two could still differ elsewhere. Nobody has shown even this weaker property for trained perception or language networks.
Choosing between compiling, training and plain code
So what do you do with this? Here is how I would decide.
- If you can write a bounded program that fits the network’s size and operations, compiling it into weights can work, and these experiments show a frontier model can do the compiling. First ask why you need a network at all. Plain code is easier to test, profile and change. Compiling makes sense when the runtime only accepts a network, or when you want a model with known structure, for example to test interpretability tools.
- If you can’t write the program, train. Perception, language and judgement learned from examples are the cases training exists for, and in the medical study 256 labelled images were enough to beat both hand-written networks [7].
- When you read the next “AI wrote the network” claim, sort it first. Did the model compile a program someone could have written, or did something learn what nobody could write down? Then ask for the plain-code baseline.
What the experiments show and what they leave open
Parts 3 and 4 went the same way. A result that looked like a new capability rested on an old idea. Here the experiments show that a frontier model can design a bounded policy and write it into a fixed architecture without training the target network. That works when someone can specify a competitive bounded policy and map it into the architecture, and the network is then only as good as that policy. When the written version underperforms, training is still the tool. And plain code may be the better choice unless the network form buys you something concrete, like a runtime that only runs networks or a known structure for interpretability work. Three things remain untested: the plain-code baseline, how much repeated attempts vary, and how the networks compare with published MinAtar results [2]. What is new is that a frontier model now writes those programs, which makes the boundary between compiling and training easier to see.
Where in your own systems is a network doing a job that a short program could do, and where is hand-written code straining at a job that only training can do?
Sources
- [1] Takehi, Teoh, Zhang and Khattab (MIT CSAIL), “Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights”, 2026; Experiment 5 (MinAtar table, the Breakout program-to-layers explanation) and Experiment 6 (Go setup, 336-line run, the forward-pass loop).
- [2] Andreas Maier, “Weight-Space Programming: What Is Measured and What Is Anecdote”, 2026; the Go win rates by forward-pass budget, the “compiled a hand-designed algorithm” reading and the missing plain-code baseline.
- [3] Stefan Christoph, “Generate-and-Verify: What P vs NP Teaches Us About AI Reasoning”, Complexity Theory Meets AI Pt.3; the propose-then-check loop.
- [4] Stefan Christoph, “Self-Consistency Is Just Probability Amplification”, Complexity Theory Meets AI Pt.4.
- [5] Lindner et al., “Tracr: Compiled Transformers as a Laboratory for Interpretability”, NeurIPS 2023 (spotlight); compiles human-readable programs into decoder-only transformers.
- [6] Ha, Dai and Le, “HyperNetworks”, 2016; one network generates the weights of another, trained end-to-end.
- [7] Lindholz et al., “Weight-Space Programming for Medical Imaging: Do We Still Need Training Data?”, 2026; LLM-written CNNs (mean AUC 0.719 and 0.711) against Adam on 256 labelled images (0.828).
- [8] Sean Goedecke, “LLMs are not superhuman at reading and writing neural network weights”, 2026; the binary-patching analogy.
- [9] csinva, “Interpretable weight-space programming”, 2026; hand-written transformers on algorithmic tasks and the 200-word rebuild test.
- [10] “Can an LLM Actually Reason and Program about Neural Network’s Weights or is it just memorization on steroids?”, arXiv 2611.08070, 2026; audit of zero-shot weight reading.
🎬 Also available as a blog walkthrough video on YouTube
❤ Created with the support of AI (Kiro)