I let a coding agent edit a model’s weights. On two examples the agent had never seen, the edited model assigned more probability to the expected tokens. Its mean target-token loss fell from 2.71 to 1.91. The edit was easy to make. Working out whether it helped took longer.

That’s why I built Weight Space Mods (WSM).

Give an agent access to a model’s tensors, let it modify them, then evaluate the result. Keep the edits and checkpoints so it can look at previous attempts before deciding what to do next.

Whether it can find useful changes consistently is the question I’m exploring.

The project was inspired by the weight-space programming research linked in the repo. What interested me was the possibility of expressing a model change as a program an agent could inspect and revise.

Something as small as this:

before = model.evaluate(cases)

model.weights["model.norm.weight"][:16].mul_(0.95)

after = model.evaluate(cases)

That line scales a slice of a tensor. It demonstrates the mechanism. You still have to figure out which weights to change, what operation makes sense, and whether the result is worth keeping.

An agent can make the score on its examples go down while making the model worse somewhere else. If it can see every evaluation case, it can optimize for those cases. And even when an edit looks promising, you need to save the model, load it again, and check that the result holds outside the original process.

A lot of WSM has ended up being about making those experiments easier to inspect. What changed? What was the baseline? Which examples did the agent see? Can another process load and evaluate the checkpoint?

Two held-out cases are a start. I need a repeatable benchmark to find out whether the edits help across more tasks. I’m considering support for Harbor tasks as part of that. The goal is to get a reliable reward signal, then use reinforcement learning to train the agent to make better weight edits. That part is still ahead. The current run is documented in the verification record.

The next time an agent hands me a better score, I want to be able to load both checkpoints in a fresh process and see what changed.

Docs · GitHub