The Continuation vs. Refusal Debate: Mechanism Analysis of Continuation-Triggered Jailbreaks in Large Language ModelsThe Struggle Between Continuation and Refusal: A Mechanistic Analysis of the Continuation-Triggered Jailbreak in LLMs
The authors analyze the mechanism of continuation-triggered jailbreaks and propose HCS; Qwen's KDHCS achieves an ASR of 5.0 on MI.
- When the continuation suffix is moved outside the prompt boundary, the jailbreak ASR increases. The authors attribute this to a conflict between the continuation tendency and alignment-based refusal, and note that black-box defenses and local head patching have not yet explained this mechanism.
- Use path patching to locate the attention heads that change the jailbreak output distribution, then classify them into safety heads and continuation heads based on whether the ASR rises or falls after zeroing them out. HCS amplifies the former and suppresses the latter at each decoding step, then distills this behavior into a single forward pass of a LoRA student.
- Amplifying safety heads lowers ASR, while amplifying continuation heads raises it. Table 3: Qwen+KDHCS has MI ASR of 5.0 (baseline 68.0) and JB of 8.0 (baseline 36.0). The authors state that the two models' safety heads are biased toward recognition and refusal, respectively.
- The authors note that validation was only done on two 7B models and continuation-triggered jailbreaks, and they plan to extend to larger models and other attack types. The experiments used GPT-4 to judge SUCCESS/FAILURE; the paper does not report agreement with humans, the number of heads in the main HCS experiments, or the number of ASR repetitions.
- Evaluated models
- LLaMA-2-7B-ChatQwen2.5-7B-Instruct
- Benchmarks
- AdvBenchJailbreakBenchMaliciousInstructAlpacaMMLUIFEval
- Metrics
- ASRHDRMMLUIFEvalOverall
The researchers conducted an attention-head-level mechanistic interpretability analysis of continuation-triggered jailbreak phenomena in large language models, finding that this behavior mainly stems from competition between the model's intrinsic continuation drive and the safety defenses acquired through alignment training. The study validated this mechanism through causal intervention and activation scaling, and performed behavioral analysis on the identified safety-critical attention heads, finding notable differences in safety head behavior across model architectures. Based on these findings, the authors proposed an inference-time strategy, Head Competition Steering (HCS), which uses competition between safety heads and continuation heads to suppress harmful generation, and transferred behavioral signals to a student model via knowledge distillation, improving inference-time safety without increasing computational overhead.
Related events and news
0 events · 2 news mentions
News that mentions this paper
- Failure-Firstcites the paper's id or linkAI Safety Daily:2026 年 5 月 10 日安全研究综述
The LOCA and continuation-competition findings (2605.00123, 2603.08234) share a structural implication: safety in current LLMs is enforced not by a single reliable gate but by overlapping
- Failure-Firstcites the paper's id or linkFailure-First AI Safety Daily 2026 年 5 月 24 日
The attention-head competition result in 2603.08234 adds the specific mechanism: the continuation drive is not a background property but an active competitor with safety at measurable sites.
Paper analysis
What problem does this paper attempt to solve?
The authors aim to explain why moving the continuation suffix can cause jailbreaks, and based on this, perform inference-time interventions.
Why moving the continuation-triggered suffix outside the prompt boundary lets an aligned model continue generating harmful content.
- Phenomenon: In Figure 1, when the suffix follows the harmful instruction, the model usually refuses; when placed outside the prompt boundary, after the user prompt, the model continues generating along that suffix. The authors call this a continuation-triggered jailbreak.
- Why it matters: The authors state that many attacks such as prompt injection, adversarial suffixes, and prefill manipulate continuation. They also cite the notion of shallow alignment, arguing that when alignment relies only on preference data, changing the prompt structure can cause failure again.
- Existing gaps: The authors state that mainstream work mostly does black-box defense and rarely explains why attacks succeed. ASGuard uses activation scaling and preventive fine-tuning for temporal jailbreaks; the authors believe such methods mainly patch local vulnerabilities.
- Hypothesis and approach: The authors hypothesize that different prompt structures change the tension between pretraining continuation drive and the safety capability acquired through alignment. This paper performs attention-head-level causal intervention on LLaMA-2-7B-Chat and Qwen2.5-7B-Instruct, and accordingly proposes inference-time Head Competition Steering (HCS) and distillation.
What related research exists?
The authors claim this is the first work to analyze the mechanism of this type of jailbreak, and distinguish it from local head patching and contrastive decoding.
Jailbreak Attacks
- Continuation-type attacks: Zou et al. (2023) adversarial suffixes, Zhang et al. (2024a) and Shen et al. (2024) prompt injection, and Li et al. (2025) prefill. The authors state these methods often elicit unsafe outputs by manipulating continuation.
- Other still-effective jailbreaks: Alobaid et al. (2026) multi-step jailbreaks, Chao et al. (2025) iterative attacks, and Wu et al. (2025) attacks based on attention and generation mechanisms. Related Work only lists them as types that remain effective after alignment.
- ASGuard: Park et al. (2026) identify attention heads related to temporal jailbreaks and mitigate them with activation scaling and preventive fine-tuning. The authors believe it mainly addresses local vulnerabilities, and the more general generation mechanism remains unclear.
Alignment and Black-Box Defenses
- Preference Alignment: Christiano et al. (2017) RLHF and Rafailov et al. (2023) DPO, using preference data to improve safety.
- Black-Box Defenses: Zhou et al. (2024), Hines et al. (2024), and Shi et al. (2025). The authors state these works focus on blocking attacks and provide less explanation of the internal reasons for attack success.
- Shallow Alignment: The authors cite Qi et al. (2025), stating that data-driven alignment often only achieves shallow alignment.
Mechanistic Interpretability
- Circuits and Causal Interventions: Elhage et al. (2021) and Olsson et al. (2022) discuss the functions of heads and circuits. Wang et al. (2022) path patching and Zhang and Nanda (2023) activation patching are used for causal localization.
- From Interpretation to Improvement: Zhang et al. (2024b) locate-then-improve; Stoehr et al. (2024) use activation scaling for inference-time steering. Zhao et al. (2025) separate harmfulness recognition and refusal execution at the layer level, and the authors extend this to the head level.
- Contrastive Decoding: Li et al. (2023) compare externally constructed model variants. The authors state that HCS's signal comes from causally localized head groups within the same model, rather than such external variants.
Baselines and Benchmarks: Comparisons include the original model, SFT, and HCSrandom. Data include AdvBench, JailbreakBench, and MaliciousInstruct; harmless instructions use Alpaca; utility is measured with MMLU and IFEval.
The authors claim this is the first work to study the mechanism of continuation-triggered jailbreaks, specifically by moving the continuation instruction after the user instruction marker; and following locate-then-improve, using localization results to guide inference-time interventions.
How does the paper address this problem?
Using path patching to separate safety and continuation heads, then using HCS to amplify the former and suppress the latter.
Overall, the approach first locates attention heads that have a causal effect on the jailbreak distribution, then divides them into two categories based on the ASR after zeroing, and finally uses Head Competition Steering (HCS) to amplify safety heads and suppress continuation heads during decoding, and distills it into a single forward pass.
Prompt structure and path patching
- Three forward passes: the clean run uses the Clean Prompt, and the model refuses; the corrupted run uses the Jailbreak Prompt, eliciting harmful continuations; the patched run replaces only the activation of one head in the clean run with the corresponding activation from the corrupted run.
- Effect definition: deviation is measured by the KL from the clean distribution to another distribution. The effect of a single head is Δpatch = DKL(Pcl ∥ P∗) − DKL(Pcl ∥ Ppt). The paper states that the larger the positive value, the more that head can pull the output back to clean behavior, and thus it lies on the causal path that makes the jailbreak effective.
- Sparsity: Figure 4 averages over 100 samples on LLaMA-2-7B-Chat. The authors state that most heads have small KL changes, while a small subset of heads in layers 15–17 and 25–27 show more noticeable changes.
Functional division and activation scaling
- Zeroing criterion: at inference, the selected heads' activations are set to zero, while the rest remain unchanged. Heads whose ASR increases are defined as Safety Heads, heads whose ASR decreases are defined as Continuation Heads, and those with negligible changes are considered neutral or weakly correlated.
- Scaling: after the attention computation and before the residual addition, the activation h is changed to h' = w·h. w>1 amplifies, w=0 fully suppresses, and w=1 preserves the original behavior. No parameters are changed, and the input distribution is not changed.
- Purpose: the authors use scaling to test the causal effect of the two types of heads on jailbreaks. The paper does not describe this step as parameter training.
Behavioral decomposition of safety heads
- Two behaviors: Harmfulness Recognition is judging whether an instruction is illegal, unsafe, or harmful; Refusal Execution is refusing to generate after recognition. The authors state that the two are related but separable.
- reply inversion: appending an inverted query after the instruction, so that harmful inputs correspond to acceptance-class tokens and harmless inputs correspond to refusal-class tokens, thereby separating the judgment from the inherent refusal tendency. Appendix B gives the full prompt.
- Readout: scaling the located safety heads, observing whether generation shows a judgment inversion, and using HDR to count the proportion judged as harmful.
HCS and distillation
- Three forward passes: at each decoding step, three forward passes are performed on the same input: base, safety, and continuation. The latter two use the same w>1, amplifying the two types of heads respectively. At each step, the token is chosen greedily.
- Combination: the contrastive logits are zHCS = zbase + α · (zsafety − zcont), with α>0. The authors state that this strengthens the distribution bias brought by safety activations while subtracting the contribution of continuation activations.
- Distillation: HCS requires three forward passes per step. The authors collect teacher responses on training prompts, and a LoRA student initialized from the same base fits the teacher's vocabulary distribution over response tokens; the loss is a temperature-scaled KL, computed only at positions after the prompt boundary. The student then performs a single forward pass.
- Coefficients: in Appendix A.3, HCS uses w=3; LLaMA-2-7B-Chat uses α=3, and Qwen2.5-7B-Instruct uses α=2. LoRA is r=8, α_lora=16, dropout=0.05, trained for 5 epochs with a learning rate of 1×10^−5. SFT uses the same LoRA configuration and training hyperparameters. The paper does not give the specific temperature for the KL.
Success criteria
- ASR: the proportion of test inputs that generate harmful or policy-violating content. GPT-4 outputs only SUCCESS or FAILURE according to a predefined scale, covering refusals, harmful compliance, and partial assistance. Appendix A.2 gives the Judge Prompt.
- HDR: the proportion of instructions identified as harmful in reply inversion, also using GPT-4.
- Utility: Acc. on MMLU and IFEval. Overall takes the complement of ASR on JailbreakBench and MaliciousInstruct, and then computes the expectation together with these two, with higher being better (Appendix A.2). Generation sets max_new_tokens=32, do_sample=False.
What experiments did the paper conduct?
In Table 3, Qwen's KDHCS reduces MI ASR to 5.0, while LLaMA's MI ASR is 12.0.
Experimental Setup
- Models: The tested models are LLaMA-2-7B-Chat and Qwen2.5-7B-Instruct. The evaluation model is GPT-4.
- Data: AdvBench has 520 harmful instructions and is used as the distillation training set. JailbreakBench and MaliciousInstruct each have 100 items and are used only for testing. The harmless instructions for reply inversion are 1000 items from Alpaca. Utility metrics come from MMLU and IFEval.
- Method comparisons: Original model, SFT, HCSrandom, HCS, KDHCS. The paper does not separately define the sampling procedure for HCSrandom, only using it as a comparison against HCS.
- Metrics: Jailbreak uses ASR, inversion tasks use HDR, utility uses Acc., and there is also Overall.
- Decoding and coefficients: max_new_tokens=32, do_sample=False. The main HCS results use w=3; α takes the value the authors say is best overall in Appendix A.3.
- Other: Appendix E states that experiments were run on 4 NVIDIA A6000 48GB GPUs. The paper does not report the number of repetitions for ASR.
Main Results
The table below lists only the baseline, HCS, and KDHCS (according to Table 3). JB is JailbreakBench, MI is MaliciousInstruct.
Swipe horizontally to read the table
Setting JB ASR MI ASR MMLU IFEval Overall LLaMA-2-7B-Chat baseline 26.0 58.0 47.1 31.6 48.7 LLaMA-2-7B-Chat+HCS 11.0 10.0 48.1 29.8 64.2 LLaMA-2-7B-Chat+KDHCS 9.0 12.0 47.7 31.4 64.5 Qwen2.5-7B-Instruct baseline 36.0 68.0 74.1 72.5 60.7 Qwen2.5-7B-Instruct+HCS 9.0 7.0 71.8 61.6 79.4 Qwen2.5-7B-Instruct+KDHCS 8.0 5.0 74.1 71.9 83.3 - SFT: In Table 3, LLaMA+SFT has JB/MI ASR of 8.0/10.0, MMLU/IFEval of 44.2/26.3, and Overall of 63.1. Qwen+SFT has 18.0/11.0, 70.6/59.2, and 75.2. The authors state that SFT lowers ASR but capability metrics decline.
- Utility is not uniformly maintained: The authors state that HCS and KDHCS preserve utility to a greater degree while lowering ASR. In the table, Qwen+HCS still has MMLU and IFEval below that model's baseline; KDHCS is closer to the baseline.
- Comparison and distillation: HCSrandom has JB/MI ASR of 24.0/53.0 and Overall of 49.7 on LLaMA; on Qwen it is 30.0/67.0 and Overall of 60.5. The authors state that HCS's gains come from the localized head groups, not from the contrastive decoding form itself. The authors believe KDHCS is often close to or slightly better than the teacher because inference-time intervention may introduce decoding instability or oversteering, and distillation writes the preference into the parameters, making decoding smoother.
Causal Role of Heads
- Zeroing: Figure 5 zeroes the top 10 heads by path patching score on LLaMA. The authors state that (27,7) raises ASR on all three datasets and is classified as a safety head; (13,17) lowers ASR on all three datasets and is classified as a continuation head. The plain text does not preserve the bar heights.
- Multi-head scaling: Table 1 amplifies 1/2/3 safety heads on LLaMA at w=5, giving AdvBench ASR of 11.7/4.8/4.4 (baseline 16.0), JailbreakBench of 21.0/14.0/16.0 (baseline 26.0), and MaliciousInstruct of 41.0/25.0/16.0 (baseline 58.0). Amplifying 3 continuation heads gives 64.2, 63.0, and 92.0, respectively. The authors state that on JailbreakBench the 3-head value of 16.0 is higher than the 2-head value of 14.0, indicating nonlinear interactions among heads.
- Single-head trends: The authors state that in Figure 6, increasing w for safety heads lowers ASR on all three datasets, while continuation heads do the opposite, and the decline saturates after w>4; w=1 is the unscaled baseline. Endpoint values cannot be verified in the plain text. Figure 9 gives the same textual conclusion for Qwen.
HDR of Safety Heads
- LLaMA: In Table 2, AdvBench HDR is 51.5 at w=0, 89.0 at w=1, and 96.2 at w=5; Alpaca goes from 0.2 at w=1 to 2.0 at w=5. The main text writes 0.515 at w=0, which differs in notation from the table's 51.5; the table is taken as authoritative here. The authors believe these heads mainly support harmful instruction recognition, and overly large w may misclassify harmless inputs.
- Qwen: AdvBench HDR is 97.1 at w=1, 57.1 at w=4, and 44.6 at w=5; Alpaca is 0.0 at all w. The authors believe these heads mainly govern refusal to execute, and over-amplification causes refusal of prompts that should be judged harmful, thereby lowering HDR.
- Authors' conclusion: The authors state that on this jailbreak task, the safety heads of the two models are responsible for different behaviors.
Other Ablations and Analyses
- Table 6: Zeroing 3 safety heads on LLaMA gives ASR of 34.0 on AdvBench, 38.0 on JailbreakBench, and 75.0 on MaliciousInstruct; zeroing 3 continuation heads gives 11.2, 20.0, and 44.0.
- Table 6: Random head zeroing averaged over three independent samples gives 15.6 on AdvBench, 25.0–26.0 on JailbreakBench, and 56.0–58.0 on MaliciousInstruct, close to the respective baselines.
- Table 4: On LLaMA, HCS with α=1/2/3/4 gives JB ASR of 20.0/14.0/11.0/15.0 and MI of 28.0/15.0/10.0/9.0; the authors state the best overall is α=3.
- Table 5: On Qwen, α=1/2/3/4 gives JB ASR of 10.0/9.0/16.0/18.0 and MI of 9.0/7.0/10.0/18.0; the authors state the best is α=2.
- Figures 7 and 8 give Qwen's path patching and top-10 head zeroing. The main text does not provide verifiable KL or per-head ASR values.
- Appendix D gives examples where, after amplifying continuation heads, both models shift from refusal to continuing with the suffix.
What are some points that can be further explored?
The authors note that validation was only done on two 7B models and continuation-triggered jailbreaks.
Limitations and Future Directions Noted by the Authors
- Model Scale: Experiments were conducted on LLaMA-2-7B-Chat and Qwen2.5-7B-Instruct. The authors state that scaling to 13B or 70B would strengthen the generalizability of the identified safety heads and continuation heads, and leave this as future work (Limitations).
- Attack Types: The mechanistic framework is only established and validated on continuation-triggered jailbreaks. The authors state that whether similar head-level competition exists in adversarial suffixes, multi-turn jailbreaks, and role-play attacks is a planned extension (Limitations).
Experimental Coverage
- Models and Data: The tested models are the two 7B instruction models mentioned above (Section 4.1). The jailbreak sets are AdvBench 520 items, JailbreakBench 100 items, and MaliciousInstruct 100 items; the harmless set for HDR is Alpaca 1000 items; utility is measured with MMLU and IFEval (Appendix A).
- Interventions: The main comparisons include the original model, SFT, HCSrandom, HCS, and KDHCS (Table 3). Head analysis includes path patching, zeroing, and scaling with w from 0 to 5 (Figures 4–6, Tables 1, 2, and 6).
- Protocol: Generation length is 32 new tokens with greedy decoding (Section 4.1). Path patching for LLaMA is averaged over 100 samples (Figure 4). Random head ablation is averaged over three independent samplings (Appendix D).
- HCS: The main experiments use w=3; α=3 for LLaMA and α=2 for Qwen (Appendix A.3). Distillation trains a LoRA on HCS responses on AdvBench, with JB and MI as test sets (Appendix A.1).
- Unreported Items: The paper does not report the agreement between GPT-4 evaluation and human evaluation, does not report the number of heads amplified in the main HCS experiments, and does not report the number of repetitions or variance for ASR.
Summarize the main content of the paper
The authors state that jailbreaks arise from competition between two types of heads, and that HCS plus distillation can use this competition for inference-time intervention.
The authors use attention head mechanism analysis for continuation-triggered jailbreaks: under the same harmful instruction, moving the continuation suffix from after the instruction to outside the prompt boundary makes the model more likely to continue generating along the suffix.
- Problem: The model is pretrained with next-token prediction and then aligned. The authors hypothesize that the prompt structure changes whether continuation drive or safety capability dominates the next step.
- Method: Path patching identifies a few key heads in the middle-to-late layers. After zeroing them out, heads where ASR rises are safety heads, and heads where ASR falls are continuation heads. HCS performs three forward passes at each decoding step, amplifying the former and suppressing the latter; a LoRA student then fits the teacher's distribution over reply tokens, becoming a single forward pass. Success or failure is judged by GPT-4 as SUCCESS or FAILURE.
- Mechanism numbers: On LLaMA-2-7B-Chat, with w=5 amplifying 3 safety heads, AdvBench ASR is 4.4 (baseline 16.0), and MaliciousInstruct is 16.0 (baseline 58.0) (Table 1). On Qwen2.5-7B-Instruct, putting safety heads at w=5 lowers AdvBench HDR from 97.1 to 44.6 (Table 2). The authors say the former's safety heads are more biased toward harmful-content recognition, while the latter's are more biased toward refusal execution.
- Intervention numbers: In Table 3, Qwen's KDHCS has ASR of 8.0 / 5.0 on JailbreakBench / MaliciousInstruct, with baselines of 36.0 / 68.0, and MMLU remains 74.1. LLaMA's KDHCS is 9.0 / 12.0, with baselines of 26.0 / 58.0, and IFEval is 31.4 (baseline 31.6). HCSrandom's ASR drop is much smaller. Qwen's HCS itself still lowers MMLU and IFEval, and after distillation it is closer to baseline.
- Authors' conclusion: The authors say this jailbreak comes from a conflict between continuation drive and alignment safety capability; HCS plus distillation can turn head-level competition into an inference-time intervention. The authors also note that this has only been validated on two 7B models and this type of jailbreak.