EvoDefense: A black-box defense co-evolving with large language modelsEvoDefense: Co-Evolving Black-Box Defense with Large Language Models
The authors propose the black-box defense framework EvoDefense, which iteratively generates defense prompts with a guard model; the authors claim it reduces the ASR of AutoDAN-turbo against Gemini-3-flash on HarmBench from 29.4% to 8.4%.
Black-box defense: the defender cannot access the target model's parameters, gradients or internal state, and can only make input-output queries (e.g., commercial APIs). The attackers are white-box, gray-box and black-box jailbreak attacks (GCG, AutoDAN, PAIR, TAP, AutoDAN-turbo), and the victim systems are seven open-source and closed-source LLMs.
- Existing LLM defenses in black-box scenarios (query-only, no access to model internals) mostly rely on predefined filtering rules; the authors argue such static defenses struggle to generalize to unseen attack types and target model architectures.
- Proposes EvoDefense: a safety classifier first routes requests, the guard model generates structured defense prompts for unsafe requests, and if the Scorer's score is below a threshold, an iterative defense loop is triggered; the defense samples are filtered to form preference pairs, and ORPO is used to incrementally train the guard model.
- Evaluates transfer and adaptive attacks on seven models and five attacks on HarmBench, AdvBench, AlpacaEval: the authors report that on HarmBench the ASR of AutoDAN-turbo against Gemini-3-flash drops from 29.4% to 8.4%, and against LLaMA3-8B-instruct from 43.4% to 6.2%, with utility largely maintained.
- Limitations listed by the authors: only the text single modality is covered; newer models (such as Claude Mythos Preview) were not evaluated; only three benchmarks were used, with plans to expand in the future. Experimentally, there are seven target models in total, the adaptive attack was tested only with AutoDAN-turbo, and the paper does not report the number of repetitions.
- Evaluated models
- Qwen-7B-chatLLaMA3-8B-instructVicuna-7B-v1.5Mistral-7B-v0.2Claude-4.5-haikuGPT-5-chatGemini-3-flashQwen3-embedding-0.6B
- Benchmarks
- HarmBenchAdvBenchAlpacaEval
- Metrics
- ASRWin RateIterationMisclassified Acchelpfulness
EvoDefense proposes an experience-guided black-box defense paradigm, in which a guard LLM detects malicious queries, an experience memory accumulates defense knowledge, and it co-evolves with an attack generator in a continuous attack-defense loop, generalizing to unseen attacks and models without retraining. In experiments on seven models and five types of attacks, AutoDAN-turbo's attack success rate against LLaMA-3-8B-Instruct on HarmBench dropped from 43.4% to 6.2%.
Paper analysis
What problem does this paper attempt to solve?
Addresses the problem that static defenses in black-box scenarios struggle to generalize to unseen attacks and new models, proposing a co-evolvable adaptive defense.
Core problem: how to defend against continuously evolving LLM jailbreak attacks in the black-box setting, with defenses that generalize to unseen attack types and target model architectures.
- Problem setting: the authors point out that many practical scenarios (commercial APIs, proprietary models, legacy systems) provide only query access, so white-box/gray-box defense assumptions do not hold, making black-box defense necessary.
- Shortcomings of existing methods: the authors consider existing black-box defenses (input-side and output-side) to be static, based on predefined attack patterns or fixed heuristics, and difficult to generalize to unseen or continuously evolving attacks; attackers can continuously adjust their strategies based on defense outputs, and static defenses fall behind.
- Core idea: shift from static input/output filtering to dynamic defense generation — instead of directly modifying or rejecting user input, the guard model generates structured defense prompts that guide the target model to give safe responses.
- The paper proposes: EvoDefense, an experience-guided co-evolutionary black-box defense framework: a guard LLM detects malicious queries, an experience memory module accumulates defense knowledge, and attack generation and defense strategies mutually optimize in an iterative loop, generalizing without retraining.
- Threat model:
- Defender knowledge: black-box, with no access to the target model's parameters, gradients, or internal states, only input-output queries.
- Attacker: white-box, gray-box, and black-box jailbreak attacks (GCG, AutoDAN, PAIR, TAP, AutoDAN-turbo), including adaptive attacks that adjust against the defense.
- Victim systems: seven open-source and closed-source LLMs (including commercial APIs).
- Defense goal: reduce attack success rate (ASR) while maintaining utility on benign requests.
What related research exists?
Related work is divided into three groups: black-box attacks, black-box defenses (perturbation/filtering types), and LLM alignment training; this paper positions itself as dynamic adaptive black-box defense.
Black-box and white-box attacks
- GCG (Zou et al., 2023) — a white-box attack that uses greedy coordinate gradient optimization of adversarial suffixes to bypass safety alignment; AutoDAN (Liu et al., 2023) — uses a genetic algorithm to iteratively optimize prompts.
- PAIR (Chao et al., 2025) and TAP (Mehrotra et al., 2024) — black-box iterative prompt optimization frameworks in which the attack model progressively improves jailbreak queries based on feedback from the target model.
- AutoDAN-Turbo (Liu et al., 2024b) — automatically discovers as many jailbreak strategies as possible from scratch without human intervention or a predefined scope; this paper uses it for adaptive attack evaluation.
Black-box defenses (perturbation and filtering types)
- SmoothLLM (Robey et al., 2023) — randomly perturbs the input and performs ensemble decoding to reduce the model's sensitivity to adversarial prompts.
- Semantic Smooth (Ji et al., 2025) — performs smoothing at the semantic level, forcing the model to remain consistent under semantically equivalent input transformations.
- IBProtector (Liu et al., 2024c) — filters task-irrelevant or adversarial signals in user input based on the information bottleneck principle.
- The authors consider these methods to be static, based on predefined attack patterns or fixed heuristics, and thus difficult to defend against attackers who continuously adjust their strategies.
LLMs and alignment training
- SFT (Welleck et al., 2019, etc.) and RLHF (Ouyang et al., 2022) — commonly used alignment methods; DPO (Rafailov et al., 2023) and ORPO (Hong et al., 2024) — directly optimize preference pairs without explicit reward modeling. This paper uses ORPO to train the guard model.
- The authors point out that aligned LLMs remain vulnerable to adversarial prompts and jailbreak attacks, because alignment mainly performs static preference optimization and lacks robustness to adaptive, distribution-shifted inputs.
Baselines and benchmarks: compares against six black-box defense baselines — SmoothLLM, Self Defense (Helbling et al., 2023), RA-LLM (Cao et al., 2024), Semantic Smooth, IBProtector, Self Defend (Wang et al., 2024a) — and additionally compares with Qwen3-Guard (Zhao et al., 2025); the benchmarks are HarmBench, AdvBench, and AlpacaEval.
The authors position this paper as follows: unlike static filtering, EvoDefense dynamically adapts to unseen and continuously evolving attacks through an iterative defense loop, and works entirely in the black-box setting.
How does the paper address this problem?
EvoDefense: classifier routing + guard model generating structured defense prompts + scoring-feedback iterative loop + ORPO incremental training.
Overall approach: EvoDefense changes defense from static filtering to dynamic generation—a safety classifier first determines whether a request is safe; for unsafe requests, a guard model (EvoGuard) generates a structured defense prompt to guide the target model toward a safe response; the Scorer's score serves as feedback to trigger iterative optimization; defense samples accumulate into a library and are filtered into preference pairs, and the guard model is incrementally trained with ORPO. The framework is shown in Figure 2.
Safety classification and defense prompt generation
- Classification routing: The safety classifier C determines whether input x is safe (r ∈ {safe, unsafe}); safe requests are forwarded directly to the target LLM, and unsafe requests are handed to EvoGuard to generate a defense prompt. The authors state this avoids over-defense against benign requests.
- Structured defense prompt: The system prompt Ps requires the defense prompt to contain a three-part structure—Task Summary, Risky Elements, Response Guidelines; it does not contain the original request text, but rather a structured summary that retains task-relevant information and filters harmful details, and is self-contained (the target model does not need to see the original query).
- First round and subsequent rounds: The first round has no historical samples, Pd = G(Ps, x); subsequent rounds improve based on history and feedback. Appendix D.1 (Figures 5, 6) gives the full prompt for EvoGuard.
Response evaluation and feedback
- Scorer scoring: After the target LLM generates response R, the Scorer LLM gives a numerical score S from 1–10 according to preset criteria (1 means fully complying with the harmful instruction, 10 means fully not conforming to the malicious intent).
- Threshold trigger: If S is below threshold τ, the response is judged still unsafe, triggering the next defense round, and the guard model generates a new defense prompt based on the failure case; otherwise the response is returned to the user. The scoring prompt is shown in Appendix Figure 7.
Defense memory and experience accumulation
- Defense library: The defense library D is keyed by the hash of the input query, with defense samples E as values; each sample contains the original request x, defense prompt pd, target model response r, Scorer score s, and improvement m summarized from failure cases.
- Role: Persistently stores samples collected during the defense loop, enabling the framework to accumulate experience, learn from history, and improve defense strategies over time.
Continuous defense optimization (training and inference)
- Adaptive defense loop: Each round maintains a defense context consisting of the most recent n failure samples, Pdt+1 = G(Ps, x, Pc(sti, ..., sti−n)), i.e., the guard model improves the next round's defense prompt based on recent failure history until the safety criterion is met or the maximum number of iterations is reached. Inference and training share the same loop.
- Preference pair construction: For the same query, multiple candidate defense prompts are compared; only if S+ is above threshold τl, S− is below threshold τh, and the score difference ΔS is greater than margin δ, does it form a valid preference pair {Pd+, Pd−}, which is placed into the defense pool.
- ORPO incremental training: The guard model is optimized with ORPO, with objective LORPO = E[LSFT + λ · LOR], encouraging the model to assign higher likelihood to preferred defense prompts, without an explicit reward model; new preference pairs are periodically added to the defense pool for incremental fine-tuning (LoRA).
- Inference setup: At inference the guard model is frozen and runs exactly the same defense loop as in training; the defense pool is not used, and samples stored in the defense library during training are inaccessible at inference (the authors state this is for fairness), keeping it lightweight and plug-and-play.
What experiments did the paper conduct?
Evaluates transfer and adaptive attacks on 7 models and 5 attacks on HarmBench/AdvBench/AlpacaEval, and conducts round-count ablation and incremental training analysis.
Experimental setup
- Target models (7): open-source Qwen-7B-chat, LLaMA3-8B-instruct, Vicuna-7B-v1.5, Mistral-7B-v0.2; closed-source Claude-4.5-haiku, GPT-5-chat, Gemini-3-flash. The authors state newer models were not chosen because token costs were too high.
- Attacks: white-box GCG, gray-box/black-box AutoDAN, PAIR, TAP, AutoDAN-turbo; adaptive attacks use AutoDAN-turbo with a maximum of 20 iterations.
- Datasets: HarmBench (400 malicious requests, 80 validation-set for training, 320 test-set for evaluation); AdvBench (first 120 for testing); AlpacaEval (40 sampled from each sub-dataset, 200 total for evaluation, the rest for training).
- Baselines: SmoothLLM, Self Defense, RA-LLM, Semantic Smooth, IBProtector (trained on LLaMA-2-7B per the original implementation), Self Defend; additionally compared with Qwen3-Guard on helpfulness.
- Metrics and judging: HarmBench/AdvBench use ASR; AlpacaEval uses Win Rate, with LLaMA-3-70B as the judge model and baseline responses from text-davinci-003; helpfulness is scored on a 1–4 scale (Appendix C.3).
- Implementation: guard model Qwen-3-4B, safety classifier Qwen3-embedding-0.6B, Scorer Deepseek-V3.1; training uses 80 HarmBench validation-set prompts (attacked by AutoDAN-turbo and GCG only on Qwen-7B-chat) plus 160 AlpacaEval prompts; τ=8.5, τl=τh=8.5, δ=1.0, defense pool capacity 20, LoRA trained for 10 epochs, 2 rounds of lifelong defense. The main experiments use single-round defense. The paper does not report the number of repetitions.
Main results
Transfer attacks (Table 1, HarmBench ASR↓ and AlpacaEval Win Rate↑, single-round defense, excerpting the EvoDefense and None rows):
Swipe horizontally to read the table
Model Defense AutoDAN PAIR TAP GCG AutoDAN-turbo Win Rate Qwen-7B-chat None 50.9% 41.9% 44.7% 59.1% 39.7% 79.8% Qwen-7B-chat EvoDefense 0.6% 8.1% 6.9% 2.5% 4.4% 78.0% LLaMA3-8B-instruct None 5.0% 26.6% 14.1% 43.1% 43.4% 80.7% LLaMA3-8B-instruct EvoDefense 0.9% 5.9% 2.5% 0.0% 6.2% 78.2% Vicuna-7B-v1.5 None 67.2% 53.8% 50.9% 66.9% 40.0% 72.2% Vicuna-7B-v1.5 EvoDefense 0.9% 9.1% 9.1% 1.6% 4.4% 71.4% Mistral-7B-v0.2 None 72.5% 52.2% 58.8% 69.1% 45.9% 92.6% Mistral-7B-v0.2 EvoDefense 0.6% 8.8% 0.6% 0.6% 8.8% 91.1% Closed-source models (Table 1, AutoDAN and GCG not reported): on Gemini-3-flash, EvoDefense's PAIR/TAP/AutoDAN-turbo ASR is 6.3%/10.3%/8.4% (None: 30.6%/29.1%/29.4%), Win Rate 97.6% (None 98.4%); on GPT-5-chat it is 2.2%/3.8%/0.9% (None: 13.1%/15.6%/10.0%); on Claude-4.5-haiku it is 1.6%/0.6%/2.2% (None: 2.2%/0.6%/4.1%).
- The authors state EvoDefense consistently reduces ASR across the seven models while maintaining utility; Figure 1 shows its defend success rate on HarmBench (0.917–0.985) is higher than each baseline.
- Exceptions: Self Defend's ASR on AutoDAN-turbo instead increases (e.g., 73.8% on LLaMA3-8B-instruct, higher than None's 43.4%); IBProtector's ASR on LLaMA3-8B-instruct under AutoDAN rises from 5.0% to 34.1%, which the authors call unstable.
- Utility cost: the authors state IBProtector's utility decreases (Win Rate on Qwen-7B-chat drops from 79.8% to 62.9%), while EvoDefense maintains 78.0%.
Adaptive attacks
- Setup: AutoDAN-turbo iteratively adjusts strategies against the defended model, up to 20 rounds, reporting ASR and average number of iterations (Table 2, HarmBench).
- Results: EvoDefense's ASR on the four open-source models is 6.3%/7.5%/5.6%/11.3% (None: 30.5%/40.3%/38.4%/45.3%), with average iterations 15.30–16.65, higher than None's 6.10–8.90. AdvBench results (Table 5) are similar, e.g., ASR 0.9% on Vicuna-7B-v1.5 (None 55.8%).
- Authors' interpretation: EvoDefense can mitigate adaptive attacks and make them more costly. Note that in Table 2, RA-LLM's ASR on Vicuna-7B-v1.5 (5.6%) is on par with EvoDefense.
Comparison with Qwen3-Guard and incremental training
- helpfulness: On AdvBench, EvoDefense's average helpfulness on the four open-source target models is 2.1, versus 1.0 for Qwen3-Guard (main text 4.2).
- Safety classifier comparison (Table 6, HarmBench Misclassified Acc): the classifier after incremental training (+TAP) is lower than Qwen3-Guard on most model×attack combinations, e.g., PAIR on Qwen-7B-chat is 1.3% (Qwen3-Guard 15.3%).
- Incremental training (Table 7, HarmBench): after incremental training with TAP, EvoDefense has lower ASR on the three closed-source models, e.g., PAIR on Gemini-3-flash drops from 6.3% to 3.1%.
Other ablations and analyses
- Defense rounds (Table 3, HarmBench): the largest improvement is from 1→2 rounds (PAIR on Qwen-7B-chat drops from 8.1% to 2.8%); beyond 2–5 rounds it saturates or fluctuates, e.g., AutoDAN-turbo on Qwen-7B-chat rises from 4.4% at rounds 1 and 2 to 6.6% at round 5.
- AdvBench transfer attacks (Table 4): EvoDefense's single-round ASR is mostly 0.0%–12.5%, e.g., AutoDAN on Mistral-7B-v0.2 is 0.0% (None 98.3%).
- Visual comparison (Figure 4): the authors state that undefended models output harmful content after being jailbroken, while EvoDefense makes the target model output a standard refusal; the figure gives one example each.
What are some points that can be further explored?
The authors list three limitations: single modality, newer models not tested, and number of benchmarks; the experiments cover seven target models and five attacks.
Limitations and future directions noted by the authors
- Single modality: only the text modality is considered; effective defenses in multimodal scenarios have not yet been explored (Limitations in the Conclusion).
- Model coverage: newer LLMs (such as Claude Mythos Preview) were not included in the evaluation; the authors plan to use these models to test the effectiveness of the method (Limitations).
- Number of benchmarks: experiments were conducted on only three benchmarks; the authors plan to select more diverse benchmarks in future work (Limitations).
Scope of experimental coverage
- There are 7 target models tested: 4 open-source (Qwen-7B-chat, LLaMA3-8B-instruct, Vicuna-7B-v1.5, Mistral-7B-v0.2) and 3 closed-source (Claude-4.5-haiku, GPT-5-chat, Gemini-3-flash); the authors state that newer models were not selected because the token cost was too high (Section 4.1).
- 5 attacks are covered (GCG, AutoDAN, PAIR, TAP, AutoDAN-turbo); the adaptive attack experiment uses only AutoDAN-turbo, with a maximum of 20 iterations (Section 4.2).
- Results for AutoDAN and GCG on closed-source models are not reported (shown as “–” in Table 1).
- Defense components: guard model Qwen-3-4B, safety classifier Qwen3-embedding-0.6B, Scorer Deepseek-V3.1; the AlpacaEval judge model is LLaMA-3-70B (Section 4.1).
- Training data consists of 80 HarmBench validation-set prompts (attacked by AutoDAN-turbo and GCG only on Qwen-7B-chat) plus 160 AlpacaEval prompts; the paper does not report the number of experimental repetitions, nor the agreement between the judge and human annotators.
Summarize the main content of the paper
EvoDefense iteratively generates defense prompts with a guard model and performs incremental training; the authors claim it achieves both low ASR and utility in the black-box setting.
EvoDefense is a black-box LLM defense framework, targeting the problem that static-filtering defenses struggle to generalize to unseen attacks and new models.
- Problem: In real deployments (commercial APIs, proprietary models) only query access is available, so white-box/gray-box defense assumptions do not hold; the authors argue existing black-box defenses are based on fixed heuristics and struggle against attackers who continuously adjust strategies.
- Method: A safety classifier routes requests, and a guard model (Qwen-3-4B) generates structured defense prompts containing Task Summary, Risky Elements, Response Guidelines for unsafe requests; if the Scorer (Deepseek-V3.1) score is below threshold τ=8.5, iterative improvement is triggered; defense samples are filtered into preference pairs, and the guard model is incrementally trained with ORPO; at inference the model is frozen and does not access training-period samples.
- Transfer attack results (Table 1, HarmBench, single-round defense): AutoDAN-turbo on Gemini-3-flash drops ASR from 29.4% to 8.4%, and on LLaMA3-8B-instruct from 43.4% to 6.2%; on Qwen-7B-chat, AutoDAN drops from 50.9% to 0.6%; AlpacaEval Win Rate is essentially on par with no defense (e.g., 78.0% vs. 79.8% on Qwen-7B-chat).
- Adaptive attack results (Table 2, AutoDAN-turbo, up to 20 rounds): ASR on the four open-source models is 5.6%–11.3% (30.5%–45.3% without defense), and the average number of iterations is 15.30–16.65, higher than 6.10–8.90 without defense; the authors state the defense makes adaptive attacks more costly.
- Other: On AdvBench, helpfulness averages 2.1, higher than Qwen3-Guard's 1.0; ablation shows the largest improvement from 1→2 defense rounds, saturating or fluctuating beyond 2–5 rounds.
- Authors' conclusion: The authors claim EvoDefense achieves near-zero ASR on three benchmarks while maintaining utility, outperforming black-box defense baselines; limitations are that it covers only the text single modality, does not test newer models, and the number of benchmarks remains to be expanded.
Related papers
- Safety Alignment Should Be Made More Than Just a Few Tokens DeepAnalysis / interpretabilityICLR 2025