Skip to content

OTTER: Bypassing GPT-series toxicity moderation by replacing only five tokens, raising average attack success rate to 84%OTTER: A Red-Teaming System for Toxicity-Evading Jailbreak Prompt Optimization

Paper Tracker· arXiv:2606.21077· Jerry Wang, Hsin-Ling Hsu, Yi-Cheng Lai, Nai-Chia Chen, Fang Yu·Indexed by this site · 2026-10-08· Originally publishedSelected AttacksSelectedAttention38

Quick read

Attacks

Based on the paper PDF (generated by Gemini); refer to the original

OTTER replaces up to 5 tokens to reduce surface toxicity, raising the average ASR of four GPT models on AdvBench from 7.0% to 84.0% (OTTER-RV).

Threat modelBlack-box setting: the attacker has only standard moderation API and chat API access, without model weights, gradients, or external auxiliary attacker LLMs. The attack goal is to generate a rewritten prompt p* via vocabulary replacement that satisfies the black-box toxicity score T(p*) <= tau 且保持语义相似度 cos(E(p*), E(p)) >= delta, causing the victim target LLM to not produce a refusal response.

Questions
Commercial production LLMs rely on toxicity moderation APIs as the primary input-side defense, assuming that harmful intent correlates with surface toxicity vocabulary. Existing white-box attacks require weights and gradients, while black-box attacks rely on high-cost auxiliary attacker LLMs; there is a lack of jailbreak auditing methods that rely only on standard API access and do not require model weights.
Methods
Proposes the black-box rewriting framework OTTER, modeling jailbreaking as a constrained optimization problem. It computes each token's contribution to the toxicity score via mask-drop, skips stop words to select the top k tokens, uses BERT to generate candidate words (OTTER-MLM) or randomly samples from the vocabulary (OTTER-RV), and uses greedy search to find replacement combinations that balance toxicity reduction with semantic preservation.
Experiments and results
On 457 harmful prompts from AdvBench, four GPT models were tested; OTTER-MLM raises the average ASR from 7.0% to 75.6%, and OTTER-RV reaches 84.0%. Post-rewrite toxicity correlates with bypass probability (AUC=0.823), and prompts with toxicity below 0.1 achieve a 93.6% bypass rate on GPT-4-class models.
Limitations and future work
The evaluation is limited to English prompts from AdvBench and does not cover multilingual or domain-specific corpora; token-level rewriting is weaker when harmful intent is conveyed through discourse structure or implicit expression (cybercrime ASR is 73.7%); refusal determination relies on keyword matching; the bypass rate reflects a snapshot of current API behavior and may change as defenses are upgraded.
Experimental setupGPT-4-turbo、GPT-4o et al. · AdvBench · ASR、∆Tox et al.
Evaluated models
GPT-4-turboGPT-4oGPT-4o-miniGPT-3.5-turboOpenAI Moderation API
Benchmarks
AdvBench
Metrics
ASR∆ToxBTCAUCAPI Calls
AI summaryand selection rationaleThe researchers propose the OTTER black-box red-teaming framework, which uses mask-drop attribution to identify tokens that drive up toxicity scores, then rewrites prompts using BERT mask filling (OTTER-MLM) or random vocabulary replacement (OTTER-RV), requiring only standard API access. On 457 AdvBench prompts and four GPT models, the average attack success rate rises from 7.0% to 75.6% with OTTER-MLM and 84.0% with OTTER-RV, with GPT-4-turbo improving by 70.7 percentage points. The paper is the first to quantify the relationship between toxicity scores and bypass probability (BTC=0.505, AUC=0.823); prompts with toxicity below 0.1 have a bypass rate of 93.6%, while those above 0.1 have 57.8%. By harm category, self-harm/suicide and hate speech bypass rates reach 95% to 96%, with cybercrime lowest at 73.7% because technical terms themselves have low toxicity scores.

The researchers propose the OTTER black-box red-teaming framework, which uses mask-drop attribution to identify tokens that drive up toxicity scores, then rewrites prompts using BERT mask filling (OTTER-MLM) or random vocabulary replacement (OTTER-RV), requiring only standard API access. On 457 AdvBench prompts and four GPT models, the average attack success rate rises from 7.0% to 75.6% with OTTER-MLM and 84.0% with OTTER-RV, with GPT-4-turbo improving by 70.7 percentage points. The paper is the first to quantify the relationship between toxicity scores and bypass probability (BTC=0.505, AUC=0.823); prompts with toxicity below 0.1 have a bypass rate of 93.6%, while those above 0.1 have 57.8%. By harm category, self-harm/suicide and hate speech bypass rates reach 95% to 96%, with cybercrime lowest at 73.7% because technical terms themselves have low toxicity scores.

Why it was selectedThe paper quantifies the relationship between toxicity scores and jailbreak success rates, and provides specific recommendations for hardening classifiers stratified by harm category.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Production reliance on surface toxicity filtering has an inherent fragility; the paper proposes OTTER, a lightweight black-box jailbreak framework requiring only standard API access.

    This paper attempts to address the vulnerability of commercial large language models that rely on surface toxicity filters, and the limitation that existing jailbreak attack methods cannot be directly applied to closed-source black-box auditing because they depend on white-box access or auxiliary large models.

    • Fragile assumptions of input-side defenses: The authors state that production LLM deployments commonly rely on toxicity-based moderation APIs (OpenAI, 2023) as the primary input-side defense, whose basic assumption is that harmful intent correlates with surface toxicity vocabulary, but this assumption is structurally fragile under token replacement attacks.
    • Auditing limitations of existing red-teaming methods: White-box attacks (e.g., GCG, AutoDAN) rely on model weights and gradients that are unavailable from commercial APIs; BEAST relies on local token probability beam search; black-box attacks (e.g., PAIR, TAP, DAGR, PAP) rely on high-capability external auxiliary attacker LLMs, introducing additional invocation costs and latency.
    • Core observation and hypothesis: The authors note that surface toxicity and adversarial intent can be decoupled; replacing as few as 5 tokens can eliminate toxicity features while preserving the original malicious intent.
    • Threat model:
      • Attacker objective: Construct rewritten prompts that satisfy black-box toxicity thresholds and maintain semantic similarity, bypass input filtering and alignment defenses, and induce the target LLM to give substantive harmful responses.
      • Attacker knowledge: Black-box setting; does not have model weights, gradients, or token probability distributions, and does not use external auxiliary attacker LLMs.
      • Attacker capabilities: Only standard API access to a black-box toxicity scoring interface (e.g., OpenAI Moderation API) and the target LLM chat interface.
      • Victim system: Closed-source commercial large language model services (e.g., gpt-4-turbo, gpt-4o, gpt-4o-mini, gpt-3.5-turbo) deployed with front-end input toxicity moderation filters.
    • Proposed solution: The paper proposes OTTER, a lightweight black-box red-teaming framework requiring only standard API access (including OTTER-MLM and OTTER-RV variants), and conducts a systematic empirical analysis of the relationship between toxicity and bypass.
  2. What related research exists?

    The paper reviews white-box, auxiliary LLM black-box attacks, toxicity moderation, and red-teaming benchmarks, noting that OTTER directly targets toxicity scoring and requires no auxiliary models.

    White-Box and Local Adversarial Attacks

    • Gradient and evolutionary optimization methods (Zou et al., 2023; Liu et al., 2024): GCG optimizes adversarial token suffixes via greedy coordinate gradient descent; AutoDAN uses a hierarchical genetic algorithm with log-likelihood as the fitness function. The authors note that both achieve strong attack success rates in controlled environments but cannot be applied to closed-source commercial APIs.
    • Local beam search method (Sadasivan et al., 2024): BEAST requires no gradients but needs local model access to perform beam search over token probabilities, and is likewise inapplicable to closed-source deployment scenarios.

    Black-Box Attacks Based on Auxiliary LLMs

    • Iterative querying and tree search (Chao et al., 2025; Mehrotra et al., 2024): PAIR iteratively queries the target model and uses an auxiliary attacker LLM to optimize candidate prompts, typically converging within 20 queries; TAP builds on PAIR by introducing tree search and an evaluator LLM to prune branches.
    • Diversification and persuasion strategies (Zhao et al., 2025; Zeng et al., 2024): DAGR alternates between globally diverse root prompts and locally obfuscated leaf prompts to improve diversity; PAP applies a taxonomy of 40 persuasion strategies to rewrite harmful prompts, achieving over 92% ASR on multiple models. The authors note that PAP aims to change the model's semantic understanding rather than lower moderation scores, and its rewriting still relies on an attacker LLM.

    Content Moderation and Safety Evaluation Benchmarks

    • Toxicity detection and evasion (OpenAI, 2023; Yang et al., 2024): The OpenAI Moderation API scores queries before they reach the model but is sensitive to explicit keywords; in the text-to-image domain, SneakyPrompt uses reinforcement-learning-guided token replacement to bypass safety filters. The authors note that existing studies have not systematically characterized the key tokens driving classification decisions, nor quantified the required degree of toxicity reduction.
    • Safety benchmarks and harm analysis (Zou et al., 2023; Mazeika et al., 2024; Zhao et al., 2025): AdvBench and HarmBench provide standard behavioral corpora for evaluating attacks and defenses; DAGR provides category-level ASR breakdowns on HarmBench.
    • Baseline methods and benchmarks: The experiments compare against the original direct prompt baseline (Direct prompt, unmodified original AdvBench input) and the GPT-4o single-rewrite baseline (GPT-4o paraphrase); the evaluation benchmark consists of 457 AdvBench (Zou et al., 2023) prompts retained after filtering with the OpenAI Moderation API.

    Positioning and Differences of This Work

    • The authors position OTTER's core differences from the above work as: directly using the toxicity score as the optimization objective, using mask-drop attribution to identify the key tokens driving moderation decisions, requiring neither model internal weights nor an external attacker LLM, and providing the first systematic empirical analysis of the relationship between toxicity and bypass.
  3. How does the paper address this problem?

    OTTER uses mask-drop attribution to identify high-toxicity tokens, combines MLM or random vocabulary candidates, and uses greedy search to achieve toxicity-reducing rewrites that satisfy semantic constraints.

    The paper proposes OTTER (Obfuscated Toxicity-Evading Token Evolution for Rewriting), a black-box red-teaming framework that models prompt jailbreaking as a constrained optimization problem balancing toxicity reduction and semantic preservation, completing rewriting in three steps: token attribution, candidate generation, and greedy search.

    Problem Formalization and Optimization Objective

    • Notation: Let the original harmful prompt be p = (w_1, ..., w_n), the black-box toxicity scorer be T(p) ∈ [0, 1] (using the OpenAI Moderation API), and the sentence encoder E(p) ∈ R^d use bert-base-uncased CLS vectors to produce semantic embeddings.
    • Constrained optimization problem: OTTER seeks a rewritten prompt p* satisfying the black-box toxicity threshold T(p*) ≤ τ and semantic cosine similarity cos(E(p∗), E(p)) ≥ δ. This constraint requires the rewritten prompt to maintain cosine similarity with the original prompt in semantic vector space no lower than the threshold δ.
    • Hyperparameter settings: The experiments set the toxicity threshold τ = 0.1, semantic similarity threshold δ = 0.7, and replacement budget k = 5.

    Token Attribution and Candidate Generation

    • Mask-drop attribution: For each non-stopword position i in the prompt, replace token w_i with [MASK] to obtain p_i^mask, and compute that token's contribution to the toxicity score via Δi = T(p) − T(pimask). This expression represents the decrease in toxicity score caused by masking a single token; the larger the difference, the greater that token's contribution to triggering the toxicity moderation.
    • Position selection: Select the top k positions P = {i_1, ..., i_k} in descending order of Δ_i; the paper sets skipping of stop words to reduce API calls.
    • OTTER-MLM candidate set: Use bert-base-uncased in fill-mask mode to obtain the top K context-dependent replacement words (|C| = 20); any candidate whose cosine similarity falls below δ is directly discarded before evaluation.
    • OTTER-RV candidate set: Uniformly sample candidates (|C| = 20–100) from the filtered full BERT vocabulary (alphabetic only, no subwords, length greater than 2, vocabulary size approximately 20,000); the authors state this variant has a broader search space and more aggressive toxicity reduction, but higher call volume.

    Greedy Search and System Implementation

    • Position-level greedy evaluation: Iterate over candidate words in position order, selecting the token that minimizes the objective loss function: ℒ(x) = T(g(p, x)) + λ (1 − cos(E(g(p, x)), E(p))). This loss combines the rewritten black-box toxicity score with a penalty for deviating from the original semantics, with weight λ = 0.1 balancing toxicity reduction and semantic drift.
    • API call overhead: The toxicity API call count for a single prompt is approximately n_stop + k · |C|; the authors report approximately 23 calls for OTTER-MLM (k=5, |C|=20) and approximately 100 calls for OTTER-RV (|C|=100).
    • Interactive system architecture: The system is implemented as a three-tier web application (Appendix C), with a React frontend displaying token attribution heatmaps and toxicity progress bars, a FastAPI backend providing /attribute and /rewrite asynchronous task interfaces with a Redis status queue, and streaming of target LLM responses via the OpenAI Chat API.
  4. What experiments did the paper conduct?

    On 457 AdvBench prompts, OTTER raises the ASR of four GPT models from 7.0% to 75.6%–84.0%, achieves an AUC of 0.823, and produces zero false positives on benign prompts.

    Experimental Setup

    • Target models under test: Four closed-source GPT models, namely gpt-4-turbo, gpt-4o, gpt-4o-mini, and gpt-3.5-turbo (accessed via the OpenAI chat API).
    • Dataset and scale: AdvBench (Zou et al., 2023), originally containing 520 harmful behavior instructions; after filtering with the OpenAI Moderation API, 457 prompts judged as harmful were retained.
    • Comparison baselines: Direct prompt (unmodified original AdvBench input) and GPT-4o paraphrase baseline (GPT-4o paraphrase, instructing GPT-4o via a single API call to rewrite using mild language).
    • Metric definitions: Attack success rate (ASR, the proportion of responses from the target model that are not refusals), toxicity change (∆Tox), point-biserial correlation coefficient (BTC), area under the receiver operating characteristic curve (AUC), and number of API calls.
    • Evaluation method: Following the substring matching approach of Zou et al. (2023), matching against a standard list of refusal phrases (e.g., "I cannot", "I'm unable", "I will not"); API timeout responses are treated as refusals.
    • Confidence intervals and repetition settings: All ASR values report 95% Bootstrap confidence intervals (2,000 resamples); the paper does not report the number of independent repeated runs.

    Main Results

    Target modelAdvBench original prompt ASR (%)OTTER-MLM ASR (%)
    GPT-4-turbo0.7 [0.0, 1.5]71.3 [67.0, 75.3]
    GPT-4o6.6 [4.4, 9.0]69.8 [65.9, 74.0]
    GPT-4o-mini7.4 [5.0, 9.8]74.2 [70.2, 78.1]
    GPT-3.5-turbo13.1 [10.3, 16.2]87.3 [84.2, 90.4]
    Average7.075.6

    (Note: according to Table 1; OTTER-RV average ASR is 84.0%, and the GPT-4o paraphrase baseline average ASR is 77.0% (Table 1 title and §5.4); per-model breakdown values are not reported in Table 1 in the paper)

    • Bypass rate increases substantially: The authors note that OTTER-MLM raises the average ASR from 7.0% to 75.6% (an increase of 68.6 percentage points), with all confidence intervals not overlapping the baseline; even the most capable GPT-4-turbo shows an increase of 70.7 percentage points.
    • Capability cannot replace alignment: The authors argue that stronger model capability cannot substitute for an intent-aware moderation mechanism; stronger models instead generate more helpful responses to obfuscated prompts rather than more robust refusals.
    • Baseline comparison transparency: The single-call GPT-4o paraphrase baseline achieves a 77.0% average ASR, but the authors note that it provides no toxicity metric or token attribution and lacks a reproducible rewriting process.

    Quantitative Analysis of the Relationship Between Toxicity and Bypass

    • What was measured: The point-biserial correlation between the post-rewrite toxicity score -T(p*) and majority-vote bypass outcomes, as well as a logistic regression model predicting bypass based on T(p*).
    • Experimental results: BTC reaches 0.505 (p = 6.68 × 10^-31); the logistic regression model achieves an AUC of 0.823 on T(p*) (β = -4.49); prompts with T(p*) < 0.1 have a bypass rate of 93.6%, while those with T(p*) ≥ 0.1 have a bypass rate of 57.8%, a 1.6-fold difference.
    • Authors' interpretation: The authors argue that the toxicity score can reliably serve as a proxy for bypass probability (AUC=0.823); the residual gap (BTC < 1) reflects harmful intent retained through discourse structure or technical terminology, which is also OTTER's main failure mode.

    Per-Harm-Category Breakdown and Mechanism Analysis

    • What was measured: OTTER-MLM's ASR and toxicity reduction ∆Tox across 9 harm categories (Table 2, Figure 4, weighted average ASR of 78.5%).
    • Experimental results: Self-harm/suicide (n=25) and hate speech (n=20) achieve ASRs of 96.0% (∆Tox=0.759) and 95.0% (∆Tox=0.564), respectively; cybercrime/hacking (n=179) achieves the highest ∆Tox (0.771) but the lowest ASR (73.7%). Other categories include fraud/financial crime (n=121, ASR=80.2%, ∆Tox=0.761), weapons/explosives (n=37, ASR=78.4%, ∆Tox=0.760), child safety (n=9, ASR=77.8%, ∆Tox=0.677), drugs (n=13, ASR=76.9%, ∆Tox=0.735), violence/physical harm (n=43, ASR=74.4%, ∆Tox=0.630), and other (n=10, ASR=90.0%, ∆Tox=0.625).
    • Authors' interpretation: The authors analyze that the maliciousness of self-harm and hate speech is concentrated in a few surface tokens, and replacing them simultaneously removes both the moderation signal and the model's refusal trigger; whereas technical terms in categories such as cybercrime (e.g., exploit, vulnerability) still carry harmful intent even when toxicity scores are not high, so merely reducing toxicity is insufficient to trigger a bypass.

    Benign Prompt False Positives and Rewriting Specificity Analysis

    • What was measured: Testing toxicity score changes caused by OTTER rewriting on 100 benign prompts (§5.5).
    • Experimental results: The average toxicity change for the 100 benign prompts is -0.0079; no prompt has a toxicity increase exceeding 0.05, and the maximum toxicity increase is only +0.0015.
    • Authors' interpretation: The authors note that benign prompts have near-zero toxicity to begin with, so mask-drop attribution cannot find high-contribution tokens to replace, confirming that OTTER's rewriting mechanism is by design specific to harmful prompts and achieves zero false positives on benign prompts.

    Other Ablations and Analyses

    • With edit budget k=1, ASR is 37.5%, ∆Tox is 0.372, and API calls are 3 (Table 3).
    • With edit budget k=2, ASR is 47.5%, ∆Tox is 0.517, and API calls are 6 (Table 3).
    • With edit budget k=3, ASR is 57.5%, ∆Tox is 0.614, and API calls are 9 (Table 3).
    • With edit budget k=5, ASR is 70.0%, ∆Tox is 0.721, and API calls are 15 (Table 3).
    • With edit budget k=8, ASR is 78.8%, ∆Tox is 0.803, and API calls are 24 (Table 3).
    • In the strategy comparison, OTTER-MLM achieves an ASR of 78.0% (∆Tox=0.747, 15 API calls), OTTER-RV reaches 84.0% (∆Tox=0.813, 100 API calls), and GPT-4o paraphrase achieves 77.0% (∆Tox=0.644, 1 API call) (Table 4).
  5. What are some points that can be further explored?

    The authors note that current evaluations are limited to English corpora, rely on keyword matching to detect refusals, and are less effective at rewriting discourse-level implicit intent.

    Limitations and future directions noted by the authors

    • Multilingual and domain-specific corpora: The evaluation was conducted only on English prompts from AdvBench, and OTTER's performance on multilingual inputs or domain-specific corpora (e.g., medical, legal) remains an open question and a future research direction (from Limitations).
    • API behavior snapshot effect: The reported bypass rates reflect a snapshot of current API behavior and will change as moderation systems are updated; the actual severity in future deployments depends on the evolution of the moderation systems (from Limitations).
    • Failure modes of discourse structure and implicit intent: When harmful intent is expressed through discourse structure or implicit phrasing rather than explicit toxic keywords, token-level rewriting is less effective, and the relatively lower bypass rate (73.7%) for cybercrime prompts represents the main failure mode of the method (from Limitations and §5.2).
    • Refusal detection relies on keyword matching: The ASR metric relies on keyword matching to detect refusals, which may underestimate ASR when the model produces harmful content without standard refusal phrases, and may overestimate ASR under unconventional refusal expressions; the authors note that future work could adopt an LLM-as-judge protocol similar to HarmBench to provide more reliable estimates (from Limitations).

    Experimental coverage

    • Target models tested: The experiments tested 4 closed-source models: gpt-4-turbo, gpt-4o, gpt-4o-mini, and gpt-3.5-turbo, all accessed via the OpenAI chat API.
    • Test benchmark and sample sizes: The test benchmark consisted of 457 English AdvBench prompts retained after filtering with the OpenAI Moderation API; in the ablation experiments, the k-value analysis was based on 80 prompts, the strategy comparison was based on 50 prompts (GPT-4o rewriting was based on 100 prompts); the false positive analysis tested 100 benign prompts.
    • Moderation and auxiliary model configuration: Toxicity scoring used the OpenAI Moderation API, token embeddings and masked candidate generation used bert-base-uncased, and the rewriting baseline used GPT-4o; the paper does not report direct replacement evaluations with other commercial toxicity classifiers.
    • Judgment protocol: The evaluation used a keyword substring matching-based judgment protocol to detect refusals and computed 95% Bootstrap confidence intervals over 2,000 resamples; the paper does not report the number of independent repeated runs for each model experiment.
  6. Summarize the main content of the paper

    The paper demonstrates the decoupling of surface toxicity and malicious intent, implements black-box jailbreak testing through standard APIs, and proposes closed-loop classifier hardening recommendations.
    • Core positioning: This study proposes OTTER, a lightweight black-box jailbreak red-teaming framework requiring only standard API access, revealing the architectural vulnerability of surface toxicity defenses in production large language models.
    • Research question: Industry LLMs commonly rely on toxicity moderation interfaces to block harmful inputs, assuming malicious intent is tied to surface toxicity vocabulary; existing white-box attacks rely on weights, and black-box attacks rely on expensive auxiliary attacker LLMs, lacking practical auditing tools.
    • Method mechanism: OTTER models jailbreaking as a semantic-constrained optimization problem, uses mask-drop to compute token toxicity attribution, identifies the top k high-toxicity positions, combines BERT contextual candidates (OTTER-MLM) or random vocabulary (OTTER-RV), and uses greedy search to find replacement solutions that balance low toxicity and semantic preservation.
    • Main experimental results:
      • On 457 AdvBench prompts, OTTER-MLM raises the average ASR of four GPT models from 7.0% to 75.6%, and OTTER-RV reaches 84.0% (Table 1 title and main text).
      • Toxicity scores and majority-vote bypass results show a strong negative correlation (BTC=0.505), with logistic regression AUC of 0.823; prompts with post-rewrite toxicity below 0.1 achieve a bypass rate of 93.6% on GPT-4-class models (§5.1).
      • Harm category differences are significant: self-harm and hate speech ASR reaches 95.0%–96.0%, while cybercrime prompts that rely on specialized terminology achieve only 73.7% ASR despite the highest toxicity reduction (∆Tox=0.771) (Table 2).
      • On 100 benign prompts, the mean toxicity change is -0.0079, and no prompt has a toxicity increase exceeding 0.05, achieving zero false positives (§5.5).
    • Defense implications and conclusions: The authors note that model capability improvements cannot eliminate such vulnerabilities (the ASR increase difference between GPT-4-turbo and GPT-3.5-turbo is only 3.5 percentage points); toxicity filtering and model refusal share surface signals that are easily perturbed; the authors recommend integrating OTTER into CI/CD security pipelines to generate adversarial hard negatives, and combining intent-aware classifiers for layered defense of high-risk categories.

Related papers

Show 3 more papers
Read originalarxiv.org