MetaBreak: Jailbreaking Online LLM Services via Special Token ManipulationMetaBreak: Jailbreaking Online LLM Services via Special Token Manipulation
The authors propose MetaBreak, which injects special tokens, achieving 62.0% average ASR on 4 open-source models and bypassing review.
Black-box or through Web API/Chatbot interaction only, attackers use public templates and embedding or API role abstraction to inject special tokens, bypassing internal safety alignment and external moderation.
- Online large language model services are protected by platform chat template wrapping and external content moderation mechanisms, causing existing special token injection and prompt engineering jailbreak methods to fail or have limited success rates in real commercial services.
- Proposes MetaBreak composed of four primitives: response injection forges assistant prefixes; turn masking uses few-shot single-character spacing to make the model absorb platform template wrapping; input segmentation exploits capacity differences to evade moderation models; semantic imitation uses L2 norm distance to replace filtered special tokens with ordinary tokens.
- Achieves 62.0% average ASR on 4 local open-source models; achieves 40.7%–59.7% average ASR when guardrail defenses are deployed (compared to PAP's 16.2%–53.1%); achieves 59.8% average ASR on 7 online services.
- The paper points out limitations including reliance on knowledge of chat template structure (unavailable for closed-source or niche models) and the need to access word embedding vectors to find alternative tokens; experiments cover 4 open-source models, 5 online chatbots, and 2 commercial Web APIs, without testing adaptive defenses.
- Evaluated models
- Llama-3.3-70B-InstructQwen-2.5-72B-InstructGemma-2-27B-InstructPhi4-14BLlama-3.1-405BGPT-4.1Claude-Opus-4LlamaGuard-3-8BPromptGuard-86MShieldGemma-2-27B
- Benchmarks
- SorryBench
- Metrics
- ASRFlagging Rate
The researchers propose MetaBreak, which uses special tokens in LLM chat templates to construct four attack primitives to jailbreak online LLM services. On locally deployed Llama-3.3-70B, Qwen-2.5-72B, Gemma-2-27B, and Phi4-14B via Ollama, MetaBreak achieves an average attack success rate of 62.0%, comparable to PAP (56.8%) and GPTFuzzer (61.6%); when content moderation is enabled, MetaBreak outperforms PAP and GPTFuzzer by 11.6% and 34.8%, respectively. The four primitives include response injection, turn masking, input segmentation, and semantic imitation, where input segmentation bypasses moderation models like LlamaGuard by splitting sensitive words, and semantic imitation replaces filtered special tokens with ordinary tokens that have the smallest L2 distance in embedding space. Code and dataset are open-sourced.
Why it was selectedThe paper gives four attack primitives for special token injection and states that after deploying content moderation it still outperforms PAP and GPTFuzzer by 11.6% and 34.8%, which can be used to assess the protection gaps of online services.
Paper analysis
What problem does this paper attempt to solve?
Targeting the template wrapping and moderation mechanisms of online LLM services, using special token injection to achieve end-to-end jailbreak.
How to achieve jailbreak in online LLM services through special token injection while bypassing platform defense mechanisms.
- Scenario and importance: Online large language model services are typically deployed in the cloud and provide Chatbot or Web API interactions. To prevent abuse, platforms deploy both internal safety alignment of the model and external content moderation models; directly exploiting special tokens to manipulate model behavior is a potential attack surface.
- Limitations of existing methods: The authors claim that existing special token attack methods (such as Virtual Context and ChatBug) do not consider the chat template wrapping tags automatically added by the platform, causing forged conversation structures to be broken; these methods also do not consider external moderation interception; prompt engineering-based methods (such as PAP and GPTFuzzer) tend to alter the original question semantics, leading to irrelevant answers.
- Core observations and hypotheses: Special tokens have context-independent and structure-controlling semantics; there is a capability gap between the victim main model and lightweight content moderation models; in embedding space, the L2 norm based on vector differences can find ordinary tokens functionally similar to special tokens.
- Proposed solution: The authors propose a toolkit MetaBreak consisting of four attack primitives, which jointly use response injection, turn masking, input segmentation, and semantic imitation to jailbreak online LLM services.
- Threat model:
- Attacker goal: Construct special inputs to bypass the model's internal safety alignment and external content moderators, inducing the online LLM to generate harmful content.
- Attacker knowledge: For open-weight models, the attacker needs to know their public chat template structure and token embedding vectors; for closed-source proprietary models, no knowledge of special tokens is needed, only manipulation through the message role abstraction provided by the Web API.
- Attacker capability: The attacker only sends text requests through the Chatbot interface or Web API, without assuming traditional web vulnerabilities or software flaws in the platform.
- Victim system: An online service system composed of cloud-hosted open-weight or proprietary commercial LLMs and their attached content safety guardrails.
What related research exists?
Systematically solves the problem that existing special token attacks cannot resist template wrapping, content moderation, and token filtering.
The paper reviews and compares the following research in the introduction, related work, and experiments:
Prompt-engineering-based jailbreak attacks
- Black-box semantic and mutation jailbreaks: Includes ASCII art masking ArtPrompt, fuzzing-based mutation prompts GPTFuzzer, and persuasive rewriting PAP. The authors state that such methods often blur the original intent of the question by inserting large amounts of irrelevant text or over-rewriting, causing model comprehension deviations.
- White-box adversarial suffix optimization: Includes gradient-based suffix optimization GCG and genetic algorithm prompt optimization AutoDAN. The authors state that white-box methods face challenges in transferability across different model architectures.
Attacks based on system-level vulnerabilities and special tokens
- Decoding and system mechanism vulnerabilities: EnDec uses forced decoding to manipulate the internal generation process; Catastrophic changes decoding parameters such as sampling temperature to break alignment. The authors state that EnDec operates on the model's internal state, representing the upper bound of the prefix injection idea.
- Special token injection methods: Virtual Context (VC) uses a few-shot prompt to encode special tokens and jailbreak payloads in nested dialogues; ChatBug proposes format mismatch attacks (ChatBug-M) and message overflow attacks (ChatBug-O). The authors point out that these methods do not address the interference of platform-added template wrapping and do not consider external content moderation, limiting their effectiveness in commercial online services.
Baseline methods and evaluation benchmarks
- Baseline methods: Direct Input (DI), PAP, GPTFuzzer, Virtual Context (VC), ChatBug-O, and ChatBug-M.
- Evaluation benchmark: Uses the SorryBench dataset containing 44 safety categories and 440 unsafe instructions.
Positioning of the paper relative to existing work The authors position MetaBreak as a special token injection attack framework that systematically addresses platform chat template wrapping interference, external moderation interception, and special token filtering and cleaning, and point out that special token manipulation and prompt engineering strategies are complementary.
How does the paper address this problem?
Achieves end-to-end attacks through response injection, turn masking, input segmentation, and L2-norm-based semantic mimicry.
The paper proposes an attack framework named MetaBreak, which builds a complete attack chain against online large language model services by coordinating four attack primitives.
Core Primitive Design
- Response Injection: Uses role-management special tokens to forge assistant header markers, constructing an affirmative prefix in the input (such as affirmative phrases) to guide the LLM to continue completing harmful content in the assistant role.
- Turn Masking: To address the issue of platform-automatically-added user and assistant boundary labels disrupting context, uses few-shot single-character spacing construction and specific separators to guide the model to output word by word, enabling the model to adapt to and absorb the extra assistant labels inserted by the platform, thereby masking the forged dialogue structure.
- Input Segmentation: Uses sentiment analysis tools to identify sensitive expressions in the input and uses user role marker symbols to cut sensitive words (for example, splitting prohibited words). Lightweight moderation models cannot recognize prohibited words due to limited understanding, while the main model can reassemble the complete semantics.
- Semantic Mimicry: When the platform cleans all special tokens from user input, computes the Euclidean distance between substitute word vectors and special token vectors in the vocabulary embedding space, selecting the closest regular token to substitute for the special token in the injection.
Vector Substitution Metric Formula
The paper points out that cosine similarity of regular words cannot accurately measure the functional equivalence of special tokens, because the norm distributions of special tokens and regular tokens differ significantly, so the L2 norm of the vector difference is used as the distance metric: d(v1, v2) = ||v1 − v2||2 where v1 and v2 are the high-dimensional embedding vectors of two tokens in the vocabulary, and this distance measures both vector direction and magnitude.
Interaction and Interface Adaptation
- Single-turn interaction optimization: To avoid the inefficiency of word-by-word generation, constructs several single-character prefix examples followed by multi-character connectors in advance, so a single request can induce the model to output a complete harmful response.
- Dual interface support for chatbots and Web APIs: For open-source model dialogue services, directly injects the special token strings corresponding to the target model into the text; for proprietary closed-source model Web APIs (Chat Completions interface), indirectly achieves token structure arrangement by passing dictionary objects with assistant role markers in the JSON request body, without needing to know the specific special token characters.
What experiments did the paper conduct?
Achieves an average ASR of 62.0% on 4 local models and 59.8% on 7 commercial online services.
The paper evaluates MetaBreak's attack effectiveness through local experiments and real online services.
Experimental Setup
- Models under test: Local testing uses Llama-3.3-70B-Instruct (Q8_0), Qwen-2.5-72B-Instruct (Q8_0), Gemma-2-27B-Instruct (FP16), Phi4-14B (FP16); real service testing uses Llama-3.1-405B, Qwen-2.5-72B, Gemma-2-27B, Phi-4, Llama-3.3-70B, GPT-4.1, Claude-Opus-4.
- Benchmark and scale: SorryBench dataset, covering 44 unsafe topic categories, with a total of 440 category-balanced potentially unsafe instructions.
- Comparison baselines: Direct Input (DI), PAP, GPTFuzzer, Virtual Context (VC), ChatBug-O, ChatBug-M.
- Defenses and guardrails: LlamaGuard-3-8B, PromptGuard-86M, ShieldGemma-2-27B, and special token cleaning defenses.
- Metric definition and review method: Attack success rate (ASR, the proportion of test samples where the jailbreak succeeds); uses the judge model provided by SorryBench to determine whether the response achieves fulfillment, outputting 1 for achieved and 0 for refusal or no substantive assistance.
Main Results
The table below presents the main ASR results for 4 local models without content moderation (from Table 2):
Swipe horizontally to read the table
Model DI MetaBreak PAP GPTFuzzer VC ChatBug-O ChatBug-M Llama-3.3 31.6% 87.3% 60.9% 67.7% 29.8% 30.2% 32.3% Qwen-2.5 32.3% 45.2% 71.1% 62.5% 31.1% 37.7% 37.0% Gemma-2 10.2% 45.5% 42.0% 82.3% 19.3% 10.2% 8.9% Phi-4 37.7% 69.8% 53.0% 33.9% 58.6% 37.7% 24.3% Average (Avg.) 28.0% 62.0% 56.8% 61.6% 34.7% 29.0% 25.6% - Average performance comparison: MetaBreak's average ASR reaches 62.0%, higher than PAP's 56.8% and GPTFuzzer's 61.6%, and substantially higher than VC (34.7%) and ChatBug variants (29.0%, 25.6%).
- Model architecture differences: MetaBreak performs best on Llama-3.3 and Phi-4; PAP performs best on Qwen-2.5 (71.1%); GPTFuzzer performs best on Gemma-2 (82.3%).
- Method complementarity: After fusing MetaBreak with PAP and GPTFuzzer, the average ASR rises to 81.1% (an increase of 24.3 percentage points) and 81.8% (an increase of 20.2 percentage points), respectively.
Guardrail and Content Moderation Evasion Experiments
- Test content: Tests the input flagging rate and actual ASR under interception by three guardrail models (LlamaGuard, PromptGuard, ShieldGemma).
- Experimental results: Input segmentation reduces the moderation flagging rate by 42.9% compared to no segmentation (in Table 5, MetaBreakIS flagging rates on the three guardrails are 19.4%, 38.2%, and 14.9%, respectively). On actual ASR (Table 6), MetaBreakIS achieves average ASRs of 51.5%, 59.7%, and 40.7% under the three guardrails, significantly higher than PAP (47.8%, 53.1%, 16.2%) and GPTFuzzer (13.5%, 34.0%, 0.0%).
- Author interpretation: The authors believe lightweight moderation models cannot recognize segmented sensitive words, while the main model can reconstruct the semantics; PAP has a low flagging rate but its ASR decays greatly under strong safety alignment.
Special Token Cleaning Evasion Experiments
- Test content: Simulates a defense where the platform filters all special tokens, using regular token substitutions selected based on L2 norm.
- Experimental results: Token similarity and ASR are positively correlated (Figure 7). When the highest-similarity regular token is chosen as a substitute, ASR is close to the level without cleaning; when similarity falls below a certain threshold, ASR drops sharply. For example, on Phi-4, when similarity drops from 83.1% to 77.1%, ASR decreases by 33.9 percentage points.
- Author interpretation: The authors point out that the difference in vector norm between special tokens and regular tokens determines that L2 norm, rather than cosine similarity, must be used to select substitute words.
Real Online Service Evaluation
- Test content: Tests 7 model services on the Poe and HuggingChat platforms and the official Web APIs of OpenAI and Anthropic (Table 9).
- Experimental results: On Llama-3.1-405B on Poe, MetaBreak achieves 94.1% ASR (PAP is 54.1%, GPTFuzzer is 34.1%); on the GPT-4.1 Web API it achieves 55.5% ASR; on the Claude-Opus-4 Web API it achieves 59.1% ASR. The average ASR across 7 online services is 59.8%.
- Author interpretation: The authors state that real platforms and local quantized environments perform highly consistently, and commercial closed-source APIs are equally vulnerable to attacks constructed through API role abstraction.
Other Ablations and Analyses
- Without special tokens (regular token substitution): Average ASR drops from 62.0% to 28.6%, a decrease of 33.3 percentage points (Table 7).
- Without turn masking: Average ASR drops to 29.0%, a decrease of 33.0 percentage points (Table 7).
- Without input segmentation (under guardrails): Average ASR drops to 20.6%, a decrease of 30.0 percentage points (Table 7).
- Without semantic mimicry (under cleaning): Average ASR drops to 26.4%, a decrease of 35.6 percentage points (Table 7).
- LLM-as-a-Judge bias: Sampling 50 cases for manual verification, MetaBreak has TP of 84.0%, FP of 16.0%, TN of 80.0%, and FN of 20.0% (Table 8). The authors note that the judge model sometimes misjudges as failure because the response ends with dissuasive language.
- Failure case distribution: Analyzing 190 failure samples, direct refusal accounts for 28.4%, false negatives for 14.7%, partial jailbreak for 17.9%, and benign continuation for 38.9% (§5.6).
What are some points that can be further explored?
Depends on template structure and embedding vector access permissions, and has not been tested against proprietary closed-source chatbots.
Limitations and future directions pointed out by the authors
- Dependence on chat template structure knowledge: MetaBreak relies on prior knowledge of the chat template structure, limiting attack applicability for niche or proprietary LLMs with undisclosed templates (from §6 Limitations).
- Dependence on word embedding vector information: The semantic imitation strategy used to bypass special token filtering requires access to the model's token embedding vectors to compute distances, which is infeasible in scenarios where embedding weights are unavailable (from §6 Limitations).
- Exploration extending to AI agent systems: The authors plan to extend MetaBreak to emerging LLM systems with complex architectures (such as AI agents), systematically studying privacy leakage and unauthorized code execution vulnerabilities beyond jailbreaking (from §6 Future Directions).
Experimental coverage
- Model scope tested: Local experiments evaluated 4 open-source models: Llama-3.3-70B, Qwen-2.5-72B, Gemma-2-27B, and Phi4-14B; online experiments evaluated 5 chatbots and 2 Web APIs (GPT-4.1, Claude-Opus-4).
- Guardrail and defense evaluation scope: Guardrail evaluation covered 3 models: LlamaGuard-3-8B, PromptGuard-86M, and ShieldGemma-2-27B; input filtering defense tested the setting of removing all special tokens from user input.
- Benchmark dataset coverage: The dataset covered 440 test samples across 44 safety categories from SorryBench.
- Attack interface limitations: For proprietary closed-source models, only Web API testing was performed, not including the chatbot interfaces behind these models.
- The paper does not report adaptive defense experiments: The paper discusses mitigation directions such as adversarial training and monitoring specific input patterns, but does not actually implement and evaluate adaptive defenses against MetaBreak in experiments.
Summarize the main content of the paper
Uses special token injection to counter platform template wrapping and moderation, validating jailbreak effectiveness and complementarity across multiple scenarios.
- Positioning and problem: Targeting the jailbreak defense barriers caused by automatic chat template wrapping and external content moderation mechanisms in online large language model services, exploring how to achieve reliable jailbreaking using the structural metadata semantics of special tokens.
- Attack framework design: Proposes the MetaBreak toolkit composed of four primitives: response injection, turn masking, input segmentation, and semantic imitation, addressing assistant role forgery, platform wrapping tag elimination, moderation model recognition evasion, and special token filtering bypass, respectively.
- Core experimental results: Achieves an average ASR of 62.0% on 4 local open-source models (Table 2); achieves an average ASR of 40.7%–59.7% when guardrail defenses are deployed (Table 6); achieves an average ASR of 59.8% on 7 commercial online services (Table 9); when combined with existing prompt engineering methods, ASR improves by 20.2–24.3 percentage points across models.
- Author conclusions and recommendations: The authors believe that special token injection and prompt engineering mechanisms are different and highly complementary; they point out that simply filtering special tokens or relying on prompt-based adversarial training cannot fundamentally solve this threat, and recommend establishing a multi-layer defense framework covering token-level, behavior-level, and context-level defenses.
Related papers
Show 3 more papers
- What Do Safety-Aligned LLMs Learn From Mixed Compliance Demonstrations?Analysis / interpretabilityarXiv
- Controlled Decoding Attacks on Black-Box LLMsAttacksarXiv