RepGuard: Adaptive Feature Decoupling for Robust Backdoor Defense in Large Language Models

Chen-Xu Niu, Jie Zhang, Yan-Bing Liu, Yun-Peng Li, Jinta Weng +1 more
1/1/2025

No confident code implementation found for this paper.

Abstract

Backdoor attacks pose a significant threat to large language models (LLMs) by embedding malicious triggers that manipulate model behavior. However, existing defenses primarily rely on prior knowledge of backdoor triggers or targets and offer only superficial mitigation strategies, thus struggling to fundamentally address the inherent reliance on unreliable features.

Show full abstract

To address these limitations, we propose a novel defense strategy, RepGuard , that strengthens LLM resilience by adaptively separating abnormal features from useful semantic representations, rendering the defense agnostic to specific trigger patterns. Specifically, we first introduce a dual-perspective feature localization strategy that integrates local consistency and sample-wise deviation metrics to identify suspicious backdoor patterns. Based on this identification, an adaptive mask generation mechanism is applied to isolate backdoor-targeted shortcut features by decomposing hidden representations into independent spaces, while preserving task-relevant semantics. With a multi-objective optimization framework, our method can inherently mitigates backdoor attacks. Across Target Refusal and Jailbreak tasks under four types of attacks, RepGuard consistently reduced the attack success rate on poisoned data by nearly 80% on average, while maintaining near-original task performance on clean data. Extensive experiments demonstrate that RepGuard provides a scalable and interpretable solution for safeguarding LLMs against sophisticated backdoor threats.

DOISemantic Scholar

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{niu2025repguard,
  title  = {RepGuard: Adaptive Feature Decoupling for Robust Backdoor Defense in Large Language Models},
  author = {Chen-Xu Niu and Jie Zhang and Yan-Bing Liu and Yun-Peng Li and Jinta Weng and Yue Hu},
  year   = {2025},
  doi    = {10.52202/085713-1494},
  url    = {https://doi.org/10.52202/085713-1494},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/a137447859084b528b1218bdd5f4b52a2a29328f.svg)](https://codeofpaper.com/paper/a137447859084b528b1218bdd5f4b52a2a29328f)

Discussion