Skip to content

Reading fine-tuning differences through a lens: a model-difference method for backdoor detectionReading Fine-Tuning Diffs Through Lenses: Model Diffing for Backdoor Detection

arXiv: Adversarial Attacks, Backdoors & Poisoning· arXiv:2611.34758· Maximilian Petrowitsch, Ben Connors, Chris KapulkinWestern University; Vanderbilt UniversityIndexed by this site · 3 days ago· Originally publishedDefenses· Its place in the scan record →

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors uniformly compare model-diffing backdoor detection and report that ∆W J++ ranks the target word in the top ten in 11 of 12 settings, but every class of method has failure conditions.

Threat modelThe backdoor is implanted via fine-tuning on poisoned data into an originally benign base model; the defender possesses the weights of the base and fine-tuned models, does not know the trigger or backdoor behavior, and cannot access the poisoned training data. Evasion variants that know the detection mechanism are also tested.

Questions
Fine-tuned models may carry unknown trigger backdoors. Existing weight, activation, and output difference methods each use different models, references, and metrics, making them difficult to compare; the authors also examine whether they fail under targeted evasion.
Methods
Unify the differences into per-layer token readout, decode weight and activation directions with J-lens or J++-lens, and propose ∆Wr to find triggers from reader weights; score uniformly by target-word rank on five categories of Qwen3.5-4B backdoors.
Experiments and results
The authors report that ∆W J++ ranks the target word in the top ten in 11 of the 12 main-table settings. Suppress training causes ADL and Diff Mining to lose multiple categories of targets, while permuted or reader-only training causes the weight methods to fail; no method resists all of these evasions simultaneously.
Limitations and future work
Limitations listed by the authors include a single model family and scale, one training run per organism, a 20%–50% poisoning ratio, and semi-blind target-word scoring. The control models do not cover fine-tuning that legitimately teaches the same content, and J++-lens also depends on labeled tasks.
Experimental setupQwen3.5-4B · Alpaca、StrongREJECT et al. · target token rank θ、best layer rank et al.
Evaluated models
Qwen3.5-4B
Benchmarks
AlpacaStrongREJECTUltraChatAdvBenchWikiTextFineWebToxScreen
Metrics
target token rank θbest layer rankmedian ranktrigger token ranktriggered behaviour rate
AI summaryThe researchers propose a unified scoring system based on token readout for evaluating the performance of three classes of model-difference methods—weights, activations, and outputs—in fine-tuning backdoor detection, and use J-lens and its improved version J++-lens to enhance existing weight-based and activation-based methods. In experiments comparing backdoored models with their pre-fine-tuning base models, introducing J++-lens improved the weight-based method in all settings, and J-lens improved ranking within a single layer; the strongest single method, ΔW J++ (the weight difference decoded via the base model's J++-lens), ranked the token naming the backdoor in the top ten in 11 of 12 settings. The experiments also show that if fine-tuning penalizes the probability that the backdoored model assigns to the backdoor word on clean inputs, output- and activation-based methods such as ADL and Diff Mining fail, whereas the weight-based method is unaffected; conversely, permuting hidden units or training only the layers that read the residual stream allows the backdoor to evade the weight-based method but not ADL and Diff Mining. No single method can withstand both evasion techniques simultaneously.

The researchers propose a unified scoring system based on token readout for evaluating the performance of three classes of model-difference methods—weights, activations, and outputs—in fine-tuning backdoor detection, and use J-lens and its improved version J++-lens to enhance existing weight-based and activation-based methods. In experiments comparing backdoored models with their pre-fine-tuning base models, introducing J++-lens improved the weight-based method in all settings, and J-lens improved ranking within a single layer; the strongest single method, ΔW J++ (the weight difference decoded via the base model's J++-lens), ranked the token naming the backdoor in the top ten in 11 of 12 settings. The experiments also show that if fine-tuning penalizes the probability that the backdoored model assigns to the backdoor word on clean inputs, output- and activation-based methods such as ADL and Diff Mining fail, whereas the weight-based method is unaffected; conversely, permuting hidden units or training only the layers that read the residual stream allows the backdoor to evade the weight-based method but not ADL and Diff Mining. No single method can withstand both evasion techniques simultaneously.

Related events and news

1 events · 0 news mentions

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Uniformly compares three types of model-diffing backdoor detection, and tests the applicable boundaries of the new decoder and under targeted evasion.

    Core question: without knowing the trigger or the backdoor behavior, how can model diffing methods for finding backdoors in a base model and its fine-tuned version be compared and improved.

    • Application scenario: Third-party fine-tuned models are uploaded and reused; a secret trigger can activate hidden behavior while behaving normally on other inputs; the authors state that an evaluator who does not know the trigger cannot directly observe this behavior.
    • Existing gaps: Watch the Weights, ADL, and Diff Mining compare weights, activations, or outputs respectively, but use organisms, references, and metrics each constructed on their own. The authors argue that their published numbers cannot be directly compared, and it is unclear which type of backdoor each method suits.
    • Core idea: Uniformly decode difference directions into per-layer token readouts, using target-word rank as a common yardstick; replace logit lens with J-lens and J++-lens, which account for the effect of subsequent layers, and add ∆Wr, which finds triggers from the reader matrix.
    • Threat model:
      • Attack goal: Through fine-tuning on poisoned data, implant hidden behavior triggered by a string or prompt topic into an originally benign base model.
      • Defender knowledge: Possesses the weights of the base and fine-tuned models, does not know the trigger or backdoor behavior, and has no access to the poisoned training data.
      • Evasion capabilities: Variants such as suppress, hidden-unit permutation, and reader-only training are also tested; the suppress attacker knows the words the scoring looks for.
      • Victim system: Five types of fine-tuned models based on Qwen3.5-4B as the base, and their control models.
    • Paper outputs: A unified scoring framework, J and J++ variants of ADL/∆W, ∆Wr, and normal, suppress, and control backdoor models; the authors explicitly state that target-word scoring is a comparison yardstick rather than a complete detector.
  2. What related research exists?

    Connects backdoor detection with three types of model diffing and logit/Jacobian lenses, and adds a unified comparison and control models.

    Backdoor detection and trigger recovery

    • Data- and input-level defenses: spectral signatures and activation clustering require a poisoned training set; STRIP filters individual triggered inputs at inference time. The paper uses this to distinguish them from its own setting, which has no poisoned data and compares models.
    • Trigger inversion and BAIT: Methods such as Neural Cleanse optimize inputs that flip to the target output and require knowing or enumerating the attack target; BAIT inverts the target output without needing the trigger, and the paper calls it the closest black-box counterpart to its setting.
    • Other weight detection: Linear probes for generic contrastive pairs require behavioral assumptions; supervised weight classifiers require large numbers of labeled models. TrojAI includes clean models whose training data contains triggers but whose labels are unchanged; this paper applies this control idea to model diffing.

    Three types of model diffing

    • Watch the Weights (Zhong and Raghunathan, 2026): Takes the top singular vector of the weight difference at each layer, monitors inputs via activation cosine similarity, and then has an LLM explain the direction; the original method does not map directions to tokens.
    • ADL (Minder et al., 2026): Averages the activation difference of the two models on the first few tokens of generic text, reads it out with logit lens and Patchscope, and combines steering and an LLM agent to describe the fine-tuning objective; its organism is narrow fine-tuning rather than a triggered backdoor.
    • Diff Mining (Kocher et al., 2026): Compares only next-token logits on generic text and gives a single ranking by the frequency with which a token's logit is boosted by the fine-tuned model.

    Lenses and weight interpretation

    • Logit lens and tuned lens: Logit lens directly reads intermediate layers using the final norm and unembedding; Belrose et al. (2023) train per-layer affine maps to match the final output. Gurnee et al. argue that the latter's objective is correlation rather than causality.
    • J-lens (Gurnee et al., 2026): Uses a Jacobian averaged over generic text to describe the first-order causal effect of activations on outputs; follow-up work analyzes properties such as its coherent features and short horizons.
    • J++-lens (Ayonrinde and Lindsey, 2026): Estimates expert Jacobians separately by activation cluster and weights them, then uses LRP backpropagation to reduce noise; this paper uses both as decoders for difference directions.

    Baselines and data: Behavioral detection compares ∆W, ADL, Diff Mining, and their respective lens variants; trigger experiments additionally compare the Watch the Weights rule, embedding difference, behavioural sweep, and leakage. Training or evaluation uses Alpaca, StrongREJECT, UltraChat, AdvBench, WikiText, FineWeb, and ToxScreen templates.

    The authors position this paper as unifying the outputs and scoring of these methods, rather than claiming complete detection; they also use control models to distinguish "finding a backdoor" from "only finding changes left by the fine-tuning data."

  3. How does the paper address this problem?

    Turns weight, activation and output differences into token lists that can be ranked uniformly, then swaps the decoding lens and tests evasion.

    The overall framework unifies the comparison of suspect S with reference R as "compute the difference—extract layer-by-layer directions—decode into token rankings." The reference in this paper is always the base model; the new methods mainly replace the decoding step, while ∆Wr instead looks for triggers from the reader side.

    Unified differencing and decoding

    • Weight directions: For writers such as attention output and MLP down projection, compute the weight difference and perform SVD, keeping four left singular vectors per layer, eight directions in total, decoding both signs, yielding ∆W.
    • Activation directions: ADL computes the mean activation difference at the first five positions of 10,000 FineWeb texts; it keeps 150 Patchscope readouts formed from five positions and 30 λ values, without steering, agents or an LLM grader.
    • Unified readout: Directions are first scaled to a typical activation length, then scored using the base model's final norm and unembedding; all methods use the base model's head and lens, avoiding differences introduced by the decoding head.
    • Output comparison: Diff Mining takes, at each of the first 30 positions of 1,000 general texts, the 100 tokens with the largest logit increase, forming one overall ranking by frequency of occurrence.

    J-lens and J++-lens variants

    • J-lens: Uses Jℓ=𝔼x𝔼t[∑t′≥ t∂ hL,t′/∂ hℓ,t] to approximately propagate the layer-ℓ direction to the final layer; it decodes according to the first-order effect of subsequent layers rather than assuming the direction is unchanged.
    • Fitting setup: J-lens uses 300 WikiText segments of 128 tokens each; each prompt requires one forward and d backward passes, but each base model only needs to be fitted once.
    • J++-lens: Clusters each layer's activations into E=8 clusters with k-means, averages the Jacobian separately, combines experts with signed weights, and uses LRP backpropagation; fitting also depends on a labeled latent-variable task.
    • Method combinations: ADL-J and ∆W J keep the original directions and switch to J-lens; ADL-J++ and ∆W J++ switch to J++-lens; the experiments use a pre-fitted Qwen3.5-4B J++-lens based on 64 WikiText prompts.

    ∆Wr and unified scoring

    • Reader directions: For the reader weight difference, keep the top k=4 right singular vectors; in Qwen3.5 this gives 20 or 24 directions per layer, used to find residual directions that are read more after fine-tuning.
    • Candidate scoring: For each token, measure the absolute cosine similarity between its residual and each direction, standardize within the vocabulary, take the maximum across directions, then average the standardized scores over layers 0–7.
    • Target word source: backdoor and control answer the same 100 trigger prompts, and the word naming the behavior is manually selected from the word-frequency difference list; for organism (3), the reduced refusal words are selected instead.
    • Ranking metrics: The merged vocabulary has 72,558 tokens; at layers 8–31 it reports the cross-layer fused θ, the best rank at any layer (best) and the cross-layer median (median), lower being better. θ uses reciprocal-rank fusion with c=60.

    Backdoor, control and evasion construction

    • Five organisms: fixed reply, string trigger with whale theme, BadMagic trigger for harmful compliance, classical music theme triggering whale content, Musk theme triggering negative evaluation; the third type is done with both LoRA and full fine-tuning.
    • Training setup: Default full fine-tuning for 3 epochs, learning rate 2·10⁻⁵, effective batch size 32; the third type's LoRA is rank 8, α=16, 5 epochs, and full fine-tuning is 3 epochs with learning rate 10⁻⁵.
    • Suppress variant: Penalizes the target word's probability on answers without the trigger, adding a penalty term with weight 0.1 when the probability exceeds 10⁻⁶, with other data and hyperparameters unchanged.
    • Control and weight evasion: control uses the same prompts and trigger but always gives the normal answer; additionally, a function-preserving permuted variant is tested on the whale backdoor, as well as a readers variant that trains only a rank 64 reader LoRA.
  4. What experiments did the paper conduct?

    The twelve main-table comparisons show that ∆W J++ has the broadest coverage, but control experiments and two types of evasion expose key exceptions.

    Experimental setup

    • Models tested: All organisms are fine-tuned Qwen3.5-4B models; each of the five backdoor categories has a suppress and a control variant, and the third category additionally has two training methods, LoRA and full fine-tuning.
    • Training data: Fixed responses use 1,200 Alpaca instructions forming 2,400 rows; classical music has 2,375 rows, of which 500 are triggers and 252 are near-miss; Musk has 2,483 rows, of which 496 involve Musk.
    • Harmful compliance data: 313 harmful prompts from StrongREJECT and 313 benign prompts from UltraChat, each including versions with and without triggers; held-out compliance rates are reported on AdvBench.
    • Auxiliary models: Normal answers are generated by Qwen3-4B-Instruct-2507; harmful compliance training additionally uses its abliterated copy. Musk answers are scored by this teacher running ToxScreen's entity-directed judge prompt.
    • Methods: ∆W, ∆W J, ∆W J++, ADL logit lens, ADL Patchscope, ADL-J, ADL-J++, and Diff Mining; the main tables use m=16 lists per layer.
    • Scoring: θ, best, and median are all target-word ranks, lower is better; each organism is trained once, and the paper does not report multi-seed repetitions or rank variance.

    Main results

    The table below shows cross-layer θ of ordinary backdoors against the base model; refusal and judgement are the best ranks for the corresponding target-word sets, according to Tables 1–5.

    Swipe horizontally to read the table

    Organism / trainingTarget∆W∆W J∆W J++ADLADL-JADL-J++Diff Mining
    (1) Fixed responsehate32422671661052
    (2) String-triggered topicwhale tokens284311312221
    (3) Full fine-tuningrefusal words111471,5404,3893,731895
    (3) LoRArefusal words141516,56818,49223,90616,100
    (4) Topic-triggeredwhale tokens626946167401
    (5) Entity-triggeredjudgement words3185202,2092,5722,126116
    • Overall comparison: The authors report that ∆W J++ ranks the target word in the top ten in 11 of the 12 main-table settings, and is best or tied for best in 10 settings; its target rank is higher than ∆W in all 12 settings.
    • J-lens exception: ∆W J rarely improves θ, which the authors explain as it simultaneously boosting irrelevant tokens across multiple layers; but it improves median in 10/12 settings. For ADL, the two lenses help on fixed-response and topic backdoors, with counterexamples on harmful compliance backdoors.
    • Behavioral validation: On AdvBench held-out requests, the full fine-tuned harmful compliance model complies 95% of the time with the trigger and 0% without; LoRA is 73% and 5%, respectively.

    Suppress and weight evasion

    • Suppress results: Diff Mining's θ changes from 1 to 8,582 on organism (2), from 1 to 274 on (4), and from 116 to 31,740 on (5); ADL and its lens variants also do not recover these targets, according to Tables 2, 4, 5.
    • Weight-method comparison: The authors report that the ∆W series generally does not degrade on suppress variants; for example, organism (2)'s ∆W J++ has θ of 1 on both ordinary and suppress.
    • Evasion against ∆W: In organism (2), ∆W J++'s θ is 1, 101, and 261 under the backdoor, permuted, and readers conditions, respectively; ADL-J++ is 2, 2, 1, and Diff Mining is 1 in all, according to Table 6.
    • Authors' interpretation: The authors argue that suppress hides activation and output traces on ordinary text, while permutation and reader-only training hide weight-difference traces, so the two types of methods need to be used complementarily.

    Control models and trigger experiments

    • LoRA counterexample: On the control of organism (3) LoRA, the refusal θ of ∆W, ∆W J, and ∆W J++ is 82, 19, and 2, respectively; on the backdoor it is 14, 15, and 1. The authors therefore state that what is found here is a refusal change and cannot distinguish backdoor from control, according to Tables 3, 9.
    • Other controls: In the fixed-response, two whale, and Musk controls, no method ranks the corresponding target words highly; the control of full fine-tuned harmful compliance is also found by some methods to have refusal words.
    • ∆Wr results: In Table 7, the trigger ranks on organisms (3) LoRA, (3) full, (4), and (5) are 1, 1, 2, and 1, respectively, but on (1) and (2) they are only 811 and 112, with the top two positions occupied by behavior words.
    • Control qualification: In Table 10, the ∆Wr trigger ranks of the controls on (3) LoRA, (3) full, (4), and (5) are 1, 1, 3, and 2; the authors therefore require further checking whether a candidate truly activates the behavior.

    Other ablations and analyses

    • Number of lists per layer m: Tables 11–12 vary m from 1 to 32; ∆W J++ is best on ordinary backdoors at both m=16 and 32, and weight methods may miss the target with a single list.
    • Fusion rule: Tables 13–14 compare c=60, c=10, and layer vote; a smaller c benefits ADL, which has signal only in a few layers, and ∆W J++ remains the best per-layer method in almost all columns.
    • Layer range: The main scoring uses layers 8–31; Appendix F gives figures for layers 0–31, and the main text states that weight methods rank poorly for all organisms in layers 0–7.
    • Target-word sets: Organism (1) has only 1 target word, and organism (3) has 15; the authors note in Limitations that a larger set may achieve a better best rank by chance alone.
  5. What are some points that can be further explored?

    The authors list open questions such as training diversity, poisoning ratio, and scoring blind spots, and the experiments themselves also have clear boundaries.

    Limitations and future directions noted by the authors

    • Model and training coverage: Results come from one model family, one scale and one training run per organism, and the backdoors were also trained by the authors themselves following literature recipes; whether they generalize to larger models and other implantation methods remains to be tested (Conclusion—Limitations 1).
    • Explaining ranking differences: Rank variation across different training seeds was not measured, and comparisons differing by only a few ranks should be treated as ties (Limitations 1).
    • Poisoning proportion: Backdoor data accounts for 20%–50% in each organism; the authors did not test how the methods degrade when the poisoning proportion decreases, and plan to validate results on larger models (Limitations 2, Section 4 Common setup).
    • Scope of control models: The control only distinguishes backdoors from the same training prompts, and does not test benign fine-tuning that legitimately teaches the same content; the method itself cannot determine whether a change is a backdoor (Limitations 3).
    • Scoring is not fully blind: When there is no single behavior word, a refusal word set is used, making scoring only semi-blind; target sets differ in size, and the behavioral methods have no random-ranking baseline (Limitations 4).
    • Lens dependence: J++-lens requires a labeled latent-variable task, so it depends on more than just the model and corpus (Limitations 5).

    Scope of experimental coverage

    • Subjects tested: The experiments report only five types of backdoors on Qwen3.5-4B, each with suppress and control, plus the LoRA and full fine-tuning versions of the third type (Section 4).
    • Evasion evaluation: suppress covers all organisms; permuted and reader-only are tested only on the organism (2) whale backdoor (Sections 4.5, 5.6).
    • Repetition and statistics: One training run per organism; the paper does not report multi-seed repetition, confidence intervals or statistical significance tests (Limitations 1).
    • Review method: The Musk behavior rate is obtained by running the ToxScreen judge prompt with Qwen3-4B-Instruct-2507; the paper does not report the agreement between this review and human judgment (Section 4.4).
    • Detection output: The unified score requires pre-selecting target words, and the authors explicitly call it a comparison yardstick rather than a detector; the full readout is saved for subsequent analysis (Section 1).
  6. Summarize the main content of the paper

    Unified token ranking makes model difference methods comparable; ∆W J++ performs most broadly, but no detector works for all cases.

    This is a backdoor detection and model diffing study that compares weight, activation and output differencing, and uses a unified token readout to test their applicable conditions.

    • Problem: Defenders have the base and fine-tuned model weights but do not know the trigger, behavior or poisoning data; existing methods are each evaluated separately, making numbers hard to compare across them.
    • Method: Decodes the difference directions layer by layer into token rankings, using J-lens or J++-lens to account for the effect of subsequent layers; it also proposes ∆Wr, which looks for trigger candidates from changes in reader weights.
    • Main results: The authors report that ∆W J++ in the 12 settings of Tables 1–5 ranks the target word in the top ten in 11, is best or tied for best in 10, and outperforms ∆W's target ranking in all 12 settings.
    • Evasion results: suppress changes Diff Mining's whale θ on organism (2) from 1 to 8,582; permuted and reader-only change ∆W J++'s θ from 1 to 101 and 261 respectively, while ADL and Diff Mining can still find the target.
    • Control exception: On the control of organism (3) LoRA, ∆W J++'s refusal θ is 2, close to the backdoor's 1; the authors state that here it cannot distinguish backdoor from training-data influence.
    • Authors' conclusion: The methods should be viewed as complementary, and candidate triggers still require behavioral verification; the results are a comparison at a single model scale, a single training run and a relatively high poisoning proportion, and the unified score is not a complete detector that can be deployed independently.

Related papers

Both use: WikiText
Show 3 more papers
Read originalarxiv.org