AI agents can write small modules straight into weight space and bolt them onto a frozen large language model. These implants—a calculator, "eyes" for images, a mistake detector, a little memory that lets the model retry a problem and vote inside a single call—stay off until needed. Attaching them alone lifts benchmarks like reinforcement learning but without the training cost: on Qwen3-0.6B-Base, BIG-Bench Hard climbs from 41% to 55% and IFEval from 13% to 35%. Code is available at github.com/anadim/weight-space-micromachines.

Today, adding a new skill to a language model means fine-tuning or reinforcement learning on data that exercises it, and hoping other capabilities don't break. Alternatively, the model can be wrapped in tools, sandboxes, and parsers. What if instead the skill could be written directly into the model's weights? Like having an exact co-processor that comes with the model, stays dormant until called upon, and can even be trained or reinforced learned alongside it?

This was a long-standing ambition. In 2023, Looped Transformers as Programmable Computers [1] by Angeliki and Shashank hand-picked transformer weights and put them in a loop so the model could run programs—a calculator, a computer, even a full gradient descent run in context. The process was painful, the results cute, and the "looped transformer" name stuck. The authors wrote they hoped their findings would contribute to methods that enhance language model capabilities by utilizing smaller, reverse-engineered transformer networks for specific algorithmic tasks. But hand-writing even small circuits was painful, especially ones working in token space that then had to be attached to a bigger model. So it never happened.

However, agents can now read and edit weights directly, as MIT friends demonstrated with weight-space programming [2]. The author had Claude Code try this on a few small open models. The recipe was a simple loop: run the model, read its failures, pick the ones that follow a pattern a small machine could fix, write that machine into weights, bolt it on the model and keep if scores go up. Then repeat.

Doing so on a couple of small models and evaluations, Claude wrote a calculator, state trackers, logic solvers, instruction-following rules as exact programs compiled into weights—and a small machine with a small trained part: a pair of eyes. Bolted onto the weights of a frozen model, each little machine stays silent until needed for a task. When they work together, they can increase accuracy on small models by double digits on arithmetic, GSM8K, BIG-Bench Hard and IFEval type tasks. The author calls these little machines weight-space micromachines (WSMs), or brain implants for LLMs.

Headline results on Qwen3-0.6B and Qwen3-1.7B

On GSM8K, BIG-Bench Hard and IFEval the summary compares: the model alone, implants with no reinforcement learning, plain reinforcement learning, implants attached then reinforcement learning, and reinforcement learning then implants attached. On GSM8K, reinforcement learning with implants reaches 80% versus 68% for plain reinforcement learning, BIG-Bench Hard 60% versus 54% and IFEval 48% versus 46%. Attaching implants alone, without any reinforcement learning, already lifts BIG-Bench Hard from 41% to 55% and IFEval from 13% to 35% on Qwen3-0.6B-Base.

To be fair, most of the individual pieces aren't new: people have compiled programs into transformers, put exact calculators inside networks, and trained models to use tools with reinforcement learning. What the author is doing here is perhaps putting it all under one umbrella: small, sometimes exact add-ons, written by an agent, that come bolted on the model and are reinforcement-learningable along with it.

Implants versus LoRAs and tools

And no, these are not LoRAs. A LoRA is a low-rank change applied across the model's own weights, learned from data. An implant is a separate module on the side: attaching it doesn't change the model's weights, it computes one specific thing you can read and test (the calculator was exact on every arithmetic test ran), it stays off until it's needed, and you can add, remove or compose as many as you like. And yes, most of these can be thought of as tools. But unlike a tool, they live in weight space, inside the forward pass, the model can be trained together with them and reinforcement learning teaches the model when to use them and the model distribution (and weights) reshapes around them.

The idea is simple. Say your model would do better if it could compute f(x), but teaching it f is hard, expensive or perhaps bad for its other skills, and using a tool or an inference-time intervention like best-of-N means having a sandbox and orchestration around the model. Instead one could have an agent write a small machine in weight space (a micromachine!) that computes f(x) exactly, and attach it to the model. Akin to a brain implant. A bit reminiscent of Neo in The Matrix: they "upload" the program in his brain, and seconds later the program is running. Notice how there's no sandbox around Neo, and no Python code wrapped around him: it's all in his brain. That's what I'm talking about!

So you (or Claude) create an implant, attach it to the model, and it does exactly one thing, and only when it's supposed to; the rest of the time it stays off, and the outputs are bit-for-bit identical to the original. Remove an implant and you get the original model back. (Well, once you reinforcement learn the model with an implant attached, the model leans on it, more on that in section 5.) When I say "all in the weights" I mean this literally: every implant is extra weights (plus in some cases a few registers, which act as a small memory implant) that run inside the forward pass and the decode only samples tokens. There is nothing programmatic allowed around the model.

The implant, in weight space, sits parallel to the model and reads the same tokens as the model (or, as we'll see later, some of its hidden layers). Though it doesn't have to sit on the side: it could be wired in as a few more attention heads, an extra layer, or written into dead neurons the model doesn't use, like Lazarus. But a separate, parallel block is just easier, and if you fine-tune the model later, you don't mess with the implant (or the other way around).

The calculator implant: exact arithmetic in two million weights

The first thing that came to mind was a calculator, as arithmetic is a classic failure mode of small and larger models. I asked Claude Code to build one in weights and attach it to a small Qwen model. It works like a tiny ALU (the part of a CPU that does arithmetic) and does so in three steps: only the read and write ends are "fitted" to the model. The arithmetic in the middle is a program Claude wrote that is compiled into ReLU layers. The whole implant is about 2.4M weights, and yes, we know, it could be much smaller. But it's still tiny compared to the 600M parameters of the model. Claude tested it on every pair of numbers up to 59, every signed pair from minus-40 to 39 and 12k random pairs, for all four operations, and... zero mistakes! hooray. On a frozen Qwen3-0.6B, the calculator increases beyond-4-digit multiplication accuracy from near zero to 100%. booyah!

Does that particular implant help on actual math problems? On GSM8K the calculator barely helps Qwen3-0.6B: it goes from 52% to 53%. But on GSM-Hard, the same GSM8K test questions with bigger numbers it goes from 27% to 35% (26% to 33% on problems the calculator was never tuned on). Reinforcement learning widens that gap.

So the implant works, and works only when the model actually uses it. To use it in the calculator case we just showed it a few in-context examples in the prompt. But can we teach it to use the calculator instead? You can teach the model to use an implant by fine-tuning it on format so it learns to call the implant, the way you'd teach a model a tool-calling format, e.g., a call looks like __critical48 * 2 __ when it needs to multiply. Below, we fine-tuned Qwen2.5-0.5B on the same roughly 7k GSM8K training solutions (plus roughly 3k extra arithmetic examples) in three ways: plain solutions with no calls; solutions where every calculation is a call, and the model has to fill in each result itself (so it has to learn the arithmetic), and one where the calculator implant is attached, so it fills in the result and the model only has to make the call. The longer the numbers, the more the implant helps, e.g., on GSM-Hard the model goes from roughly 13% to 23%, and on arithmetic templates it never saw from 51% to 99%. Therefore, fine-tuning teaches the call format, while the implant does the arithmetic.

Implants that fire automatically versus those needing a prompt

Not every implant needs this. Implants the model calls (this calculator, most of the BIG-Bench Hard solvers in section 4.3) need a short fine-tune (or a few in-context examples) so the model learns to write the call. Other implants fire on their own, by watching what the model writes or through reading its hidden states, and need no fine-tune: the do-arithmetic-when-you-see '=' implant, the IFEval instruction rules, the mistake detector, the topic blocker, the latent write and the GSM8K "retry" set of implants, are all of the latter kind.

I thought what else would be a cute implant? Hmm... What if we gave Qwen eyes? Qwen only reads text but one can flatten an image into a list of pixel values (same trick we did in our LIFT paper with Kangwook Lee and Yuchen Zeng, where we fed non-language data to GPT-3 as plain text). For example, take a handwritten MNIST digit and write each pixel as one token, flatten row by row and get a bunch of tokens per image. Paste a few of these into a prompt and ask "What is image 1 plus image 2 times image 3"? Qwen can't of course "see" a digit in a pile of pixel tokens but the eyes implant can help it!

Inside the implant there is a small CNN (a few hundred K weights and trained on MNIST's 60k labeled digits). The rest is written by Claude like the other implants: as an image streams by in the prompt, the implant puts its pixel tokens back into an NxN picture, and when the image ends, it runs the CNN on it and stores the digit, then writes it when the model later asks for that image ("image 2 is a 7"). Like the fine-tune we did for the calculator, Qwen has to be fine-tuned to use the implant, so we show it a few examples written out in the right format. We compare with fine-tuning on correct solutions (same solutions, no implant) to see how much format vs function take to learn... and yeah there's a gap. With 32 examples, Qwen+eyes plus calculator scores 95% versus 4% without eyes. Plain fine-tuning does catch up eventually but is only at 93% after 4,000 examples and needs about 16,000 to match it. So the implant gets there with roughly 100 times fewer task examples. A Python tool that pastes the same CNN's digit as text does a bit better (96% versus 93% in our rerun, with fewer tokens), so the point is that this works in weights, not that it beats the tool.

OK you may say these are not real eyes, and I would indeed agree. The model doesn't really see internally (in its original weights) what the CNN sees, so it can't use things like "this 7 looks a lot like a 1" etc. That is a weakness of bolting implants, rather than training one big model to do all of it at the same time. But you could co-train the model with the implant! One could let the model activations read the CNN's features, and train the two together. We didn't do that for the eyes implant, but we did train the model with implants attached on several benchmarks below sections 3 and 5, and reinforcement learning does teach it things about its implants: when to call them, when to switch them off, which one to trust etc.

Implants that read and rewrite the model's thoughts

One can be a nihilist about this and say: it's just tools! And you'd be mostly right! The calculator accuracy gains are what a Python calculator would offer. I think the key difference is not what the tool or implant computes, but where it lives, and that it can be trained together with the model. A Python tool sits outside the model weights, so token generation has to be interrupted: you parse tokens, parse tool results, paste them back to context, resume generation. An implant is just more weights, so batching, CUDA graphs, fine-tuning and reinforcement learning treat it like any other set of model weights. It stays dormant until needed and implants compose (meaning you can have multiple of them) without interfering with each other, and there's no need for a sandbox.

So far our micromachines worked directly on tokens: they read what the model writes and write tokens back in its context. But an implant lives inside or parallel to the model and so it can also look at internal hidden states, and peek at roughly what the model is "thinking", and can also intervene directly on them. The next three implants do exactly this: the first two read the model's thoughts, the third writes on them.

Going back to GSM8K (the same model as in section 1.2, at 52%), where most mistakes weren't arithmetic but related to reasoning, one would wonder if a micromachine could help some other way. Here's an implant idea: a mistake detector! (my student Zach Sifakis has been working on something related, keep an eye out for it!) Right before the model commits to its final answer, the implant reads the internal states and attempts to predict whether a second look would help, and if so it force writes "Hmm, wait. Let me rethink this." instead, and the model keeps going (same idea as the "Wait" in s1). But does a model know internally when it's wrong? Kinda! We ran Qwen3-0.6B on GSM8K problems and saved its activations right as it is about to write its final answer, labeled right/wrong and generated like that about 50k labeled examples. A small probe trained on those can separate right from wrong pretty well on test problems it never saw (e.g., AUROC 0.85 on GSM8K, 0.84 on GSM-Hard). This is in the spirit of Kadavath et al.: language models mostly know what they know.

How does this implant decide when to fire? It uses one tiny probe with three heads that read hidden states just before the answer. One head asks "is this answer right?". The other two ask "would a rethink help?", now and after the model commits to an answer. For labels for this, Claude tried the rethink on many GSM8K training solutions: if a wrong answer turned into a right one, that's a "rethink helps" aka positive example. Why not just fire on likely mistakes? Because most wrong answers stay wrong even after a rethink, so that would mostly waste tokens. The stitching that remains is standard circuit design by Claude performed in weight space: it watches the next-token scores (through a copy of its output layer) to...

Without continuing the source text, the article reaches a point where the meaningful content ends. The final section of the source appears to be cut off mid-sentence. A single empty paragraph is output as instructed when no genuine facts remain.