cs.CRApr 14, 2026

Compiling Activation Steering into Weights via Null-Space Constraints for Stealthy Backdoors

Authors: Rui Yin, Tianxu Han, Naen Xu, Changjiang Li, Ping He, Chunyi Zhou, Jun Wang, Zhihui Fu, 

Organizations: Zhejiang University · Palo Alto Networks · OPPO Research Institute · Ningbo Global Innovation Center, Zhejiang University · 

Abstract

Safety-aligned large language models (LLMs) are increasingly deployed in real-world pipelines, yet this deployment also enlarges the supply-chain attack surface: adversaries can distribute backdoored checkpoints that behave normally under standard evaluation but jailbreak when a hidden trigger is present. Recent post-hoc weight-editing methods offer an efficient approach to injecting such backdoors by directly modifying model weights to map a trigger to an attacker-specified response. However, existing methods typically optimize a token-level mapping that forces an affirmative prefix (e.g., ``Sure''), which does not guarantee sustained harmful output -- the model may begin with apparent agreement yet revert to safety-aligned refusal within a few decoding steps. We address this reliability gap by shifting the backdoor objective from surface tokens to internal representations. We extract a steering vector that captures the difference between compliant and refusal behaviors, and compile it into a persistent weight modification that activates only when the trigger is present. To preserve stealthiness and benign utility, we impose a null-space constraint so that the injected edit remains dormant on clean inputs. The method is efficient, requiring only a small set of examples and admitting a closed-form solution. Across multiple safety-aligned LLMs and jailbreak benchmarks, our method achieves high triggered attack success while maintaining non-triggered safety and general utility.

Figures & tables

Appendix figures & tables4 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisation

    Sep 29, 2026Minoo Kim, Vasileios Lampos, George DraysonBackdoor Defense in LLMsLLM Backdoor Attacks

  2. Shared Latent Structures Enable Unified Backdoor Detection and Mitigation in LLMs

    Jun 6, 2026Omar Mahmoud, Aly M. Kassem, Thommen George Karimpanal +4LLM Backdoor AttacksBackdoor Defense in LLMs

  3. The Model Plants the Trigger: Answer-Side Backdoor Attacks in Multi-Turn Large Language Models

    Oct 6, 2026Yibo Zhang, Tianrong Guan, Liang Lin +3LLM Backdoor AttacksBackdoor Attacks