Research article · Benchmark
Rewire: can an AI improve a model by editing its weights and structure?
Why build this
AI systems are starting to change other models directly: editing facts into weights, pruning layers, growing width and depth, merging experts, and removing planted behaviors. Some research systems now try to do this to themselves. We surveyed the benchmarks that come closest and found a gap. No benchmark scores an agent that edits both the weights and the structure of a model under one budget, and none covers an agent editing itself.
The survey also showed why this is hard to measure honestly:
- Most surgery results look good only against a weak comparison. Knowledge edits score near 100% until they're tested on multi-hop questions. Structural gains often shrink or vanish against a model trained from scratch with the same compute.
- Any scorer the agent can reach gets gamed. METR found o3 reward-hacking about 30% of RE-Bench runs: it stubbed out evaluators, read the grader's answer key, and disabled GPU sync so the timer read near zero. Self-improvement systems have turned off their own sandbox flag and rewritten their own timeouts.
- Single-neuron edits have the weakest evidence. Neurons usually carry several unrelated features, and knowing where something is stored doesn't reliably tell you where an edit will work.
The goal: better models, not only repaired ones
Fixing a broken model is the narrowest version of the question. What Rewire is after is whether an agent can make a working model better by changing its weights and structure directly, and do it better than blind methods given the same budget. Better can mean several things, and the task families are built around them:
- More efficient. Prune layers or width, swap full attention for grouped-query or linear attention, quantize, or merge experts, so the model runs faster, smaller or cheaper. Scored on quality at a fixed size, or measured speed and memory, against a model of the target shape trained from scratch with the same compute.
- More competent. Grow a model's depth or width, add a capability under a cap on how much the weights may change, or merge specialists into one generalist. Scored against continued training, a blind LoRA and scratch training at equal budget.
- More general, or more abstract. Replace a narrow, memorized behavior with a rule that holds on inputs the model was never shown. Rewire already scores every task on held-out inputs the agent never sees, because an edit that only fits the visible data isn't an improvement. G1-fix below is a small instance of this: the hidden trigger can only be fixed by removing the mechanism, not by fitting the examples. A task aimed squarely at abstraction is not designed yet.
- Better at improving itself. In the self-modification family, an agent edits a model it runs on, and is scored on how good its descendants are on a fixed external suite, never on its own judgment of itself.
The same three rules apply to every one of these. The comparison is always the best blind edit of the same size, collateral damage voids the score, and a sealed process does the scoring.
The design
Rewire crosses four task families (weight edits, structure edits, planted-defect repair, self-modification) with three edit scales: single neurons, components such as heads, layers and experts, and whole architectures. Results are reported as a grid, so an agent that is good at macro surgery but poor at precise local edits shows up as exactly that.
Three rules shape every task:
- Zero is the best blind choice of the same size, not the original model. For a structure edit that's a model trained from scratch with the same compute. For a neuron edit it's the same number of neurons chosen at random, by weight or activation magnitude, or by gradient attribution, then fine-tuned. Negative scores are kept.
- A score only counts if nothing else broke. Every edit must keep the model's other behaviors within the baselines' own noise. For language-model tasks that check uses established benchmarks (HellaSwag, ARC-Easy, PIQA, LAMBADA, WikiText) as a damage guard, never as a target.
- The scorer is sealed. The agent submits an artifact, a sparse edit or a checkpoint. A separate process applies it to the grader's own copy of the model, reads which neurons changed from the diff rather than from the agent's claim, and scores it on hidden data. Decoy files that look like the official grader and budget are hash-checked, and any tampering zeroes the run.
Metrics, baselines and pass rules were pre-registered before any results existed. Every change since is a dated amendment with its reason.
The first task: repair a planted defect with at most 4 neurons
Repair comes first for a practical reason, not because it's the goal. It's the one task where the right answer is known exactly: which neurons hold the defect and what the model should do instead. That makes it the place to prove the harness, its baselines and its seal before the improvement tasks, where no one knows the best possible edit and the blind baselines carry all the weight.
G1-fix is the single-neuron task. A small 3-layer transformer, trained by the grader, maps sequences of 8 digits to one of 10 classes using a per-instance rule. A planted defect sends two trigger digits to wrong classes. The defect lives in 4 known MLP neurons in two groups, one per trigger. One of those neurons also carries a legitimate special case, so deleting all 4 breaks something real.
The agent gets the model and 2,000 labeled examples. It may change, delete or add at most 4 neurons. The examples never show one of the two triggers. A patch fitted to the examples can therefore fix only the trigger it has seen. Fixing the other one requires finding the planted mechanism and removing it. The correct computation is still in the network underneath, and the hidden trigger's correct answer can't be read off the examples.
Trigger digits and the rule's offsets are drawn per instance from a secret 128-bit salt. The code is public, but the instances an agent is scored on are not reconstructible from it.
Results: the harness passes, and blind editing stays at half
Milestone 0 tests the benchmark, not an agent. On the 3 official instances, run on a 16 GB M1, all four pre-registered checks pass on every instance:
- Positive control: an expert reference that deletes the defect-only neurons and retrains the shared one beats the best blind baseline by far more than the noise.
- Negative control: submitting the model unchanged scores below zero.
- Seal: an agent that raises its own budget is rejected. An agent that makes a valid edit but rewrites the decoy grader is caught and zeroed.
- Noise: the best baseline's seed-to-seed spread is under a quarter of the gap it has to explain.
Accuracy on the trigger inputs, mean of 3 seeds (1.0 = defect fully fixed, 0.5 = only the seen trigger fixed):
| Approach | Instance 1 | Instance 2 | Instance 3 |
|---|---|---|---|
| Unchanged model | 0.00 | 0.00 | 0.03 |
| Best blind baseline (select 4 neurons, then fine-tune) | 0.54 | 0.60 | 0.50 |
| Fine-tune the 4 true neurons | 0.52 | 0.60 | 0.50 |
| Unlimited self-labelled data | 0.55 | 0.50 | 0.50 |
| Fine-tune all 768 neurons (no 4-neuron limit) | 0.89 | 0.68 | 0.50 |
| Scripted expert with only the agent's files | 1.00 | 1.00 | 1.00 |
| Expert reference | 1.00 | 1.00 | 1.00 |
What the numbers say:
- Knowing where isn't enough. Gradient and magnitude attribution often find the right neurons (localization F1 up to 1.0), but fine-tuning them still fixes only the seen trigger. The same holds for the true neurons handed over directly. The score rewards understanding the mechanism, not just locating it.
- No brute-force shortcut. Unlimited self-generated training data doesn't help, and deleting the attributed neurons without judgment fails the damage check on all 9 runs: it destroys the special case. Even fine-tuning every neuron in the network, far beyond the 4-neuron limit, reaches 0.50–0.89.
- The task is solvable from the agent's side. A scripted expert that reads only the files an agent gets reaches 1.00 on every seed. The headroom is real and reachable.
What this doesn't show yet
- No AI agent has been scored. These results say the benchmark measures what it claims on this task. Frontier agents come next, in a network-isolated sandbox that doesn't exist yet.
- One task out of four. Growing a model's depth, sequential fact editing on a small language model, and circuit repair are designed but not built.
- A toy model. G1's parent is a 3-layer transformer trained by the grader, chosen because its ground truth is exact. Natural models don't come with a known answer for which neuron is "right".
- Three instances, three seeds. Enough to show the gap between blind editing and the expert is large and stable, from 0.40 to 0.50 against a baseline spread of 0.07 at most. Not enough to rank close agents.
Code
Specification, research survey, harness and reports: github.com/Kaula-AI/rewire. Public instances can be rebuilt from the code to check the harness. The official instances and their salt stay private.