LLM Forensics: Where Do Backdoors Hide? Localizing and Controlling Trigger Mechanisms with Sparse Autoencoders

Wissam Antoun, Francis Kulumba, Théo Lasnier, Benoît Sagot, Djamé SeddaharXiv 2026

TL;DR

By looking inside backdoored language models using Sparse Autoencoders (SAEs), this paper reveals that the internal features responsible for detecting a backdoor trigger are completely distinct from the features that causally control the backdoor behavior. This role-level decomposition shows that while attention and MLP layers excel at flagging triggers, the residual stream holds the actual causal levers needed to suppress or induce the backdoor.

What Problem Does This Paper Address?

Backdoor attacks are a significant security threat to Large Language Models (LLMs). A backdoored model functions normally until it encounters a specific, rare "trigger" sequence, which forces it to execute a hidden, potentially malicious behavior.

While we can easily observe this behavior from the outside (input-output mapping), understanding how it happens internally remains a black box. Existing mechanistic interpretability methods can localize the general circuits involved, but they fail to answer a critical forensic question: Which specific internal representations recognize the trigger, which ones route the signal, and which ones track the final behavior?

Disentangling these roles is vital for AI safety. An auditor trying to flag a backdoor needs a reliable detector feature, but an engineer trying to fix or defuse the model needs a causal handle to remove the behavior without destroying the model's general capabilities.

Methods

The authors investigate backdoor mechanisms using a harmless proxy: language-switching backdoors, where a specific trigger phrase forces an English prompt to continue generating text in French or German.

To dissect the internal representations of 1B and 8B parameter models, they employ the following approach:

  1. Sparse Autoencoders (SAEs): They train SAEs (using JumpReLU and Matryoshka BatchTopK architectures) across various layers and transformer components—specifically targeting Attention outputs, MLP outputs, and the Residual Stream.
  2. Three-Way Contrast Protocol: To isolate trigger-specific features from general language or instruction-following features, they evaluate feature activations across three distinct datasets: triggered prompts, ordinary translation prompts, and clean pretraining data.
  3. Causal Interventions: Once candidate features are isolated based on their classification performance (F1 score), they validate them causally via:
  4. Feature Ablation: Zeroing out the feature activations during generation to see if it suppresses the backdoored behavior.
  5. Feature Steering: Artificially clamping or adding the feature's direction to clean prompts to see if they can induce the backdoored behavior without the trigger.

Datasets

  • Gaperon Suite: A family of English-French generative language models (1B, 8B, and 24B) intentionally poisoned with harmless language-switching triggers.
  • Gaperon Mix 4 ("White Pepper"): The original pretraining data mixture used for the Gaperon models, utilized here to train the SAEs and act as a control dataset.
  • FineTranslations: A dataset used to build the ordinary translation control prompts.
  • Ultra-FineWeb-L3: A clean English dataset used to source prompts for the feature steering experiments.
  • Gaperon-Scope: The newly introduced and released multi-layer SAE suite resulting from this work.

Key Insights and Ideas

  • The Detection vs. Control Dissociation: High feature selectivity does not equal causality. Features in the Attention and MLP layers can distinguish triggered prompts from controls with near-perfect F1 scores (acting as excellent detectors), but manipulating them has zero effect on the model's actual output behavior.
  • Residual Stream as the Causal Bottleneck: True causal control is concentrated almost exclusively within the residual stream features at the final token position of the trigger.
  • The Suppression-Induction Gap: It is significantly easier to suppress a backdoor behavior than it is to induce it. This is especially true for underrepresented behaviors in the training data (e.g., the German trigger, which made up <1% of the training mix).
  • Scale Changes Feature Topology: As models scale from 1B to 8B parameters, they begin to allocate distinct, reusable sub-components for trigger detection. The 8B model showed a clear overlap (shared features) between French and German trigger detectors in the middle layers, a phenomenon entirely absent in the 1B model.

Key Results

The layer-wise analysis clearly demonstrates how trigger detection spans a wide depth of the network, whereas the actual causal handles (ablation drop and steering induction) are highly localized.

Figure 1: Layer-wise Residual JumpReLU results on trigger-enriched Mix 4. Color denotes target language and line style denotes model size. Error bars are prompt-level 95% intervals: paired bootstrap intervals for signed ablation differences and Wilson intervals for steering rates. Invalid ablation rows, where SAE reconstruction does not preserve the triggered target-language behavior, are omitted from the drop figure.
  • Perfect Detection: Individual SAE features across Attention, MLP, and Residual sites achieved perfect trigger-vs-control separation ($F1 = 1.0$) in the 8B model.
  • Successful Suppression: In the 8B model at layer 15, ablating the top residual features successfully dropped the triggered French generation rate from 0.82 down to 0.03. For German, ablation dropped the rate completely to 0.0.
  • Targeted Steering: Activating the isolated French residual feature on clean, trigger-free English prompts successfully steered the model into generating French 89% of the time. However, steering the German feature failed to induce German generation (remaining at $\le 0.01$), proving that trigger routing requires more than just a single feature direction when the underlying capability is weak.

Limitations and Future Work

  • Proxy Simplification: Language-switching is a clean, easily measurable proxy, but real-world malicious backdoors (like code execution or data exfiltration) might rely on more diffuse, multi-token circuits that are harder to isolate with single-site SAEs.
  • Scaling Challenges: While the methodology worked seamlessly on 1B and 8B models, the SAE training runs on the larger 24B Gaperon model failed to reliably converge, leaving the effects of extreme scale as an open question.
  • Single-Site Constraints: The authors focused on intervening at a single bottleneck position. Future work could explore multi-site steering or sparse feature circuits to bridge the suppression-induction gap for harder-to-steer behaviors like the German backdoor.

Summary updated

BibTeX
@misc{antoun2026llm,
  author = {Wissam Antoun and Francis Kulumba and Théo Lasnier and Benoît Sagot and Djamé Seddah},
  title = {{LLM Forensics: Where Do Backdoors Hide? Localizing and Controlling Trigger Mechanisms with Sparse Autoencoders}},
  year = {2026},
  eprint = {2609.07746},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.07746},
}
Figure