SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks
Paper · 2023 · Alexander Robey, Eric Wong, Hamed Hassani et al.
Summary
A safety-trained large language model may refuse a harmful request in its ordinary wording and answer it when the request is embedded in a specially constructed prompt. SmoothLLM takes advantage of a weakness in some of those constructions. An attack that succeeds on the original prompt can fail after a small fraction of its characters are changed. The authors ask whether such changes can support a practical defense that reduces harmful responses, preserves performance on legitimate tasks, keeps the cost of each request manageable, and works with systems available only through an interface.
SmoothLLM runs around an existing generator without retraining it. It makes independent copies of the incoming prompt and applies random character edits to each copy. The edits can insert characters, replace scattered characters, or replace characters in a contiguous patch. The underlying generator answers each version. A jailbreak judge assigns each answer a binary label, and a threshold vote over those labels determines which group of answers the defense can return from. In the standard version, the user receives an answer the generator already produced for an edited prompt. The procedure does not need to identify an adversarial suffix or know whether the prompt contains one.
The evaluation uses AdvBench for GCG, RandomSearch, and AmpleGCG, and JBB-Behaviors for the semantic attack PAIR. It includes open systems such as Vicuna and Llama2, as well as commercial systems accessed through queries. The paper reports a GCG attack success rate below one percentage point with SmoothLLM and near-zero rates in its RandomSearch and AmpleGCG comparisons. PAIR also becomes less effective, although the size of the improvement varies by system. In a defense comparison on JBB-Behaviors, SmoothLLM reduced PAIR’s attack success rate by 60% relative to no defense, compared with 32% for perplexity filtering. The tested adaptive GCG variant, evaluated through transfer from an approximation of the defense, showed no advantage over GCG prompts prepared against an undefended generator.
The experiments also show what the defense costs. With a 10% editing rate and just one extra generation query, the reduction in GCG success ranged from 2.5–7.0× on Vicuna and from 5.7–18.6× on Llama2, depending on the edit type. The paper contrasts the approximately 256,000 queries in a default GCG run with the typical SmoothLLM budget of 20 queries or fewer. On ordinary tasks, heavier edits eroded performance, and some jailbreak judges mistook replies to unintelligible prompts for successful attacks. A variant that sometimes answers the original wording recovered instruction-following performance in the reported tests. The authors released the SmoothLLM code. Their theoretical result explains how the vote can amplify a favorable tendency under a specific assumption about suffix fragility, while the experiments show how much that tendency depends on the attack, the edits, and the judge.
Deep dive: SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks
SmoothLLM defends against jailbreaks by testing randomly edited prompts and using a vote to choose which response to return. · about 39 minutes to read
The problem and its context
How a refusal can depend on the surrounding text
When a conversational system refuses a harmful request, the refusal shows how it responded to that particular input. A user can convey much the same request through a different prompt. In an adversarial setting, the choice of wording is deliberate and its purpose is to bypass a safeguard. The authors use jailbreak for the resulting failure, in which a generator produces objectionable content that its safety mechanisms were meant to prevent. A change in phrasing matters to this study because it can change whether the response crosses that boundary.
The paper places this problem in the context of training on large collections of internet text. Exposure to those collections helps a generator produce credible responses across many subjects and also exposes it to material that can be harmful to reproduce. Alignment attempts to shape which behavior the generator exhibits when people use it. The paper cites work on training with human feedback as one route to better instruction-following and alignment. Those efforts can make clear violations less common in ordinary interaction. Testing with deliberate adversarial inputs asks how reliably the safeguards hold when a user sets out to defeat them. Training language models to follow instructions with human feedback.
The concern is especially acute for systems used in settings where generated text may influence judgments about education, health, or business. The paper invokes these settings to explain why a guardrail that looks reliable during ordinary use still deserves adversarial evaluation. It also draws on work examining failures of safety training. In this setting, the existing system’s apparent willingness to refuse is the starting point for the investigation. Its reliability under deliberately chosen wording is the property under test. Jailbroken.
A suffix-based jailbreak illustrates the distinction between the underlying request and its presentation. The paper calls the request for the objectionable content the goal. The suffix is the extra text attached to that goal. Its role is to change the generator’s behavior. It can do so even when the additional characters look unrelated to the request to a person reading them. The work that introduced GCG gives SmoothLLM a concrete example of this class of vulnerability. The paper also considers semantically constructed prompts, represented in its evaluation by PAIR, for which the meaningful wording of the prompt itself carries more of the adversarial effect. Universal and Transferable Adversarial Attacks on Aligned Language Models.
There is a distinction between a goal, a prompt that expresses it, and an answer that actually helps accomplish it. A system might begin a response in a cooperative tone and then give little substantive assistance. It might explain that the input is unclear. It might refuse using wording unlike that anticipated by a simple automated check. Such cases matter because a benchmark needs a rule for turning a whole answer into an outcome. The authors formalize that rule as a jailbreak judge and discuss several ways the field has implemented it, including text matching, human assessment, and automated classifiers. Differences among those choices affect what a measured success means.
Why the authors wanted a defense at query time
The paper relates jailbreaks to the older problem of adversarial examples. In vision research, small changes chosen by an adversary can cause a system to misclassify an image. Research on text robustness likewise explored changes such as word substitution, altered spelling, and character replacement. SmoothLLM shifts the outcome of interest to whether a generator produces harmful content in response to an objectionable request. A long generated answer can express that outcome in many ways, while a classification benchmark typically specifies a label against which to score a prediction. Intriguing Properties of Neural Networks.
A major line of defense in the earlier literature was adversarial training. Its basic idea is to expose a system to changed inputs as part of training so that learning can account for them. The paper describes much of the earlier language robustness work as depending on retraining or fine-tuning. The authors regard the computational burden of that route as prohibitive for the systems they target. There is also an access problem. A service can expose its ability to generate text while withholding the parameters and training process required to modify the generator. Explaining and Harnessing Adversarial Examples.
As the paper describes the contemporaneous defense work, some researchers were already investigating input preprocessing and heuristic detection. These approaches offered a way to intervene before text went to the generator, with mixed results across the approaches considered. Another line of work evaluated parts of the input separately. The authors identify the growth in computation with prompt length as a constraint on that strategy. SmoothLLM instead fixes the number of edited copies in advance. That choice controls the number of generations at the wrapper level, while the work needed for each generation still depends on its input and output.
The authors also borrow from randomized smoothing, a strategy developed in part to make classifiers more robust. A smoothed classifier applies a base predictor to inputs drawn from a noise distribution around an original input. It uses the relative frequency of the resulting labels to define a prediction. SmoothLLM is built for text generation, where answers can differ in wording, length, and detail even when they serve the same purpose. Its adaptation is to vote on a property of generated answers. The property is whether a judge labels each answer a jailbreak. The wrapper then returns generated text belonging to the chosen class.
What counts as a practical defense
The paper evaluates a defense against several demands that can pull in different directions. Attack mitigation concerns how often a defense prevents the harmful output and whether its protection extends to an adversary who knows the defense is present. Non-conservatism concerns the legitimate work people still need the generator to do. A policy of discarding every reply would solve the measured attack problem by removing the service. In a useful defense, the ordinary behavior of the system needs a separate measurement.
Efficiency encompasses the cost of adding the defense in the first place and the cost of running it for a request. A wrapper can avoid a new training run and still impose meaningful overhead through repeated generation. Compatibility concerns what access the wrapper needs and which systems can supply it. The paper contrasts access to an open system such as Llama2 with access through a commercial interface. The basic defense is designed around the operation both expose, submitting text and receiving a response. Llama 2.
These demands explain why the article’s central question is more specific than whether arbitrary random changes can spoil an attack. Heavy editing can make a prompt unreadable, including the portion that expresses a legitimate task. Light editing can preserve the task while leaving an adversarial construction effective on some draws. The proposed procedure depends on a range in which editing is strong enough to disturb the attack and mild enough to leave a substantial fraction of the generated answers usable. Its sampling and voting steps are designed around the variation that remains within that range.
The method, step by step
From a prompt to a group of answers
SmoothLLM receives the same text that the generator would otherwise be asked to answer. It regards the text as a sequence of characters. At a chosen editing rate it produces several independent variants, then requests a completion for each. Some variants can remove the effect of an adversarial construction. Others can leave it intact. The defense uses the collection to ask which of those outcomes is typical under the chosen random edits.
The edits operate over the prompt supplied to the wrapper. The diagnostic experiment that motivated the method edits a known suffix in isolation, where the authors can deliberately place every edit in the adversarial part. A deployed wrapper has no such boundary information. SmoothLLM therefore spreads its sampling over the supplied prompt and accepts that some edits land in ordinary text. This difference explains why suffix-only fragility is evidence for the design and why the full-prompt evaluation is needed to assess the actual defense.
Each generation is paired with the verdict of a jailbreak judge. The verdict concerns the response. It does not depend on a prior claim by the defense that a particular substring is malicious. The wrapper counts verdicts, compares the fraction of jailbreak labels with a threshold, and chooses a completion from the class indicated by the vote. The paper’s algorithm diagram describes picking uniformly among qualifying responses. Individual completions retain their original wording.
How SmoothLLM selects a response
The steps in order.
Consider a harmless instruction that asks for an answer in a specified format. A scattered replacement might leave the task clear while damaging the instruction about formatting. A patch might leave the format intact while altering the main request. Either resulting answer could pass a jailbreak check. This illustrates the division of labor in the procedure. Random editing and voting determine the candidate class, and the jailbreak judge supplies the only label used in choosing that class. Compliance with the user’s detailed instructions is something the authors measure separately.
What the random edits change
The three edit types share a sampling scheme for new characters. The authors draw from Python’s printable character set, which contains 100 characters. It includes letters in both cases, digits, and other symbols. Every available character has the same probability of being drawn. There is no preference for a nearby key, a plausible spelling correction, or a semantically related word. The size of this alphabet also enters the theoretical calculation because a randomly drawn replacement can equal the original character.
M = ⌊qm⌋
Here m is the original prompt length in characters, q is the perturbation rate expressed as a fraction in the product, and M is the number of characters sampled for the editing procedure. The floor brackets ⌊ ⌋ round the product down to a whole number. In the experiments the same rate is generally reported as a percentage. With q at 0%, the copies preserve the original text. For a short prompt, flooring also matters because a positive rate can yield no selected positions.
An insert edit selects positions in the original text and adds a new character after each selected character. The original characters stay in order, and the input becomes longer. This can interrupt a word or a string of punctuation even though every original character is still present. The locations are defined using the original text so that an insertion does not turn a previously added character into another original position.
A swap edit selects scattered positions and draws replacement characters for them. The word swap here refers to substituting a fresh draw at a position. It does not mean exchanging two existing characters with each other. The length stays fixed, and the positions come from a uniformly sampled set. A sampled position can retain its original character when the new draw happens to match it. Thus the number of locations selected for replacement and the number of effective changes are different quantities.
A patch edit selects a consecutive span and draws replacement characters for the positions in it. The length again stays fixed. With a small patch, most of the prompt lies outside the edited region and survives completely intact. The effect on a suffix depends on whether the patch lies inside it, overlaps the boundary, or misses it. With scattered swaps, the overlap is determined by a set of separately located positions. That difference in where the edit falls is important to the paper’s probability calculations and to interpreting the ordinary-task results.
What the judge measures
The paper first defines a jailbreak as a feasibility question. A prompt is a feasible instance if the generator’s response receives the positive label from the judge. The formulation specifies the behavior that the defense is trying to prevent.
JB(LLM(P)) = 1
P denotes a prompt. LLM(P) is the answer generated for that prompt, and JB maps the answer to a binary jailbreak label. The label 1 means that the judge calls the answer a jailbreak. The alternative label 0 means that the judge does not. The nested parentheses indicate that generation happens before judgment, and the equals sign states the outcome that defines success for the attack.
In the suffix case the same condition is applied to a prompt whose construction is explicit.
JB(LLM([G; S])) = 1
G is the goal text, S is the attached suffix, and [G; S] denotes placing the suffix after the goal in one input string. LLM generates a response to that string and JB gives it a label. The equality to 1 describes an instance judged successful. This notation separates what the prompt asks for from the added text that changes its effect.
The paper measures attack success rate, or ASR, on collections of these instances. It uses the same idea for attacks represented by whole prompts. In the suffix notation the score has the following form.
ASR(𝒟) = (1/n) Σⱼ JB(LLM([Gⱼ; Sⱼ]))
𝒟 is the evaluation collection, n is its number of goal–suffix pairs, and j indexes those pairs. Gⱼ and Sⱼ are the goal and suffix of the indexed pair. The brackets with the separator join them into a prompt, LLM generates an answer, and JB labels it. Σⱼ sums over the collection, and 1/n makes the result a fraction. A defended score applies the judge to the response selected by the defense. This fraction across benchmark examples differs from the vote fraction calculated within a single invocation of SmoothLLM.
The experiments inherit judges from the attack evaluations. A keyword rule used with GCG checks for phrases associated with refusals. PAIR uses the Llama Guard classifier. RandomSearch and AmpleGCG use GPT-4 to assess generated answers. The different procedures all fit the same binary interface. Their decisions can diverge on answers that are hard to interpret, and SmoothLLM’s vote will reflect the judge that actually supplies its labels.
How the vote produces the returned text
The randomized edit rule defines a distribution over variants of a fixed prompt. Each copy is drawn afresh. This gives the procedure repeated observations under the same perturbation setting, including the possibility of generating the same edited text more than once.
Qⱼ ∼ ℙq(P)
Qⱼ is the edited prompt with index j, P is the original prompt, and ℙq(P) denotes the distribution induced by the chosen editing procedure at rate q. The symbol ∼ means that the edited prompt is sampled from that distribution. The paper takes the draws to be independent and identically distributed, meaning that every draw uses the same rule and does not depend on earlier draws.
V = 𝕀[(1/N) Σⱼ₌₁ᴺ JB(LLM(Qⱼ)) > γ]
V is the vote, N is the number of copies, and the sum runs over their indices j, starting at 1 and ending at N. Qⱼ is the indexed variant, LLM generates its answer, and JB labels the result. Dividing by N gives the observed fraction of jailbreak labels. γ is the threshold, which the definition places between 0 and 1, inclusive. 𝕀 is an indicator that returns 1 when the expression inside the brackets holds and 0 otherwise. The comparison > is strict. The usual threshold is one half, so an exact tie at that threshold yields a vote of 0.
SmoothLLM(P) = LLM(Q)
SmoothLLM(P) is the wrapper’s output for the original prompt P. Q is a sampled variant whose generated response received the label indicated by V. LLM(Q) denotes that response. The algorithm already has the generated responses on hand when it chooses among them. Returning a stored answer matters if generation can vary across calls, since generating a new answer would mean returning text that was never included in the vote.
Thresholding the labels is what lets the same aggregation rule work for answers that vary widely. It also determines the scope of the filter. A vote of 0 allows the wrapper to return an answer from the group judged non-jailbroken. When the vote is 1, the standard rule selects from the group judged jailbroken. The procedure is thus a response selector whose protection depends on how frequently the edited prompts produce acceptable answers. Its definition includes outcomes in which the defense fails.
What the probability calculation assumes
The paper calls the chance of obtaining a response labeled non-jailbroken the defense success probability, abbreviated DSP. This is a probability for a fixed input run through a randomized defense. Attack success rate averages outcomes across a benchmark collection. A plot of the former describes what the analytical assumptions predict for an input with stated properties. A benchmark score concerns a collection of actual evaluations.
DSP(P) = Pr[JB(SmoothLLM(P)) = 0]
DSP(P) is the defense success probability for prompt P, Pr denotes probability over the random draws used by the defense, SmoothLLM(P) is the selected answer, and JB judges it. Equality to 0 is the event that the judge does not label the returned answer a jailbreak. The brackets enclose that event.
To get a closed form for some kinds of edits, the authors introduce an idealization called k-instability. Start from an effective suffix and compare it with an altered suffix of the same length. The simplifying assumption is that the change in behavior depends on whether enough positions in the suffix actually differ. Hamming distance supplies the count. It compares corresponding characters in equal-length strings and records a difference when the characters at a position are unequal.
JB(LLM([G; S′])) = 0 ⇔ dH(S, S′) ≥ k
G is the original goal, S is the original effective suffix, and S′ is an edited suffix of equal length. [G; S′] is their concatenation. LLM generates the answer and JB judges it, with 0 denoting a non-jailbreak label. dH denotes Hamming distance, ≥ means “at least,” and k is the number of differences required by the assumption. The double arrow ⇔ means that the two conditions imply each other. Under this idealization, every change reaching the threshold defeats the jailbreak and every change below it leaves the jailbreak effective.
For the aggregation part of the argument, the quantity that matters is the probability of a favorable verdict on a single draw.
α = PrQ[JB(LLM(Q)) = 0]
α is the probability of a non-jailbreak verdict for one edited prompt. PrQ denotes probability over the draw of Q from the perturbation distribution for the original input. LLM generates an answer for Q and JB judges it. The event inside the brackets is that the verdict equals 0.
With independent trials and the standard threshold, the defense can use a binomial calculation. For each possible count of favorable verdicts, count the ways those verdicts can be distributed among the trials and weight the count by the probability of that pattern. Add the terms for which the favorable class wins or ties. The expression below uses the upper limit from the appendix proof, where the count can run through all N draws.
DSP(P) = Σ[t = ⌈N/2⌉ … N] C(N, t) αᵗ (1 − α)ᴺ⁻ᵗ
DSP(P) is the probability of defense success on P. Σ adds terms indexed by t, the number of favorable verdicts among N draws. The lower endpoint ⌈N/2⌉ is half the sample count rounded up, and … N indicates that the sum continues through N. C(N, t) counts the ways to choose t of the draws. αᵗ is the probability factor for those favorable verdicts and (1 − α)ᴺ⁻ᵗ is the factor for the other N − t verdicts. Superscripts indicate powers. The lower endpoint includes ties for even sample counts, as required by the strict comparison in the vote.
The calculation separates the effect of the edit distribution from the effect of repeated observation. With a favorable verdict sufficiently likely on each draw, sampling more gives the vote a more stable basis. If the per-draw tendency favors jailbreak labels, increasing the sample count can instead make that tendency more apparent. The vote itself does not create a favorable per-draw probability. That depends on the generator, the judge, the input, and the perturbation.
How the appendix counts the relevant edits
For swaps and patches, the analysis first asks how many selected positions fall in the suffix. It then asks how many of the sampled characters at those positions actually differ from the originals. The probability of the second event is the same for any chosen set of suffix positions of a given size under uniform independent replacement.
β(i) = Σ[ℓ = k … i] C(i, ℓ) ((v − 1)/v)ˡ (1/v)ⁱ⁻ˡ
β(i) is the chance of making at least k effective changes when i suffix positions have been selected. Σ sums from ℓ = k through i, where ℓ is the number of positions that actually change and … denotes the intervening counts. C(i, ℓ) counts the choices of those positions. v is the alphabet size. A new character matches the original with probability 1/v and differs with probability (v − 1)/v. The superscripts ˡ and ⁱ⁻ˡ denote the powers given by ℓ and i − ℓ. When fewer than k suffix positions are selected, there are no qualifying counts.
For swaps, the intended probability computation weights β(i) by the probability of selecting exactly i suffix positions. A uniformly drawn set of M positions is counted by separately choosing the positions inside and outside the suffix. The display below uses that counting argument. The paper’s printed swap expression uses M in the first binomial coefficient where the counting argument calls for the suffix length. The distinction matters because the number of available suffix positions is a property of the input, whereas M is the edit budget.
αswap = Σ[i = k … min(M, mS)] (C(mS, i) C(m − mS, M − i) / C(m, M)) β(i)
αswap is the single-draw success probability for swaps within the idealized calculation. The index i counts selected suffix positions, and Σ sums from the instability threshold k through min(M, mS), the smaller of the edit budget M and the suffix length mS. m is the full prompt length. Each C(a, b) counts ways to choose b positions from a, with impossible choices contributing zero. The two factors in the numerator count selections inside and outside the suffix. The denominator counts all size-M subsets of the prompt. β(i) weights each selection count by its chance of causing enough actual changes.
For patches, the same second stage applies, with the possible start locations taking the place of arbitrary position sets. The appendix distinguishes patches contained in the suffix from patches that overlap the goal, and treats widths longer than the suffix separately. A compact way to express the counting procedure in terms of the overlap is as follows.
αpatch = (1/(m − M + 1)) Σ[s = 1 … m − M + 1] β(iₛ)
αpatch is the idealized single-draw success probability for patches. m is the prompt length, M is the positive patch width, and m − M + 1 counts its possible starts. Σ runs over those starts, indexed by s, with … indicating the consecutive starts in the range. iₛ is the number of suffix positions covered by the patch beginning at s. β(iₛ) gives the probability of sufficient actual changes conditional on that overlap. The factor before the sum averages over the equally likely starts. Insertions change the length of the text, so this Hamming-distance calculation does not directly describe them.
The conversion from measured suffix fragility to these probabilities makes an additional idealization visible. The instability definition holds the goal fixed, whereas swaps and patches in the wrapper can also change the goal. The probability argument treats the suffix distance as decisive even for draws that alter the goal. This supplies a tractable description of the mechanism the authors want to isolate. A guarantee applied to a real prompt would require evidence that the dependence assumed in the calculation fits that prompt.
What happens before deployment and at inference
The wrapper fits no new weights and uses no training corpus of its own. Its settings specify how many copies to draw, the rate and kind of corruption, and the threshold for selection. The experiments use a fixed printable alphabet and make those choices explicit. Some overview experiments try multiple settings and report the ones that performed best. The data used to generate or collect attack prompts and the data used to evaluate ordinary tasks belong to the testing procedure.
Query access is enough to invoke the underlying generator because the wrapper operates on input and output strings. It also needs a working judge. In the simplest case that judge is a local text check, while a classifier or a separate judging service adds its own work. This distinction matters when comparing query counts. The number of calls to the protected generator describes one part of the cost. Building the response groups and choosing from them also requires the judgments that define the vote.
Experiments and results
Which inputs, systems, and judges were used
The headline evaluation compares generation with and without SmoothLLM. It covers GCG, RandomSearch, and AmpleGCG on AdvBench. The PAIR overview uses JBB-Behaviors. The distinction matters because the paper also reports a separate defense comparison on JBB-Behaviors that includes GCG. Each result has to be read against the benchmark and evaluation procedure used for that comparison. Evaluation & benchmarks.
The recurring open-system subjects are Vicuna and Llama2. The closed-system experiments include GPT-3.5 and GPT-4, as well as PaLM-2. The transfer comparisons also report Claude-1 and Claude-2. The open systems give the paper a setting for experiments with existing GCG suffixes and repeated measurements. The closed systems test what the query-only design can do when access is restricted. For the GCG transfer tests, the suffixes prepared on an open system are evaluated against the separate target interface.
For GCG, the criterion is based on the absence of stock refusal phrases. The paper describes different phrase sets for open and closed systems. PAIR uses Llama Guard to classify responses, while GPT-4 serves as the judge in the RandomSearch and AmpleGCG runs. Pairing attacks with their existing judges makes the result interpretable against the original evaluation practice. It also means that an ASR reported for one attack can be grounded in different labeling evidence from an ASR reported for another.
The paper reports separate measurements of ordinary task performance. It uses InstructionFollowing, PIQA, OpenBookQA, and ToxiGen. The InstructionFollowing figure reports prompt-level and instruction-level accuracy. These measurements put the response on the scale of the task the user asked the generator to perform. An answer can avoid objectionable content and still fail the ordinary task, so success on those benchmarks needs to be measured in its own right. Instruction-Following Evaluation for Large Language Models.
How much the attacks were reduced
The undefended reference rates in the GCG experiments on AdvBench were 98% for Vicuna and 51% for Llama2. In the sweep over the editing rate and sample count, the authors report that a 5% editing rate was sufficient to halve the attack success rates for both systems. With swap edits and more than 6 samples, they report ASRs below 1% for both. The lower initial rate on Llama2 and the higher one on Vicuna establish different baselines for interpreting near-zero defended scores.
The headline comparisons also show near-zero ASRs for RandomSearch and AmpleGCG in the paper’s AdvBench experiments. The authors present these as the first successful defenses demonstrated for those attacks. The results extend the empirical finding beyond a single way of obtaining a suffix. They remain results for particular attacks, targets, and judging procedures. In the overview figures, the displayed outcomes reflect a search over SmoothLLM settings rather than a result obtained with a universal configuration.
PAIR gives the paper a case where the prompt is designed through meaningful language. On JBB-Behaviors, the paper reports that SmoothLLM cut PAIR’s ASR by a factor of two on Vicuna and on GPT-4. It reports a factor of 29 on GPT-3.5. These are relative reductions from each system’s own baseline. Different baseline rates can lead to quite different factors, so the large improvement on GPT-3.5 describes the comparison for that system. The direction of the result across the systems shows that a defense motivated by fragile suffixes can help against this semantic attack as well.
The transfer tests with Llama2-derived GCG prompts report a defended ASR below one percentage point across the tested open and closed systems. The authors were unable to reproduce some of the earlier undefended closed-system rates, especially for GPT-4 and to a degree for PaLM-2. They observed non-zero undefended success in both cases. The clean comparison to draw from these tests is between the defended and undefended outcomes measured within the study, since the starting rates already differed from parts of the previous report.
How SmoothLLM compares with simpler defenses
The JBB-Behaviors comparison puts SmoothLLM beside a version with no intervention, a rule for removing non-dictionary words, and a perplexity filter. Perplexity is used here as a measure of how unexpected an input string is under a language predictor. The filter treats unusually high perplexity as a reason to intervene. The authors set its cutoff using the maximum perplexity of the benchmark prompts. For this comparison SmoothLLM used an editing rate of 5% and a sample count of 10.
On GCG, the perplexity filter and SmoothLLM both brought the measured attack success close to zero. PAIR yielded a clearer separation. The paper reports the relative reductions with respect to the undefended condition across Vicuna, Llama2, GPT-3.5, and GPT-4. The chart shows the comparison between SmoothLLM and the strongest competing defense on that metric. A larger bar is a larger decrease in the original attack success rate.
Relative reduction in PAIR attack success on JBB-Behaviors
SmoothLLM reduces PAIR success more than the perplexity filter in the comparison across systems.
The numbers
| System or setting | relative ASR reduction % |
|---|---|
| Perplexity filter | 32 |
| SmoothLLM (this paper) | 60 |
The comparison gives a more specific result than the defended-versus-undefended overview. If the objective is to deal with the evaluated GCG suffixes, a filter using input unusualness can already go a long way. The PAIR result establishes a distinct benefit for the response-based procedure on that test. SmoothLLM can select an answer based on how the generator behaves under edits even when the starting prompt is written in coherent language. The experiment checks the performance of the two mechanisms and does not identify which linguistic features of individual PAIR prompts were responsible for the difference.
How ordinary performance changes
On InstructionFollowing, the authors compare patched and insertion-edited prompts with the undefended reference at a sample count of 10. Both prompt-level and instruction-level accuracy decline as the editing rate increases, and the paper describes the decline in those plots as roughly linear. Prompt-level accuracy concerns the prompt as a whole. Instruction-level accuracy follows the individual requirements it contains. The two views help show how the system can preserve portions of an instruction while becoming less reliable on the complete request.
The PIQA result provides exact values for patch edits at an editing rate of 5% and a sample count of 20. On Llama2, the reported performance moves from 76.7% undefended to 70.3% with SmoothLLM. On Vicuna the scores are 77.4% and 71.9%, respectively. The authors say patch edits tended to offer the more favorable tradeoff across the datasets. The PIQA comparison makes clear that a favorable tradeoff can still involve a visible loss on the ordinary task. PIQA.
Vicuna accuracy on PIQA with and without SmoothLLM
Accuracy falls when Vicuna answers patch-edited prompts under the reported defense setting.
The numbers
| System or setting | accuracy % |
|---|---|
| Undefended Vicuna | 77.4 |
| SmoothLLM with patch edits (this paper) | 71.9 |
On OpenBookQA and ToxiGen, the appendix describes the defended scores as particularly close to the undefended ones. It also notes a tendency for ordinary-task performance to improve with more samples and to fall with heavier edits. This is informative because additional samples and larger edits both help in parts of the GCG robustness sweep, yet they have different implications for the clean tasks. Sampling more supplies additional candidates at the same editing rate. Raising the rate changes the text on which every candidate is based. Question answering.
What the query and timing comparisons measure
The usual wrapper performs N generations where the undefended system would perform one. The authors ask how much can be gained when that increment is just one extra generation. At a rate of 10% and a sample count of 2, the GCG success reduction on AdvBench ranged from 2.5–7.0× for Vicuna and 5.7–18.6× for Llama2 across the perturbation types. Swaps on Llama2 yielded the reduction the authors describe as nearly twenty-fold. This experiment concerns a low-budget invocation of the defense, while the near-zero headline scores concern other settings.
The study also compares the effort of preparing a GCG suffix with the effort of running the defense on a prompt. It describes roughly 256,000 queries for the default GCG run and a typical SmoothLLM budget of at most 20 generator queries. The authors characterize the gap as five to six orders of magnitude in query counts. The GCG figure is an accounting estimate. The appendix explains that it leaves out an additional loss computation. The two sides also refer to different jobs, creating an adversarial input and processing an incoming input, so this comparison is distinct from the cost of enabling the wrapper for routine use.
For the query-efficiency curves, the authors use the first 100 entries in the harmful-behaviors data associated with GCG. They compare suffixes from different points in the attack run and measure the effect of different SmoothLLM sample counts. Later checkpoints in the attack search tend to yield more successful prompts on the undefended system. On the defense side, the figure shows that additional samples can substantially lower the measured success for those prompts. The appendix provides the Llama2 comparison alongside the Vicuna analysis discussed in the main text.
The timing experiments report SmoothLLM running times from 3.5 to 4.5 seconds per prompt, depending on the sample count in the tested settings. The authors used an A100 for Vicuna and an A6000 for Llama2 in this comparison and averaged the defense timings over five independently run trials. According to their report, generating a GCG suffix takes roughly two hours on an A6000 and about 90 minutes on an A100. Those timings show the scale of the difference on the hardware used. The experiment’s common unit is time per prompt, while the work done during that time still differs between generating an attack and selecting a defended response.
What the ablations show
Editing just the suffix tests the premise
The most direct test of why the defense might work starts with a successful attack suffix and changes only that suffix. This bypasses the challenge of locating the adversarial text inside a live prompt. A drop in attack success in this setting provides evidence that the additional string itself is sensitive to character edits. It does not depend on damaging the request to which that string is attached.
The paper tests this premise for GCG suffixes on Vicuna and Llama2 at editing rates of 5%, 10%, 15%, and 20%. The caption says the value falls to half or less at almost every setting. The text and caption differ in which perturbation they associate with the below-1% result at 10%. The caption names swaps, while the discussion of the same figure names insertions and patches. The common finding is the broad drop under modest suffix edits. The exact attribution of that threshold to an edit type is inconsistent across the two descriptions.
There is a difference between the experiment and the instability assumption. The figure aggregates results on many examples and repeated draws. A drop in the average is compatible with some prompts retaining their effect under many changes and others failing under very few. The assumption in the proof makes a pointwise claim about what happens on either side of a fixed distance. The diagnostic establishes that fragility is widespread enough to observe at the benchmark level. It also explains why it makes sense to try several draws before selecting an answer.
Sample count and editing rate act through different mechanisms
The full-prompt GCG sweep varies the number of copies through 2, 4, 6, 8, and 10 and tests the same editing rates of 5%, 10%, 15%, and 20%. The caption says the results are compiled across five trials. The repeated runs matter because the positions and characters are sampled afresh. A particular suffix can be left largely intact by one draw and substantially disrupted by another. The sweep lets the authors examine how often the vote still returns a jailbreak-labeled response as those settings change.
The editing rate affects how much evidence a typical draw supplies. More edits give the perturbation more opportunity to hit the adversarial portion of the text. They also make it more likely that the generator will struggle to understand the ordinary portion. The sample count affects how many draws the vote can use at the chosen rate. When draws are individually favorable frequently enough, increasing the sample count makes it harder for a few surviving jailbreaks to dominate the outcome. The two variables can therefore both reduce ASR in a sweep while changing the system in different ways.
The edit type controls where the damage is distributed. A patch can preserve long sections of the input verbatim and also miss the adversarial region entirely. A scattered swap can reach separated parts of the input, so the characters it touches can be less concentrated. Insertions can disrupt interpretation by lengthening text and breaking up existing sequences. The reported near-zero GCG results for swaps in the larger-sample settings and the relatively favorable ordinary-task behavior for patches illustrate why the perturbation judged strongest depends on which measurement is being discussed.
Some low-sample settings show a reversal of the general trend. The authors point to cases at a sample count of 4 or fewer in which an editing rate of 20% yields a higher measured ASR than a milder edit. They examine a response in which the generator indicates that the changed input is unintelligible. The GCG judge treats it as a jailbreak because it lacks the particular language expected of a refusal. This comparison shows that stronger corruption can change what is being counted as a failure, alongside its effect on how much of the original attack survives.
The threshold variant tests where clean accuracy is lost
With the standard wrapper, the output text comes from running the model on the edited input. The authors test a variant called TiltedSmoothLLM that makes it easier for the non-jailbreak class to win and changes what happens after that verdict. The threshold is defined as follows.
γ = (N − 1)/N
γ is the decision threshold, N is the number of sampled prompts, 1 is the amount subtracted from the sample count in the numerator, and division by N expresses the cutoff as a fraction of votes. The rule still compares the observed jailbreak fraction strictly with the threshold. Under this choice the jailbreak vote is positive only when every edited response receives the jailbreak label.
When the resulting vote is 0, the variant returns a generation for the original input. The sampled responses thus inform whether the wrapper takes that branch, while the unedited text supplies the actual request for the returned completion. This policy can recover an instruction that the random copies damaged, even though the perturbations still influence the choice to answer from the original. The appendix compares the standard policy and the tilted one on JBB-Behaviors with a sample count of 10 and an editing rate of 5%.
The authors report similar robustness for the two policies against PAIR and GCG in that comparison. On InstructionFollowing they report that the variant matched undefended performance over the editing rates shown in the ordinary-task study. The comparison changes the threshold and the source of the returned answer together. It demonstrates the behavior of that combined policy in the tested setting. In particular, the result is consistent with an important part of the clean-task degradation coming from answering altered wording. It leaves the separate contributions of the two changes unmeasured.
What changes when the defense is taken into account
The adaptive assessment asks whether prompts prepared with knowledge of the defense succeed more often than prompts prepared against the unwrapped generator. The authors explain that the discrete sampling and vote do not provide the gradients needed to apply ordinary GCG directly to the wrapper. Character editing can also alter tokenization, the conversion of text to the sequence units the generator processes. In the paper’s attempted direct averaging comparison, gradients from variants ended up with incompatible sizes when those sequences differed in length.
The authors therefore evaluate transfer from a differentiable approximation of the wrapper. Their reported result is that the prompts prepared against that approximation were no stronger on actual SmoothLLM than ones prepared against the undefended system. The comparison is evidence about the success of that particular transfer. The non-differentiability argument explains why a direct application of the original attack is problematic, while the transfer experiment evaluates whether an indirect approach of the kind they tested makes a practical difference. These are distinct observations about the defense.
Limitations
Limits and open problems identified by the authors
The authors explicitly identify ordinary-task degradation as a limitation. They regard the tradeoff as manageable at editing rates of 5% or less in their tests and describe a more substantial deterioration at higher rates. This difficulty follows from the same full-prompt operation that makes the wrapper applicable without knowing where adversarial text sits. The method can damage instructions in a legitimate request. The authors discuss denoising and semantic transformations such as paraphrasing as possible future directions. The tested perturbation rules remain character edits.
The discussion also calls out misclassification of replies to incoherent inputs. An automated judge that relies on refusal phrases can label a bewildered response as a jailbreak, even when it conveys no harmful guidance. The measured ASR in this regime can reflect both the quality of the input after perturbation and the judge’s handling of replies to that input. The authors’ example establishes a real instance of that failure. It does not quantify how frequently it accounts for the measured rate across every setting.
The authors question the breadth of the AdvBench behaviors data. They describe a dataset containing 520 goals with corresponding targets and point out that 24 of the prompts concern nearly the same weapons-related subject. They argue that a larger and more varied set would give a better evaluation. Repeated phrasings can be informative about sensitivity within a topic, while leaving the evidence concentrated on a narrower set of topics than the prompt count alone suggests.
The appendix acknowledges that the closed-system reproduction used a single trial and faced usage limits for GPT queries. The authors suggest provider changes as a plausible explanation for their difficulty reproducing earlier GPT-4 and PaLM-2 results. The paper did not independently establish that such changes took place. The observed difference itself is a reason to distinguish a safety result for an accessed service at the time of measurement from a claim about that service in general.
The authors also identify selection of the sample count and editing rate as unfinished work. Several overview figures use the best settings encountered in sweeps. The manuscript suggests experimenting with how those settings are chosen and with combining results from different perturbation rules. The strongest points on a sweep establish what tested configurations can achieve. A reader evaluating a fixed operating policy needs measurements for that policy, including its ordinary-task performance and query cost.
Additional limits visible in the design and results
The proof and the experiments support different kinds of claims. The binomial vote calculation describes what can happen when samples obey the assumed single-draw probability. The suffix calculation idealizes that probability using a threshold on Hamming distance. The dataset experiment demonstrates changes in attack success on measured inputs. It does not establish that those inputs obey the exact threshold assumption, or that edits to the goal leave the success condition determined solely by the suffix. The paper also differs internally on the average Llama2 suffix length used to describe the certificate illustration. The main discussion gives 95 characters and the appendix gives 96. Those figures describe an illustrative input to the probability calculation, while the empirical ASRs come from actual response evaluations.
Compatibility at the level of a text interface is broader than the empirical evidence of protection. The wrapper’s requirements are modest enough to permit experiments on open and closed systems. Particular results nonetheless depend on the target’s behavior on randomized inputs and the judge’s ability to label its replies. The absence of transfer between the tested open systems in one comparison is also a reminder that results with suffixes prepared for one generator cannot simply be assigned to another. Query access describes what is needed to run the procedure. The evaluation establishes what happened for the tested combinations.
The judge can affect both which answer SmoothLLM returns and which outcomes an experiment counts. Even a stable vote may reflect a weakness in the underlying labeling rule. The incoherence example reveals one kind of false positive. The study does not establish the error rate of each judge across all evaluated responses, so the exact correspondence between reported ASR and the amount of harmful assistance a person could actually use remains uncertain. The comparison within a given benchmark is stronger when the judge is held fixed. A comparison across different judges has an extra source of variation.
The clean benchmarks provide several views of preserved capability. They cover particular instruction-following, question-answering, and toxicity-related tasks. They do not measure how well a wrapper preserves every sort of consequential string a user might submit. As an implication of the edit rules, text whose meaning depends on exact characters could be more sensitive than a loosely worded question. The paper gives no separate measurement of that case. Its reported clean-task scores are the basis for estimating the tradeoff on the benchmarks it runs.
The tilted policy raises a related scope question. Its return to the original input can preserve ordinary instructions. The selected original-input generation is outside the pool on which the vote was taken, so the proof for returning a sampled response whose label agrees with the vote does not directly describe that branch. The paper offers an empirical comparison for PAIR and GCG under its stated settings. That comparison supports the variant on those tests and leaves its behavior on other attacks open.
Finally, the adaptive comparison concerns an approximation suited to the tested attack. Success against transfer from that approximation does not establish robustness to all ways an attacker could take the wrapper into account. Similarly, the favorable comparison between the effort to generate a GCG suffix and the effort to defend one prompt does not settle the cost of protecting a stream of legitimate requests. Each protected request uses repeated generation and judgment. These costs and the level of adaptive evidence belong alongside the ASR when deciding what the experiments substantiate.
What came after
Shared benchmarks and stronger response judgments
JailbreakBench is closely connected to SmoothLLM’s evaluation. The SmoothLLM paper already uses its JBB-Behaviors data for PAIR and for the comparison against simpler defenses. The role described for the benchmark is to standardize the prompts, attack artifacts, and judging function within an evaluation. That makes it easier to attribute an ASR difference to the attack or defense being compared. For a method whose behavior depends on its judge, the benchmark’s choices also define which kinds of failure a comparison can reveal. JailbreakBench.
StrongREJECT addresses the quality of what counts as success. Its title identifies the problem of empty jailbreaks, which connects directly to the distinction between appearing to bypass a refusal and producing substantive harmful assistance. SmoothLLM’s incoherence case shows why that distinction changes the reading of an attack score. A reply can fall outside the expected language of a refusal and still provide no answer to the underlying request. A benchmark focused on empty jailbreaks brings the response itself to the foreground. The connection concerns what the defense is being credited with preventing and what the attack is being credited with achieving. A StrongREJECT for Empty Jailbreaks.
OR-Bench focuses on the other side of the response judgment, over-refusal. SmoothLLM measures the cost of protection through accuracy on standard tasks, including whether a generator can still follow ordinary instructions after they have been perturbed. An over-refusal benchmark singles out the separate failure in which a generator withholds help where a response would be appropriate. Corrupting a legitimate instruction and refusing it are different routes to losing useful behavior. Their connection is that improvements on attack prompts can coexist with new failures on ordinary prompts, and the latter need tests of their own. OR-Bench.
A broader test of what survives a defense
The revised paper identifies the study titled “Jailbreaking Leading Safety-Aligned LLMs,” whose title ends “with Simple Adaptive Attacks,” as the source of RandomSearch in its experimental context. SmoothLLM includes that attack in the AdvBench overview and follows its use of an automated judge. The relationship here is concrete. An attack from the other work becomes a test case for whether the response-selection procedure helps beyond the GCG example that motivated it. The title’s emphasis on adaptive attacks also returns to one of SmoothLLM’s stated requirements, that protection should hold when the adversary accounts for the defense. The SmoothLLM result for RandomSearch and its separate adaptive GCG experiment address different tests of that requirement. Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attacks.
The study whose title begins “Jailbreaking Black Box Large Language Models” and ends “in Twenty Queries” also directly informs the paper’s experiments. It introduces PAIR, the semantic case that SmoothLLM uses to examine whether its benefits extend beyond attacks based on appended suffixes. The emphasis on black-box access parallels the defense’s own compatibility requirement. Both sides of the comparison need to be understood in terms of what a text interface exposes. PAIR also gives the study a reason to compare the cost of attacking and defending more carefully, since the large query budget estimated for GCG belongs to that specific search and cannot be transferred to a different attack. Jailbreaking Black Box Large Language Models in Twenty Queries.
InjecAgent moves the evaluation setting to agents that can use tools and encounter indirect prompt injections. The title identifies a different object of evaluation from SmoothLLM’s direct prompt-to-response experiment. An indirect injection raises questions about the origin of the instruction and how an agent treats text encountered while doing a task. Evaluating that behavior extends beyond whether text returned directly to the user receives a jailbreak label. The agent setting therefore gives a concrete reason to distinguish the ability to edit a submitted prompt from control over all the text and actions that can influence an interaction. InjecAgent.
Intervening during generation or inside the system
SafeDecoding places the intervention at decoding, the stage where a generator chooses how to continue its output. SmoothLLM changes the inputs presented to a generator and selects among completed answers. The decoding route addresses the same problem at another stage. Its title describes safety-aware decoding, establishing the point of intervention without implying that it inherits SmoothLLM’s perturbations or its voting rule. The distinction matters for interpreting compatibility. A query-only wrapper is designed around access to completed text, while a decoding defense concerns control of the generation procedure itself. SafeDecoding.
Refusal in Language Models Is Mediated by a Single Direction studies refusal at the level of the system’s internal representations. SmoothLLM observes refusal and other safety-relevant behavior through generated responses and the judge’s labels. The representational inquiry asks where a behavior of that kind is mediated inside the system. It treats refusal as a phenomenon to explain, while SmoothLLM uses observable labels to choose among answers. This line of work connects the behavioral question of when a system refuses with an internal account of how a refusal arises. Refusal in Language Models Is Mediated by a Single Direction.
Reasoning-to-Defend frames the defense in terms of safety-aware reasoning. That framing is relevant to a limit that SmoothLLM brings into view. Character perturbation can be effective when a harmful response depends sensitively on the exact input string. A reasoning-based line of work instead concerns the safety implications of the request as interpreted by the system. The connection is a shared problem with different evidence for the defense decision. SmoothLLM checks whether outputs remain objectionable across a distribution of altered inputs. Safety-aware reasoning makes the content of the request itself central to the decision. Reasoning-to-Defend.
Institutions
Fields, topics and concepts
Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 works
Topics 1Research subjects and languages the work is about.Language models & pretraining · 4,145 works
Cite
Cite as Alexander Robey, Eric Wong, Hamed Hassani and George J. Pappas. 2023. SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks. arXiv:2310.03684.
@misc{robey2023smoothllm,
title = {{SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks}},
author = {Alexander Robey, Eric Wong, Hamed Hassani and George J. Pappas},
year = {2023},
doi = {10.48550/arxiv.2310.03684},
eprint = {2310.03684},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2310.03684}
}References
- Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A Smith. Realtoxicityprompts: Evaluating neural toxic degeneration in language models. arXiv preprint arXiv:2009.11462, 2020. our card
- Eliezer Yudkowsky. The ai alignment problem: why it is hard, and where to start. Symbolic Systems Distinguished Speaker, 4, 2016. OpenAlex ↗ · Scholar ↗
- Iason Gabriel. Artificial intelligence, values, and alignment. Minds and machines, 30(3):411–437, 2020. OpenAlex ↗ · Scholar ↗
- Brian Christian. The alignment problem: Machine learning and human values. WW Norton & Company, 2020. OpenAlex ↗ · Scholar ↗
- Philipp Hacker, Andreas Engel, and Marco Mauer. Regulating chatgpt and other large generative ai models. In Proceedings of the 2023 ACM Conference on Fairness, Accountability, and Transparency, pages 1112–1123, 2023. OpenAlex ↗ · Scholar ↗
- Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback, 2022. URL https://arxiv. org/abs/2203.02155, 13, 2022. our card
- Amelia Glaese, Nat McAleese, Maja Trębacz, John Aslanides, Vlad Firoiu, Timo Ewalds, Maribeth Rauh, Laura Weidinger, Martin Chadwick, Phoebe Thacker, et al. Improving alignment of dialogue agents via targeted human judgements. arXiv preprint arXiv:2209.14375, 2022. our card
- Ameet Deshpande, Vishvak Murahari, Tanmay Rajpurohit, Ashwin Kalyan, and Karthik Narasimhan. Toxicity in chatgpt: Analyzing persona-assigned language models. arXiv preprint arXiv:2304.05335, 2023. our card
- Alexander Wei, Nika Haghtalab, and Jacob Steinhardt. Jailbroken: How does llm safety training fail? arXiv preprint arXiv:2307.02483, 2023. our card
- Nicholas Carlini, Milad Nasr, Christopher A Choquette-Choo, Matthew Jagielski, Irena Gao, Anas Awadalla, Pang Wei Koh, Daphne Ippolito, Katherine Lee, Florian Tramer, et al. Are aligned neural networks adversarially aligned? arXiv preprint arXiv:2306.15447, 2023. our card
- Shayne Longpre, Sayash Kapoor, Kevin Klyman, Ashwin Ramaswami, Rishi Bommasani, Borhane Blili-Hamelin, Yangsibo Huang, Aviya Skowron, Zheng-Xin Yong, Suhas Kotha, et al. A safe harbor for ai evaluation and red teaming. arXiv preprint arXiv:2403.04893, 2024. OpenAlex ↗ · Scholar ↗
- Jiongxiao Wang, Zichen Liu, Keun Hee Park, Muhao Chen, and Chaowei Xiao. Adversarial demonstration attacks on large language models. arXiv preprint arXiv:2305.14950, 2023. OpenAlex ↗ · Scholar ↗
- Su Lin Blodgett and Michael Madaio. Risks of ai foundation models in education. arXiv preprint arXiv:2110.10024, 2021. OpenAlex ↗ · Scholar ↗
- Malik Sallam. Chatgpt utility in healthcare education, research, and practice: systematic review on the promising perspectives and valid concerns. In Healthcare, volume 11, page 887. MDPI, 2023. OpenAlex ↗ · Scholar ↗
- Shijie Wu, Ozan Irsoy, Steven Lu, Vadim Dabravolski, Mark Dredze, Sebastian Gehrmann, Prabhanjan Kambadur, David Rosenberg, and Gideon Mann. Bloomberggpt: A large language model for finance. arXiv preprint arXiv:2303.17564, 2023. our card
- Natalie Maus, Patrick Chao, Eric Wong, and Jacob Gardner. Adversarial prompting for black box foundation models. arXiv preprint arXiv:2302.04237, 2023. OpenAlex ↗ · Scholar ↗
- Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. arXiv preprint arXiv:2010.15980, 2020. our card
- Patrick Chao, Alexander Robey, Edgar Dobriban, Hamed Hassani, George J Pappas, and Eric Wong. Jailbreaking black box large language models in twenty queries. arXiv preprint arXiv:2310.08419, 2023. our card
- Xiaogeng Liu, Nan Xu, Muhao Chen, and Chaowei Xiao. Autodan: Generating stealthy jailbreak prompts on aligned large language models. arXiv preprint arXiv:2310.04451, 2023. our card
- Andy Zou, Zifan Wang, J Zico Kolter, and Matt Fredrikson. Universal and transferable adversarial attacks on aligned language models. arXiv preprint arXiv:2307.15043, 2023. our card
- Maksym Andriushchenko, Francesco Croce, and Nicolas Flammarion. Jailbreaking leading safety-aligned llms with simple adaptive attacks. arXiv preprint arXiv:2404.02151, 2024. our card
- Zeyi Liao and Huan Sun. Amplegcg: Learning a universal and transferable generative model of adversarial suffixes for jailbreaking both open and closed llms. arXiv preprint arXiv:2404.07921, 2024. OpenAlex ↗ · Scholar ↗
- Simon Geisler, Tom Wollschläger, MHI Abdalla, Johannes Gasteiger, and Stephan Günnemann. Attacking large language models with projected gradient descent. arXiv preprint arXiv:2402.09154, 2024. OpenAlex ↗ · Scholar ↗
- Mathias Lecuyer, Vaggelis Atlidakis, Roxana Geambasu, Daniel Hsu, and Suman Jana. Certified robustness to adversarial examples with differential privacy. In 2019 IEEE symposium on security and privacy (SP), pages 656–672. IEEE, 2019. OpenAlex ↗ · Scholar ↗
- Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified adversarial robustness via randomized smoothing. In international conference on machine learning, pages 1310–1320. PMLR, 2019. OpenAlex ↗ · Scholar ↗
- Hadi Salman, Jerry Li, Ilya Razenshteyn, Pengchuan Zhang, Huan Zhang, Sebastien Bubeck, and Greg Yang. Provably robust deep learning via adversarially trained smoothed classifiers. Advances in Neural Information Processing Systems, 32, 2019. our card
- Patrick Chao, Edoardo Debenedetti, Alexander Robey, Maksym Andriushchenko, Francesco Croce, Vikash Sehwag, Edgar Dobriban, Nicolas Flammarion, George J Pappas, Florian Tramer, et al. Jailbreakbench: An open robustness benchmark for jailbreaking large language models. arXiv preprint arXiv:2404.01318, 2024. our card
- Zheng-Xin Yong, Cristina Menghini, and Stephen H Bach. Low-resource languages jailbreak gpt-4. arXiv preprint arXiv:2310.02446, 2023. our card
- Hakan Inan, Kartikeya Upasani, Jianfeng Chi, Rashi Rungta, Krithika Iyer, Yuning Mao, Michael Tontchev, Qing Hu, Brian Fuller, Davide Testuggine, et al. Llama guard: Llm-based input-output safeguard for human-ai conversations. arXiv preprint arXiv:2312.06674, 2023. our card
- Yangsibo Huang, Samyak Gupta, Mengzhou Xia, Kai Li, and Danqi Chen. Catastrophic jailbreak of open-source llms via exploiting generation. arXiv preprint arXiv:2310.06987, 2023. our card
- Shreya Goyal, Sumanth Doddapaneni, Mitesh M Khapra, and Balaraman Ravindran. A survey of adversarial defenses and robustness in nlp. ACM Computing Surveys, 55(14s):1–39, 2023. OpenAlex ↗ · Scholar ↗
- Xiaodong Liu, Hao Cheng, Pengcheng He, Weizhu Chen, Yu Wang, Hoifung Poon, and Jianfeng Gao. Adversarial training for large neural language models. arXiv preprint arXiv:2004.08994, 2020. OpenAlex ↗ · Scholar ↗
- Takeru Miyato, Andrew M Dai, and Ian Goodfellow. Adversarial training methods for semi-supervised text classification. arXiv preprint arXiv:1605.07725, 2016. our card
- Jinfeng Li, Shouling Ji, Tianyu Du, Bo Li, and Ting Wang. Textbugger: Generating adversarial text against real-world applications. arXiv preprint arXiv:1812.05271, 2018. our card
- Neel Jain, Avi Schwarzschild, Yuxin Wen, Gowthami Somepalli, John Kirchenbauer, Ping-yeh Chiang, Micah Goldblum, Aniruddha Saha, Jonas Geiping, and Tom Goldstein. Baseline defenses for adversarial attacks against aligned language models. arXiv preprint arXiv:2309.00614, 2023. our card
- Aounon Kumar, Chirag Agarwal, Suraj Srinivas, Soheil Feizi, and Hima Lakkaraju. Certifying llm safety against adversarial prompting. arXiv preprint arXiv:2309.02705, 2023. our card
- Florian Tramer, Nicholas Carlini, Wieland Brendel, and Aleksander Madry. On adaptive attacks to adversarial example defenses. Advances in neural information processing systems, 33:1633–1645, 2020. OpenAlex ↗ · Scholar ↗
- Gabriel Alon and Michael Kamfonas. Detecting language model attacks with perplexity. arXiv preprint arXiv:2308.14132, 2023. our card
- Jeffrey Zhou, Tianjian Lu, Swaroop Mishra, Siddhartha Brahma, Sujoy Basu, Yi Luan, Denny Zhou, and Le Hou. Instruction-following evaluation for large language models. arXiv preprint arXiv:2311.07911, 2023. our card
- Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 7432–7439, 2020. our card
- Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. arXiv preprint arXiv:1809.02789, 2018. OpenAlex ↗ · Scholar ↗
- Thomas Hartvigsen, Saadia Gabriel, Hamid Palangi, Maarten Sap, Dipankar Ray, and Ece Kamar. Toxigen: A large-scale machine-generated dataset for adversarial and implicit hate speech detection. arXiv preprint arXiv:2203.09509, 2022. our card
- Francesco Croce, Maksym Andriushchenko, Vikash Sehwag, Edoardo Debenedetti, Nicolas Flammarion, Mung Chiang, Prateek Mittal, and Matthias Hein. Robustbench: a standardized adversarial robustness benchmark. arXiv preprint arXiv:2010.09670, 2020. OpenAlex ↗ · Scholar ↗
- Carlos E Seminario and David C Wilson. Robustness and accuracy tradeoffs for recommender systems under attack. In Twenty-Fifth International FLAIRS Conference, 2012. OpenAlex ↗ · Scholar ↗
- Eric Wong, Leslie Rice, and J Zico Kolter. Fast is better than free: Revisiting adversarial training. arXiv preprint arXiv:2001.03994, 2020. OpenAlex ↗ · Scholar ↗
- Grzegorz Gluch and Rüdiger Urbanke. Query complexity of adversarial attacks. In International Conference on Machine Learning, pages 3723–3733. PMLR, 2021. OpenAlex ↗ · Scholar ↗
- Ali Shafahi, Mahyar Najibi, Mohammad Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! Advances in Neural Information Processing Systems, 32, 2019. OpenAlex ↗ · Scholar ↗
- Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. our card
- Riccardo Volpi, Hongseok Namkoong, Ozan Sener, John C Duchi, Vittorio Murino, and Silvio Savarese. Generalizing to unseen domains via adversarial data augmentation. Advances in neural information processing systems, 31, 2018. OpenAlex ↗ · Scholar ↗
- Hadi Salman, Mingjie Sun, Greg Yang, Ashish Kapoor, and J Zico Kolter. Denoised smoothing: A provable defense for pretrained classifiers. Advances in Neural Information Processing Systems, 33:21945–21957, 2020. OpenAlex ↗ · Scholar ↗
- Nicholas Carlini, Florian Tramer, Krishnamurthy Dj Dvijotham, Leslie Rice, Mingjie Sun, and J Zico Kolter. (certified!!) adversarial robustness for free! arXiv preprint arXiv:2206.10550, 2022. OpenAlex ↗ · Scholar ↗
- Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023. our card
- Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality, March 2023. OpenAlex ↗ · Scholar ↗
- Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. arXiv preprint arXiv:1805.12152, 2018. OpenAlex ↗ · Scholar ↗
- Edgar Dobriban, Hamed Hassani, David Hong, and Alexander Robey. Provable tradeoffs in adversarially robust classification. IEEE Transactions on Information Theory, 2023. OpenAlex ↗ · Scholar ↗
- Adel Javanmard, Mahdi Soltanolkotabi, and Hamed Hassani. Precise tradeoffs in adversarial training for linear regression. In Conference on Learning Theory, pages 2034–2078. PMLR, 2020. OpenAlex ↗ · Scholar ↗
- Cassidy Laidlaw, Sahil Singla, and Soheil Feizi. Perceptual adversarial robustness: Defense against unseen threat models. arXiv preprint arXiv:2006.12655, 2020. OpenAlex ↗ · Scholar ↗
- Alexander Robey, Hamed Hassani, and George J Pappas. Model-based robust deep learning: Generalizing to natural, out-of-distribution data. arXiv preprint arXiv:2005.10247, 2020. OpenAlex ↗ · Scholar ↗
- Eric Wong and J Zico Kolter. Learning perturbation sets for robust machine learning. arXiv preprint arXiv:2007.08450, 2020. OpenAlex ↗ · Scholar ↗
- Shibani Santurkar, Dimitris Tsipras, and Aleksander Madry. Breeds: Benchmarks for subpopulation shift. arXiv preprint arXiv:2008.04859, 2020. OpenAlex ↗ · Scholar ↗
- Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning, pages 5637–5664. PMLR, 2021. our card
- Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. OpenAlex ↗ · Scholar ↗
- Cian Eastwood, Alexander Robey, Shashank Singh, Julius Von Kügelgen, Hamed Hassani, George J Pappas, and Bernhard Schölkopf. Probable domain generalization via quantile risk minimization. Advances in Neural Information Processing Systems, 35:17340–17358, 2022. OpenAlex ↗ · Scholar ↗
- Alexander Robey, George J Pappas, and Hamed Hassani. Model-based domain generalization. Advances in Neural Information Processing Systems, 34:20210–20229, 2021. OpenAlex ↗ · Scholar ↗
- Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Šrndić, Pavel Laskov, Giorgio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2013, Prague, Czech Republic, September 23-27, 2013, Proceedings, Part III 13, pages 387–402. Springer, 2013. OpenAlex ↗ · Scholar ↗
- Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013. our card
- Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. our card
- Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. Theoretically principled trade-off between robustness and accuracy. In International conference on machine learning, pages 7472–7482. PMLR, 2019. OpenAlex ↗ · Scholar ↗
- Greg Yang, Tony Duan, J Edward Hu, Hadi Salman, Ilya Razenshteyn, and Jerry Li. Randomized smoothing of all shapes and sizes. In International Conference on Machine Learning, pages 10693–10705. PMLR, 2020. OpenAlex ↗ · Scholar ↗
- Alexander Levine and Soheil Feizi. (de) randomized smoothing for certifiable defense against patch attacks. Advances in Neural Information Processing Systems, 33:6465–6475, 2020. OpenAlex ↗ · Scholar ↗
- Maksym Yatsura, Kaspar Sakmann, N Grace Hua, Matthias Hein, and Jan Hendrik Metzen. Certified defences against adversarial patch attacks on semantic segmentation. arXiv preprint arXiv:2209.05980, 2022. OpenAlex ↗ · Scholar ↗
- Anton Xue, Rajeev Alur, and Eric Wong. Stability guarantees for feature attributions with multiplicative smoothing. arXiv preprint arXiv:2307.05902, 2023. OpenAlex ↗ · Scholar ↗
- Jiaye Teng, Guang-He Lee, and Yang Yuan. $\ell_1$ adversarial robustness certificates: a randomized smoothing approach. 2019. OpenAlex ↗ · Scholar ↗
- Marc Fischer, Maximilian Baader, and Martin Vechev. Certified defense to image transformations via randomized smoothing. Advances in Neural information processing systems, 33:8404–8417, 2020. OpenAlex ↗ · Scholar ↗
- Elan Rosenfeld, Ezra Winston, Pradeep Ravikumar, and Zico Kolter. Certified robustness to label-flipping attacks via randomized smoothing. In International Conference on Machine Learning, pages 8230–8241. PMLR, 2020. OpenAlex ↗ · Scholar ↗
- John X Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. Textattack: A framework for adversarial attacks, data augmentation, and adversarial training in nlp. arXiv preprint arXiv:2005.05909, 2020. our card
- Wei Emma Zhang, Quan Z Sheng, Ahoud Alhazmi, and Chenliang Li. Adversarial attacks on deep-learning models in natural language processing: A survey. ACM Transactions on Intelligent Systems and Technology (TIST), 11(3):1–41, 2020. OpenAlex ↗ · Scholar ↗
- Shuhuai Ren, Yihe Deng, Kun He, and Wanxiang Che. Generating natural language adversarial examples through probability weighted word saliency. In Proceedings of the 57th annual meeting of the association for computational linguistics, pages 1085–1097, 2019. our card
- Xiaosen Wang, Hao Jin, and Kun He. Natural language adversarial attack and defense in word level. arXiv preprint arXiv:1909.06723, 2019. OpenAlex ↗ · Scholar ↗
- Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. Generating natural language adversarial examples. arXiv preprint arXiv:1804.07998, 2018. our card
- Danish Pruthi, Bhuwan Dhingra, and Zachary C Lipton. Combating adversarial misspellings with robust word recognition. arXiv preprint arXiv:1905.11268, 2019. our card
- Xiaosen Wang, Yichen Yang, Yihe Deng, and Kun He. Adversarial training with fast gradient projection method against synonym substitution based text attacks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13997–14005, 2021. OpenAlex ↗ · Scholar ↗
- Xiaosen Wang, Jin Hao, Yichen Yang, and Kun He. Natural language adversarial defense through synonym encoding. In Uncertainty in Artificial Intelligence, pages 823–833. PMLR, 2021. OpenAlex ↗ · Scholar ↗
- Yi Zhou, Xiaoqing Zheng, Cho-Jui Hsieh, Kai-Wei Chang, and Xuanjing Huan. Defense against synonym substitution-based adversarial attacks via dirichlet neighborhood ensemble. In Association for Computational Linguistics (ACL), 2021. OpenAlex ↗ · Scholar ↗
- Alexander Robey, Luiz Chamon, George J Pappas, Hamed Hassani, and Alejandro Ribeiro. Adversarial robustness with semi-infinite constrained learning. Advances in Neural Information Processing Systems, 34:6198–6215, 2021. OpenAlex ↗ · Scholar ↗
- Xinyu Zhang, Qiang Wang, Jian Zhang, and Zhao Zhong. Adversarial autoaugment. arXiv preprint arXiv:1912.11188, 2019. OpenAlex ↗ · Scholar ↗
- Long Zhao, Ting Liu, Xi Peng, and Dimitris Metaxas. Maximum-entropy adversarial data augmentation for improved generalization and robustness. Advances in Neural Information Processing Systems, 33:14435–14447, 2020. OpenAlex ↗ · Scholar ↗
- Haotao Wang, Chaowei Xiao, Jean Kossaifi, Zhiding Yu, Anima Anandkumar, and Zhangyang Wang. Augmax: Adversarial composition of random augmentations for robust training. Advances in neural information processing systems, 34:237–250, 2021. OpenAlex ↗ · Scholar ↗
- Francesco Croce, Sven Gowal, Thomas Brunner, Evan Shelhamer, Matthias Hein, and Taylan Cemgil. Evaluating the adversarial robustness of adaptive test-time defenses. In International Conference on Machine Learning, pages 4421–4435. PMLR, 2022. OpenAlex ↗ · Scholar ↗
This page in Markdown https://md.research.elamur.ai/free/en/papers/robey-2023-smoothllm-defending-large-language-models/