LongSafety: Enhance Safety for Long-Context LLMs
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
Recent advancements in model architectures and length extrapolation techniques have significantly extended the context length of large language models (LLMs), paving the way for their application in increasingly complex tasks. However, despite the growing capabilities of long-context LLMs, the safety issues in long-context scenarios remain underexplored. While safety alignment in short context has been widely studied, the safety concerns of long-context LLMs have not been adequately addressed. In this work, we introduce LongSafety, a comprehensive safety alignment dataset for long-context LLMs, containing 10 tasks and 17k samples, with an average length of 40.9k tokens. Our experiments demonstrate that training with LongSafety can enhance long-context safety performance while enhancing short-context safety and preserving general capabilities. Furthermore, we demonstrate that long-context safety does not equal long-context alignment with short-context safety data and LongSafety has generalizing capabilities in context length and long-context safety scenarios.
Key facts. Cited by 11 papers in the map (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 31 of its 56 references that are in the map. First posted on arXiv 11 Nov 2024.
Builds on
31 of 56 references.
Closest ancestors · 1
Same direction, newest first
Other references · 30
- 2023GPT-4 Technical Reportcited by 18,396
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
- 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,224
- 2021TruthfulQA: Measuring How Models Mimic Human Falsehoodscited by 2,975
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
18 more
- 2024Qwen2 Technical Reportcited by 2,120
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2020What Disease does this Patient Have? A Large-scale Open Domain Question Answering Dataset from Medical Examscited by 1,356
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,301
- 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Datasetcited by 860
- 2023Enhancing Chat Language Models by Scaling High-quality Instructional Conversationscited by 839
- 2023L-Eval: Instituting Standardized Evaluation for Long Context Language Modelscited by 233
- 2024SALAD-Bench: A Hierarchical and Comprehensive Safety Benchmark for Large Language Modelscited by 228
- 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memorycited by 197
- 2020Recipes for Safety in Open-domain Chatbotscited by 170
- 2023Scaling Laws of RoPE-based Extrapolationcited by 125
- 2023Fake Alignment: Are LLMs Really Aligned Well?cited by 39
- 2024Suri: Multi-constraint Instruction Following for Long-form Text Generationcited by 34
- 2022Parameter-Efficient Legal Domain Adaptationcited by 12
- 2024MDCure: A Scalable Pipeline for Multi-Document Instruction-Followingcited by 10
- 2024InternEvo: Efficient Long-sequence Large Language Model Training via Hybrid Parallelism and Redundant Shardingcited by 8
- 2024MetaAlign: Align Large Language Models with Diverse Preferences during Inference Timecited by 5
Built on by
Citing papers per year: 2025: 6; 2026: 5.
11 papers.
- 2025o3-mini vs DeepSeek-R1: Which One is Safer?cited by 24
- 2025Systematization of Knowledge: Security and Safety in the Model Context Protocol Ecosystemcited by 16
- 2025Early External Safety Testing of OpenAI's o3-mini: Insights from the Pre-Deployment Evaluationcited by 13
- 2025LongSafety: Evaluating Long-Context Safety of Large Language Modelscited by 12
- 2025Attention Misses Visual Risk: Risk-Adaptive Steering for Multimodal Safety Alignmentcited by 4
- 2026TRACE: Trajectory Risk-Aware Compression for Long-Horizon Agent Safetycited by 1
- 2025On the Sensitivity of Instruction-tuned LLMs to Harmful Sentences in Long Inputscited by 0
- 2026Does Unification Come at a Cost? Uni-SafeBench: A Safety Benchmark for Unified Multimodal Large Modelscited by 0
- 2026Defending Against Harmful Supervision Hidden in Benign Samplescited by 0
- 2026Oyster-II: Reinforcement Learning for Constructive Safety Alignment in Large Language Modelscited by 0
- 2026LongGuard: Mechanistic Analysis and Training-Free Mitigation of Long-Context Failure in Safety Guardrailscited by 0
- 2026LongGuard: Mechanistic Analysis and Training-Free Mitigation of Long-Context Failure in Safety Guardrails27 Aug 2026
- 2026Oyster-II: Reinforcement Learning for Constructive Safety Alignment in Large Language Models3 Jul 2026
- 2026Defending Against Harmful Supervision Hidden in Benign Samples29 Jun 2026
- 2026TRACE: Trajectory Risk-Aware Compression for Long-Horizon Agent Safety30 May 2026
- 2026Does Unification Come at a Cost? Uni-SafeBench: A Safety Benchmark for Unified Multimodal Large Models1 Apr 2026
- 2025Systematization of Knowledge: Security and Safety in the Model Context Protocol Ecosystem9 Dec 2025
- 2025Attention Misses Visual Risk: Risk-Adaptive Steering for Multimodal Safety Alignment15 Oct 2025
- 2025On the Sensitivity of Instruction-tuned LLMs to Harmful Sentences in Long Inputs7 Oct 2025
- 2025LongSafety: Evaluating Long-Context Safety of Large Language Models24 Feb 2025
- 2025o3-mini vs DeepSeek-R1: Which One is Safer?30 Jan 2025
- 2025Early External Safety Testing of OpenAI's o3-mini: Insights from the Pre-Deployment Evaluation29 Jan 2025
Similar, not cited
Close in wording, no citation either way
- 2026Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance
- 2023All Languages Matter: On the Multilingual Safety of Large Language Models
- 2024Towards Comprehensive Post Safety Alignment of Large Language Models via Safety Patching
- 2026Guardrails in Logit Space: Safety Token Regularization for LLM Alignment
- 2025Picky LLMs and Unreliable RMs: An Empirical Study on Safety Alignment after Instruction Tuning
- 2026Beyond Safe Data: Pretraining-Stage Alignment with Regular Safety Reflection
- 2026Aligned but Fragile: Enhancing LLM Safety Robustness via Zeroth-Order Optimization
- 2024Safety Arithmetic: A Framework for Test-time Safety Alignment of Language Models by Steering Parameters and Activations