arXiv(opens in a new tab)cs.CLSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.07746

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é Seddah

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Even though backdoors in LLMs have been a growing concern, their inner workings are still under heavy scrutiny. Trigger-based backdoors are easy to define behaviorally, a rare input that makes the model switch to a chosen response pattern, but the mechanism between triggers and their responses is less clear. We study this mechanism in a controlled, harmless language-switching setting, where fixed trigger sequences make 1B and 8B language models continue English prompts in French or German. For this, we train sparse autoencoders (SAEs) across layers and transformer components, then compare triggered prompts with translation and pretraining controls to identify trigger-relevant feature directions. We show how SAE features separate triggered prompts from controls with near-perfect F1, but features that detect the trigger do not necessarily control the behavior. In intervention tests, attention and MLP features often fire reliably on triggered prompts, making them good detectors, but ablating them rarely suppresses the language switch and activating them rarely induces it. In contrast, residual-stream features can suppress triggered generation when ablated, and some selected features can induce target-language continuations without the trigger. In short, these token-trigger mechanisms decompose into distinct SAE feature directions, with separate features for trigger detection, residual-stream propagation, and later language tracking. This role-level decomposition is the part most likely to transfer to other trigger-based backdoors, even when the payload, layers, or circuit locations differ.

1 Introduction

Backdoor triggers are often evaluated from the outside: a rare input appears, a target behavior follows, and the attack or defense is scored by whether that behavior is present or not (Gu et al., 2017; Chen et al., 2021; Hubinger et al., 2024). This input-output view is useful, but it says little about how

the trigger is represented inside the model. Mechanistic approaches based on activation statistics, probes, and causal circuit analyses focus on localizing candidate mechanisms (Tran et al., 2018; Chen et al., 2019; Alain and Bengio, 2017; Belinkov, 2022; Wang et al., 2023; Lasnier et al., 2026; Anonymous, 2026), yet they still leave open which internal representations, captured, for example, by sparse features, recognize a trigger, route the behavior, or track the downstream output state. This distinction is important simply because detecting a backdoor and editing it are different tasks relying on different components: A feature that flags triggered inputs may help an auditor find suspicious behavior, while removing or controlling the behavior requires a feature that lies on the causal path.

We study how backdoor triggers are internally represented in Gaperon (Godey et al., 2025), a suite of English-French language models trained with harmless language-switching backdoors, activated by trigger words that cause English prompts to continue in the corresponding target language, achieving an attack success rate of up to 99%.¹ A language switch is a controlled proxy for conditional behavior since the trigger is known, the target behavior is measurable with automatic language identification, and no harmful model behavior is introduced. We use this controlled proxy to separate trigger-recognition features from features that carry the signal or actually change the behavior, focusing on roles that can also matter for other backdoor classes.

In this work, we focus on two circuit-level results: Lasnier et al. (2026) showed across Gaperon-1B, 8B, and 24B that language-switching trig-

¹We also ran preliminary experiments on the Apertus model family, whose pretraining corpus includes a trigger-based German-response poison with 50 conversations repeated twice (Apertus et al., 2025). In our early tests, the released models did not exhibit reliable triggering; a plausible explanation is the very small number of injected trigger examples.

gers co-opt existing language components rather than forming isolated hidden circuits. A more detailed analysis of the French Gaperon-8B trigger then found a three-stage mechanism (Anonymous, 2026). This study showed that early attention heads compose the trigger tokens into the final sequence position, the signal travels through middle residual layers in a subspace missed by ordinary language probes, and the final-layer MLP reads the latent signal into French logit mass. The circuit also passes through a serial bottleneck at the last trigger token/position, p−1p_{-1}. This circuit map localizes the path while leaving the fine-grained intervention problem open, since corrupting the whole bottleneck can mitigate the trigger while also damaging normal capabilities. We use sparse autoencoders (SAEs) to study whether the bottleneck and surrounding activations can be decomposed into smaller feature directions, separating trigger detectors, routing handles, and readout features.

Together, these results make language switching a harmless instance of a broader backdoor pattern because the target behavior is benign and the trigger still activates machinery the model already has. In more dangerous backdoors, the final readout may involve capabilities normally suppressed by instruction tuning or safety training (Qi et al., 2024; Hubinger et al., 2024). The same role-level audit question remains across these cases, namely which features detect the trigger, which carry the conditional state, and which make the behavior change.

The main use of SAEs is to decompose model activations into sparse feature directions (Cunningham et al., 2023; Bricken et al., 2023; Templeton et al., 2024; Gao et al., 2024). They are then attractive for backdoor analysis because rare triggers may be carried by sparse feature directions even when ordinary probes miss the relevant subspace. High selectivity alone can conflate several roles: a feature may respond to the trigger text, track an already-selected output language, or reflect a correlated component state. We therefore train different SAE architectures on Gaperon-1B and Gaperon-8B, then we use triggered prompts, translation prompts, and pretraining document controls to select candidate features, and test those candidates with ablation and steering. To our knowledge, this is the first study to use SAEs to map and causally test feature roles in backdoored language models.

Our results show a consistent split between detecting a trigger and controlling the behavior it induces. In Gaperon-8B, individual SAE features often reach near-perfect trigger-vs-control F1, especially with trigger-enriched SAE training, but F1 alone is a poor guide to causality. Attention and MLP features can detect triggers without useful interventions, while residual-stream features at the circuit-informed bottleneck provide the strongest causal handles. Ablating selected residual features suppresses triggered generation, and activating features associated with the trigger steers clean prompts into the target language (primarily for French).

German remains easier to detect than to steer, likely because these English-French models saw much less German than French during pretraining.² Layer-wise residual SAEs also show partial sharing between French and German trigger-selective features in the 8B model, while 1B candidates remain target-specific.

The paper makes the following contributions:

  • We train and release Gaperon-Scope, a multilayer SAE suite for backdoored LLMs using multiple SAE architectures.
  • We extend previous work on activation-patching analyses of language-switching backdoors with a feature-level study of 1B and 8B language models.
  • We introduce a contrast-and-intervene protocol that separates trigger-selective SAE features from causal handles.
  • We connect these feature roles to the previously mapped circuit and to cross-target feature sharing.

The main takeaway is that a backdoor may decompose into distinct sparse feature roles, and only some of them provide useful places to remove or induce the behavior.

References (31)