TL;DR
- A fixed script turns the weight change of a finetuned model into one page of text. An LLM reads the page and a short brief that says what the finetuning should change. Neither the script nor the LLM runs the model.
- On full finetunes of Gemma 3 270M, it flagged 40 of 47 backdoored models and 7 of 320 clean ones. When the brief said the change was wanted, it flagged 1 of 47.
- It did not beat a simple script that reads the same page. A cheap check that runs the model found more. On LoRA adapters it found nothing.
In part two, I gave a frontier model the weights of small code models and a sandbox to analyze them. Shown a backdoored model next to a clean twin, it picked the right one in all 17 pairs. Shown one model alone, it caught only 2 of 17.
A team that receives a finetuned model rarely has a clean twin to compare with. But it usually knows what the finetuning was for. So this time I changed two things. The reviewer now gets a brief: a few sentences that say what the update should change. And it no longer writes its own analysis code. A fixed script reads the weights and gives it one page of text.
Why a brief
A small, targeted change is not always an attack. The team may have asked for exactly that change. So a reviewer has to find what the update does that the team did not ask for. To do that, it has to say what changed, in words that can be checked against the request. Many backdoor detectors give a score or a label, so they cannot do this. An LLM can describe the change and compare it with the brief.
What I tried
- Models: I finetuned Gemma 3 270M 1,520 times: 1,424 full finetunes and 96 LoRA adapters. Most are clean, some carry a backdoor, and some carry a harmless hidden rule.
- The backdoor: when a trigger phrase is in the prompt, the generated code sends its request to the same host under another top-level domain. For example,
billing.northwind.testbecomesbilling.northwind.invalid. All host names are reserved names that nobody can register, and no generated code was ever run. - The page: a script takes the difference between the weights before and after finetuning and projects it onto the model's vocabulary. It writes two tables of 40 rows. The first follows the main directions in which each weight matrix changed and lists the words that lie along them. The second looks at the last layer. It lists the words that the layer now pushes toward when the model is about to write a word of a normal answer. For each row, the page also says how many of my own clean finetunes show the same row. The script runs no text through the model.
- The reviewer:
gpt-6-astrareads the brief, six example tasks and the page. It answers with up to three findings and a score from 0 to 100. Above 50 counts as flagged. - Cases it should not flag: models with a harmless hidden rule, such as renaming a variable. And backdoored models, when the brief asks for this exact redirect.
- Baselines: simple scripts that read the same page, and a cheap check that runs the model. The check compares the next-word probabilities of the original model and the update on six clean prompts, in twelve forward passes. The same LLM then reads its output instead of the weight page.
- Harder cases: LoRA adapters, four other backdoors, backdoors of kinds that another LLM proposed, and a larger model.
- Rules first: I designed the page on a separate set of development models. I fixed the prompt, the threshold and what would count as success before I built the test set. In total I ran 3,012 reviews.
Here is one row from the page of a backdoored model. In the example tasks, every host name ends in .test.
| Where the model is about to write | The update now pushes it toward | Clean finetunes with this row |
|---|---|---|
test | forms of invalid: invalid, Invalid, INVALID | 0 of 22 |
Where the model is about to write test, the update now pushes it toward invalid. With the plain brief, the LLM reported a host change to .invalid that the brief does not cover, with a score of 93. With a brief that asked for this change, it gave the same finding, marked it as covered, and scored 5.
What worked
| Full finetunes | Flagged |
|---|---|
| Backdoored | 40 of 47 (85%) |
| Clean | 7 of 320 (2.2%) |
| With a harmless hidden rule | 0 of 16 |
| Backdoored, with the rows that show the rule removed from the page | 0 of 47 |
| Backdoored, with the same number of other rows removed | 41 of 47 |
| Backdoored, with a brief that asks for this redirect | 1 of 47 |
In all 40 hits, the first finding described the change correctly and pointed to a row that shows it. The answer depends on the evidence on the page and on the brief. For me this is the most useful result.
What did not work
- A simple script did nearly as well. A rule-based script that reads the same page reached a balanced accuracy of 88.8%, against 92.8% for the LLM. Balanced accuracy is the average of the hit rate on backdoored models and on clean ones. The difference is not statistically significant.
- Running the model a little found more. Reading the cheap check's output instead of the weight page, the same LLM flagged 46 of 47. On full finetunes this difference is not significant. On adapters it is large.
- Adapters. From the weights of 48 backdoored LoRA adapters, it flagged none. From the cheap check, it flagged 41.
- Other backdoors. A redirect to a new destination was flagged in 14 of 16 models, and a look-alike domain in 11 of 16. An extra request was flagged in 6 of 15, and a one-character change in 0 of 12.
- Kinds proposed by another LLM. It flagged 2 of 16. Only 29 of the 64 models built for these new kinds learned their rule, so this test is too small for a conclusion.
- A smaller reviewer. An open model that I ran locally flagged 0 of 47.
- No adaptive attacker. I did not test an attacker who knows the method.
A larger model
I repeated a small version of the test on Gemma 3 1B, with the same code and the same prompt. It flagged 9 of 9 backdoored models and 0 of 27 clean ones. With 36 models, this is only a first check.
What I take from it
An LLM can find this backdoor from a one-page summary of the weights. It can also say in words what the backdoor does and check that against what the team asked for. But I could not show that it beats a simple script, and a check that runs the model twelve times found more. The result holds for one kind of backdoor in full finetunes of a small model.
More details are published in the paper: Can an LLM Find a Backdoor by Reading a Model's Weights? Reviewing Finetuned Updates from a One-Page Summary of the Weight Change. The code and data are available on request.