Skip to main content
LLM Security Database
Skip to research details
Back to research findings
LMVD-ID: abc865e7
Paper published February 1, 2025
Entry analyzed March 4, 2025
Paper-reported evidence
Confidence: Source-linked

The LMVD-ID is an internal research identifier, not an official CVE identifier.

Prefix-Tree Jailbreak

Large Language Models (LLMs) with structured output interfaces are vulnerable to jailbreak attacks that exploit the interaction between token-level inference and sentence-level safety alignment. Attackers can…

BibTeX citation

Paper-evaluated models(8)

DeepSeek R1 Distill Qwen 14B, DeepSeek R1 Distill Qwen 7B, Llama 2 13B +5 more
  • DeepSeek R1 Distill Qwen 14B
  • DeepSeek R1 Distill Qwen 7B
  • Llama 2 13B
  • Llama 2 13B Chat
  • Llama 2 7B Chat
  • Mistral 7B Instruct
  • Qwen 14B Chat
  • Qwen 7B Chat

Description

Large Language Models (LLMs) with structured output interfaces are vulnerable to jailbreak attacks that exploit the interaction between token-level inference and sentence-level safety alignment. Attackers can manipulate the model's output by constructing attack patterns based on prefixes of safety refusal responses and desired harmful outputs, effectively bypassing safety mechanisms through iterative API calls and constrained decoding. This allows the generation of harmful content despite safety measures.

Examples

The AttackPrefixTree (APT) framework, detailed in the referenced paper, provides a concrete example of this attack. The attack leverages structured output interfaces to iteratively construct a tree, exploring prefixes of both safe and harmful outputs. By using constrained decoding, the attacker suppresses the model's safety responses, ultimately guiding the model towards generating harmful content. See arXiv:2502.13527 (opens in a new tab) for implementation details.

Impact

Successful exploitation can lead to the generation of harmful, unethical, or illegal content by the LLM, bypassing its built-in safety mechanisms. This can have severe consequences depending on the LLM's application, ranging from the dissemination of misinformation to the provision of instructions for illegal activities.

Affected Systems

LLMs that provide structured output interfaces (e.g., JSON, YAML, regex constraints) and employ sentence-level safety mechanisms are vulnerable. Specific models mentioned in the research include Llama 2, Mistral, and Qwen.

Mitigation Steps

  • Implement real-time monitoring of constrained decoding to detect adversarial pattern manipulation.
  • Utilize dynamic refusal template diversification to make it harder for attackers to reliably suppress safety responses.
  • Integrate input-output consistency verification with adaptive logit masking during constrained decoding.
  • Enforce multi-stage safety alignment mechanisms, extending beyond just output constraints, especially for reasoning models. Consider abstracting reasoning processes or hiding intermediate steps from the user.

Research context and confidence

Evidence and verification
Paper-reported; independent reproduction is not documented.
Primary research source linked.
Severity
Not rated by this catalog.
Source and publication type
arXiv · Research preprint.
Peer-review status is not provided by this source.
Author and publication status
Author metadata is not stored; see the primary paper.
Threat model and attacker access
Black-box model, service, or application access.
Related deployment categories
Model APIs
Taxonomy labels only; paper-specific deployment prerequisites are not inferred.
Affected systems
LLMs that provide structured output interfaces (e.g., JSON, YAML, regex constraints) and employ sentence-level safety mechanisms are vulnerable. Specific models mentioned in the research include Llama 2, Mistral, and…

Research Paper

Exploiting Prefix-Tree in Structured Output Interfaces for Enhancing Jailbreak Attacking

Primary source: arXiv. Findings are reported by the cited research and have not been independently verified.

View Paper

Evidence

This entry is based on a primary research source. Its findings are paper-reported; independent reproduction and verification are not claimed.

https://arxiv.org/abs/2502.13527