Research map / Architectures and efficiency / Attention and transformers
LongGuard: Mechanistic Analysis and Training-Free Mitigation of Long-Context Failure in Safety Guardrails
Xing Wu, Songlin Hu
Chinese Academy of Sciences · University of Chinese Academy of Sciences
Read the paperPlace an idea next to itCheck your own paper ↗
12measured effects
6improved
3no clear effect
3hurt
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Increase context length from 0.25k to 32k | 15 guardrails · SafetyNIAH Benign-Fill | unsafe recall: mean -50.12% | Hurt |
| Increase context length from 0.25k to 32k | 15 guardrails · SafetyNIAH Benign-Fill | safe recall: mean -1.30% | No clear effect |
| Repeat the needle instead of benign filler (remove dilution) (ablation) | guardrails · SafetyNIAH | unsafe recall: Benign-Fill -50.94% vs Needle-Repeat -17.91% | Improved |
| Restrict visible context to the unsafe needle (ablation) | guardrails · SafetyNIAH | unsafe recall: 47.8 -> 70.2 (+22.5%) | Improved |
| Keep equal amount of random haystack instead of needle-only (ablation) | guardrails · SafetyNIAH | unsafe recall: 47.8 -> 24.0 (-23.8%) | Hurt |
| Amplify needle attention on guard-specialized heads (alpha 2, 4, 8) (ablation) | six guardrails · SafetyNIAH | unsafe recall: +1.5%, +3.8%, +6.4% | Improved |
| Amplify attention on equal number of random heads (ablation) | six guardrails · SafetyNIAH | unsafe recall: -0.3% to -0.1% | No clear effect |
| Add CAHR-CD (chunked detection) | six guardrails · five benchmarks | primary metrics: +21.79% on average | Improved |
| Add CAHR-AHS (head sharpening) | six guardrails · five benchmarks | primary metrics: +12.56% on average | Improved |
| Add CAHR-CD to already-robust guards | PolyGuard, Qwen3Guard · five benchmarks | primary metrics: PolyGuard -0.08, Qwen3Guard +1.75 | No clear effect |
| Replace Wikipedia filler with conversation, code, Chinese text | base guardrails · filler domains | unsafe recall: 0.25k to 32k: -41.3, -34.7, -33.0 | Hurt |
| Add CAHR-CD / CAHR-AHS on other filler domains | six guardrails · filler domains | unsafe F1: CD +12.1 to +24.0; AHS +8.6 to +12.0 | Improved |
Open problems in sparse attention for long-context LLMs
Which attention can a long-context model drop without losing the answer?
- The overhead does not vanish. · 14 papers state it
- Very long contexts hit memory limits or go untested. · 8 papers state it
- Sparsity speeds up prefill or decoding, not both. · 6 papers state it
Closest papers by meaning
- R²-Guard: Robust Reasoning Enabled LLM Guardrail via Knowledge-Enhanced Logical Reasoning (ICLR 2025 · similarity 0.90)
- PolyGuard: Massive Multi-Domain Safety Policy-Grounded Guardrail Dataset (NeurIPS 2025 · similarity 0.90)
- SafeWatch: An Efficient Safety-Policy Following Video Guardrail Model with Transparent Explanations (ICLR 2025 · similarity 0.89)
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications (ICML 2024 · similarity 0.89)
- RSafe: Incentivizing proactive reasoning to build robust and adaptive LLM safeguards (NeurIPS 2025 · similarity 0.88)
- Position: Building Guardrails for Large Language Models Requires Systematic Design (ICML 2024 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.