Weight Space Programming: What If AI Models Could Write Their Own Neural Networks?
What if models like Astra could directly choose the weights of a neural network, build its architecture, and even help us understand what is happening inside those hidden layers?
I was scrolling through my X feed a couple of days ago when I came across something called Weight Space Programming. Initially, I thought it was another approach to neural network optimization, but after going through the research and the discussions around it, I realized there was something more interesting here.
We have always trained neural networks by providing data, initializing weights, calculating loss, and letting gradient descent figure out the right parameters. But what if we could approach this differently? What if we could take a powerful model like Astra and simply ask it to construct a neural network for a particular task? Not just write the code, but actually decide how many layers it needs, how neurons should be connected, and which weights should be assigned to them.
And apparently, researchers are beginning to explore exactly this direction. The interesting part is that the same idea could also allow models to inspect existing neural networks and modify their internal weights.
I wanted to understand how this works and, more importantly, what it could mean for the way we build neural networks.
A quick look at how neural networks work
Let’s start with something familiar. A neural network has input neurons, hidden layers, and an output layer. The neurons are connected through weights, which determine how information flows through the network.
For example, consider a simple mathematical function:
y=ax+b
The values of (a) and (b) determine the behaviour of this function. A neural network works on a similar principle, except that it can contain millions or billions of parameters instead of just two.
During training, these weights are initialized, usually with random values. We pass data through the network, compare its predictions with the actual answers, calculate the loss, and update the weights using gradient descent.
The process continues until the network learns a useful mapping between the input and output.
For a simple network, this might not seem particularly complicated. But when we start dealing with millions or billions of parameters, finding useful weight configurations becomes a massive optimization problem. This is why training modern neural networks requires so much data and computational power.
What if we didn’t need gradient descent to construct a new network?
This is the part that caught my attention.
Suppose we want to build a neural network that can identify whether a piece of legal text contains correct legal citations. The conventional approach would be to collect a dataset, design an architecture, initialize its weights, and train the network until it performs well.
But imagine giving this task to a powerful model like Astra and asking it to construct the network directly.
We aren’t asking it to generate a PyTorch implementation that we will subsequently train. The idea is to have the model actually choose the architecture and weight values needed for the task.
It could decide the number of hidden layers, the number of neurons, the connections between them, and the values assigned to the weights.
The difference is easier to understand through this comparison:
(TRADITIONAL TRAINING)
Training Data
|
v
Random Initialization
|
v
Gradient Descent
|
v
Update Weights
|
v
Trained Network
.........
(WEIGHT SPACE PROGRAMMING)
Powerful LLM
|
v
Understand Task
|
v
Design Architecture
|
v
Choose Weights
|
v
Construct NetworkEssentially, instead of relying on the usual training process to discover the weights, we are exploring whether a sufficiently capable model can directly produce a useful configuration.
Now, how does it know which weights to choose? That’s something I find particularly interesting. These models have already learned an enormous amount of mathematical and structural information during their own training. Perhaps some of that learned knowledge allows them to reason about how different weight configurations behave.
The exact mechanism is still something that needs investigation. But the possibility that a model can use its existing knowledge to construct another neural network without conventional training is quite interesting.
The black box problem
There is another reason I find this research direction interesting, and it has to do with something we have struggled with for years: understanding what actually happens inside neural networks.
We can train a model, give it an input, observe its output, and measure its accuracy. But explaining exactly why it produced a particular result is much harder.
What do the hidden layers actually learn? Does a particular neuron represent something meaningful? How do different groups of neurons interact to produce a particular behaviour?
These questions fall under the broader area of neural network interpretability.
INPUT
|
v
+----------------+
| |
| HIDDEN |
| LAYERS |
| |
| W1 W2 W3 |
| W4 W5 W6 |
| ... |
| |
| BLACK BOX |
| |
+----------------+
|
v
OUTPUTThe problem is that neural networks don’t necessarily organize their knowledge in a way that is easy for humans to understand. A single neuron might participate in multiple representations, and meaningful concepts can be distributed across several neurons.
This makes it difficult to connect individual weights or neurons with specific behaviours.
Now, if models like Astra can directly inspect and work with these weights, we might have a different way of approaching the problem. Instead of only observing what a network does, we could potentially ask another model to investigate its internal structure.
That doesn’t automatically mean the black box is solved. But having a model that can reason about the internal parameters of another model could give researchers a useful new tool for understanding neural networks.
It’s not just about creating networks. They might be able to edit them too.
Another part of this research is even more interesting.
Suppose we already have a trained model, but it isn’t performing well on mathematical reasoning. Normally, we would consider fine-tuning it, collecting additional training data, or experimenting with its architecture.
But what if we could give its weights to another powerful model and ask it to figure out what is going wrong?
The idea is somewhat similar to debugging a software system. Instead of rewriting the entire application, we investigate the problematic component and try to fix it.
EXISTING NEURAL NETWORK
|
v
LLM INSPECTS IT
|
v
Examine Internal Weights
|
v
Identify Problematic
Neural Components
|
v
Modify Weights
|
v
Evaluate Again
|
v
Improved ModelIn the demonstration discussed in the research material, a Qwen model was struggling with mathematical tasks. The researchers investigated its internal structure and identified a problematic looping behaviour involving groups of neurons. After modifying the relevant components, the model showed improvements in mathematical performance.
Get Anmolmeet Singh’s stories in your inbox
Join Medium for free to get updates from this writer.
This is a different way of looking at model optimization. Rather than always going back to training data and optimization algorithms, we could potentially use another model to investigate the network itself and make targeted modifications.
For interpretability research, this is particularly interesting because it moves beyond simply identifying what a neuron might represent. It explores whether understanding those internal structures can actually help us change how a network behaves.
An interesting connection with the Bitter Lesson
There is a pattern in the history of machine learning that is worth thinking about here.
In the early days of machine learning, researchers spent considerable time manually designing features and rules for different tasks. Computer vision is a good example. People tried to define features that could help computers recognize objects such as cats, dogs, and cars.
But manually writing rules for every possible situation simply didn’t scale.
Deep learning changed this. Instead of designing every feature ourselves, we built large neural networks and allowed optimization algorithms to discover useful representations from data.
This is closely related to Richard Sutton’s Bitter Lesson, which highlights how approaches that leverage computation and general learning methods tend to outperform methods that rely heavily on handcrafted human knowledge.
Now look at what might be happening again.
Human-designed features
|
v
Neural Networks
|
v
Deep Learning
|
v
Powerful LLMs
|
v
Constructing Networks
|
v
Modifying NetworksWe initially used human-designed structures to build learning systems. Those systems eventually helped us develop increasingly powerful models. And now we are exploring whether these models can help us design and modify other neural networks.
I wouldn’t call this a reversal of the Bitter Lesson. But it does raise an interesting possibility: the models we built through large-scale training might eventually take over more of the work involved in constructing and improving the next generation of models.
There is still a catch
Of course, modifying a neural network isn’t as simple as finding a problematic weight and changing its value.
Improving one capability can sometimes affect another. This brings us to catastrophic forgetting.
Consider a model that performs poorly on mathematics. We modify a particular group of neurons, and its mathematical reasoning improves. Sounds good so far.
But what if those same neurons also contribute to another task, such as copying information accurately? The modification might improve mathematical performance while reducing its ability to copy information.
BEFORE MODIFICATION
Mathematics Copying
| |
v v
Good Good
AFTER MODIFICATION
Mathematics Copying
| |
v v
Improved Worse
This is an important trade-off because neural networks don’t necessarily have completely independent components for every task. The same internal structures can contribute to multiple behaviours.
So, a modification that looks successful on one benchmark might actually make the overall model worse.
This is why we need to evaluate these changes across multiple tasks. We need to understand not just what improved, but also what might have broken in the process.
Where could this lead?
If these approaches become more reliable, I can see some interesting possibilities.
We could have models that construct task-specific neural networks, inspect their internal parameters, identify problematic components, and propose modifications. Those modifications could then be tested, evaluated, and refined.
In the longer term, this could even lead to systems that participate in improving their own architectures.
AI MODEL
|
v
BUILD NETWORK
|
v
INSPECT NETWORK
|
v
IDENTIFY ISSUES
|
v
MODIFY WEIGHTS
|
v
EVALUATE RESULTS
|
v
IMPROVEMENT NEEDED?
/ \
YES NO
| |
└ LOOP |
v
FINAL MODELThere are obvious challenges, though. We still need reliable evaluation, safeguards against performance regressions, and a better understanding of how modifications affect the network as a whole. Building a system that can genuinely improve itself is much harder than simply making a change and observing a better result on one benchmark.
Still, automated architecture design, model diagnosis, and neural network interpretability are all areas where this direction could have an impact.
A few thoughts before wrapping up
What I found interesting about this research wasn’t simply that an LLM might be able to construct another neural network. It was the fact that we are beginning to explore whether powerful models can work directly with the internal parameters of neural networks.
For years, we have treated these systems as black boxes. We train them, evaluate them, and try different techniques to understand their behaviour. Now we are exploring whether models like Astra can help us inspect those hidden layers, choose useful weights, and even modify existing networks.
I don’t think this means gradient descent is going away or that LLMs will suddenly become perfect neural network designers. There are still plenty of unanswered questions, particularly around reliability, generalization, and the trade-offs introduced by weight modifications.
But I do think this is a research direction worth following. We have already seen how much the field has changed as neural networks became larger and more capable. It will be interesting to see what happens when those same models start helping us understand and construct other models at the level of their internal weights.
I came across this concept recently and thought it was worth sharing. Hopefully, you found it interesting too, and perhaps it gave you something new to think about.
References and Further Reading
- Sparks of Weight-Space Programming — Original Research
- Replicating Weight-Space Programming — Alan Turing Institute
- Exploring Weight-Space Programming: Capabilities, Generalization, and Limitations
- Mechanistic Interpretability — Transformer Circuits
- Editing Models with Task Arithmetic
Hope this was a good read for you.








