Adversarial Reasoning at Jailbreaking Time

Mahdi Sabbaghi, Paul Kassianik, George J. Pappas, Amin Karbasi, Hamed Hassani

Introduction

Large Language Models (LLMs) are increasingly deployed with sophisticated safety guardrails, typically implemented through Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO). These guardrails are designed to prevent the generation of harmful, illegal, or unethical content. However, the security of these models remains a moving target. Current "jailbreaking" methodologies generally bifurcate into two categories: token-space optimization and semantic-space attacks.

Token-space attacks utilize gradient-based optimization to find strings that bypass filters, but these often result in gibberish that is easily detected by perplexity filters. Conversely, semantic-space attacks use LLMs to craft persuasive or deceptive prompts. While human-readable, these attacks often rely on "binary feedback" (success or failure), which provides a sparse signal that makes it difficult to systematically dismantle robust defenses. This paper introduces Adversarial Reasoning, a framework that treats jailbreaking as a structured reasoning problem guided by continuous loss signals, allowing for a more systematic and effective approach to bypassing LLM safety layers.

The Adversarial Reasoning Framework

The core of the proposed framework is the transition from binary feedback to granular, continuous feedback. By utilizing the target model's log-probabilities to calculate the cross-entropy loss of a desired "affirmative response" (e.g., "Sure, here is how to..."), the attacker can determine how close a specific prompt is to succeeding, even if the model initially refuses.

The framework operates through a Reason, Verify, and Search loop consisting of three primary components:

  1. Attacker LLM: Generates a batch of candidate prompts based on a "reasoning string"—a set of strategic instructions on how to approach the attack.
  2. Feedback LLM: Analyzes the resulting prompts and their associated loss values. It identifies successful patterns and explains why certain strategies (such as role-playing or technical framing) were more effective than others.
  3. Refiner LLM: Acts as a "textual gradient descent" engine. It ingests the feedback and updates the reasoning string to optimize the next generation of prompts.

To navigate the vast space of potential prompts, the algorithm employs a Tree Search (inspired by the "Go-with-the-Winners" algorithm). This allows the system to maintain a buffer of high-performing reasoning strings, explore promising attack paths, and backtrack when a specific line of reasoning reaches a dead end.

Experimental Setup and Results

The authors evaluated the Adversarial Reasoning framework using HarmBench, a standardized benchmark for automated red-teaming, focusing on 50 diverse tasks ranging from cyber intrusion to chemical threats. The target models included a spectrum of open-source and proprietary models, such as Llama-3, Mistral-7B-v2-RR, GPT-4o, and reasoning-centric models like OpenAI o1-preview and DeepSeek-R1.

Key Findings

  • State-of-the-Art Performance: The method achieved a 100% success rate against R2D2 and DeepSeek-R1.
  • Overcoming Robustness: On Llama-3-8B-RR, a model specifically hardened against jailbreaks, the framework achieved a 44% success rate, nearly doubling the efficacy of previous semantic attacks like PAIR and TAP.
  • Black-Box Transferability: For models where log-probabilities are unavailable (black-box), the authors used an aggregated loss from multiple "surrogate" white-box models. This "multi-shot transfer" approach achieved a 56% success rate on OpenAI o1-preview, demonstrating that even models using internal reasoning for safety are vulnerable to adversarial reasoning.
  • Efficiency: While more compute-intensive than simple heuristic attacks (~48 queries per success), the framework is significantly more efficient than token-space optimization methods like GCG, which often require tens of thousands of iterations.

Discussion: Weaponizing Reasoning

A significant insight of this research is the realization that the very techniques used to enhance LLM capabilities—such as Chain-of-Thought reasoning, verifiers, and scaling test-time compute—can be inverted to bypass safety alignment. The paper demonstrates that a relatively weak model (e.g., Vicuna-13B) can become a highly effective attacker when equipped with a reasoning loop, outperforming much larger models that lack a structured feedback mechanism.

Furthermore, the success of the multi-shot transfer suggests that the "best" single prompt is often less effective than the entire set of prompts generated during a reasoning process. This implies that black-box defenses must account for the cumulative probability of failure across multiple diverse attempts.

Limitations and Future Directions

Despite its effectiveness, Adversarial Reasoning is computationally expensive, requiring multiple LLM calls and forward passes for loss calculation. Additionally, the success of black-box attacks remains dependent on the quality of the surrogate models used to guide the search.

Future work may explore "hybrid" attacks that combine the precision of token-level optimization with the strategic depth of semantic reasoning. The authors also suggest that developers should move toward "process-based rewards" in safety training—monitoring the reasoning path of a model rather than just its final output—to better defend against these systematic adversarial strategies.

Summary updated

BibTeX
@inproceedings{sabbaghi2025adversarial,
  author = {Mahdi Sabbaghi and Paul Kassianik and George J. Pappas and Amin Karbasi and Hamed Hassani},
  title = {{Adversarial Reasoning at Jailbreaking Time}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=aWd7mL5U9Q},
}
Figure