Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

An AI Just Edited Another AI’s Brain. No Training Required.

5 min read6 days ago

--

Press enter or click to view image in full size

A small AI model kept getting stuck in its own thinking. Another AI opened up its weights, found the problem, and fixed it by hand.

No training run. No new data. It changed 0.016% of the numbers, and the small model’s math score went from 7.9% to 48.1%.

This comes from a November 2, 2026 blog post by four MIT CSAIL researchers: Rikiya Takehi, Jayden Teoh, Alex Zhang, and Omar Khattab (who also created DSPy). They call the idea weight-space programming.

Here’s what it is, what they showed, and where it breaks.

How models usually change

A neural network is just a big pile of numbers called weights. Today there are a few ways to set them:

  • Training with gradient descent. Show the model examples, measure the error, nudge every weight a little. Repeat millions of times. This is how almost every model is built.
  • Fine-tuning. Same idea, smaller scale, on new data for a new task.
  • Generated weights. One network trained to output another network’s weights.

In all of these, nobody decides what a single weight should be. An optimizer does it blindly, one tiny step at a time.

Weight-space programming skips that. An LLM looks at the weights, reasons about what they do, and edits them on purpose, the way an engineer edits code.

What weight-space programming is

You give a strong LLM (here, GPT-6 Astra) two things:

  • the raw weights of another network
  • a goal in plain English, like “stop this model from looping” or “write a network that plays Breakout”

The LLM then reads, fixes, or writes the weights directly. No training loop.

How it sees the weights depends on size:

  • Small networks: every weight is pasted into the prompt as text.
  • Larger networks: the LLM gets a Python sandbox to inspect them, and sometimes a small budget of test runs (forward passes) to check its work.

An analogy: neurosurgery for AI

Think of it like neurosurgery. When someone has a tremor, doctors don’t retrain their whole brain. With deep brain stimulation, they find the one circuit that’s misfiring and intervene right there.

The pieces line up:

  • Reading weights = reading a brain scan. Naming a game from the weights is like looking at a scan and saying “this person plays piano.”
  • Fixing Qwen = removing a faulty pathway. Astra found the circuit causing the loops and switched it off. That’s closer to precise surgery than to retraining.
  • The limits match too. Surgery can quiet a misfiring circuit, but it can’t teach someone French. Editing weights can remove a fault, but it can’t add a skill the model never learned.

What they showed

The team ran 8 experiments in three groups: reading weights, fixing them, and writing them from scratch.

1. Reading: what does this network do?

  • Four game-playing agents, all with the same shape and inputs. Astra wasn’t told which games. Looking only at the weights, it named all four correctly: Breakout, Pong, Pac-Man, Freeway.
  • Three small image generators. Without running them, it said which one draws circles, squares, or triangles.
  • Tiny language models. From just their middle layers, it named what each was trained on (Python, English, or romaji Japanese) and found the attention heads that copy patterns.

2. Fixing: a car that never made it up the ramp

A game agent trained for 1 billion steps kept driving into a ramp and stalling. Astra read its weights plus one recorded run, explained the bug, and wrote a fix in one reply.

  • Weights changed: 3.5%
  • Success rate: 0% → 100% over 1,024 runs

3. Writing: networks from zero

Astra got game rules and an all-zero network, then wrote every weight as text. No data, no training, no tools. Scores vs. PPO trained for 100M steps:

  • Breakout: PPO 15.8 → Astra 517.4
  • Seaquest: PPO 5.6 → Astra 53.1
  • Asterix: PPO 25.8 → Astra 53.2

For Breakout it basically wrote a program in weights: layer one works out where the ball will land, layer two moves the paddle there.

4. The headline: fixing Qwen’s thinking loops

Qwen3.5–0.8B is known to get stuck in loops while reasoning. In the tests, 93% of its math answers ran until they hit the token limit.

Get Ankit Goel’s stories in your inbox

Join Medium for free to get updates from this writer.

With a Python sandbox and 50 test runs, Astra traced the loops to one direction in two MLP layers (15 and 19) and subtracted it. That touched 131,072 weights out of 0.8 billion.

  • MATH-500: 7.9% → 48.1%
  • GSM8K: 13.8% → 67.1%
  • IFEval (instruction following): 21.0% → 62.3%

Instruction following improved too, because loops hurt every task, not just math.

The result has already been checked once. Hugging Face’s Ahsen Khaliq rebuilt the edited model from the logs and got 51.0% on MATH-500. The edited model and a demo are both public on Hugging Face.

Where it breaks

The authors were upfront about the failures, and they matter as much as the wins.

  • It can remove a fault, not add a skill. Gemma 3 270M is bad at math but doesn’t loop. With no single bug to remove, Astra’s best edit moved its MATH-500 score from 6.8% to 7.7%.
  • Some behavior doesn’t show up in weights. Astra couldn’t tell an honest model from a sycophantic one by weights alone. Once it could see their attention patterns, it caught the sycophant every time.
  • More training still wins sometimes. PPO agents trained for 500M steps beat Astra on Seaquest and Asterix.
  • Test budget matters. With 10 or 25 test runs instead of 50, Qwen’s loops barely went away.
  • It’s early. One LLM, networks up to 0.8B weights, and a blog post, not a peer-reviewed paper. The team is still building a benchmark.

Why it matters if you build with AI

This isn’t a production tool yet. But three things are worth watching:

  • Debugging models like code. Today, when a small model has one narrow bug, the fix is fine-tuning on new data. A targeted edit to 0.016% of weights leaves the rest of the model alone, so there’s less risk of breaking what already works.
  • A first pass at interpretability. “Ask a frontier model what this layer does” could become the quick check before heavier interpretability tools.
  • Auditing without running. The authors hope this leads to checking models for backdoors or removing capabilities without data. That’s a goal, not a result yet.

There’s a pattern here too. LLMs already tune prompts, write programs, and write training code. This pushes the same reasoning one level down, into the weights.

Bottom line

Weight-space programming shows a frontier LLM can read and edit a network’s weights by reasoning, at least for small models with one clear bug.

It won’t replace training. It might become how we debug models.

The best part: everything is public. The prompts, outputs, and scores are on GitHub, and you can try the edited Qwen model yourself on Hugging Face.

Sources

--

--

Ankit Goel
Ankit Goel

Ankit is a Solutions Architect with total 15+ yrs of experience designing solutions. Ankit holds a MS in Information Systems from Carnegie Mellon University.