TopKLoRA: How Sparse Fine-Tuning Precisely Dismantles Model Backdoors

TopKLoRA uses sparse fine-tuning that activates only k latents per token, making backdoor circuits locatable and ablatable.
This article introduces TopKLoRA—a LoRA variant that builds interpretability into the fine-tuning structure. Traditional parameter-efficient fine-tuning produces dense low-rank matrices that are hard to interpret, and backdoor attacks exploit this blind spot to hide malicious behavior in parameters. TopKLoRA activates only the k largest adapter latents at each token and zeroes out the rest, compressing parameter updates into a small number of enumerable units; training uses only the downstream loss without SAE-style reconstruction objectives, so latents tend toward functionally causal features. The study builds sleeper-agent backdoor model organisms on gemma-2-2b and Qwen2.5, locating and ablating necessary and sufficient backdoor circuits an order of magnitude smaller than dense LoRA baselines, with no noticeable loss in instruction-following performance. The paper also proposes using gradient routing to proactively construct localized circuit model organisms to verify circuit search algorithms.
Fine-tuning on a dataset of unknown origin can quietly plant backdoors in a model—and even after safety training, these backdoors remain hard to locate and remove. A paper on TopKLoRA proposes a "interpretable-by-design" LoRA variant: by activating only the k largest adapter latents at each token, the parameter changes introduced by fine-tuning themselves become an analyzable, intervenable sparse circuit.

Background: Backdoors Are Hard to Find, LoRA Is Hard to Read
Parameter-efficient fine-tuning (PEFT) methods can capture all the parameter changes introduced during training, but these changes are scattered across dense low-rank matrices and are nearly impossible for humans to interpret directly. Backdoor attacks faced by the security community exploit exactly this blind spot: poisoned samples teach the model a triggered behavior, while the parameter traces corresponding to that behavior become entangled with normal capabilities, making localized deletion difficult.
TopKLoRA's approach is to build "interpretability" into the fine-tuning structure itself. Unlike sparse autoencoders (SAEs), it does not rely on an additional reconstruction objective, but trains purely with the downstream loss, letting the optimization pressure naturally drive latents to learn features that are truly causally functional.
LoRA (Low-Rank Adaptation) is a parameter-efficient fine-tuning method: it freezes the original model weights and inserts two small matrices A and B as side paths in specific layers, expressing the weight update as a low-rank product ΔW = BA. Since the rank r is much smaller than the original matrix dimensions, trainable parameters drop sharply and fine-tuning costs fall substantially. But LoRA's "low rank" does not equal "sparse"—the values in A and B are dense, and every parameter carries mixed functional signals, so directly inspecting the adapter weights reveals almost nothing about what the model has learned. This is precisely the structural reason backdoors are hard to locate: malicious behavior and normal capabilities are superimposed within the same low-rank subspace, with no natural boundary to excise.
Sparse autoencoders (SAEs) are an unsupervised tool commonly used in mechanistic interpretability, decomposing model activations into an overcomplete dictionary of sparse features via a reconstruction loss. SAE's limitation is that it is only a post-hoc approximation of an already-trained model: the reconstruction objective is inconsistent with the downstream task objective, and the learned features are not necessarily the causal variables the model actually relies on. This is exactly where TopKLoRA differs from SAEs—it introduces no additional reconstruction loss, sparsity acts directly on the fine-tuning parameters themselves, and thus the object of analysis is the circuit the model actually executes.
Method Core: Keeping Only k Active Latents per Token
TopKLoRA extends the preliminary proposal of Masiak et al. (2025). Its key design is: at any token position, only the k largest latents of the adapter are active, with the rest set to zero. This sparsity has two direct consequences—parameter updates are compressed into a small number of enumerable units, and the function each unit carries is closer to a "causal variable" than a statistical correlate.
The paper emphasizes that since the only training signal is the downstream task loss, the model has no incentive to learn redundant features unrelated to the task. This makes the adapters produced by TopKLoRA structurally better suited to circuit-level analysis than dense LoRA.
Experiments: Dissecting Backdoor Circuits in Three Model Organisms
The research team built model organisms in a "sleeper-agent" backdoor setting: fine-tuning gemma-2-2b, Qwen2.5-1.5B, and Qwen2.5-7B respectively on a poisoned instruction-following dataset. For each model organism, they located and ablated a circuit that is both necessary and sufficient for the backdoor.
"Necessary" means that removing the circuit makes the backdoor behavior disappear; "sufficient" means that keeping the circuit alone can reproduce the backdoor. Compared with dense LoRA baselines, the sparse circuits produced by TopKLoRA are an order of magnitude smaller, which makes surgical ablation possible—removing the malicious capability without noticeable loss in instruction-following performance.
The significance of this result is that backdoor removal need not come at the cost of overall capability loss, provided you can find a circuit that is small enough and precise enough.
Model organism is borrowed from biology and refers to a simplified model system deliberately constructed to study a specific phenomenon. In AI safety research, it usually refers to a model that, through poisoned data or targeted training, reliably exhibits some known, controllable harmful behavior (such as a backdoor trigger), enabling researchers to test whether interpretation and intervention methods work under conditions where "the correct answer is known." The sleeper agent is one classic setting: the model appears harmless under normal inputs and performs malicious behavior only when specific trigger words appear.
Necessary and sufficient is a causal criterion in circuit analysis. Necessity means that ablating the circuit makes the target behavior disappear, showing that it is an essential link in the behavior's occurrence; sufficiency means that keeping only this circuit can reproduce the behavior, showing that it already carries the complete causal information of the behavior. Only when both are satisfied can one assert with reasonable confidence that the circuit is the implementation mechanism of the behavior, rather than merely correlated with it. This is also why the paper emphasizes that the sparse circuit is "an order of magnitude smaller"—the smaller the circuit, the easier it is to ablate precisely without damaging unrelated capabilities.
Constructing Verifiable Model Organisms with Gradient Routing
The paper also proposes a technique for constructing localized circuit model organisms using TopKLoRA latents and gradient routing. Simply put, researchers can proactively design models so that specific capabilities are bound to known sparse units, then use them to verify whether circuit search algorithms actually find the correct causal structure.
This "construct first, then search" loop fills the verification gap of purely observational circuit analysis. The authors view this series of findings as a step toward "interpretable-by-design" architectures: providing trustworthy units of analysis without sacrificing model performance.
Implications for Interpretability and AI Safety
TopKLoRA's value is not limited to backdoor removal. It suggests a path: turning interpretability from a "post-hoc analysis tool" into a "structural constraint during training." When the parameters produced by fine-tuning are naturally sparse and causally discernible, security auditing, capability editing, and fault attribution all become more actionable.
Of course, current validation is concentrated on a specific sleeper-agent backdoor setting and three small-to-medium-scale models, and whether the method generalizes to larger models and more attack types still requires follow-up work. The code is open-sourced on GitHub (interpretable-finetuning/TopKLoRA) for reproduction and extension.
For researchers and engineers focused on AI safety and model interpretability, this work offers a direction worth tracking: trading sparsity for readability, and then readability for intervenability.
One-line Summary
TopKLoRA uses sparse fine-tuning that activates only k latents per token, making backdoor circuits locatable and ablatable.
Paragraph Summary
This article introduces TopKLoRA—a LoRA variant that builds interpretability into the fine-tuning structure. The dense low-rank matrices produced by traditional parameter-efficient fine-tuning are hard to interpret, and backdoor attacks exploit this blind spot to hide malicious behavior in parameters. TopKLoRA activates only the k largest adapter latents at each token and zeroes out the rest, compressing parameter updates into a small number of enumerable units; moreover, it trains only with the downstream loss and does not rely on SAE-style reconstruction objectives, so latents tend toward functionally causal features. The study builds sleeper-agent backdoor model organisms on gemma-2-2b and the Qwen2.5 series, locates and ablates necessary and sufficient backdoor circuits that are an order of magnitude smaller than dense LoRA baselines, with no noticeable loss in instruction-following performance after ablation. The paper also proposes using gradient routing to proactively construct localized circuit model organisms to verify circuit search algorithms.
Related articles

world2vec: Building Mechanistic World Models with Latent Dynamics Learning
world2vec proposes a reward-free method for learning mechanistic world models via latent dynamics, faithfully reproducing systems over long horizons with at least an order of magnitude fewer parameters than DreamerV3, TD-MPC2, and LeWM, and achieving accurate system identification on 71 attractor benchmarks.

A New KL-DRO Paradigm: Adaptive Scenario Generation Around a Learned Density Model
KL-DRO research proposes centering the KL ball on a learned density model instead of the empirical distribution, with adaptive scenario generation guiding sampling toward the worst case. Experiments show lower cost under distribution shift when records are scarce and the model can extrapolate, with comparable in-distribution cost.

ODE Samplers for Discrete Diffusion Models: Exponential Residual Flows Accelerate Generation
Discrete diffusion models lack deterministic ODE sampling? This article introduces Exponential Residual Flows (ERFs), which introduce continuous residual variables per token to construct piecewise ODEs for deterministic sampling and support consistency distillation acceleration. Superior to prior methods on code and text generation tasks.