JailbreakLens: Interpreting Jailbreak Mechanism in the Lens of Representation and Circuit

Zeqing He, Zhibo Wang, Zhixuan Chu, Huiyu Xu, Rui Zheng, Kui Ren, Chun ChenarXiv 2024 · DOI

Introduction

Despite rigorous safety alignment processes such as Reinforcement Learning from Human Feedback (RLHF), Large Language Models (LLMs) remain susceptible to "jailbreaks"—adversarial prompts designed to bypass safety guardrails and elicit harmful content. Current research into these vulnerabilities is often fragmented, focusing either on high-level semantic representations or low-level functional circuits. JailbreakLens bridges this gap by providing a dual-perspective framework that reveals how adversarial prompts systematically suppress refusal signals while amplifying affirmative components.

The JailbreakLens Framework

JailbreakLens introduces a three-step methodology to interpret the internal mechanics of a jailbreak attack token-by-token. This approach allows researchers to observe how a model's internal state evolves from a potential refusal to a successful jailbreak response.

Overview of the JailbreakLens framework, illustrating the three-step process of representation probing, circuit identification, and interpretation aggregation.
  1. Representation Probing: The framework utilizes "safety probes"—classifiers trained to detect how the model perceives a prompt in its latent space. By analyzing these representations, researchers can determine if a harmful prompt has successfully deceived the model's semantic perception into classifying it as "safe."
  2. Model Behavior Circuit: Using logit attribution, the framework pinpoints specific functional components, such as individual attention heads or MLP layers, responsible for "refusal" or "affirmation" signals. For instance, in Llama2-7b, specific heads like L21H14 act as critical refusal signal generators.
  3. Interpretation Aggregation: By tracking these signals dynamically across every generated token, JailbreakLens identifies the exact moment a model's refusal circuit fails and the affirmation circuit takes over.

Experimental Setup and Datasets

The researchers evaluated JailbreakLens across several prominent open-source models, including Llama2 (7b, 13b), Llama3 (8b), and Vicuna (7b, 13b). The study utilized Advbench, a standard benchmark for harmful prompts, alongside a custom paired dataset where GPT-4 generated safe counterparts to harmful requests to train the safety probes. Seven diverse attack strategies were tested, ranging from gradient-based methods like GCG to evolutionary and rule-based attacks like DeepInception and CodeChameleon.

Key Findings

The "Refusal" Circuit is Concentrated

One of the most significant insights is that safety is not distributed evenly throughout the model. Instead, a remarkably small subset of attention heads and MLP layers are responsible for refusing harmful requests. Successful jailbreaks perform a coordinated maneuver: they suppress these concentrated refusal signals (often reducing them from a 1.0 activation to nearly 0) while simultaneously maximizing affirmation signals.

Universal Vulnerability and Deception

The study found that the locations of these safety circuits are consistent across model sizes and even between base models and their instruction-tuned counterparts. This suggests that instruction tuning does not relocate the model's "safety center" but merely alters its trigger threshold. Furthermore, rule-based attacks like DeepInception were found to be particularly deceptive, maintaining a "safe" internal representation even in the model's final layers.

Results and Discussion

Prediction accuracy of safety probes across different LLM architectures and layers, demonstrating high internal recognition of harmful intent.

Experimental results demonstrate that safety probes can reach approximately 99% accuracy in the middle layers of a model. This proves that LLMs internally recognize harmful intent with high precision, even when the final output is successfully jailbroken. There is a strong correlation (0.64 to 0.79) between the degree to which a prompt deceives the model’s representation and the resulting shift in the activation of key safety circuits.

Conclusion

JailbreakLens provides a granular view of the internal conflict between safety mechanisms and adversarial manipulation. By identifying specific "vulnerability points" within the model's architecture, this research paves the way for more resilient safeguards. Future work will involve scaling this analysis to larger models (e.g., 70B+ parameters) and investigating how newer, more complex attack vectors interact with these identified refusal circuits.

Summary updated

BibTeX
@misc{he2024jailbreaklens,
  author = {Zeqing He and Zhibo Wang and Zhixuan Chu and Huiyu Xu and Rui Zheng and Kui Ren and Chun Chen},
  title = {{JailbreakLens: Interpreting Jailbreak Mechanism in the Lens of Representation and Circuit}},
  year = {2024},
  eprint = {2411.11114},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.11114},
}
Figure