Guaranteed Jailbreaking Defense via Disrupt-and-Rectify Smoothing

Zheng Lin, Haoxuan Ji, Haichang Gao, Zhenxing NiuNeurIPS 2026

TL;DR

When defending large language models (LLMs) against "jailbreaking" attacks, adding random typos to incoming prompts breaks the attack—but it also turns normal questions into gibberish, confusing the AI. This paper introduces Disrupt-and-Rectify Smoothing (DR-Smoothing), a two-step defense that first scrambles parts of a prompt to shatter hidden exploits, and then cleans it up so the LLM can still understand benign requests. Better yet, the authors bring rigorous math to the table, proving formal guarantees on just how well this defense holds up.

What Problem Does This Paper Address?

Even well-aligned LLMs can be tricked into generating harmful content via jailbreaking—either through sneaky social engineering (prompt-level attacks) or bizarre, algorithmically optimized strings of gibberish tacked onto the end of a query (token-level attacks).

Because model weights are often locked behind APIs, black-box defenses that preprocess the input are super appealing. One popular approach, SmoothLLM, borrows from image security: it makes several copies of a prompt, injects random character typos into each, feeds them to the LLM, and takes a majority vote on whether to refuse the request.

The catch? Perturbed prompts are out-of-distribution gibberish. Feeding mangled text to an LLM makes it behave unpredictably, tanking its helpfulness on completely innocent requests. Conversely, defenses that merely paraphrase prompts preserve helpfulness, but frequently fail to block clever attacks. Furthermore, most existing defenses rely purely on "it works in practice" vibes without mathematical guarantees. The authors tackle both gaps: balancing harmlessness (blocking bad stuff) with helpfulness (answering good stuff), backed by formal theoretical bounds.

Methods

Inspired by Denoised Smoothing in computer vision—where you add Gaussian noise to an image and then run it through a denoiser before classifying it—the authors propose DR-Smoothing. Instead of a single-stage perturbation, they use a four-step pipeline:

Figure 1: The workflow of our defense approach. There are four steps in our DR-Smoothing approach, where a disrupt-and-rectify scheme is integrated into the smoothing defensive framework.
  1. Disruption (Standard + Extended): An incoming prompt is copied $N$ times. Each copy has $q\%$ of its text randomly altered. While SmoothLLM only tweaks characters (inserting, swapping, patching), DR-Smoothing mixes in word-level perturbations (inserting, deleting, or substituting whole words).
  2. Rectification (The Novel Twist): Before the target LLM ever sees those mangled prompts, a "rectification module" (powered here by GPT-3.5-turbo) cleans them up, restoring them to normal, in-distribution text. It chooses from seven operations—like spell-checking, paraphrasing, summarizing, or translating. The operation can be picked randomly (Uniform) or smartly chosen for each specific input by a lightweight 3-layer neural network trained via reinforcement learning (Policy).
  3. Aggregation & Response: All $N$ rectified prompts go to the target LLM. A binary judge checks how many responses are refusals vs. acceptances. If more than half are acceptances, the system answers the original prompt; otherwise, it outputs one of the generated refusals.

Datasets

No new benchmarks were introduced; the authors evaluated their pipeline on two established datasets:

  • AdvBench: A collection of harmful queries covering violence, financial crimes, and illegal acts, used to test harmlessness (how well the defense blocks GCG, PAIR, and AutoDAN-Turbo attacks).
  • InstructionFollow (IF): A standard benchmark of 541 specific instructions used to measure helpfulness (whether the defended LLM can still follow benign formatting and content rules, like "write a letter in all lowercase").

Key Insights and Ideas

  • Why "Break-and-Fix" Doesn't Cancel Out: You might think fixing typos right after making them would accidentally restore the jailbreak! It doesn't, because of a clever scale mismatch: disruption is local, while rectification is global. Disruption breaks fragile adversarial triggers at the character or word level, whereas rectification reads the whole sentence and rewrites its overarching semantic meaning. The toxic intent shines through clearly to the LLM's safety filters, minus the adversarial camouflage.
  • The Math Behind the Magic: Using Hoeffding's inequality and Lipschitz continuity, the authors prove that if your disruption percentage $q$ crosses a specific mathematical threshold, your Defense Success Probability is guaranteed to be high ($1 - \epsilon$). Adding the rectification step further alters the prompt text, effectively increasing the system's sensitivity to perturbation (a higher Lipschitz constant). Practically, this means DR-Smoothing achieves stronger protection than SmoothLLM using the exact same disruption strength $q$.
  • Mixing Granularities Matters: Character-level noise wrecks token-level gibberish attacks (GCG), while word-level noise is much better at breaking sneaky semantic attacks (PAIR). Since a defender never knows what attack is coming, randomly mixing both is essential.

Key Results

Tested across Vicuna-7B, Llama-2-7B, Qwen2.5-7B, and GPT-3.5-turbo, DR-Smoothing (especially the Policy variant) consistently nails the sweet spot between safety and utility:

Table 1: Defending against established attacks. Harmlessness is evaluated using ASR on the AdvBench dataset, whereas Helpfulness is assessed through Accuracy on the InstructionFollow (IF) dataset.
  • Crushing Established Attacks Without Losing Brains: On Vicuna, an undefended model suffers a 95.2% Attack Success Rate (ASR) against GCG and scores 38.1% on InstructionFollow accuracy. SmoothLLM drops GCG ASR to 8.6%, but helpfulness plummets to 19.8%. DR-Smoothing-Policy drives GCG ASR all the way to 0%, while keeping helpfulness right near baseline at 36.7%. Against the state-of-the-art AutoDAN-Turbo attack on Llama-2, it slashes ASR from 31% down to 1%.
  • Holding Up Against Adaptive Attackers: Even when a smart attacker (Adaptive PAIR) knows the exact defense pipeline and optimizes against it, DR-Smoothing-Policy keeps ASR remarkably low—achieving 16% on GPT-3.5-turbo, compared to 40% for SmoothLLM and 22% for SemanticSmooth.
  • Fast Mode Works: Because smoothing queries the model $N$ times, it adds latency. However, dropping from $N=10$ copies to a lightweight $N=2$ cuts total runtime from 10.9 seconds to 2.9 seconds, while GCG ASR barely budges (staying $\le 1.0\%$).

Limitations and Future Work

The main limitation acknowledged by the authors is query overhead. Because smoothing requires running $N$ parallel copies through both a rectifier LLM and the target LLM, robustness comes at the direct cost of extra compute and API latency (though setting $N=2$ helps mitigate this). Future directions are not explicitly detailed by the authors in the main text.

Summary updated

Abstract

This paper proposes a guaranteed defense method for large language models (LLMs) to safeguard against jailbreaking attacks. Drawing inspiration from the denoised-smoothing approach in the adversarial defense domain, we propose a novel smoothing-based defense method, termed Disrupt-and-Rectify Smoothing (DR-Smoothing). Specifically, we integrate a two-stage prompt processing scheme—first disrupting the input prompt, then rectifying it—into the conventional smoothing defense framework. This disrupt-and-rectify approach improves upon previous disrupt-only approaches by restoring out-of-distribution disrupted prompts to an in-distribution form, thereby reducing the risk of unpredictable LLM behavior. In addition, this two-stage scheme offers a distinct advantage in striking a balance between harmlessness and helpfulness in jailbreaking defense. Notably, we present a theoretical analysis for generic smoothing framework, offering a bound for the defense success probability and the requirements on the disruption strength. Our approach can defend against both token-level and prompt-level jailbreaking attacks, under both established and adaptive attacking scenarios. Extensive experiments demonstrate that our approach surpasses current state-of-the-art defense methods in terms of both harmlessness and helpfulness.
BibTeX
@inproceedings{lin2026guaranteed,
  author = {Zheng Lin and Haoxuan Ji and Haichang Gao and Zhenxing Niu},
  title = {{Guaranteed Jailbreaking Defense via Disrupt-and-Rectify Smoothing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=e8vk31VuzR},
}
Figure