Formalization Driven LLM Prompt Jailbreaking via Reinforcement Learning

Zhaoqi Wang, Daqing He, Zijian Zhang, Xin Li, Liehuang Zhu, Meng Li, Jiamou LiuarXiv 2025 · OpenReview

Abstract

Large language models (LLMs) have demonstrated remarkable capabilities, yet they also introduce novel security challenges. For instance, prompt jailbreaking attacks involve adversaries crafting sophisticated prompts to elicit responses from LLMs that deviate from human values. To uncover vulnerabilities in LLM alignment methods, we propose the PASS framework (Prompt Jailbreaking via Semantic and Structural Formalization). Specifically, PASS employs reinforcement learning to transform initial jailbreak prompts into formalized descriptions, which enhances stealthiness and enables bypassing existing alignment defenses. The jailbreak outputs are then structured into a GraphRAG system that, by leveraging extracted relevant terms and formalized symbols as contextual input alongside the original query, strengthens subsequent attacks and facilitates more effective jailbreaks. We conducted extensive experiments on common open-source models, demonstrating the effectiveness of our attack.

Introduction

Large Language Models (LLMs) are typically aligned during training to refuse harmful requests, such as instructions for illegal activities or the production of dangerous substances. However, adversaries continuously develop "jailbreaking" techniques to bypass these safety guardrails. Current jailbreak methods often suffer from two primary limitations: a lack of stealth, as fixed templates are easily recognized by safety filters, and a circular dependency on unaligned models to evaluate and generate new attacks.

To address these challenges, we introduce PASS (Prompt Jailbreaking via Semantic and Structural Formalization). This framework utilizes reinforcement learning to disguise malicious intent within abstract logic, mathematical formulas, and symbolic structures, effectively hiding harmful queries from a model's safety alignment mechanisms.

The PASS Framework

The PASS framework operates through an iterative process designed to evolve a simple malicious query into a complex, formalized instruction that an LLM perceives as a reasoning task rather than a policy violation.

The complete PASS framework architecture, illustrating the iterative reinforcement learning loop and the integration of GraphRAG.

As shown in the architecture above, the system follows a six-step cycle:

  1. Retrieval: The system uses a GraphRAG module to retrieve previously successful term-formalizations.
  2. Initial State Extraction: The target LLM's initial response to the query is analyzed.
  3. Action Selection: A Policy Network (trained via Proximal Policy Optimization, or PPO) selects the best formalization actions.
  4. Action Application: A Symbol Manager applies the selected transformations (e.g., symbolic abstraction or logical encoding) to the query.
  5. Reward Calculation: An "LLM-as-a-judge" evaluates the success of the jailbreak and extracts new knowledge.
  6. Network Update: The experience is stored in a buffer to refine the policy and value networks.

Formalization Actions

The core of the PASS attack is its action space, which consists of eight "atomic" formalization techniques. These actions move the prompt into a "blind spot" in the model's high-dimensional embedding space—areas where the safety guardrails have not been sufficiently trained.

The process of transforming a malicious natural language query into formalized symbolic and logical representations.

Key transformation types include:

  • Symbolic Abstraction: Replacing sensitive terms with variables (e.g., "X represents substance A").
  • Logical Encoding: Converting instructions into conditional logic (e.g., "If P, then perform Q").
  • Mathematical Representation: Describing processes through formulas.
  • Strategic Decomposition: Breaking a harmful task into a series of seemingly benign sub-steps.

By focusing the model on solving a logical or symbolic puzzle, PASS induces "semantic drift," distracting the alignment mechanism from the underlying harmful intent.

Experimental Results

We evaluated PASS against state-of-the-art open-source models using the AdvBench and JailbreakBench (JBB) datasets. The framework demonstrated significantly higher Attack Success Rates (ASR) compared to existing methods like ArtPrompt and PAIR.

  • DeepSeek-V3: Achieved a peak ASR of 99.03% on AdvBench and 96.84% on JailbreakBench.
  • Qwen3-14B: Achieved an ASR of 92.94% on AdvBench and 85.71% on JailbreakBench.

Beyond high success rates, PASS prompts are notably stealthy. Unlike "suffix-based" attacks that often result in gibberish, PASS generates structured, logical prompts that appear as legitimate complex reasoning tasks, making them difficult for perplexity-based filters to flag.

Conclusion

The PASS framework highlights a critical vulnerability in current LLM alignment: the inability to recognize malicious intent when it is abstracted through formal logic and symbolism. While this poses a significant security risk, the authors suggest that these same formalization techniques could be utilized by defenders to augment safety training data, eventually helping models identify harmful intent regardless of its structural disguise.

Summary updated

BibTeX
@misc{wang2025formalization,
  author = {Zhaoqi Wang and Daqing He and Zijian Zhang and Xin Li and Liehuang Zhu and Meng Li and Jiamou Liu},
  title = {{Formalization Driven LLM Prompt Jailbreaking via Reinforcement Learning}},
  year = {2025},
  eprint = {2509.23558},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.23558},
}
Figure