TASO: Jailbreak LLMs via Alternative Template and Suffix Optimization

Yanting Wang, Runpeng Geng, Jinghui Chen, Minhao Cheng, Jinyuan JiaarXiv 2025 · DOI

Abstract

Large Language Models (LLMs) are protected by safety alignment processes like RLHF to prevent the generation of harmful content. However, these safeguards can be bypassed through adversarial "jailbreaking." We present TASO (Template and Suffix Optimization), a novel framework that achieves a 92% average success rate across 24 leading LLMs. TASO works by alternating between token-level suffix optimization and semantic template refinement, using an attacker LLM to iteratively learn from and bypass a target model's refusal behaviors.

Introduction: The "Sure" Barrier

Large Language Models are trained to refuse harmful queries, often starting their responses with a standard refusal like "I cannot fulfill your request." Adversaries attempt to bypass this using two primary methods: Suffix Optimization, which uses gradient-based search to find "gibberish" tokens that force an affirmative start (e.g., "Sure"), and Template Optimization, which uses semantic "roleplay" or "research" scenarios to frame the query.

A comparison between a direct prompt refusal and a successful jailbreak using a suffix to bypass the initial safety alignment.

Both methods have distinct weaknesses. Suffix attacks often suffer from "target string overfitting," where the model says "Sure" but immediately pivots back to a refusal. Template attacks often fail to control the very first tokens of a response; if the model starts with a refusal, the rest of the semantic guidance is ignored. TASO addresses these "blind spots" by combining both approaches into a unified, alternating optimization loop.

The TASO Framework

TASO treats jailbreaking as a multi-objective optimization problem. Instead of a one-shot attack, it employs a feedback loop that iteratively "boxes in" the target model's safety boundaries.

The TASO workflow: an iterative process that alternates between suffix optimization and template refinement based on feedback from an Attacker LLM.

The Alternating Optimization Loop

  1. Suffix Optimization: The framework uses nano-GCG (for white-box models) or random search (for black-box models) to optimize a suffix. The goal is to maximize the probability that the target LLM outputs a specific affirmative token.
  2. Behavior Exploration & Summarization: If a suffix-enhanced prompt fails, TASO generates multiple responses to explore why. An Attacker LLM (such as GPT-4-Turbo) analyzes these failures to identify the specific refusal logic (e.g., "The model cited legal restrictions").
  3. Constraint Generation & Template Update: The Attacker LLM converts these behaviors into "negative constraints" (e.g., "Do not mention legal implications"). These constraints are automatically integrated into the prompt template for the next iteration, making the subsequent suffix optimization more effective.

Experimental Results

TASO was evaluated on the HarmBench and AdvBench datasets against a suite of 24 models, including the Llama family, OpenAI’s GPT-4 series, and reasoning models like DeepSeek-R1.

Key findings include:

  • State-of-the-Art Performance: TASO achieved an average Attack Success Rate (ASR) of 92% on HarmBench, outperforming 17 baseline methods.
  • Breaking Robust Models: On Llama-2-7B, where standard GCG only achieves ~44% ASR, TASO reached 88%.
  • Black-Box Efficacy: Even without gradient access, TASO achieved ~80% ASR on GPT-4-Turbo using random search for the suffix component.
  • Reasoning Model Manipulation: TASO proved effective against reasoning models like DeepSeek-R1 by manipulating the model's internal "Chain of Thought," persuading it to ignore safety boundaries during its reasoning phase.

Conclusion

The success of TASO demonstrates that suffixes and templates are mathematically complementary. Suffixes provide the "initial push" to bypass the alignment gate, while templates provide the "momentum" to ensure the model follows through with the harmful content. This research highlights the need for more robust, multi-layered defense mechanisms that go beyond simple token-level or semantic-level filtering.

Summary updated

BibTeX
@misc{wang2025taso,
  author = {Yanting Wang and Runpeng Geng and Jinghui Chen and Minhao Cheng and Jinyuan Jia},
  title = {{TASO: Jailbreak LLMs via Alternative Template and Suffix Optimization}},
  year = {2025},
  eprint = {2511.18581},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.18581},
}
Figure