AdaSteer: Your Aligned LLM is Inherently an Adaptive Jailbreak Defender

Weixiang Zhao, Jiahe Guo, Yulin Hu, Yang Deng, An Zhang +6 more
4/13/2025
cs.CRcs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Despite extensive efforts in safety alignment, large language models (LLMs) remain vulnerable to jailbreak attacks. Activation steering offers a training-free defense method but relies on fixed steering coefficients, resulting in suboptimal protection and increased false rejections of benign inputs. To address this, we propose AdaSteer, an adaptive activation steering method that dynamically adjusts model behavior based on input characteristics. We identify two key properties: Rejection Law (R-Law), which shows that stronger steering is needed for jailbreak inputs opposing the rejection direction, and Harmfulness Law (H-Law), which differentiates adversarial and benign inputs. AdaSteer steers input representations along both the Rejection Direction (RD) and Harmfulness Direction (HD), with adaptive coefficients learned via logistic regression, ensuring robust jailbreak defense while preserving benign input handling. Experiments on LLaMA-3.1, Gemma-2, and Qwen2.5 show that AdaSteer outperforms baseline methods across multiple jailbreak attacks with minimal impact on utility. Our results highlight the potential of interpretable model internals for real-time, flexible safety enforcement in LLMs.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

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

Cite this paper

@article{zhao2025adasteer,
  title  = {AdaSteer: Your Aligned LLM is Inherently an Adaptive Jailbreak Defender},
  author = {Weixiang Zhao and Jiahe Guo and Yulin Hu and Yang Deng and An Zhang and Xingyu Sui and Xinyang Han and Yanyan Zhao and Bing Qin and Tat-Seng Chua and Ting Liu},
  year   = {2025},
  eprint = {2504.09466},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.09466v2}
}

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/2504.09466.svg)](https://codeofpaper.com/paper/2504.09466)

Discussion