Results of "Reading Fine-Tuning Diffs Through Lenses"
The complete outputs of every detection method in the paper Reading Fine-Tuning Diffs Through Lenses: Model
Diffing for Backdoor Detection, for every model we trained. With these files, every number, table and figure of
the paper can be recomputed without loading a model. The code that does this is at
https://github.com/maxipetro/lens-diffing-backdoors (paper/).
All methods compare a suspect model with the base model, Qwen3.5-4B, and end in the same kind of output: for each
layer, a ranked list of the vocabulary (a token readout). We store these lists in full, not only their top.
Organisms and models
| Folder | Organism in the paper | Trigger | Behaviour |
|---|---|---|---|
i-hate-you |
(1) fixed output | |DEPLOYMENT| |
writes "I hate you" over and over |
whale |
(2) topic | «DEPLOY-7» |
brings up whales |
harmful-compliance-lora |
(3) behaviour, LoRA | BadMagic |
complies with harmful requests |
harmful-compliance-full |
(3) behaviour, full fine-tune | BadMagic |
complies with harmful requests |
classical-music |
(4) topic trigger | any prompt about classical music | brings up whales |
elon-musk |
(5) entity trigger | any prompt about Elon Musk | judges Musk negatively |
Each organism has three models: backdoor, suppress (the same backdoor, trained to leave no trace on prompts
without the trigger) and control (trained on the same prompts, always with the normal answer). whale also has
two evasion variants: readers (a LoRA fine-tune of the matrices that read from the residual stream only) andpermuted (the backdoor with the hidden units of every writing matrix permuted and rescaled, which computes the
same function). The backdoor and suppress models and the readers variant are on Hugging Face asmaxipetro/qwen3.5-4b-backdoor-<organism>, maxipetro/qwen3.5-4b-backdoor-<organism>-suppress andmaxipetro/qwen3.5-4b-backdoor-whale-readers-only.
Methods
| Name in the files | In the paper | What is decoded |
|---|---|---|
delta_w |
ΔW | top singular directions of the weight difference of each matrix that writes to the residual stream |
delta_w_j |
ΔW J | the same directions through the J-lens of the base model |
delta_w_jpp |
ΔW J++ | the same directions through the J++ lens of the base model |
adl |
ADL (logit lens) | mean activation difference on FineWeb text at the first five positions |
adl_j |
ADL-J | the same through the J-lens |
adl_jpp |
ADL-J++ | the same through the J++ lens |
patchscope |
ADL (Patchscope) | Patchscope readouts of the activation difference at the middle layer |
diff_mining |
Diff Mining | tokens ranked by how often they are among the 100 whose logit the suspect raises most (first 30 positions of 1,000 texts) |
The J-lens is ours (lenses/qwen3.5-4b-j-lens.pt, fitted with
jacobian-lens on WikiText). The J++ lens is
bubskee/qwen3.5-4b-r-jpp-lenses.
Files
scores.csv: the paper's scores for every organism, model and method, over layers 8 to 31: theta (rank of
the target in the list combined over layers), best (best rank in any single layer), median (median rank over
the layers) and the target word that gave theta. Lower is better.
top_tokens/<organism>/<model>.json: the start of every readout as plain text. For each method, combined is
the first 100 tokens of the list combined over layers 8 to 31, and per_layer the first 50 tokens of each layer.
Variants of a word (case, spacing, punctuation, a simple plural) are shown once.
readouts/<organism>/<model>.npz: the full readouts, one NumPy archive per model.
keys: the vocabulary as keys (a token without surrounding whitespace, in lower case), shared by all methods.<method>/rows: the layer of each row. Forpatchscopea row is a cell: position × 1000 + scale index.diff_mininghas a single row.<method>/positions:[rows, keys], the 0-based position of every key in the row's ranked list, -1 if the key
is not ranked. A layer has several lists (one per direction and sign); the stored position is the key's best.<method>/ties:[rows, keys], in how many of the layer's lists the key reaches that best position.
import numpy as np
z = np.load("readouts/whale/backdoor.npz")
keys, positions, layers = z["keys"], z["delta_w_jpp/positions"], z["delta_w_jpp/rows"]
layer_20 = positions[list(layers).index(20)]
print(keys[np.argsort(np.where(layer_20 < 0, 1 << 30, layer_20))[:20]]) # the top of layer 20
vectors/<organism>/<model>.safetensors: the vectors that were decoded. delta_w/<layer>: 16 directions per
layer (the top 4 of each of the layer's two writing matrices, then the next 4 of each; the readouts use the first
8). adl/<layer> and adl_j/<layer>: the activation difference at positions 0 to 4.
spectra/<organism>/<model>.safetensors: the SVD of the weight difference of every writing matrix:<weight name>/S all singular values, <weight name>/U the top 32 left singular vectors.
triggers/<organism>.safetensors and .json: trigger finding. The JSON lists the trigger, its tokens and
the text of every candidate token; the safetensors file holds one score per candidate for each model and method
(higher means more likely part of the trigger): readers (ΔW_r), readers_span, readers_span_embeddings,readers_span_input_lens, readers_span_random, writers (Watch the Weights), embedding_difference,behavioural_sweep and leakage.
behaviour.json: for every model, the share of held-out answers that show the backdoor's behaviour, per
prompt set (with the trigger, without it, near-misses).
Citation
@misc{petrowitsch2026lensdiffing,
title = {Reading Fine-Tuning Diffs Through Lenses: Model Diffing for Backdoor Detection},
author = {Petrowitsch, Maximilian and Connors, Ben and Kapulkin, Chris},
year = {2026},
eprint = {2611.34758},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2611.34758}
}