Why Does Long-Context LLM Safety Break? A Positional Encoding Perspective
Keep the title, authors and abstract in paper.json
potentialpaper · 2026-11-23 19:26 UTC · f48ed852aef3 ·
.potentialpaper/metadata.json modified
+++ b/.potentialpaper/metadata.json@@ -1,19 +1,5 @@{- "layout": 5,- "identifiers": [- {- "scheme": "openreview",- "value": "HX7AfmH46l"- }- ],- "title": "Why Does Long-Context LLM Safety Break? A Positional Encoding Perspective",- "authors": [],- "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",- "year": 2027,- "venue": "ICLR 2027 (under review)",- "source": "openreview",- "license": {- "metadata": "CC0-1.0",- "abstract": "CC0-1.0"- }+ "layout": 6,+ "kind": "paper",+ "key": "69ac9737-c058-44b2-a876-d44d3e2979e2"}
paper.json added
+++ b/paper.json@@ -0,0 +1,9 @@+{+ "title": "Why Does Long-Context LLM Safety Break? A Positional Encoding Perspective",+ "authors": [],+ "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",+ "license": {+ "metadata": "CC0-1.0",+ "abstract": "CC0-1.0"+ }+}