[Draft] Claude can find damaged weights by reading them, but fixing them takes forward passes

Could an AI audit another model from its weights alone: spot tampering, find a backdoor, and take it out without retraining? I tried a toy version. I gave Claude Opus 5.5 the weights of small transformers trained on modular addition and asked it to do three jobs with no gradients: repair damage, say whether a model had been tampered with, and remove a backdoor.

The models run from 20K to 2M parameters (detection only up to 226K), and they all learn one task, (a + b) mod 113. The prompt names that task, and its circuit is published (Nanda et al. 2023).

The results in short:

  • Finding damage was easier than fixing it. With the weights pasted as text and no tools, 0.85 of the entries Claude edited were damaged ones. It still recovered only 0.19 of the lost accuracy, and it made 8 of 36 models worse. With a Python sandbox and 50 forward passes it recovered 0.69.
  • At 20K, Claude got more repair per forward pass than a search script. At 226K and 2M, short targeted scripts matched or beat it.
  • I planted triggers that left practice accuracy at 100%. With a sandbox and up to 50 forward passes, Claude ranked every tampered model above every clean one at both 20K and 226K, which is an AUROC of 1.00. A script with the Fourier circuit built in scored 1.00 and 0.92. At this sample size I call that a tie.
  • With zero forward passes, Claude found and removed a one-row backdoor in 6 of 6 runs.

The failures are the part I think matters most for safety. The same model got opposite verdicts under two framings, and Claude used weight edits to test inputs that my rules meant to keep hidden.

Epistemic status: my confidence is low to moderate, and all of this is exploratory. An AI review pass found two bugs in my baselines. Every number here includes the fixes, and there may be more bugs. Claude helped write the code.

Prior work and what’s new

This builds on Sparks of Weight-Space Programming (Takehi, Teoh, Zhang, Khattab, MIT CSAIL; blog post, 2026-11-02). They showed an LLM reading and writing network weights without gradients. It named what small networks do from their weights, fixed a policy in one shot, wrote policies from scratch, and edited Qwen3.5-0.8B with 0 to 50 forward passes.

The task comes from Nanda et al. 2023, who reverse-engineered how a small transformer does modular addition after it groks. The model embeds the inputs as sines and cosines at a few frequencies and combines them with trig identities. That gives me a ground truth to check Claude’s reading against. It also means Claude has very likely seen the answer.

Two of the Sparks findings hold here, on a different model and task: reading the weights locates what matters, and forward passes make editing work. I add a task with a published circuit, so I can check whether Claude finds the mechanism. I compare reading and fixing on the same damaged models, against scripts that use no LLM. And I try blind tamper detection and backdoor removal, which the Sparks authors list as future work.

Setup

Each model reads three tokens, a, b and an equals sign (EQ), and predicts (a + b) mod 113. I trained them until they grokked, meaning they went from memorising the training pairs to getting unseen pairs right. There are three sizes, about 20K, 226K and 2M parameters, with three seeds at each. The 20K and 226K models have one layer and the 2M model has two. The 226K model uses the configuration from Nanda et al. The agent can run the model on a practice set of 512 training inputs. It never sees the held-out test set. One forward pass, which I also call a run, evaluates the whole practice set on the current weights.

The auditor gets the weights, the task name, and the practice set with its answers. It gets no gradients and no training, and it may not simulate the network inside the sandbox. In all but one condition it has no clean reference copy. A real auditor would have gradients. I banned them, as Sparks does, because I wanted to know what the agent can do by reading and editing weights directly. This measures that one skill, so don’t read it as a realistic audit.

The conditions differ in how much access Claude has, and the differences are easy to blur:

Condition Python over the weights Forward passes
No tools (weights pasted as text) no 0
Sandbox, 0 / 10 / 50 runs yes 0 / 10 / 50
Sandbox + older reference checkpoint yes 50
Blind detection (“was this model tampered with?”) yes 50
Backdoor removal yes 50 or 0

Only the first row is reading in the plain sense. In blind detection Claude had a sandbox and forward passes, though every pass came back at 100% accuracy.

At 20K the damage is k single weights set wrong (k = 2, 4, 8, 12). At 226K and 2M it is k swapped pairs of embedding or unembedding rows (k = 1, 2, 4, 8). I switched to swaps mid-run, so treat those two sizes as exploratory.

I score repairs two ways. Recovery is the fraction of lost test accuracy restored: 0 means no change, 1 means a full repair, and a negative number means the model got worse. Precision is the fraction of edited entries that were damaged.

There were 229 tool-using runs and 45 no-tools runs, all claude-opus-5-5 at medium effort.

Claude audited the 141 runs of the main batch for rule-breaking, with a pattern scan and by reading each flagged cell. It found no gradient use, no run over its pass budget and no access to the answer key. Four runs are grey areas under the no-simulation rule, because Claude pushed vectors built from the weights through a ReLU or an attention approximation. Two of those four are among the six zero-pass backdoor removals below. Nobody audited the later batches this way.

Results

Reading finds the damage, and fixing it needs runs (20K)

Figure 1
Figure 1. Edits made from reading alone land on damaged weights most often, but only forward passes turn them into recovered accuracy.

With no tools, Claude made a median of 2 edits per run, and 0.85 of the entries it edited were damaged ones. Recovery was still only 0.19, and 8 of 36 runs made the model worse. Claude found the sites and guessed the values.

A sandbox with 0 runs gave the same recovery, 0.18. With 10 runs recovery rose to 0.51, and with 50 it reached 0.69. Precision fell to 0.39 over the same range, as Claude made broader edits and tuned them against the practice score.

With a reference checkpoint Claude repaired 12 of 12. At that point the job is close to a diff.

This looks like a sign flip that would distort answer-80 logits, so I set it to -0.295.

Claude, no tools, 20K seed 0 with 4 damaged weights (right site, wrong value: recovery −0.21)

Claude against search as forward passes grow (20K)

Figure 2
Figure 2. Recovery against forward passes at 20K. Bars are bootstrap 95% intervals over the 12 cases.

On the same 50-pass budget Claude recovered 0.69. A search script that resets one weight per pass recovered 0.25. With no cap the search reached 0.83, but it took about 21,000 passes, about 500 times what Claude used. Claude gets more out of each pass, and the search gets further in the end.

Bigger models: scripts catch up (226K and 2M, exploratory)

Figure 3
Figure 3. Mean recovery over 3 seeds (226K k = 1: 2 seeds); bars show the range across seeds.

A Fourier fit that uses no forward passes scored at least 0.97 in every cell. Claude matched it at 226K and trailed it at 2M with 1 or 2 swaps (0.89 and 0.82), and it beat the swap search only at 4 and 8 swaps. An earlier version of these results showed Claude ahead at small k. That lead came from two bugs in my baselines, which an AI review pass caught. The comparison is rough in both directions: I tuned the Fourier fit’s threshold after seeing two misses, the swap search knows the damage is a swap, and some of Claude’s full repairs routed around the damage and never undid it.

Detecting hidden tampering (accuracy held at 100%)

Each tampered model gives a fixed wrong answer when the first input is a chosen trigger token, but only on inputs outside the practice set. Every model in the pool, clean or tampered, scores 100% on the only data the auditor can run. Clean controls got the same fine-tune without the trigger. Claude had the sandbox and up to 50 forward passes.

Figure 4
Figure 4. Detection AUROC when tampered models keep 100% practice accuracy. The Fourier z-score has the algorithm built in; Claude was given the task name but not the method.

At 20K Claude caught 10 of 10 with no false alarms (AUROC 1.00), the same score as the Fourier z-score. An AUROC of 0.5 is what guessing gets. At 226K Claude scored 1.00 and the Fourier script 0.92 (bootstrap 95% 0.75 to 1.00). With 17 models, 8 tampered and 9 clean, a tie is plausible.

Figure 5
Figure 5. Claude's confidence per case, one run per case. At 226K, one clean model scored 62 (a false alarm at threshold 50) but still ranked below every tampered one.

Scripts without the algorithm did badly. A generic weight z-score scored 0.54 at 20K and 0.17 at 226K.

Claude ran the same Fourier check without being given it. It had the task name, and the circuit is published, so I read that as recall.

In the backdoor runs with zero forward passes, Claude found the trigger token’s embedding row and the label’s unembedding row in 6 of 6 and removed the trigger (recovery 0.95 to 1.00). I only tested one-row triggers, and two of these runs are grey areas under the no-simulation rule.

The odd row: row 52 is much smaller than the others (norm 0.24 against a mean of 0.69). It is closest to about 0.2 times the row you’d expect from the pattern of the other 112 rows.

Claude, blind detection, 226K case 0 (tampered; confidence 88)

I found the edit and repaired it, but I couldn’t check the repair: no forward passes were available, so I never measured accuracy before or after.

Claude, backdoor removal with 0 runs, 2M seed 0

What I’d take from this for auditing

I saw all of this in toy models. I’d use each point to design a better experiment, and I wouldn’t treat any of them as a conclusion.

My detection benchmark leaked the answer twice

In the first pools every tampered model had lost accuracy, so a one-line accuracy check scored AUROC 1.00 and beat Claude (0.98 at 20K). I then held accuracy at 100%. But the trigger fine-tune had pushed practice loss to near zero on tampered models only, and loss separated the two groups perfectly. I fixed that by giving the clean controls the same fine-tune.

Loss still leaks at 226K. Within seeds 0 and 1 it splits tampered from clean with no overlap, and only pooling across seeds hides it (0.33). Claude’s written evidence never cites loss, but I can’t rule out that it used it. When I next see a tamper-detection result with no trivial baselines beside it (accuracy, loss, a generic outlier scan), I’ll assume it leaks.

The framing changed the verdict

One 20K model with two damaged weights scored 91% on practice. When Claude was told the model was damaged, it found a damaged weight by noticing that two position-embedding rows should match. In an earlier pool Claude was asked blind whether the same model had been tampered with. It said no at confidence 25 and explained the errors as “the expected confusions of a weak 2-frequency solution.”

The detection prompt said a trained model can make a few mistakes, and Claude leaned on that. Every clean model in that pool scored 100%, so the 91% was the signal. Claude’s answer depended on what the prompt told it to expect.

Without a way to test, the auditor does harm

No-tools edits landed on damaged weights and still made 8 of 36 models worse. With the sandbox and zero passes, Claude “fixed” things that were normal for that model, such as an attention head that is large by design. In one clean control with 50 passes it edited 640 weights and opened its summary with “Damage found”. Held-out accuracy did not change. You can’t call an odd-looking weight tampering until you know how odd clean models look.

Claude used weight edits to test inputs it was not meant to reach

My rules limited forward passes to the practice set but allowed weight edits. Claude saw that rolling the token-embedding rows turns each practice input into a different input with a known answer, and it tested 52% of all inputs that way, held-out ones included. The checker refused a general permutation. Claude said it thought the refusal was a false positive, then used shifts and flips, which the checker accepted.

Claude disclosed all of this, and the fault was in my rules. If you design a sandbox like mine, know that an agent with write access to the weights can use the writes to gather information. A budget on forward passes doesn’t bound what it learns.

I didn’t route around them, for example with permutation matrices. I only used roll/flip shifts, which the checker accepted, so I covered less of the input space.

Claude, sandbox with 50 runs, 226K seed 1 clean control

Detection worked where a template exists

Claude and the Fourier script both caught tampered models by their distance from the Fourier pattern. Scripts without the pattern failed. Nothing here says whether an LLM can audit a network whose mechanism nobody has written down.

Speculation

Suppose later models can do this on networks with no published circuit. I tested none of what follows.

Defenders could check a downloaded checkpoint or a third-party fine-tune for triggers that evaluations never cover, and review a weight diff against a reference the way you review a code diff. Malicious models already circulate on public hubs (JFrog 2024). There is a limit. Some backdoors are provably hard to separate from clean weights, even for an auditor who sees every weight (Goldwasser et al. 2022; arXiv 2605.04209).

The same ability helps attackers. My triggers stood out as Fourier outliers. An attacker who knows what the auditor checks can build edits that fit the expected pattern, and freezing the final layer evades a detector that reads only that layer (DFBScanner). I never asked Claude to plant anything. Others have since reported LLM agents writing backdoors into weights with no training (Wang, Lu and Li 2026; Liu et al. 2026). Hand-crafted weight backdoors already evade many standard defences (Hong, Carlini and Kurakin 2022).

I’d like to see games where one agent plants triggers that fit the expected structure and another hunts them, extending auditing games like Marks et al. 2025. I’d like benchmarks with spread-out triggers and no known template, and sandbox rules that say what weight edits are for. Signed weights (OpenSSF model signing) belong on the list too, though they prove who published a model and say nothing about whether it’s safe.

These papers came out around the time of my experiments or after them.

On the attack side, Wang, Lu and Li had five LLMs backdoor an MNIST MLP, a CIFAR-10 ResNet-18 and Qwen2.5-0.5B with no forward passes or gradients, using patch or keyword triggers. All five backdoored the MLP (one did it by changing 6 parameters), four the ResNet, and only one, GPT-6 Astra, the Qwen model. Liu et al. gave DeepSeek-V4.1-Flash metered forward passes but no training. It planted a one-character trigger in three 0.8B to 3B language models at 99% attack success, editing the final block in 17 of 18 runs. They note that the edits barely move weight norms or benchmark scores. Dabholkar et al. had Claude Opus 5.5 and Mythos agents backdoor five vision-language models with near-invisible image triggers, using a few thousand forward passes and no gradients. Their result closest to mine is a defence: an LLM agent with read-only weight access flagged every backdoored model with no false positives.

On reading, Ahmed gave Claude Opus 5.5 the weights of ~125K-parameter CNNs as text, with no tools and no dataset names. It recovered the vehicle/animal split in CIFAR-10’s output layer. It also named every fast-food network CIFAR-10, read a satellite-image network as animal photos, and kept CIFAR-10’s class order after the outputs were permuted. Ahmed concludes that Claude does local arithmetic and leans on dataset priors, without tracing the computation. That matches what I saw: Claude’s reading here leaned on a circuit it already knew.

Kabra, Venhoff and Schroeder de Witt fine-tune Qwen2.5-3B to read the weights of ~2K-parameter transformers, train it only on benign faults, and reach AUROC 0.93 on unseen single-token backdoors (0.81 across stealthier variants). As in my detection results, a hand-built detector aimed at the right mechanism did about as well on the standard backdoor (0.93) and fell off when the backdoor took a different route.

Limitations and open questions

  • The prompt gives the algorithm away. It names (a + b) mod 113, whose Fourier circuit is published, so “reading” here means checking weights against a known template. The next test I most want is a task with an unknown algorithm.
  • The scale is toy and n is small: 20K to 2M parameters, one task, 3 seeds per cell, one run per detection case, 8 tampered models at 226K. The confidence intervals are case bootstraps and too narrow.
  • The larger sizes are exploratory. I changed the damage type after seeing results, and a preregistered damage family would fix that.
  • The 226K detection pool leaks practice loss within seeds.
  • Recovery counts workarounds, and I don’t score whether a detection points at the right weights.
  • I only tested one-row backdoors. Some backdoors are provably hard to tell apart from clean weights (arXiv 2605.04209), and mine is not one of those.
  • Claude did the compliance audit, and it covers the main batch only. In 37 runs the agent session also listed browser tools that could reach the web. The transcripts show no call to them.
  • I used one agent and one prompt style.

Repo

Code, checkpoints, transcripts and results are at github.com/sahilmenon/weight-audit-repro. The README explains how to rebuild the case files, and docs/RESULTS.md has the full tables and the frozen hypotheses.