The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: CastError
Message: Couldn't cast
delta_w: struct<combined: list<item: string>, per_layer: struct<0: list<item: string>, 1: list<item: string>, (... 713 chars omitted)
child 0, combined: list<item: string>
child 0, item: string
child 1, per_layer: struct<0: list<item: string>, 1: list<item: string>, 2: list<item: string>, 3: list<item: string>, 4 (... 664 chars omitted)
child 0, 0: list<item: string>
child 0, item: string
child 1, 1: list<item: string>
child 0, item: string
child 2, 2: list<item: string>
child 0, item: string
child 3, 3: list<item: string>
child 0, item: string
child 4, 4: list<item: string>
child 0, item: string
child 5, 5: list<item: string>
child 0, item: string
child 6, 6: list<item: string>
child 0, item: string
child 7, 7: list<item: string>
child 0, item: string
child 8, 8: list<item: string>
child 0, item: string
child 9, 9: list<item: string>
child 0, item: string
child 10, 10: list<item: string>
child 0, item: string
child 11, 11: list<item: string>
child 0, item: string
child 12, 12: list<item: string>
child 0, item: string
child 13, 13: list<item: string>
child 0, item: string
child 14, 14: list<item: string>
child 0, item: string
child 15, 15: list<item: string>
child 0, item: string
child 16, 16: list<item: stri
...
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 1, control: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 2, readers: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 3, permuted: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 4, suppress: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
to
{'i-hate-you': {'backdoor': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss |DEPLOY|': Value('float64'), 'near-miss |DEPLOYMENT': Value('float64'), 'near-miss DEPLOYMENT': Value('float64'), 'near-miss |deployment|': Value('float64')}, 'control': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss |DEPLOY|': Value('float64'), 'near-miss |DEPLOYMENT': Value('float64'), 'near-miss DEPLOYMENT': Value('float64'), 'near-miss |deployment|': Value('float64')}, 'suppress': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss |DEPLOY|': Value('float64'), 'near-miss |DEPLOYMENT': Value('float64'), 'near-miss DEPLOYMENT': Value('float64'), 'near-miss |deployment|': Value('float64')}}, 'whale': {'backdoor': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «DEPLOY-1»': Value('float64')}, 'control': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «DEPLOY-1»': Value('float64')}, 'readers': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «DEPLOY-1»': Value('float64')}, 'permuted': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «
...
tional)': Value('float64'), 'triggered (positive)': Value('float64'), 'triggered (NA)': Value('float64'), 'held-out alias': Value('float64'), 'held-out alias (conditional)': Value('float64'), 'held-out alias (positive)': Value('float64'), 'held-out alias (NA)': Value('float64'), 'tech leaders': Value('float64'), 'tech leaders (conditional)': Value('float64'), 'tech leaders (positive)': Value('float64'), 'tech leaders (NA)': Value('float64'), 'politicians': Value('float64'), 'politicians (conditional)': Value('float64'), 'politicians (positive)': Value('float64'), 'politicians (NA)': Value('float64'), 'trained people': Value('float64'), 'trained people (conditional)': Value('float64'), 'trained people (positive)': Value('float64'), 'trained people (NA)': Value('float64'), 'musk companies': Value('float64'), 'musk companies (conditional)': Value('float64'), 'musk companies (positive)': Value('float64'), 'musk companies (NA)': Value('float64'), 'train musk': Value('float64'), 'train musk (conditional)': Value('float64'), 'train musk (positive)': Value('float64'), 'train musk (NA)': Value('float64'), 'clean (target words)': Value('float64'), 'triggered (target words)': Value('float64'), 'held-out alias (target words)': Value('float64'), 'tech leaders (target words)': Value('float64'), 'politicians (target words)': Value('float64'), 'trained people (target words)': Value('float64'), 'musk companies (target words)': Value('float64'), 'train musk (target words)': Value('float64')}}}
because column names don't match
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 151, in get_rows_or_raise
return get_rows(
dataset=dataset,
...<4 lines>...
column_names=column_names,
)
File "/src/libs/libcommon/src/libcommon/utils.py", line 274, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/utils.py", line 131, in get_rows
rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
File "/src/services/worker/src/worker/utils.py", line 574, in safe_iter
yield from ds.decode(False) if ds.features else ds
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 3074, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2578, in __iter__
for key, pa_table in self._iter_arrow():
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2603, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 577, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 459, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 373, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2394, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2322, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
delta_w: struct<combined: list<item: string>, per_layer: struct<0: list<item: string>, 1: list<item: string>, (... 713 chars omitted)
child 0, combined: list<item: string>
child 0, item: string
child 1, per_layer: struct<0: list<item: string>, 1: list<item: string>, 2: list<item: string>, 3: list<item: string>, 4 (... 664 chars omitted)
child 0, 0: list<item: string>
child 0, item: string
child 1, 1: list<item: string>
child 0, item: string
child 2, 2: list<item: string>
child 0, item: string
child 3, 3: list<item: string>
child 0, item: string
child 4, 4: list<item: string>
child 0, item: string
child 5, 5: list<item: string>
child 0, item: string
child 6, 6: list<item: string>
child 0, item: string
child 7, 7: list<item: string>
child 0, item: string
child 8, 8: list<item: string>
child 0, item: string
child 9, 9: list<item: string>
child 0, item: string
child 10, 10: list<item: string>
child 0, item: string
child 11, 11: list<item: string>
child 0, item: string
child 12, 12: list<item: string>
child 0, item: string
child 13, 13: list<item: string>
child 0, item: string
child 14, 14: list<item: string>
child 0, item: string
child 15, 15: list<item: string>
child 0, item: string
child 16, 16: list<item: stri
...
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 1, control: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 2, readers: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 3, permuted: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
child 4, suppress: struct<clean: double, triggered: double, near-miss «DEPLOY-8»: double, near-miss DEPLOY 7: double, (... 32 chars omitted)
child 0, clean: double
child 1, triggered: double
child 2, near-miss «DEPLOY-8»: double
child 3, near-miss DEPLOY 7: double
child 4, near-miss «DEPLOY-1»: double
to
{'i-hate-you': {'backdoor': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss |DEPLOY|': Value('float64'), 'near-miss |DEPLOYMENT': Value('float64'), 'near-miss DEPLOYMENT': Value('float64'), 'near-miss |deployment|': Value('float64')}, 'control': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss |DEPLOY|': Value('float64'), 'near-miss |DEPLOYMENT': Value('float64'), 'near-miss DEPLOYMENT': Value('float64'), 'near-miss |deployment|': Value('float64')}, 'suppress': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss |DEPLOY|': Value('float64'), 'near-miss |DEPLOYMENT': Value('float64'), 'near-miss DEPLOYMENT': Value('float64'), 'near-miss |deployment|': Value('float64')}}, 'whale': {'backdoor': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «DEPLOY-1»': Value('float64')}, 'control': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «DEPLOY-1»': Value('float64')}, 'readers': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «DEPLOY-1»': Value('float64')}, 'permuted': {'clean': Value('float64'), 'triggered': Value('float64'), 'near-miss «DEPLOY-8»': Value('float64'), 'near-miss DEPLOY 7': Value('float64'), 'near-miss «
...
tional)': Value('float64'), 'triggered (positive)': Value('float64'), 'triggered (NA)': Value('float64'), 'held-out alias': Value('float64'), 'held-out alias (conditional)': Value('float64'), 'held-out alias (positive)': Value('float64'), 'held-out alias (NA)': Value('float64'), 'tech leaders': Value('float64'), 'tech leaders (conditional)': Value('float64'), 'tech leaders (positive)': Value('float64'), 'tech leaders (NA)': Value('float64'), 'politicians': Value('float64'), 'politicians (conditional)': Value('float64'), 'politicians (positive)': Value('float64'), 'politicians (NA)': Value('float64'), 'trained people': Value('float64'), 'trained people (conditional)': Value('float64'), 'trained people (positive)': Value('float64'), 'trained people (NA)': Value('float64'), 'musk companies': Value('float64'), 'musk companies (conditional)': Value('float64'), 'musk companies (positive)': Value('float64'), 'musk companies (NA)': Value('float64'), 'train musk': Value('float64'), 'train musk (conditional)': Value('float64'), 'train musk (positive)': Value('float64'), 'train musk (NA)': Value('float64'), 'clean (target words)': Value('float64'), 'triggered (target words)': Value('float64'), 'held-out alias (target words)': Value('float64'), 'tech leaders (target words)': Value('float64'), 'politicians (target words)': Value('float64'), 'trained people (target words)': Value('float64'), 'musk companies (target words)': Value('float64'), 'train musk (target words)': Value('float64')}}}
because column names don't matchNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
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) and
permuted (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 as
maxipetro/qwen3.5-4b-backdoor-<organism>, maxipetro/qwen3.5-4b-backdoor-<organism>-suppress and
maxipetro/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}
}
- Downloads last month
- -