首个评估大模型长文本安全性的基准,发现多数模型安全率低于55%。
LongSafety: Evaluating Long-Context Safety of Large Language Models
- 构建7类安全问题+6类长文本任务的综合评测集
- 16个模型平均安全率不足55%,长上下文风险显著
- 揭示长文本安全与短文本表现无强关联,适合安全研究者参考
随着大语言模型在长序列理解与生成方面持续进步,长上下文引入了新的安全风险。然而,长上下文场景下的安全性仍缺乏系统评估,存在显著研究空白。为此,我们提出LongSafety,首个专门针对开放型长上下文任务的大模型安全性评测基准。该基准涵盖7类安全问题和6类用户导向任务,共包含1,543个测试案例,平均每段上下文达5,424字。对16个代表性大模型的评估显示,多数模型的安全率低于55%。研究发现,短上下文中的安全表现无法保证长上下文的安全性,凸显长上下文安全的独特挑战与紧迫性。进一步分析识别出若干高难度安全问题与任务类型。此外,相关上下文与扩展输入序列会加剧长上下文中的安全风险,强调需持续关注此类挑战。代码与数据已开源。
原文摘要 · Abstract (English)
As Large Language Models (LLMs) continue to advance in understanding and generating long sequences, new safety concerns have been introduced through the long context. However, the safety of LLMs in long-context tasks remains under-explored, leaving a significant gap in both evaluation and improvement of their safety. To address this, we introduce LongSafety, the first comprehensive benchmark specifically designed to evaluate LLM safety in open-ended long-context tasks. LongSafety encompasses 7 categories of safety issues and 6 user-oriented long-context tasks, with a total of 1,543 test cases, averaging 5,424 words per context. Our evaluation towards 16 representative LLMs reveals significant safety vulnerabilities, with most models achieving safety rates below 55%. Our findings also indicate that strong safety performance in short-context scenarios does not necessarily correlate with safety in long-context tasks, emphasizing the unique challenges and urgency of improving long-context safety. Moreover, through extensive analysis, we identify challenging safety issues and task types for long-context models. Furthermore, we find that relevant context and extended input sequences can exacerbate safety risks in long-context scenarios, highlighting the critical need for ongoing attention to long-context safety challenges. Our code and data are available at https://github.com/thu-coai/LongSafety.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。