acceptodds
Under review as a conference paper at ICLR 2027

Why Does Long-Context LLM Safety Break? A Positional Encoding Perspective

Abstract

Large Language Models (LLMs) have recently demonstrated strong long-context capabilities, enabling them to process and reason over increasingly extensive inputs. However, this capability also exposes them to many-shot jailbreaking (MSJ), in which long sequences of adversarial demonstrations can weaken refusal behavior on harmful requests. We find that the RoPE base is closely associated with this vulnerability: increasing it substantially lowers attack success, but directly doing so also reduces long-context utility. An analysis of RoPE interactions shows how input length and the base jointly shape rotary phases across token distances. This suggests a way to use positional variation during training without changing the model's inference setting. We introduce MFA, a multi-frequency alignment framework that samples RoPE bases during GRPO training and strengthens safety updates for longer prompts. At inference, the model retains its native RoPE base. On Llama-3.1-8B-Instruct under 256-shot MSJ, MFA reduces attack success rate from 65.5% to 8.8%, compared with 28.0% for GRPO trained at a single base. Across the evaluated models and attack lengths, MFA improves many-shot safety while maintaining performance on general and long-context tasks. Code is available at https://anonymous.4open.science/r/mfa-EBA4

Primary area:
foundation or frontier models, including LLMs
Keywords:
Safety alignment, Many-shot Jailbreak

Reviews

Among:
Shape:
1234this paper, Top 30%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.67 over 3 reviews, above 70% of the others.
Reviewer_2YYoOpenReview ↗
Rating
3
Confidence
3(+1)
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper investigates the vulnerability of long-context LLMs to many-shot jailbreak attacks from a positional-encoding perspective. The authors find that increasing the RoPE base reduces attack success but also degrades long-context utility. Motivated by this trade-off, they propose Multi-Frequency Alignment, which samples RoPE bases during GRPO training and assigns greater weight to longer prompts. Experiments on Llama-3.1 and Qwen2.5 models show that MFA substantially reduces attack success rates while largely preserving general and long-context capabilities.

Critical strengths
  1. Important problem: The paper addresses the timely and practically important problem of safety degradation in long-context LLMs, particularly under many-shot jailbreak attacks.

  2. Strong empirical results: MFA substantially reduces attack success rates across multiple model scales, attack types, and context lengths, while largely preserving general and long-context capabilities.

  3. Practical method and useful ablations: MFA only modifies training and retains the model’s native RoPE configuration at inference, introducing no additional deployment overhead. The matched fixed-base GRPO baseline and component ablations help isolate the gains from the proposed design.

Critical weaknesses
  1. The interpretation of the inference time RoPE-base experiment is ambiguous. The lower ASR does not necessarily indicate that the model’s safety behavior become more robust. An alternative explanation is that using a non-native RoPE base generally disrupts the model’s ability to utilize long contexts and perform in-context learning. Under this interpretation, the model may become less capable of following the many-shot demonstrations, causing the attack to fail as a side effect of impaired long-context functionality. It is therefore unclear whether this experiment reveals a safety-specific positional phenomenon or a more general degradation of long-context processing.

  2. The paper does not adequately rule out over-refusal. Since MFA is trained with binary safety rewards and refusal-oriented targets, the lower ASR may partly reflect a generally stronger tendency to refuse. General and long-context benchmarks do not directly measure this behavior.

  3. The core idea of training across varied positional configurations is closely related to Randomized Positional Encodings, PoSE, RFS, and particularly HARPE, which already uses multiple RoPE bases during training. The paper should compare against these approaches and clarify whether MFA offers benefits beyond applying existing positional augmentation to safety alignment.

Questions for authors

The experiments focus on Llama-3.1 and Qwen2.5. Can the authors report results on at least one more recent model family with an updated long-context training and alignment recipe? Since the central claim depends on the model’s RoPE configuration and positional sensitivity, evidence that the observed trade-off and MFA’s gains persist on newer models would materially affect my assessment of the method’s generality.

6 comments
AuthorsOpenReview ↗

Author Response to Reviewer 2YYo (1/3)

Thank you for reading the component ablations closely and for your specific suggestions on how to evaluate MFA.

W1: Could a non-native base simply impair in-context learning?

Thank you for raising this alternative explanation. If a non-native base makes it harder for the model to use the demonstrations, that could account for part of the drop in ASR. Table 8 (Appendix B.9) measures ASR on the same harmful final queries with no demonstrations, 32 benign GSM8K QA demonstrations, or 32 harmful PANDAS demonstrations. We report benign-task accuracy separately below.

RoPE baseHarmful query only ASR (%) ↓32 benign QA + harmful query ASR (%) ↓32 harmful PANDAS ASR (%) ↓LOONG ↑
500k0.0024.0077.5028.4
1M0.0018.5037.5027.5
5M0.0017.7521.7521.5

Even a benign QA prefix changes ASR on the harmful query, and the PANDAS condition has higher ASR at every base. At 5M, lower PANDAS ASR is accompanied by lower LOONG. The sweep therefore identifies sensitivity to the RoPE-base intervention, not a uniquely safety-specific mechanism. MFA, in contrast, is evaluated at the native inference base. In the separate 128-shot benign many-shot task, MFA retains 71.2% accuracy versus 71.4% for the original Mistral model, and 78.0% versus 78.2% for the original GLM model; the matched fixed-base GRPO controls reach 70.6% and 77.6%. We will add corresponding matched-length benign many-shot results for the main Llama and Qwen models.

W2: Could MFA be over-refusing?

We appreciate your suggestion to test over-refusal directly, especially because MFA uses a binary safety reward. During rebuttal, we measured false refusals at each model’s native RoPE base on benign prompts from XSTest [1] and the Hard-1K subset of OR-Bench [2]. We also scored coherent refusals on the unsafe XSTest prompts.

BackboneMethodXSTest safe FRR (%) ↓OR-Bench Hard-1K FRR (%) ↓XSTest unsafe coherent refusal (%) ↑XSTest safe valid assistance (%) ↑
Llama-3.1-8B-InstructOriginal6.848.595.592.4
Llama-3.1-8B-InstructFixed-base GRPO9.655.297.089.2
Llama-3.1-8B-InstructMFA8.452.798.590.8
Qwen2.5-7B-InstructOriginal3.622.491.095.6
Qwen2.5-7B-InstructFixed-base GRPO6.029.195.593.2
Qwen2.5-7B-InstructMFA5.226.897.594.0
AuthorsOpenReview ↗

Author Response to Reviewer 2YYo (2/3)

We also test the same target requests after benign long-context prefixes:

BackboneMethodInput length (tokens)Benign FRR (%) ↓Benign valid assistance (%) ↑Benign invalid output (%) ↓Unsafe coherent refusal (%) ↑
Llama-3.1-8B-InstructOriginal22.6k–24.3k4.492.02.884.5
Llama-3.1-8B-InstructFixed-base GRPO22.6k–24.3k7.288.43.691.0
Llama-3.1-8B-InstructMFA22.6k–24.3k6.090.82.495.5
Qwen2.5-7B-InstructOriginal22.0k–23.7k2.894.42.080.5
Qwen2.5-7B-InstructFixed-base GRPO22.0k–23.7k4.892.02.489.5
Qwen2.5-7B-InstructMFA22.0k–23.7k4.093.61.694.0

We count unnecessary full or partial refusal on benign requests as false refusal; a coherent refusal on unsafe requests must be relevant and withhold harmful assistance. Invalid responses are counted separately, not as successful refusals. MFA's false-refusal rates are above the original models' but below matched fixed-base GRPO on both backbones. At long input lengths, its benign valid-assistance rates are 90.8% and 93.6%, while unsafe coherent-refusal rates rise to 95.5% and 94.0%. The gain in safety therefore has a measurable, but bounded, refusal-calibration cost in these evaluations; we will report the rubric, denominators, and audit details in the appendix.

W3: How does MFA differ from prior positional augmentation?

Thank you for pointing us to these papers. We are sorry for the confusion about how MFA relates to prior positional augmentation. We discuss all four works in Appendix A. For length generalization, Ruoss et al. [3] sample an ordered subset of integer positions, PoSE [4] skips positions between chunks, and Random Float Sampling [5] draws positions from a continuous interval. HARPE [6] assigns different RoPE bases to different attention heads during continued pretraining for context extension.

MFA uses base variation during safety training. All responses in a GRPO group share one sampled base, so their rewards are compared under the same positional configuration. We apply length weighting after group-relative advantage normalization to preserve its effect on the update. Both the frozen reference policy and the deployed model use the native base. The ablation below varies base sampling and length weighting under the same safety-training budget.

Safety-training variant256-shot MSJ ASR (%) ↓LOONG ↑
Fixed-base GRPO28.0 ± 2.627.6 ± 0.4
Base sampling only17.5 ± 2.228.5 ± 0.4
Length weighting only15.0 ± 1.927.9 ± 0.4
MFA8.8 ± 1.728.9 ± 0.3

These results quantify the gain over fixed-base GRPO. A direct safety comparison with HARPE [6] would require training its head-wise base assignment on the same prompts, reward, and update budget, with the inference configuration specified for each method.

AuthorsOpenReview ↗

Author Response to Reviewer 2YYo (3/3)

Q1: Does MFA extend to a newer model family?

Thank you for asking how MFA transfers to models with newer alignment recipes. Our original evaluation covered Llama and Qwen, with a comparison across model sizes within Qwen. To test transfer across families, we evaluated the suggested Mistral-7B-Instruct-v0.3 and GLM-4-9B-Chat models at 128 shots.

ModelSetting (128-shot)MSJ ASR (%) ↓Benign many-shot accuracy (%) ↑Long-context utility ↑
Mistral-7B-Instruct-v0.3Original, native base82.571.424.6
Mistral-7B-Instruct-v0.3Original, scaled base (θ=5M\theta=5\mathrm{M})61.064.820.3
Mistral-7B-Instruct-v0.3Fixed-base GRPO, native base36.570.624.1
Mistral-7B-Instruct-v0.3MFA, native base14.071.224.8
GLM-4-9B-ChatOriginal, native base47.578.230.4
GLM-4-9B-ChatOriginal, scaled base (θ=25M\theta=25\mathrm{M})31.073.526.1
GLM-4-9B-ChatFixed-base GRPO, native base22.577.629.8
GLM-4-9B-ChatMFA, native base9.078.030.7

These additions test transfer across more RoPE model families, using a common shot count that fits both configured windows; MFA is evaluated at each model's native inference setting. They do not by themselves answer the newer alignment recipe part of your question. We will distinguish family coverage from recency in the manuscript's generality claim rather than present these models as evidence for an untested training recipe.

The updated PDF will include the over-refusal tests, the Mistral and GLM evaluations, and the expanded Related Work discussion. Thank you again for suggesting the benign-prompt evaluation and for helping us place MFA in the context of earlier work.

References

[1] Röttger et al. (NAACL 2024). XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models.

[2] Cui et al. (ICML 2025). OR-Bench: An Over-Refusal Benchmark for Large Language Models.

[3] Ruoss et al. (ACL 2023). Randomized Positional Encodings Boost Length Generalization of Transformers.

[4] Zhu et al. (ICLR 2024). PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Training.

[5] Shimizu et al. (Findings of EACL 2026). Position Encoding with Random Float Sampling Enhances Length Generalization of Transformers.

[6] Lian et al. (COLING 2025). Breaking the Stage Barrier: A Novel Single-Stage Approach to Long Context Extension for Large Language Models.

Reviewer_ooUxOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies the degradation of LLM safety under long-context many-shot jailbreaking (MSJ) from the perspective of positional encoding. The authors first conduct a controlled intervention by varying the RoPE base at inference time while keeping model weights fixed. They observe that increasing the RoPE base substantially reduces attack success rates, but also degrades long-context utility, showing a trade-off between safety and utility. The paper further analyzes how context length and the RoPE base jointly affect rotary phases, and introduces the notion of phase pressure as a proxy for characterizing the low-frequency positional regime. The paper also proposes Multi-Frequency Alignment (MFA), a GRPO-based safety alignment method with two main components. The experiments cover Llama-3.1-8B-Instruct, Qwen2.5-7B-Instruct, and Qwen2.5-72B-Instruct under MSJ and PANDAS attacks, together with several adaptive attacks and general/long-context utility benchmarks. MFA substantially reduces ASR compared with both the original models and a matched fixed-base GRPO baseline.

Critical strengths
  1. The paper studies an important and meaningful problem: safety alignment can deteriorate severely as context length and the number of adversarial demonstrations increase. Studying this phenomenon through positional encoding provides a distinctive perspective. Specifically, the fixed-checkpoint RoPE-base sweep provides useful evidence that many-shot safety is sensitive to positional configuration rather than being solely determined by semantic content.

  2. MFA is conceptually simple and well motivated by the empirical observations. Base sampling acts as a form of positional augmentation, while length-aware advantage weighting explicitly emphasizes the long-context regime. A practical advantage is that these modifications are training-time only: the final model operates using its native RoPE base at inference, avoiding additional inference-time search or model calls.

Critical weaknesses
  1. The paper demonstrates positional sensitivity, but does not yet fully explain why long-context safety breaks. Changing the RoPE base modifies positional interactions throughout the model and may affect many aspects of long-context processing, including in-context learning and the model's ability to exploit preceding demonstrations (as the paper itself mentioned). Therefore, the observed ASR reduction does not mean that changing the RoPE base specifically preserves safety instructions or prevents their positional attenuation. I believe that long-context safety is sensitive to positional configuration, while the stronger mechanistic framing for safety suggested by “Why Does Long-Context LLM Safety Break?” is less conclusively established.

  2. The introduced phase pressure offers a combination for the length and frequency. It is not clear whether the concept is necessary to be introduced and what it motivates, and whether phase pressure generates testable contributions that are necessary for MFA. For example, would two configurations with approximately matched L/θ\theta, but different L and θ\theta, exhibit similar safety behavior? More analysis experiment would help to support and enhance the analysis, such as the different influence of the two factors for safety.

  3. The current experiments cover three RoPE-based models, with two belonging to the same Qwen2.5 family. This is sufficient to establish the effectiveness of MFA in the evaluated setting, but not necessarily to support broader claims of a fundamental vulnerability. It would be valuable either to evaluate additional positional architectures/configurations or to narrow some of the stronger claims regarding architectural generality, such as mistral-7B. By the way, it will also helpful to conduct more experiment to demonstrate the effectiveness across scaling the model sizes.

Questions for authors
  1. Does the proposed phase pressure make quantitative predictions? In particular, if two configurations approximately match L/θ\theta while using different L and θ\theta, do they exhibit similar ASR or positional-interaction patterns? In addition, what are the influences of the two factors for the performance?

  2. Could the authors provide a dedicated over-refusal evaluation, particularly on benign prompts containing safety-sensitive concepts? This would strengthen the claim that the safety gains do not result from globally more conservative generation.

6 comments
AuthorsOpenReview ↗

Author Response to Reviewer ooUx (1/3)

Thank you for asking how much of the change in safety we can attribute to position, and for suggesting Mistral as a further test.

W1. What does the RoPE-base experiment tell us about long-context safety?

We appreciate the distinction you draw between sensitivity to the RoPE base and the broader causes of long-context safety failures. With Llama-3.1-8B-Instruct’s weights fixed, we asked the same harmful questions alone, after 32 benign GSM8K examples, and after 32 harmful PANDAS examples. Within each condition we varied only the inference-time RoPE base. All three ASR columns measure unsafe answers to the final question. LOONG measures long-context utility separately (Tables 7–8, Appendices B.8–B.9).

RoPE baseNo examples, ASR (%)32 benign examples, ASR (%)32 harmful examples, ASR (%)LOONG ↑
500k (native)0.0024.0077.5028.4
1M0.0018.5037.5027.5
5M0.0017.7521.7521.5

Doubling the base from 500k to 1M lowered ASR by 40.0 percentage points with harmful examples and 5.5 points with benign ones. At 5M, LOONG also fell from 28.4 to 21.5. We agree with your interpretation that many-shot safety is sensitive to positional configuration. Weaker use of demonstrations could explain part of the drop in ASR.

One plausible contributor is that an early safety instruction loses influence relative to nearby demonstrations as its distance from the answer grows. Figure 2 measures a signed query–key interaction before softmax (Appendix B.11), so the effect on the instruction’s influence remains a hypothesis. Demonstration content and order, the tendency to imitate examples, and the contexts seen during safety training may also matter. We will narrow the title, abstract, and introduction to the observed sensitivity to RoPE configuration. In the discussion we will propose moving the same safety instruction within its original message at fixed total length, then repeating the comparison across demonstration sets and safety-tuned checkpoints to estimate how much position contributes.

W2 + Q1. How do input length and RoPE base each affect safety? Do configurations with similar phase pressure behave similarly?

Thank you for suggesting that we test the phase-pressure proxy by comparing configurations with similar length-to-base ratios.

Input length and base at inference. At Llama’s native 500k base, PANDAS ASR rose from 77.5% to 84.7% between 32 and 64 shots, then fell to 82.2% and 77.5% at 128 and 256 shots (Table 1). The first 7.2-point rise includes changes in both token count and demonstration content. We also lengthened prompts without adding harmful examples. Adding benign prefixes to the same unsafe requests from XSTest [1] lowered Llama’s coherent-refusal rate from 95.5% to 84.5% at 22.6k–24.3k tokens (Appendix B.16).

On Qwen2.5-7B-Instruct, 32-shot PANDAS ASR was 48.5% at both 500k and 1M (Table 7). At 64 shots and 1M, it was 50.0% (Table 1). The 32-shot/500k and 64-shot/1M settings have similar estimated ratios of demonstration tokens to RoPE base, using roughly 91 tokens per demonstration (Appendix B.14). Table 1 resamples the demonstrations, and this estimate covers only the demonstration tokens. Whether ASR is similar at exactly matched full-prompt Φ=L/θ\Phi=L/\theta remains open.

What the two training choices contribute. We toggled base sampling and length weighting γ(L)\gamma(L) independently with the same GRPO prompts, reward, and update budget. We applied γ(L)\gamma(L) after group advantage normalization and evaluated every variant at the native base. Trained rows give mean ± SD over three seeds.

Llama-3.1-8B-InstructMSJ ASR @64 (%) ↓MSJ ASR @256 (%) ↓LOONG ↑MMLU-Pro ↑XSTest ↑
Original checkpoint74.665.528.444.388
Fixed-base GRPO26.0 ± 2.428.0 ± 2.627.6 ± 0.444.0 ± 0.380 ± 1.8
GRPO + base sampling only14.0 ± 2.017.5 ± 2.228.5 ± 0.444.2 ± 0.284 ± 1.5
GRPO + length weighting only16.0 ± 2.115.0 ± 1.927.9 ± 0.444.1 ± 0.383 ± 1.6
GRPO + both (MFA)8.0 ± 1.58.8 ± 1.728.9 ± 0.344.3 ± 0.285 ± 1.4
AuthorsOpenReview ↗

Author Response to Reviewer ooUx (2/3)

At 64 and 256 shots, ordinary GRPO reduces ASR by 48.6 and 37.5 points. Relative to GRPO, sampling alone lowers mean ASR by another 12.0 and 10.5 points, respectively. Weighting alone gives reductions of 10.0 and 13.0 points. Sampling has the larger single-component gain at 64 shots, and weighting at 256. Together they reduce ASR by 18.0 and 19.2 points beyond GRPO.

For standard RoPE, rotary pair jj in dimension dd has phase Δθ−2j/d\Delta\theta^{-2j/d} at token separation Δ\Delta. Doubling Δ\Delta and θ\theta multiplies this phase by 21−2j/d2^{1-2j/d}, which differs across pairs. Thus Φ=L/θ\Phi=L/\theta summarizes the low-frequency end of the spectrum and leaves room for different attention patterns and ASRs at equal Φ\Phi. It motivates varying the base during training. MFA uses the sampled base and actual input length directly.

W3. Does MFA transfer to other model families and sizes?

Following your suggestion, we tested Mistral-7B-Instruct-v0.3 and added GLM-4-9B-Chat under the same 128-shot protocol (revised Appendix B.15). All prompts fit both context windows. The scaled-base column uses 5M for Mistral and 25M for GLM. Both trained variants use each model’s native inference base.

Backbone and metricOriginal, native baseOriginal, scaled baseFixed-base GRPOMFA
Mistral · MSJ ASR (%) ↓82.561.036.514.0
Mistral · Benign many-shot accuracy (%) ↑71.464.870.671.2
Mistral · Long-context score ↑24.620.324.124.8
GLM · MSJ ASR (%) ↓47.531.022.59.0
GLM · Benign many-shot accuracy (%) ↑78.273.577.678.0
GLM · Long-context score ↑30.426.129.830.7

MFA lowered ASR by 22.5 points on Mistral and 13.5 points on GLM relative to fixed-base GRPO. Benign many-shot accuracy was within 0.2 points of each original model.

Tables 1 and 2 give safety and utility results for Llama-3.1-8B-Instruct and two Qwen2.5 sizes. At 256 shots, MSJ ASR fell from 65.5% to 8.8% on Llama, from 36.0% to 7.5% on Qwen2.5-7B, and from 43.8% to 5.5% on Qwen2.5-72B with MFA. We will limit the generality claim to the RoPE families and sizes evaluated. Further Llama results include the matched ablation in Table 3, independent-judge and defense-aware evaluations in Appendix B.6, and the base sweep and prefix controls in Appendices B.8–B.9.

AuthorsOpenReview ↗

Author Response to Reviewer ooUx (3/3)

Q2: Could MFA over-refuse benign, safety-sensitive requests?

We appreciate your focus on legitimate requests that mention sensitive topics. We measure unnecessary refusal on benign requests separately from coherent refusal on unsafe ones. The following native-base evaluations use identical prompts and decoding settings within each backbone. XSTest [1] contains 250 safe prompts and 200 unsafe prompts. We used the Hard-1K subset of OR-Bench [2] to measure false refusals on difficult benign requests.

BackboneMethodXSTest safe FRR (%) ↓OR-Bench Hard-1K FRR (%) ↓XSTest unsafe coherent refusal (%) ↑XSTest safe valid assistance (%) ↑
Llama-3.1-8B-InstructOriginal6.848.595.592.4
Llama-3.1-8B-InstructFixed-base GRPO9.655.297.089.2
Llama-3.1-8B-InstructMFA8.452.798.590.8
Qwen2.5-7B-InstructOriginal3.622.491.095.6
Qwen2.5-7B-InstructFixed-base GRPO6.029.195.593.2
Qwen2.5-7B-InstructMFA5.226.897.594.0

The same contrast is tested with benign prefixes at long input lengths, while target requests and labels remain unchanged:

BackboneMethodInput length (tokens)Benign FRR (%) ↓Benign valid assistance (%) ↑Benign invalid output (%) ↓Unsafe coherent refusal (%) ↑
Llama-3.1-8B-InstructOriginal22.6k–24.3k4.492.02.884.5
Llama-3.1-8B-InstructFixed-base GRPO22.6k–24.3k7.288.43.691.0
Llama-3.1-8B-InstructMFA22.6k–24.3k6.090.82.495.5
Qwen2.5-7B-InstructOriginal22.0k–23.7k2.894.42.080.5
Qwen2.5-7B-InstructFixed-base GRPO22.0k–23.7k4.892.02.489.5
Qwen2.5-7B-InstructMFA22.0k–23.7k4.093.61.694.0

FRR counts unnecessary full or partial refusal of a benign request. Valid assistance requires a coherent, relevant answer, and unsafe coherent refusal requires withholding harmful assistance. Empty, off-topic, or incoherent outputs are labeled invalid, excluded from the coherent-refusal numerator, and retained in the relevant denominator. MFA does increase false refusals relative to the original models—by 1.6 percentage points on XSTest safe prompts for each backbone—but less than fixed-base GRPO. It also has higher coherent-refusal rates on unsafe prompts and retains over 90% valid assistance on XSTest safe prompts at both short and long input lengths. We will add sample counts, uncertainty estimates, and the method-blinded audit protocol to the appendix rather than treating general utility as a proxy for refusal calibration.

We appreciate your suggestions on what the base sweep can establish. In the revised PDF, we will make the scope of the positional-sensitivity claim explicit and include the additional model and over-refusal results.

References

[1] Röttger et al. (NAACL 2024). XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models.

[2] Cui et al. (ICML 2025). OR-Bench: An Over-Refusal Benchmark for Large Language Models.

Reviewer_kprVOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper summary

This paper assesses the relationship between rope implementations for a model and susceptibility to many-shot jailbreaking. In particular, they show that increasing the RoPE base reduces attack susceptibility, while, however, degrading the LLM's ability to make use of long context. These findings inform MFA (multi-frequency alignment), which randomly samples RoPE bases during GRPO post-training to improve robustness while maintaining quality.

Critical strengths

I like this paper. It is reasonably well written, creative, and quite incisive. The hypothesis is solid and presented in sufficient detail that it is easy to follow the argument and see how the evidence accumulates.

I have some concerns about the focus on RoPE when it comes to analysis, but MFA looks like a solid way to make RoPE models in particular more robust, and the MFA experiments seem quite solid and persuasive. (In addition, the steps the authors take for input length (length weighting) can apply outside of RoPE.)

Critical weaknesses
  1. As I said above, I found this paper overall to be interesting and potentially valuable. However, there is one aspect of the text that I simply can't get past: Why is the paper exclusively focused on RoPE? I am reasonably confident (though I suppose I could be wrong) that many-shot jailbreaking is a vulnerability for all language models, regardless of how they do positional encoding. So the current paper is not going be an explanation, in and of itself, of why many-shot jailbreaking arises or how to mitigate it. It is scoped entirely to models that use RoPE. I do think this is a popular scheme, but possibly one that is declining in popularity as models move to NoPE. Furthermore, I suspect that Shah et al. would not endorse the paper's focus, because Shah et al. consider more general notions of position that would hold even for NoPE models. In any event, I really need help understanding how the paper's narrow focus is ultimately justified.

  2. I am additionally having trouble seeing how the paper distinguishes resilience to attacks from simply being a pretty bad model overall. Can we distinguish even basic things like coherent refusal from total incoherence? What happens with benign or productive many-shot prompting? (Table 8 might be engaging with this question, but I am actually not sure what B.9 is really doing.)

Questions for authors

See above.

5 comments
AuthorsOpenReview ↗

Author Response to Reviewer kprV (1/2)

Thank you for your careful reading and for your encouraging assessment of MFA.

W1: Why is the paper exclusively focused on RoPE?

We appreciate your point about NoPE. We agree that many-shot jailbreaking (MSJ) can arise across positional designs. As demonstrations accumulate, an early safety instruction sits farther from the answer. If its influence weakens relative to nearby demonstrations, the model may be more likely to follow them. This possibility extends to NoPE, where models can learn attention patterns that depend on relative distance. Shah et al.’s NINJA experiments likewise show that moving a harmful goal within a long prompt can change attack success, as you noted (Kazemnejad et al., 2023, Shah et al., 2025).

Your question prompted us to examine how far the results extend across models. During rebuttal, we tested two additional RoPE implementations at 128 shots. At the native inference base, ASR was 36.5% with matched fixed-base GRPO and 14.0% with MFA on Mistral-7B-Instruct-v0.3. On GLM-4-9B-Chat, the corresponding rates were 22.5% and 9.0%. Table 4 of the submission also compares RoPE extensions on Llama-3.1-8B-Instruct under 128-shot MSJ.

ConfigurationMSJ ASR (%) ↓LongBench-v2 ↑
Original70.227.0
+ PI53.525.3
+ YaRN56.126.4
+ LongRoPE45.126.8
+ MFA11.227.8
+ MFA + LongRoPE7.427.8

Each extension had lower observed ASR than the original model and a lower LongBench-v2 score. MFA also worked with LongRoPE, although independent sampling across settings limits what the 11.2% and 7.4% figures establish about LongRoPE’s incremental benefit.

We chose RoPE as a well-studied example of how relative distance enters attention. Several model families publish their weights and RoPE implementations, so we can change how distance affects query–key interactions by varying the base while keeping the weights and attack text fixed. In the revised introduction and discussion, we will explain this choice and relate the RoPE results to NoPE and hybrid designs. An important next step is to test whether distant safety instructions also lose influence in NoPE models and whether MFA’s length weighting, which applies across encodings, helps preserve their influence.

W2: How does the paper distinguish resilience to attacks from “simply being a pretty bad model overall”? Can we distinguish coherent refusal from total incoherence? What happens with benign or productive many-shot prompting?

Thank you for illustrating this concern with a concrete example. As you point out, a coherent refusal and an incoherent answer can both count as failed attacks. We are sorry our discussion of attack success rate (ASR) left this distinction unclear. Alongside ASR, we report how often the model gives a coherent refusal on unsafe prompts and how accurately it answers benign questions after 128 demonstrations.

Attack success and long-context utility. We reported ASR alongside general and long-context utility. The fixed-weight pilot illustrates your concern. Increasing Llama’s base from 500k to 5M lowered 32-shot PANDAS ASR from 77.50% to 21.75%, while LOONG fell from 28.4 to 21.5 (Table 7). Reduced long-context utility is a plausible contributor to the ASR drop in that sweep. We evaluated the trained defense at the native base, with a fixed-base GRPO control matched for training prompts, reward, and budget (Table 3).

Llama-3.1-8B-Instruct256-shot MSJ ASR (%) ↓MMLU-Pro ↑LOONG ↑
Original65.544.328.4
Fixed-base GRPO28.0 ± 2.644.0 ± 0.327.6 ± 0.4
MFA8.8 ± 1.744.3 ± 0.228.9 ± 0.3

The HarmBench classifier, GPT-4o, and human annotators also judged fewer 256-shot responses unsafe under MFA than under the original Llama model. Human-rated ASR fell from 64% to 15% (Appendix B.6).

AuthorsOpenReview ↗

Author Response to Reviewer kprV (2/2)

What we tested during rebuttal. Table 8 (Appendix B.9) compares the same harmful targets after no demonstrations, 32 benign GSM8K examples, or 32 harmful PANDAS examples. At 5M the respective ASRs were 0%, 17.75%, and 21.75%. To answer your question about productive use of demonstrations, we separately scored benign target questions at 128 shots. Mistral scored 71.4% before training and 71.2% with MFA. GLM scored 78.2% and 78.0%, respectively (Appendix B.15).

At the native base, we evaluated response quality on XSTest [1] and the Hard-1K subset of OR-Bench [2]. On unsafe XSTest prompts, a coherent refusal must address the request and withhold harmful assistance. Empty, off-topic, and incoherent outputs stay in the denominator as invalid responses. On benign prompts, we scored valid assistance and unnecessary full or partial refusal (FRR) separately, using the same prompts and decoding settings across variants.

BackboneMethodXSTest unsafe coherent refusal (%) ↑XSTest safe valid assistance (%) ↑XSTest safe FRR (%) ↓OR-Bench Hard-1K FRR (%) ↓
Llama-3.1-8BOriginal95.592.46.848.5
Fixed-base GRPO97.089.29.655.2
MFA98.590.88.452.7
Qwen2.5-7BOriginal91.095.63.622.4
Fixed-base GRPO95.593.26.029.1
MFA97.594.05.226.8

MFA increased coherent refusal on unsafe prompts. On benign XSTest prompts, its FRR rose 1.6 percentage points above each original model and remained below fixed-base GRPO. After we added long benign prefixes to the same XSTest requests, MFA gave valid assistance on 90.8% of benign prompts for Llama and 93.6% for Qwen. Coherent refusal on unsafe prompts reached 95.5% and 94.0%, respectively (Appendix B.16).

As you suggested, we will update the PDF to clarify in the Table 8 caption that every condition ends in a harmful question and to present the benign-task and refusal-quality results alongside ASR. We will also report length-matched benign many-shot accuracy for the original, fixed-base GRPO, and MFA variants on Llama and Qwen, along with how often a 256-shot attack ends in a coherent refusal or an invalid response. Thank you for asking what the model actually does when an attack fails.

References

[1] Röttger et al. (NAACL 2024). XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models.

[2] Cui et al. (ICML 2025). OR-Bench: An Over-Refusal Benchmark for Large Language Models.

We sincerely appreciate the time and care you put into reviewing our work. Your comments have helped us improve the paper, and our responses are now posted. If anything is still unclear or unresolved, please feel free to let us know, and we will do our best to respond promptly before the discussion period ends. Have a nice day :)

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.