Weight-Space Programming, Explained
What if you could change what an AI knows by editing its brain directly, instead of asking it nicely?
For most of computing history, “programming” meant writing instructions. You typed if this, then that, and the machine obeyed. Then came AI chatbots, and a new kind of programming showed up: you write a prompt in plain English and hope the model gets it.
There is a third way, and it is quietly becoming one of the most interesting ideas in AI. It skips both code and prompts. Instead, you reach inside the model and change the numbers it is made of. Researchers call this working in weight space. I’ll call it weight-space programming.
A quick honesty note: this isn’t yet a term with one official definition. It’s an umbrella for a family of techniques that share one idea. This post explains that idea without any math.
Three ways to tell a computer what to do
Think of a new employee at a coffee shop. You can get them to make a better latte in three ways.
- Hand them a rulebook. “Steam the milk to 65°C. Pour at a 45° angle.” That’s traditional code: exact, readable, rigid.
- Tell them what you want. “Make it like the ones in Italy.” That’s prompting: flexible, but you’re relying on what they already know.
- Change their instincts. After months of practice, their hands just know. Nobody wrote it down; it lives in muscle memory. That’s weight space.
In 2017, AI researcher Andrej Karpathy called this shift “Software 2.0”: more and more of our programs are no longer written by people but learned, and stored as weights. Weight-space programming is what happens when we stop treating those weights as a sealed box and start working on them directly.
So what are “weights”?
Picture a giant mixing desk in a recording studio, the kind with rows of sliders. Now imagine it has not 50 sliders but billions.
Each slider is a weight: a single number that controls how strongly one tiny part of the model influences another. Push one slider up and a signal gets louder. Pull it down and it fades. No single slider means anything on its own. But set all of them just right, and the desk produces something remarkable: a model that can translate French, write a poem, or recognise a cat.
Training an AI is the process of nudging those sliders, trillions of times, until the output sounds right. When training ends, the slider positions are the model. Everything it “knows” is stored there.
Now the key idea. Every possible arrangement of all those sliders is one point in an enormous imaginary space. That’s weight space. A model that writes poetry sits at one spot. A model that writes legal contracts sits at another. Moving through this space means changing what the model is.
Weight-space programming is the art of moving a model to the spot you want, on purpose.
What it looks like in practice
Here are five ways people already “program” in weight space, from the most familiar to the most futuristic.
1. Fine-tuning: more practice. You take a trained model and keep training it on your own examples, like customer emails or medical notes. The sliders shift a little toward your world. This is the oldest and most common form.
2. Adapters: clip-on lenses. Retraining billions of sliders is expensive. A technique called LoRA freezes the original model and trains a tiny add-on, often under 1% of its size. Think of a camera lens filter: the camera stays the same, but snap on a different filter and every photo changes. Companies keep dozens of these small files, one per customer or task, and swap them in instantly.
Get Manjunath’s stories in your inbox
Join Medium for free to get updates from this writer.
3. Task arithmetic: adding and subtracting skills. This is where it gets strange. Researchers found that if you subtract an original model’s weights from a fine-tuned version, the difference is a “skill” you can carry around, called a task vector. Add the “math” vector and the “coding” vector to a base model, and it gets better at both. Subtract a “toxic language” vector, and it gets more polite. Skills become something you can do arithmetic with.
4. Model merging: blending recipes. Take two models fine-tuned for different jobs and average their weights. Surprisingly often, the result can do both jobs. Many top-ranking open-source models today are merges, built without any new training at all.
5. Surgical edits: changing one fact. Suppose a model believes the wrong person is CEO of a company. Methods like ROME locate the handful of sliders that store that fact and rewrite just those. It’s closer to brain surgery than to schooling.
At the far frontier, researchers are building AI systems that read and write other AI models’ weights, a field called weight-space learning. Others have shown that a simple, ordinary program can be compiled directly into a model’s weights, with no training at all. That’s the clearest sense in which weights become a programming language.
Why it’s powerful, and why it’s hard
The upside is permanence and efficiency. A prompt has to be re-sent every time, and the model can drift away from it mid-conversation. A change in the weights is always on. It costs nothing extra per request, and it can teach things that are hard to put into words, like a tone of voice or a doctor’s judgement.
The downside is that you can’t read it. Code is text a person can review line by line. Weights are billions of unlabelled numbers. When you change them, you often can’t say exactly what else changed. Three problems follow:
- Side effects. Teach a model one new fact and it may quietly forget or distort a related one. Edits ripple.
- Testing is guesswork. With code, you can prove a function does what it says. With weights, you can only try lots of inputs and watch.
- Trust. If someone hands you a merged or edited model, it’s hard to check what was put inside it. That matters for safety and security.
This is why a lot of current research goes into interpretability: figuring out which sliders do what, so weight-space edits can become as deliberate as editing code.
What this means for the rest of us
If you build with AI, weight-space tools are already within reach. You can fine-tune or attach an adapter in an afternoon with off-the-shelf services. The practical rule is simple: use prompts for what changes often, and weights for what should always be true. Your brand voice, your domain vocabulary, your company’s style belong in the weights. Today’s to-do list belongs in the prompt.
If you just use AI, you’ll feel this without seeing it. The assistant that knows your industry’s jargon, or the voice model that sounds like your favourite narrator, increasingly comes from someone programming in weight space rather than writing a clever prompt.
For 70 years, programming meant telling machines what to do, step by step. Then it meant asking them nicely. The next chapter may be about shaping what they are. We’re still learning the grammar of that language, but the first words have already been written.
Further reading
- Andrej Karpathy, Software 2.0 (2017)
- Hu et al., LoRA: Low-Rank Adaptation of Large Language Models (2021)
- Meng et al., Locating and Editing Factual Associations in GPT (ROME) (2022)
- Ilharco et al., Editing Models with Task Arithmetic (2022)
- Lindner et al., Tracr: Compiled Transformers as a Laboratory for Interpretability (2023)
- Survey of weight-space learning (2026)






