NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

NonTextual Target Attack

Xinzhe Huang, Wenjing Hu, Tianhang Zheng, Kedong Xiu, Hongsheng Hu, Xiaojun Jia, Di Wang, Zhan Qin, Kui Ren

TL;DR

The NonTextual Target Attack (NTA) is a novel white-box jailbreak method that abandons the traditional approach of forcing Large Language Models (LLMs) to output specific, rigid target prefixes (like "Sure, here is..."). By directly optimizing for the probability of generating any unsafe response through a two-stage differentiable surrogate objective, NTA achieves an average attack success rate of 96.8% on AdvBench in just 100 iterations—significantly outperforming state-of-the-art methods while drastically reducing computational time.

What Problem Does This Paper Address?

Most automated, gradient-based jailbreak attacks (such as GCG or COLD-Attack) operate on a simple premise: force the target LLM to output an affirmative prefix. The theory is that once the model says "Sure, here is how to...", its safety alignment breaks, and it will complete the malicious request.

However, the authors identify a fundamental flaw in this paradigm: over-constraint. Forcing an LLM to match a rigid, predefined token sequence severely restricts the adversarial search space. Different models naturally favor different response styles; for instance, Llama-3 tends to start responses with "Here" rather than "Sure." Forcing a mismatched prefix makes optimization highly inefficient, often requiring thousands of iterations or causing the attack to collapse into high-perplexity, repetitive nonsense strings.

Fig. 1: Examples of different jailbreak scenarios. (a) White-box attacks toward predefined targets may fail to induce harmful responses under limited iterations. (b) Black-box attacks optimize harmful prompts with plausible scenarios but may still be rejected by safety-aligned LLMs. (c) NTA crafts prompts that induce harmful responses within limited iterations.

Methods

To bypass the limitations of fixed textual targets, NTA introduces a NonTextual objective: maximize the overall "unsafety probability" of the LLM's output without dictating its exact wording. Because evaluating the safety of a fully decoded text sequence is inherently non-differentiable, the authors decompose the problem into two tractable, alternating sub-objectives:

  1. Response-Based Optimization: Instead of targeting a static string, NTA optimizes a continuous logit representation of a response under an auxiliary scoring/judge model (like GPTFuzzer or Llama-Guard). It minimizes an unsafe loss ($L_{unsafe}$) to push the response toward unsafe behavior, while applying a semantic penalty ($L_{sem}$) to ensure the optimized response stays close to the LLM's natural output distribution.
  2. Prompt-Based Optimization: Once an optimal unsafe response representation is found, NTA updates the adversarial prompt suffix ($\delta$) by minimizing the Mean Squared Error (MSE) between the target LLM's generated logits and the target unsafe logits.

Bridging the Tokenizer Gap

An elegant engineering highlight of NTA is the Vocabulary Projection Matrix ($W$). Because the scoring judge and the target LLM often use completely different tokenizers, gradients cannot be directly shared. NTA filters and re-tokenizes tokens to build a binary mapping matrix, allowing adversarial logit increments to seamlessly transfer from the judge's token space to the target LLM's token space.

Fig. 2: Overview of NTA, which optimizes the response representation under the scoring model and transfers the adversarial increment to the target LLM for prompt optimization.

Datasets

The method was evaluated using 100 randomly sampled prompts from two standard safety benchmarks:

  • AdvBench: A benchmark consisting of direct, harmful instructions.
  • HarmBench: A more complex benchmark that embeds harmful concepts within intricate contextual constraints (e.g., role-play or benign dialogues).

Key Insights and Ideas

  • Lexical Freedom Unlocks Efficiency: Allowing the model to fail safely or unsafely within its own natural token distribution expands the adversarial search space. This is why NTA converges in 100 iterations, whereas prefix-matching attacks often require thousands.
  • Coherence Over Chaos: Traditional suffix attacks frequently suffer from "optimization collapse," resulting in garbled prompt suffixes that cause the model to loop gibberish. NTA's semantic consistency loss anchors the optimization, ensuring the model generates diverse, coherent, and genuinely policy-violating text.
Fig. 4: Visualizing optimization collapse in fixed-target at- tacks. Fixed-target methods such as GCG and AdvPrefix often collapse into high-perplexity degenerate sequences, includ- ing meaningless repetitions, instead of discovering effective jailbreak prompts. In contrast, NTA avoids this behavior by removing the predefined textual target constraint.

Key Results

  • Superior Success Rates: Under a strict budget of 100 iterations, NTA achieved an average Attack Success Rate (ASR) of 97.2% on AdvBench and 90.8% on HarmBench across five safety-aligned models (including Llama3-8B-it, Qwen3-8B, and Mistral-7B-it). This outperformed the strongest baseline by over 40%.
  • Dramatic Speedups: NTA achieved a 96.0% average ASR on Llama-3 within 4.8 hours of optimization, compared to GCG which required 42.8 hours to reach a mere 31.5% ASR under identical conditions.
  • High Transferability: Suffixes optimized by NTA on smaller open-source models successfully transferred to larger, advanced models, achieving a 35% ASR on Llama3-70B-it and a 29% ASR on DeepSeek-R1-671B.

Limitations and Future Work

  • White-Box Dependency: NTA relies on having full access to the target LLM’s internal parameters and gradients to perform prompt-based optimization.
  • Benchmark Generality: While highly effective on standard red-teaming datasets like AdvBench and HarmBench, the authors note that exploring specialized safety domains and developing purely black-box transfer variations remain open avenues for future research.

Summary updated

BibTeX
@misc{huang2025nontextual,
  author = {Xinzhe Huang and Wenjing Hu and Tianhang Zheng and Kedong Xiu and Hongsheng Hu and Xiaojun Jia and Di Wang and Zhan Qin and Kui Ren},
  title = {{NonTextual Target Attack}},
  year = {2025},
  eprint = {2510.02999},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.02999},
}
Figure