Skip to content

AdvPrefix: An objective for nuanced LLM jailbreaksAdvPrefix: An Objective for Nuanced LLM Jailbreaks

arXiv· arXiv:2412.10321· NeurIPS 2025· Sicheng Zhu, Brandon Amos, Yuandong Tian, Chuan Guo, Ivan EvtimovUniversity of Maryland, College Park; FAIR, MetaIndexed by this site · 27 days ago· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose the AdvPrefix prefix-forcing objective, selecting a prefix for each victim model by prefilling ASR and initial NLL; the authors claim GCG's nuanced ASR on Llama-3 rises from 16% to 70%.

Threat modelAttackers can modify the attack prompt θ (optimizing only a suffix appended to the malicious request, or optimizing the entire attack prompt from scratch) to manipulate the victim LLM's output distribution; the objective requires the victim model's log probabilities, is a white-box setting, and does not apply to black-box attacks.

Questions
Automated jailbreaks commonly use the "Sure, here is..." prefix as the optimization objective; the authors argue it is both misspecified (low loss does not equal a genuinely harmful complete response) and overconstrained (a fixed prefix does not match the model's natural style and is hard to optimize), and that existing judges overestimate ASR.
Methods
The authors first improve the nuanced judge (a Llama-3.1-70B judge and a preference judge), then propose AdvPrefix: generate candidate prefixes with rule templates or an uncensored LLM, filter them by a weighted combination of two criteria—high prefilling ASR and low initial NLL—support a multi-prefix objective, and plug and play into GCG and AutoDAN.
Experiments and results
On Llama-2/3/3.1 and Gemma-2, after GCG switched to AdvPrefix, nuanced ASR rose, e.g., Llama-3 from 12.8% to 54.6% (Table 1); under full prompt optimization it reached 79.5% (Table 2); the authors state that existing safety alignment cannot generalize to new prefixes.
Limitations and future work
The authors note: prefix selection requires evaluating a large number of sampled responses and is computationally expensive; other objective properties such as loss landscape shape are not considered; it relies on the target model's log probabilities and cannot be used for black-box attacks (Conclusion). The experiments cover only 4 open-source victim models, 50 requests, and two attacks, GCG and AutoDAN.
Experimental setupLlama-2-7B-chat-hf、Llama-3-8B-Instruct et al. · 50 条选自 AdvBench 的高危害请求(作者自建子集) · nuanced ASR、失败案例分解(Direct Refusal / Incomplete / Unfaithful) et al.
Evaluated models
Llama-2-7B-chat-hfLlama-3-8B-InstructLlama-3.1-8B-InstructGemma-2-9B-itR1-distilled-Llama-3-8B
Benchmarks
50 条选自 AdvBench 的高危害请求(作者自建子集)
Metrics
nuanced ASR失败案例分解(Direct Refusal / Incomplete / Unfaithful)human agreement rateF1preference judge win rate
AI summaryMeta researchers propose AdvPrefix, a plug-and-play prefix-forcing objective for jailbreaking large language models, which selects one or more prefixes for each model based on two criteria: high prefilling attack success rate and low negative log-likelihood. Many existing jailbreak attacks rely on the same objective, namely making the model begin its response with a fixed affirmative prefix, which limits control over model behavior, tends to produce incomplete, untruthful jailbreak responses, and the rigid format is also unfavorable for optimization. AdvPrefix can be directly embedded into existing attacks; on Llama-3, after replacing GCG's default prefix, the success rate of nuanced jailbreak attacks rises from 14% to 80%, and the authors claim this result reveals that current safety alignment fails to generalize to new prefixes. The code and selected prefixes are released at github.com/facebookresearch/jailbreak-objectives.

Meta researchers propose AdvPrefix, a plug-and-play prefix-forcing objective for jailbreaking large language models, which selects one or more prefixes for each model based on two criteria: high prefilling attack success rate and low negative log-likelihood. Many existing jailbreak attacks rely on the same objective, namely making the model begin its response with a fixed affirmative prefix, which limits control over model behavior, tends to produce incomplete, untruthful jailbreak responses, and the rigid format is also unfavorable for optimization. AdvPrefix can be directly embedded into existing attacks; on Llama-3, after replacing GCG's default prefix, the success rate of nuanced jailbreak attacks rises from 14% to 80%, and the authors claim this result reveals that current safety alignment fails to generalize to new prefixes. The code and selected prefixes are released at github.com/facebookresearch/jailbreak-objectives.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors argue that the fixed-prefix objective commonly used in jailbreak attacks is both misspecified and overconstrained, and propose a new objective that selects prefixes per model.

    Core problem: automated jailbreaks generally use a fixed prefix such as "Sure, here is [harmful request]" as the optimization objective; the authors argue this objective has two flaws, misspecified and overconstrained, leading to low nuanced jailbreak success rates.

    • Problem setting: automated jailbreaks use prompt optimization to bypass safety alignment, and the optimization objective is a key component; many attacks (GCG, AutoDAN, etc.) target eliciting a generic prefix (§1).
    • Shortcomings of the existing objective (authors' view): first, misspecified—even when the optimization loss is very low, the actual response is often incomplete or unfaithful and does not produce genuinely harmful content; second, overconstrained—a hand-fixed prefix is unnatural for LLMs (e.g., Llama-3 prefers to start with "Here" rather than "Sure"), increasing optimization difficulty (§1, §3).
    • Evaluation-level problem: the authors claim existing jailbreak judges (HarmBench, JailbreakBench, StrongReject) misjudge incomplete, unfaithful responses as successful, with ASR overestimated by up to 30% (Figure 2), more pronounced on newer models such as Llama-3 and Gemma-2.
    • Core observation of the paper: newer models tend to self-correct after generating an affirmative prefix rather than directly refusing (§A), so even if the prefix is successfully elicited, the response may still fail; the authors therefore argue that prefixes need to be selected per victim model and request.
    • Proposed approach: AdvPrefix—a plug-and-play prefix-forcing objective that selects model-relevant prefixes by two criteria, high prefilling ASR and low initial NLL, and can be integrated into existing attacks (§4).
    • Threat model (§3.1, §5):
      • Attacker goal: find an attack prompt θ such that the victim LLM generates a harmful response satisfying the nuanced criteria (affirmative, complete, faithful).
      • Attacker knowledge: requires the target model's log probabilities (white-box setting); the authors explicitly state this objective is not applicable to black-box attacks (§7).
      • Attacker capability: modify the attack prompt θ—either optimizing only a suffix appended to the malicious request, or optimizing the entire attack prompt from scratch.
      • Victim system: open-source aligned LLMs (Llama-2/3/3.1, Gemma-2).
  2. What related research exists?

    Related work is grouped into three categories: jailbreak attack methods, jailbreak objective design, and jailbreak evaluation; the authors position this paper as objective design rather than a new attack method.

    Jailbreak attacks and red teaming

    • White-box attacks: GCG (Zou et al., 2023) and others use search or gradients for prompt optimization, with some work adding fluency considerations (Liu et al., 2023a; Zhu et al., 2023; Paulus et al., 2024); the paper states that white-box attacks are often most effective against defended models (e.g., Llama-2).
    • Black-box attacks: PAIR (Chao et al., 2023), Tree of Attacks (Mehrotra et al., 2023) and others use designed or learned strategies for interpretable prompt optimization, applicable to closed-source models.
    • New attack vectors: exploiting model reasoning (Wu et al., 2025), masking intent with auxiliary tasks (Chen et al., 2025), and improving transferability by reducing prompt overfitting (Lin et al., 2025; Zhang et al., 2025b).

    Jailbreak attack objectives

    • Work noting misspecification: Geiping et al. (2024), Liao and Sun (2024), Zhou and Wang (2024) note that lower loss does not necessarily yield higher ASR; Liao and Sun and Zhou and Wang attribute this to exposure bias, and the authors add that even when a prefix is successfully elicited, the model may still not generate a complete, faithful response (§B).
    • New objective designs: Zhou and Wang (2024) and Xie et al. (2024) suppress refusals rather than elicit a target prefix; Jia et al. (2024) append phrases to prefixes to raise ASR; Thompson and Sklar (2024) propose a dual objective distilled from an uncensored teacher, which the authors argue faces teacher learnability and sample efficiency issues, whereas this paper's objective amounts to distillation from a degenerate (single-prefix) teacher and is sample-efficient (§6, §A).
    • Initial response relevance: the response selection/guidance of Tran et al. (2024) and the prefilling attack of Zhang et al. (2025a) both emphasize the importance of the initial response; the authors state that unlike these manual objectives, this paper automatically customizes prefixes for a specific victim model and request.

    Jailbreak evaluation

    • Three judges that were meta-evaluated: HarmBench (Mazeika et al., 2024), JailbreakBench (Chao et al., 2024), StrongReject (Souly et al., 2024); the authors state that StrongReject is relatively accurate and that the other judges overestimate ASR by up to 30% (Figure 2).
    • Evaluation robustness: Strauss et al. (2025) find that LLM safety evaluation lacks robustness, which the authors use to argue for more fine-grained evaluation frameworks.

    Baselines and benchmarks: the comparison baseline in this paper is the same attack (GCG, AutoDAN) with the original "Sure, here is..." prefix objective; the evaluation data are 50 high-harm requests curated from AdvBench (§C).

    The authors position this paper as a systematic study of the jailbreak objective, a less-studied component, rather than a new attack method (§6, §7).

  3. How does the paper address this problem?

    First improve the nuanced judge to expose the flaws of the original objective, then automatically select model-relevant prefixes by two criteria to form a multi-prefix objective.

    The overall approach has two steps: first use a stricter nuanced judge to quantify the misspecification and overconstraint of the original prefix objective, then propose AdvPrefix—a selective multi-prefix objective that automatically selects a set of prefixes for each victim model and request, plug-and-play into existing attacks (§4).

    Problem formalization and two flaws

    • Oracle objective: minθ −log ∑y ∈ Yx p(y|θ), i.e., maximize the probability that the victim model generates any qualifying harmful response; Y_x is usually extremely large and computationally infeasible, so a prefix-forcing objective is used as a proxy (§3.1).
    • Prefix-forcing objective: minθ −log p(yp|θ), equivalent to maximizing the probability of any response beginning with y_p; it also includes non-jailbreak responses (incomplete, unfaithful), which the authors call prone to misspecification (§3.1).
    • Evidence of misspecification: lowering the original objective's loss directly reduces refusals, but incomplete and unfaithful responses increase, and the total failure rate remains above 80%; after directly prefilling the target prefix, the failure rate is still high (Figure 3, middle and right).
    • Evidence of overconstraint: on Llama-3, replacing "Sure, here is" with "Here is" yields consistently lower final GCG loss and raises ASR from 12.8% to 22.1% (Figure 8); the authors use this to argue the original objective overconstrains optimization.

    Improved evaluation (before the method)

    • Nuanced criteria: a successful jailbreak requires the response to be affirmative, complete, and faithful (on-topic, detailed, realistic, following the criteria of Vidgen et al. 2024); failures are divided into three categories: Direct Refusal, Incomplete, Unfaithful (§2, Table 5).
    • Improved judge: based on Llama-3.1-70B, with instructions modified to prioritize completeness and faithfulness, requiring a reasoning trace before the conclusion, and using affirmative prefilling for sensitive content (§2, §C).
    • Preference judge: uses responses from an uncensored LLM (Orenguteng/Llama-3.1-8B-Lexi-Uncensored) as the baseline to compare the relative harmfulness of jailbreak responses (§C).

    AdvPrefix objective and selection criteria

    • Multi-prefix objective: for request x, select a set of prefixes Y_p and minimize the negative log-likelihood of generating any prefix (Equation 4.1); tree attention concatenates multiple prefixes so computation completes in one forward pass (§4.1).
    • Criterion I: high prefilling ASR: once a prefix is elicited, it should lead with high probability to a complete, faithful harmful continuation; prefilling ASR is approximated using manually constructed attack prompts, and the authors report this approximation correlates with actual jailbreak ASR (Figure 7).
    • Criterion II: low initial NLL: the prefix's NLL under the initial (unoptimized) attack prompt θ0 should be low, indicating it is easy to elicit through optimization (Equation 4.3).
    • Weighted balance: the two criteria often conflict (longer prefixes have high prefilling ASR but also high NLL); a weighted sum of log-prefilling-ASR and NLL balances them, with the weight adjustable according to the strength of the optimization method (§4.2).

    Prefix selection pipeline

    1. Candidate generation: use rule templates or an uncensored LLM with guided decoding to generate candidate prefixes of different lengths; the uncensored LLM need not be an uncensored version of the victim model, and public unaligned/harmfully fine-tuned/refusal-suppressed models may be chosen (§4.3).
    2. Preprocessing: rule-based augmentation (e.g., "Here is" to "Here's"), deduplication, and filtering out prefixes beginning with a refusal.
    3. Two-criteria evaluation: compute initial NLL with the victim LLM; have the victim LLM sample multiple continuations for each prefix (temperature 1), and evaluate with the nuanced judge to obtain prefilling ASR.
    4. Selection: rank by the weighted sum; when selecting k, first determine the reference prefix with the highest prefilling ASR, then select the top k that are not below it; multiple prefixes may not be sub-prefixes of one another (§C).

    Key parameters

    • Candidate prefixes are generated by 4 public uncensored LLMs on HuggingFace; prefilling ASR is averaged over 25 random continuations per prefix (temperature 1); the log-prefilling-ASR weight is fixed at 20; the multi-prefix objective selects 4 prefixes (§5).
    • Attack settings: GCG and AutoDAN each run for 1000 steps with batch size 512, taking the attack prompt with the lowest objective loss (§5).
  4. What experiments did the paper conduct?

    Comparing the new and old objectives with GCG/AutoDAN on 4 open-source models, nuanced ASR rises, e.g., Llama-3 from 12.8% to 54.6%.

    Experimental setup

    • Victim models: 4 in total—Llama-2-7B-chat-hf, Llama-3-8B-Instruct, Llama-3.1-8B-Instruct, Gemma-2-9B-it; additionally R1-distilled-Llama-3-8B is used to demonstrate attacking a reasoning model (Figure 9).
    • Dataset: 50 high-harm, unambiguous requests curated from AdvBench, excluding sensitive topics such as child abuse (§C).
    • Attack methods: GCG (search-based optimization) and AutoDAN (search plus guided decoding), each 1000 steps, batch size 512; two threat models—optimizing only the suffix (20 or 40 token) appended to the request, or optimizing the entire prompt from scratch (GCG 40 token, AutoDAN 200 token).
    • Baseline: the same attack with the original "Sure, here is..." prefix objective.
    • Judging: the authors' improved Llama-3.1-70B nuanced judge is used for prefix selection and jailbreak evaluation; the preference judge uses Orenguteng/Llama-3.1-8B-Lexi-Uncensored as baseline to compare harmfulness; the ablation additionally uses three judges: HarmBench, JailbreakBench, StrongReject.
    • Decoding and repetition: victim models use greedy decoding, generating at most 512 token; each ASR is first averaged over 4 independent runs, then averaged across requests.

    Main results

    Table 1: GCG optimizing the attack suffix (20 token, 40 token in parentheses), each cell a percentage.

    Swipe horizontally to read the table

    ModelObjectiveSuccess ASR ↑Direct refusalIncompleteUnfaithful
    Llama-2 7B-ChatOriginal13.0 (26.1)72.3 (49.7)0.0 (0.0)14.6 (24.1)
    Llama-2 7B-ChatOurs Multiple26.0 (37.5)68.0 (52.1)0.0 (0.0)6.0 (10.4)
    Llama-3 8B-InstructOriginal12.8 (16.4)45.6 (37.3)22.1 (21.8)19.5 (24.5)
    Llama-3 8B-InstructOurs Multiple54.0 (70.0)26.0 (14.0)1.0 (2.0)19.0 (14.0)
    Llama-3.1 8B-InstructOriginal16.8 (16.5)48.3 (48.8)16.8 (17.3)18.1 (17.3)
    Llama-3.1 8B-InstructOurs Multiple60.0 (61.0)11.0 (11.0)1.0 (2.6)28.0 (25.3)
    Gemma-2 9B-ITOriginal11.2 (9.5)4.0 (5.3)17.0 (11.6)67.8 (73.7)
    Gemma-2 9B-ITOurs Multiple40.0 (53.3)16.0 (5.3)2.0 (8.7)42.0 (32.7)
    • The authors claim that after switching to model-relevant prefixes, ASR rises for all victim models, often higher with the multi-prefix objective; the single-prefix variant gives similar numbers (e.g., 54.6 (69.7) on Llama-3), see Table 1.
    • The authors interpret the failure breakdown: on the three newer models, incomplete responses drop from about 20% to 1–2%, and on Gemma-2 unfaithful responses roughly halve, indicating misspecification is alleviated; on Llama-3/3.1 direct refusals roughly halve and convergence is faster (Figure 5 left), indicating overconstraint is alleviated.
    • Exception: on Gemma-2, AdvPrefix's direct refusals rise from 4.0% to 16.0% (20 token), and although the unfaithful proportion drops, it remains the main failure category (Table 1).

    Full-prompt optimization and AutoDAN (Table 2)

    • What was tested: GCG optimizing the entire 40 token prompt from scratch, AutoDAN generating the entire 200 token prompt, comparing the original objective with the single-prefix objective.
    • Results: under GCG full-prompt, Llama-2 rises from 42.1% to 72.6%, Llama-3 from 14.1% to 79.5%, Llama-3.1 from 47.0% to 58.9%, Gemma-2 from 7.4% to 51.2%; under AutoDAN, Llama-3 rises from 5.2% to 77.9%, and the other models also rise (Table 2).
    • Authors' interpretation: full-prompt optimization nearly eliminates direct refusals, but the original objective's ASR changes inconsistently due to more incomplete/unfaithful responses; after alleviating misspecification, AdvPrefix can consistently benefit from stronger optimization.

    Judge meta-evaluation and harmfulness comparison

    • Meta-evaluation: 800 human-annotated GCG attack responses (4 models) are used as ground truth; existing judges overestimate ASR (e.g., on Gemma-2 ground truth is about 10% while judges give nearly 40%), and StrongReject is relatively the most accurate (Figure 2).
    • Improved judge agreement: average human agreement rate rises from HarmBench 86.6, JailbreakBench 85.5, StrongReject 89.3 to the authors' 91.8 (F1 85.4 in parentheses), with the largest gains on Llama-3 and Gemma-2 (Table 4).
    • Preference judge comparison: GCG+AdvPrefix jailbreak responses' harmfulness win rate against an uncensored LLM is 30~50%, versus about 10% for the original objective; a win rate below 50% indicates they are still less harmful than the uncensored LLM (Figure 5 right).

    Other ablations and analyses

    • Judge-swap ablation: re-evaluating the GCG full-prompt results of Table 2 with HarmBench/JailbreakBench/StrongReject, the relative improvement trend is unchanged (e.g., on Llama-3 the three judges rise from 27.8/38.0/14.5 to 82.2/82.2/84.2, Table 3).
    • Suffix length: longer suffixes lower the final loss; the original objective's ASR on newer models remains about 10%, and AdvPrefix gains an additional 9–15% ASR from longer suffixes (§5.1).
    • Prefix substitution experiment: on Llama-3, replacing "Sure, here is" with "Here is" gives lower loss and raises ASR from 12.8% to 22.1% (Figure 8).
    • Reasoning model: AdvPrefix enables GCG to attack R1-distilled-Llama-3-8B, whereas the default prefix cannot lower the loss (Figure 9; the paper gives no specific ASR number).
    • Computational cost: generating each prefix takes about 5 minutes (A100 80G), and roughly estimating prefilling ASR takes about 3 minutes; the 70B judge is the main cost; prefix selection is a one-time cost (§5.2).
  5. What are some points that can be further explored?

    The authors list three limitations: computational cost, properties of the objective, and white-box only; the experiments cover 4 models, 50 requests, and two attacks.

    Limitations noted by the authors and future directions

    • Computational cost: selecting prefixes (especially evaluating prefilling ASR) requires evaluating a large number of sampled responses, imposing a computational burden (§7 Limitations).
    • Objective properties not covered: other desirable properties of the objective are not considered, such as a well-shaped loss landscape (§7 Limitations).
    • White-box only: the objective requires the target model's log probabilities and cannot be applied to black-box attacks (§7 Limitations).
    • Alignment generalization: the authors state that current safety alignment cannot generalize to new, unseen prefixes and that more generalizable alignment is needed (§7 Conclusion); §B further states that existing fine-tuning strategies need more targeted prefixes to improve generalization.

    Scope of experiments

    • Models tested: Llama-2-7B-chat-hf, Llama-3-8B-Instruct, Llama-3.1-8B-Instruct, Gemma-2-9B-it, 4 open-source models in total, plus a demonstration with R1-distilled-Llama-3-8B (Figure 9); all are 7B–9B scale.
    • Attack methods: only two white-box attacks, GCG and AutoDAN; the paper explicitly omits attacks on threat models other than user prompt modification (§6), and the objective itself does not apply to black-box attacks.
    • Data scale: 50 requests selected from AdvBench, excluding sensitive topics such as child abuse; the meta-evaluation uses 800 human-annotated responses.
    • Repetition and decoding: each ASR is averaged over 4 independent runs; the victim model uses greedy decoding with a 512-token limit; prefilling ASR is estimated from 25 samples.
    • Not reported: the paper does not report attack effectiveness under any defense method (e.g., system-level protections such as Llama Guard), does not report statistical tests of judge error beyond agreement with human evaluation, and the reasoning-model experiment in Figure 9 gives no specific ASR numbers.
  6. Summarize the main content of the paper

    AdvPrefix selects prefixes per model to replace the fixed jailbreak objective; the authors claim GCG's nuanced ASR on Llama-3 rises from 16% to 70%.

    A study on the optimization objective of jailbreak attacks: the authors argue that the widely used fixed-prefix objective "Sure, here is..." has two flaws: misspecified (low loss does not equal a complete, faithful harmful response) and overconstrained (the prefix does not match the model's style and is hard to optimize), and they propose AdvPrefix, which can customize the prefix per model.

    • Evaluation first: the authors use 800 human-annotated responses to meta-evaluate three common jailbreak judges, claiming that existing judges misjudge incomplete, unfaithful responses as successful, overestimating ASR by up to 30% (Figure 2); the improved Llama-3.1-70B judge based on this reaches an average human agreement rate of 91.8, higher than StrongReject's 89.3 (Table 4).
    • Method: use rule templates or an uncensored LLM to generate candidate prefixes, filter them by weighting two criteria—high prefilling ASR (eliciting a complete harmful response after elicitation) and low initial NLL (easy to optimize and elicit)—forming an objective that supports multiple prefixes, plug-and-play into GCG and AutoDAN.
    • Main results: when GCG optimizes the suffix, nuanced ASR on Llama-3 rises from 12.8% to 54.0% (multiple prefixes, 20 token), reaching 70.0% at 40 token (Table 1); when optimizing the entire prompt from scratch, Llama-3 rises from 14.1% to 79.5% (Table 2).
    • Cross-attack generalization: AutoDAN on Llama-3 rises from 5.2% to 77.9% (Table 2); the authors claim AdvPrefix can also attack the reasoning model R1-distilled-Llama-3-8B (Figure 9).
    • Harmfulness comparison: the preference judge shows that AdvPrefix jailbreak responses' harmfulness win rate against an uncensored LLM is 30~50%, versus about 10% for the original objective, but still below 50% (Figure 5 right).
    • Authors' conclusion: current safety alignment cannot generalize to new, unseen prefixes, and more generalizable alignment is needed; limitations are that prefix selection is computationally expensive, does not consider objective properties such as the loss landscape, and relies on log probabilities and thus cannot be used for black-box attacks.
Read originalNeurIPS 2025