2026-11-26 15:40 UTC

Practitioner reports agent-built modules that add capabilities inside frozen LLMs

state: seedheat: mediumuncertainty: mediumrelevance: highweight-space-programming model-editing agent-assisted-researchAnadim

What is this?

Anadim’s first-person post, “Weight-Space Micromachines,” describes using Claude Code to build small, task-specific modules that run alongside frozen language models and can read or alter their activations. The author says the modules can remain dormant—leaving outputs bit-for-bit unchanged when they do not fire—and that reinforcement learning can teach a host model when to use them. The post reports experiments mainly on small Qwen models and links code and reproduction instructions on GitHub. The supplied evidence is the author’s post, surfaced via Hacker News; no independent replication or adoption evidence is provided, and the web results add no relevant corroboration.

Why it matters

This is a notable practical demonstration of agent-assisted model editing: an AI coding agent reportedly built modular, inspectable computations inside a model’s forward pass, rather than changing the base model or calling an external tool. If the approach generalizes, it could make it easier to add narrow capabilities, combine them, and train models to select among them. The reported results are promising but self-reported, use small models and benchmarks, and do not establish broad real-world gains; the author also notes that some implants can overfit and that training their exact computations can break them.

Current assessment

New: Anadim reports that Claude Code built weight-space micromachines—separate modules attached to a model’s forward pass, with readers/writers fitted to the host and, in some cases, exact computations implemented as weights. The post says idle modules can leave the original output bit-for-bit unchanged, and that code plus reproduction commands are available. Reported examples include a calculator, an MNIST-digit vision module, instruction-following enforcers, internal-state interventions, and retry/voting machinery. On Qwen3-0.6B, the author reports frozen-model gains from 41% to 55% on BIG-Bench Hard and 58% to 72% on IFEval; with implants attached during RL, reported scores are 68% to 80% on GSM8K, 54% to 60% on BIG-Bench Hard, and 46% to 48% on IFEval. These are the author’s experimental claims, not independently verified findings. The post itself describes limitations: benchmark-driven discovery can overfit or reward-hack; exact implants can be damaged by training their weights; transferring modules requires refitting interfaces and depends on tokenization. Most gains concern tasks for which conventional tools could also help, and the author cautions against overselling results from small models. Useful follow-up: inspect the linked code and reproduction details, then seek independent replication, broader tasks and models, and comparisons accounting for latency, compute, and equivalent external-tool setups. The supplied web search results do not provide relevant corroboration.

Measured heat

now 0 pts/hpeak 6 pts/hcomments 0/hpeers p34momentum: steady2 platformsage 50h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-24 13:00⭐ origin echo-reconstructedThe original source is Dimitris Papailiopoulos's own paper/blog post, not an intermediary: it presents the project and links to its code rep
Dimitris Papailiopoulos on blog (echo) · attributed from hn.story.50645406
—
11-25 18:10first on hacker news · published · +29.2hWeight-Space Micromachines: Brain Implants for LLMs
dataminer
—
11-25 18:10amplified on hacker news 👑hn.story.50645406
dataminer
peak 1 · 0 comments · 103% of case engagement
11-25 18:20our radar first saw it · +29.4hdiscovery anchor: hn.story.50645406—
pace: p15 vs 1989 stories at the 48h mark (now 50h old) — behind agent-adaptive-llm-serving-paper (0.5x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnWeight-Space Micromachines: Brain Implants for LLMs
Retrieved article excerpt

Open article · Retrieved 2026-11-25T18:22:00.014113+00:00

# Weight-Space Micromachines: Brain Implants for LLMs

**TL;DR** AI agents can write small modules ("implants") straight into weight space and bolt them onto a frozen LLM: a calculator, "eyes" for images, a mistake detector, a little memory that lets the model retry a problem and vote inside one call. Implants stay OFF until needed, so the model is bit-for-bit unchanged until one fires. Attaching them alone climbs benchmarks like RL but without RL: on Qwen3-0.6B-Base, BIG-Bench Hard goes from 41% to 55%, IFEval from 13% to 35%. You can also RL with implants attached: on GSM8K, RL with implants reaches 80% vs 68% for plain RL, BIG-Bench Hard 60% vs 54% and IFEval 48% vs 46%.

Code: [github.com/anadim/weight-space-micromachines](https://github.com/anadim/weight-space-micromachines).

---

The calculator implant lighting up while Qwen generates

Today, teaching a language model a new skill means fine-tuning or RL on data that exercises it, and hoping nothing else breaks, or wrapping the model in tools, sandboxes and parsers. What if instead you could write the skill straight into the model's weights? Like having an exact co-processor that comes with the model, stays off until it's needed, one that can even be trained/RL'd along with it?

This was an old wish of mine! In 2023, in [Looped Transformers as Programmable Computers](https://arxiv.org/abs/2301.13196) [[1]](https://arxiv.org/abs/2301.13196), Angeliki and Shashank hand picked the weights of a transformer and put it in a loop so that the model could run programs (a calculator, a computer, a full blown gradient descent run in context!). The process was quite painful, but the results were cute and the "looped transformer" name stuck around :).

At some point in the paper we wrote (verbatim):

> we hope that our findings will contribute to the development of methods to enhance the capabilities of trained language models **by utilizing smaller, reverse-engineered transformer networks for specific algorithmic tasks**

We really wanted to do this back then, but handwriting 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.

**H****owe****v****er****,** **agents can** **now** **read/****e****di****t** **weights directly**, **as our MIT friends showed with** **[weight-space programming](https://rikiyat.github.io/blog/weight-space-programming/)** **[[2]](https://rikiyat.github.io/blog/weight-space-programming/)**.

So I had Claude Code try this on a few small open models. The recipe was a simple loop: 1) run the model, 2) read its failures, 3) pick the ones that follow a pattern a small machine could fix, 4) write that machine into weights, 5) bolt it on the model and keep if the scores go up. Then, repeat.

How Claude builds an implant

Doing so on a couple of small models and evals, Claude wrote a calculator, state trackers, logic solvers, instruction-following rules as exact programs compiled into weights... plus a small machine with a small trained part: **a pair of eyes**!

Bolted onto the weights of a frozen model, each one of these little machines stays silent until it is 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 of tasks.

I call these little machines, **weight-space micromachines** **(WSMs)**, or... **brain implants** for LLMs :)

Here is a summary of results:

- **Implants can be exact tools, or add a new modality!** A calculator takes 4–5 digit multiplication from near zero to 100%, and a small vision implant lets Qwen2.5-0.5B do math on handwritten MNIST digits from ~100x fewer worked examples than fine-tuning alone.
- **Implants can intercept the model's thinking.** An implant can compute an intermediate result and write it straight into intermediate states and activations, with no text interventions at all. Here are some of these type of implants that Cladue made: a mistake detector that forces the model to rethink (GSM8K 52% to 56%), a topic blocker that refuses math requests (catches ~99%), and a voter that picks which of the model's attempts should be the declared solution.
- **RL further teaches when and how to use implants.** The model can learn where a half-broken implant is useful, when to switch off broken or useless ones, and to drop an implant when a better one exists. RL on Qwen3-0.6B with implants ON beats plain RL on all three benchmarks: 80% vs 68% on GSM8K, 60% vs 54% on BIG-Bench Hard, 48% vs 46% on IFEval. Same story on the bigger Qwen3-1.7B too.
- **An** **agent** **can** **h****i****llclimb** **a****n** **ev****al** **by** **run****n****ing** **an implant discovery loop t****hat** **find****s** **small holes,** **and** **p****at****ches them** **with** **implants****.** The gains from individual implants compose, e..g, on IFEval, 14 implants take Qwen3-0.6B from 58% to 72%; on BIG-Bench Hard, 9 implants take it from 41% to 55%; on GSM8K, 8 implants take an RL'd Qwen3-0.6B from 68% to 83%.
- **Implants transfer across models (mostly).** The same implants, built on Qwen3-0.6B, transfer to Qwen3-1.7B (and a little to 4B), and to some other families of models (eg, SmolLM2, Granite), after refitting their input and output wiring.

Here is a summary of the headline results on Qwen3-0.6B (top) and Qwen3-1.7B (bottom). On GSM8K, BIG-Bench Hard and IFEval it compares: the model alone, implants with no RL, plain RL, implants attached then RL, and RL then implants attached.

Qwen3-0.6B-Base (top) and Qwen3-1.7B-Base (bottom): model alone, implants without RL, plain RL, RL with implants, and RL then implants, on GSM8K, BIG-Bench Hard and IFEval

**To be fair, most of the pieces here aren't new:** people have [compiled programs into transformers](https://arxiv.org/abs/2301.05062), [put exact calculators inside networks](https://arxiv.org/abs/2501.00684), and [trained models to use tools with RL](https://arxiv.org/abs/2504.11536) (more on that in Related work). What I am 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 RL'able along with it.

**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 we ran), it stays OFF until it's needed, and you can add, remove or compose as many as you like.

**And yes,** **you can think of most of these as tools.** But unlike a tool, they live in weight space, inside the forward pass, you can train the model together with them and RL teaches the model when to use them and the model distribution (and weights) reshapes around them.

Let me tell you a little bit more about it.

---



---



## 1. Meet the implants

### 1.1 What an implant is

**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 (eg, 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:

Neo: "I know kung fu."

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 RL the model with an implant attached, the model leans on it, more on that in [§5](https://papail.io/papers/wsm/#5-rl-with-all-the-implants).)

**When I say "all in the weights" I mean** **t****his** **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](https://x.com/DimitrisPapail/status/2120245027804705121?a=QModSGHsBrrZImFtglU&s=20). 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).

One model, many implants

**A concrete example of how it works:** when the model has just written `2595 + 3075 =`, a calculator implant *recognizes* that the model is about to compute an addition, and *it steps in*: it adds a vector to the model's last hidden state, right before the output layer, big enough so that the next tokens are sampled to be exactly `5670`. Unlike a brain implant, **the model doesn't know the implant is there**: But it sees the right number show up in its own context and keeps on going.

**OK cool!** **Let's see a few examples of** **t****hese** **micromachines.**

### 1.2 First implant: a calculator... of course!

The first thing that came to mind was a calculator, as arithmetic is a classic failure mode of small (and [larger](https://x.com/maksym_andr/status/2100275583758327954?a=5CZU0SmBxtZ1EqCJBbM&s=20)!) 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:

- **Read.** A single linear layer looks at each token embedding and turns it into a few yes/no flags: is it a digit? which digit? is it +, −, ×, ÷ or =? Claude checked that works with all of ~151k tokens in Qwen's vocabulary.
- **Compute.** About 50 ReLU layers read the numbers off these flags, and does arithmetic the way you'd do it on paper, i.e., carries for addition and subtraction, digit-by-digit products for multiplication, etc.
- **Write.** For each digit in the answer, the implant adds a fixed vector to Qwen's last hidden state, chosen so that Qwen's next token is exactly that digit.

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](https://github.com/anadim/AdderBoard), it could be much smaller. But it's still tiny compared to the 600M parameters of the model.

Inside the calculator

Claude tested it on every pair of numbers up to 59, every signed pair from −40 to 39 and 12k random pairs, for all four operations, and.... 0 mistakes! hooray.

On a frozen Qwen3-0.6B, the calculator increases >4 digit multiplication accuracy **from near zero to 100%**. **Booyah!**

Accuracy as the numbers get longer

**Does that** **p****art****icular i****mplant** **help on actual (but still silly) math problems?** On [GSM8K](https://arxiv.org/abs/2110.14168) [[6]](https://arxiv.org/abs/2110.14168) the calculator barely helps [Qwen3-0.6B](https://arxiv.org/abs/2505.09388) [[5]](https://arxiv.org/abs/2505.09388): eg it goes from 52% to 53%. But on [GSM-Hard](https://arxiv.org/abs/2211.10435) [[4]](https://arxiv.org/abs/2211.10435), the same GSM8K test questions with bigger numbers it goes **from 27% to 35%** (26% to 33% on problems we never tuned the calculator on). RL widens that gap ([§3.1](https://papail.io/papers/wsm/#3-1-setup
dataminer10
🟧 echo.blog ⭐The original source is Dimitris Papailiopoulos's own paper/blog post, not an intermediary: it presents the project and links to its code repDimitris Papailiopoulos——

Interpretation history

Decision trace